Version Description
- 06.24.2020 =
- NEW: Added a mechanism in Other Options > Misc to update page featured images assigned with NextGen version 1 that were broken by a WordPress 5.4 API change
- NEW: Added two filters (ngg_default_settings and ngg_default_global_settings) to allow control over default settings for new networks, sites and sub-sites
- NEW: Updated SimpleLightbox to the latest version. This fixes all gallery images appearing in the lightbox if more than one gallery was on the page.
- Fixed: Album routing was broken if the albums were named using a non-latin alphabet
- Fixed: Gallery path validation was broken on some IIS servers
- Fixed: NextGen was unable to serve AJAX requests on home.pl hosting
- Fixed: Removed the unused simple_html_dom module which was causing errors with PHP 7.3
Download this release
Release Info
Developer | photocrati |
Plugin | NextGEN Gallery – WordPress Gallery Plugin |
Version | 3.3.6 |
Comparing to | |
See all releases |
Code changes from version 3.3.5 to 3.3.6
- changelog.txt +9 -0
- composer.json +4 -4
- composer.lock +19 -19
- nggallery.php +2 -2
- non_pope/class.nextgen_style_manager.php +8 -4
- products/photocrati_nextgen/modules/fs/module.fs.php +1 -1
- products/photocrati_nextgen/modules/lightbox/module.lightbox.php +1 -1
- products/photocrati_nextgen/modules/lightbox/package.module.lightbox.php +1 -1
- products/photocrati_nextgen/modules/lightbox/static/simplelightbox/simple-lightbox.css +230 -0
- products/photocrati_nextgen/modules/lightbox/static/simplelightbox/simple-lightbox.js +1563 -580
- products/photocrati_nextgen/modules/lightbox/static/simplelightbox/simple-lightbox.min.css +6 -0
- products/photocrati_nextgen/modules/lightbox/static/simplelightbox/simple-lightbox.min.js +2 -1
- products/photocrati_nextgen/modules/lightbox/static/simplelightbox/simplelightbox.css +0 -298
- products/photocrati_nextgen/modules/lightbox/static/simplelightbox/simplelightbox.min.css +0 -1
- products/photocrati_nextgen/modules/nextgen_admin/module.nextgen_admin.php +19 -13
- products/photocrati_nextgen/modules/nextgen_admin/static/ngg_progressbar.js +1 -0
- products/photocrati_nextgen/modules/nextgen_admin/static/ngg_progressbar.min.js +1 -1
- products/photocrati_nextgen/modules/nextgen_basic_album/module.nextgen_basic_album.php +1 -1
- products/photocrati_nextgen/modules/nextgen_basic_album/package.module.nextgen_basic_album.php +2 -13
- products/photocrati_nextgen/modules/nextgen_data/module.nextgen_data.php +1 -1
- products/photocrati_nextgen/modules/nextgen_data/package.module.nextgen_data.php +50 -13
- products/photocrati_nextgen/modules/nextgen_other_options/module.nextgen_other_options.php +3 -2
- products/photocrati_nextgen/modules/nextgen_other_options/package.module.nextgen_other_options.php +39 -2
- products/photocrati_nextgen/modules/nextgen_other_options/templates/misc_tab.php +28 -1
- products/photocrati_nextgen/modules/nextgen_other_options/templates/update_legacy_featured_images_field.php +40 -0
- products/photocrati_nextgen/modules/nextgen_settings/module.nextgen_settings.php +10 -8
- products/photocrati_nextgen/modules/ngglegacy/admin/admin.php +2 -2
- products/photocrati_nextgen/modules/ngglegacy/admin/js/ngg.progressbar.js +279 -135
- products/photocrati_nextgen/modules/ngglegacy/admin/js/ngg.progressbar.min.js +1 -1
- products/photocrati_nextgen/modules/ngglegacy/admin/manage.php +11 -5
- products/photocrati_nextgen/modules/ngglegacy/lib/core.php +4 -10
- products/photocrati_nextgen/modules/ngglegacy/lib/imagemagick.inc.php +0 -596
- products/photocrati_nextgen/modules/ngglegacy/module.ngglegacy.php +1 -1
- products/photocrati_nextgen/modules/simple_html_dom/module.simple_html_dom.php +0 -40
- products/photocrati_nextgen/modules/simple_html_dom/package.module.simple_html_dom.php +0 -1
- products/photocrati_nextgen/modules/simple_html_dom/simplehtmldom/simple_html_dom.php +0 -1742
- products/photocrati_nextgen/product.photocrati_nextgen.php +1 -2
- readme.txt +10 -1
- vendor/autoload.php +1 -1
- vendor/composer/autoload_files.php +1 -1
- vendor/composer/autoload_real.php +10 -7
- vendor/composer/autoload_static.php +4 -4
- vendor/composer/installed.json +53 -53
- vendor/{reactr-io → imagely}/pope-framework/README.txt +0 -0
- vendor/{reactr-io → imagely}/pope-framework/composer.json +1 -1
- vendor/{reactr-io → imagely}/pope-framework/lib/autoload.php +0 -0
- vendor/{reactr-io → imagely}/pope-framework/lib/class.base_module.php +12 -8
- vendor/{reactr-io → imagely}/pope-framework/lib/class.base_product.php +0 -0
- vendor/{reactr-io → imagely}/pope-framework/lib/class.component.php +0 -0
- vendor/{reactr-io → imagely}/pope-framework/lib/class.component_factory.php +0 -0
- vendor/{reactr-io → imagely}/pope-framework/lib/class.component_registry.php +5 -3
- vendor/{reactr-io → imagely}/pope-framework/lib/class.extensibleobject.php +3 -2
- vendor/{reactr-io → imagely}/pope-framework/lib/class.pope_cache.php +0 -0
- vendor/{reactr-io → imagely}/pope-framework/lib/interface.component.php +0 -0
- vendor/{reactr-io → imagely}/pope-framework/lib/interface.component_factory.php +0 -0
- vendor/{reactr-io → imagely}/pope-framework/lib/interface.pope_module.php +0 -0
- vendor/nikic/php-parser/grammar/php7.y +51 -44
- vendor/nikic/php-parser/grammar/rebuildParsers.php +1 -1
- vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php +2 -2
- vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php +15 -7
- vendor/nikic/php-parser/lib/PhpParser/Comment.php +85 -13
- vendor/nikic/php-parser/lib/PhpParser/JsonDecoder.php +3 -1
- vendor/nikic/php-parser/lib/PhpParser/Lexer.php +11 -5
- vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php +2 -1
- vendor/nikic/php-parser/lib/PhpParser/Node.php +0 -2
- vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php +7 -7
- vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php +20 -0
- vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php +15 -18
- vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php +3 -3
- vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php +690 -701
- vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php +21 -12
- vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php +2 -2
- vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php +1 -8
changelog.txt
CHANGED
@@ -1,6 +1,15 @@
|
|
1 |
NextGEN Gallery
|
2 |
by Imagely
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
= V3.3.5 - 04.09.2020 =
|
5 |
* Fixed: Broken dynamic images
|
6 |
|
1 |
NextGEN Gallery
|
2 |
by Imagely
|
3 |
|
4 |
+
= V3.3.6 - 06.24.2020 =
|
5 |
+
* NEW: Added a mechanism in Other Options > Misc to update page featured images assigned with NextGen version 1 that were broken by a WordPress 5.4 API change
|
6 |
+
* NEW: Added two filters (ngg_default_settings and ngg_default_global_settings) to allow control over default settings for new networks, sites and sub-sites
|
7 |
+
* NEW: Updated SimpleLightbox to the latest version. This fixes all gallery images appearing in the lightbox if more than one gallery was on the page.
|
8 |
+
* Fixed: Album routing was broken if the albums were named using a non-latin alphabet
|
9 |
+
* Fixed: Gallery path validation was broken on some IIS servers
|
10 |
+
* Fixed: NextGen was unable to serve AJAX requests on home.pl hosting
|
11 |
+
* Fixed: Removed the unused simple_html_dom module which was causing errors with PHP 7.3
|
12 |
+
|
13 |
= V3.3.5 - 04.09.2020 =
|
14 |
* Fixed: Broken dynamic images
|
15 |
|
composer.json
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
{
|
2 |
-
"name": "
|
3 |
-
"version": "3.3.
|
4 |
"description": "The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 28 million downloads.",
|
5 |
"keywords": ["nextgen", "nextgen gallery", "gallery", "galleries", "image", "images", "image gallery", "photo", "photos", "photo gallery", "picture", "pictures", "picture gallery", "album", "albums", "photo albums", "image album", "media", "media gallery", "thumbnails", "thumbnail gallery", "thumbnail galleries", "slideshow", "slideshows", "slideshow gallery", "slideshow galleries", "fancybox", "lightbox", "responsive", "responsive gallery", "responsive galleries", "singlepic", "watermarks", "watermarking", "photography", "photographer"],
|
6 |
"homepage": "https://www.imagely.com/",
|
7 |
"license": "GPLv2",
|
8 |
"type": "wordpress-plugin",
|
9 |
"repositories": [
|
10 |
-
{"type": "composer", "url": "https://repo.packagist.com/
|
11 |
{"packagist.org": false}
|
12 |
],
|
13 |
"require": {
|
14 |
-
"
|
15 |
},
|
16 |
"require-dev": {
|
17 |
"nikic/php-parser": "^4.3"
|
1 |
{
|
2 |
+
"name": "imagely/nextgen-gallery",
|
3 |
+
"version": "3.3.5",
|
4 |
"description": "The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 28 million downloads.",
|
5 |
"keywords": ["nextgen", "nextgen gallery", "gallery", "galleries", "image", "images", "image gallery", "photo", "photos", "photo gallery", "picture", "pictures", "picture gallery", "album", "albums", "photo albums", "image album", "media", "media gallery", "thumbnails", "thumbnail gallery", "thumbnail galleries", "slideshow", "slideshows", "slideshow gallery", "slideshow galleries", "fancybox", "lightbox", "responsive", "responsive gallery", "responsive galleries", "singlepic", "watermarks", "watermarking", "photography", "photographer"],
|
6 |
"homepage": "https://www.imagely.com/",
|
7 |
"license": "GPLv2",
|
8 |
"type": "wordpress-plugin",
|
9 |
"repositories": [
|
10 |
+
{"type": "composer", "url": "https://repo.packagist.com/imagely/"},
|
11 |
{"packagist.org": false}
|
12 |
],
|
13 |
"require": {
|
14 |
+
"imagely/pope-framework": "v0.16"
|
15 |
},
|
16 |
"require-dev": {
|
17 |
"nikic/php-parser": "^4.3"
|
composer.lock
CHANGED
@@ -4,24 +4,24 @@
|
|
4 |
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
5 |
"This file is @generated automatically"
|
6 |
],
|
7 |
-
"content-hash": "
|
8 |
"packages": [
|
9 |
{
|
10 |
-
"name": "
|
11 |
-
"version": "v0.
|
12 |
"source": {
|
13 |
"type": "git",
|
14 |
-
"url": "https://github.com/
|
15 |
-
"reference": "
|
16 |
},
|
17 |
"dist": {
|
18 |
"type": "zip",
|
19 |
-
"url": "https://api.github.com/repos/
|
20 |
-
"reference": "
|
21 |
"shasum": "",
|
22 |
"mirrors": [
|
23 |
{
|
24 |
-
"url": "https://repo.packagist.com/
|
25 |
"preferred": true
|
26 |
}
|
27 |
]
|
@@ -32,7 +32,7 @@
|
|
32 |
"./lib/autoload.php"
|
33 |
]
|
34 |
},
|
35 |
-
"notification-url": "https://repo.packagist.com/
|
36 |
"license": [
|
37 |
"GPL-2.0-only"
|
38 |
],
|
@@ -44,29 +44,29 @@
|
|
44 |
],
|
45 |
"description": "A component framework inspired by Zope 3. Pope is \"PHP's Zope\".",
|
46 |
"support": {
|
47 |
-
"source": "https://github.com/
|
48 |
-
"issues": "https://github.com/
|
49 |
},
|
50 |
-
"time": "2020-
|
51 |
}
|
52 |
],
|
53 |
"packages-dev": [
|
54 |
{
|
55 |
"name": "nikic/php-parser",
|
56 |
-
"version": "v4.
|
57 |
"source": {
|
58 |
"type": "git",
|
59 |
"url": "https://github.com/nikic/PHP-Parser.git",
|
60 |
-
"reference": "
|
61 |
},
|
62 |
"dist": {
|
63 |
"type": "zip",
|
64 |
-
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/
|
65 |
-
"reference": "
|
66 |
"shasum": "",
|
67 |
"mirrors": [
|
68 |
{
|
69 |
-
"url": "https://repo.packagist.com/
|
70 |
"preferred": true
|
71 |
}
|
72 |
]
|
@@ -93,7 +93,7 @@
|
|
93 |
"PhpParser\\": "lib/PhpParser"
|
94 |
}
|
95 |
},
|
96 |
-
"notification-url": "https://repo.packagist.com/
|
97 |
"license": [
|
98 |
"BSD-3-Clause"
|
99 |
],
|
@@ -107,7 +107,7 @@
|
|
107 |
"parser",
|
108 |
"php"
|
109 |
],
|
110 |
-
"time": "
|
111 |
}
|
112 |
],
|
113 |
"aliases": [],
|
4 |
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
5 |
"This file is @generated automatically"
|
6 |
],
|
7 |
+
"content-hash": "82ce22d8971d1f742e7c2238cf7840d8",
|
8 |
"packages": [
|
9 |
{
|
10 |
+
"name": "imagely/pope-framework",
|
11 |
+
"version": "v0.16",
|
12 |
"source": {
|
13 |
"type": "git",
|
14 |
+
"url": "https://github.com/imagely/pope-framework.git",
|
15 |
+
"reference": "a14bdc1f5153664770df00d53577a9954f1e691c"
|
16 |
},
|
17 |
"dist": {
|
18 |
"type": "zip",
|
19 |
+
"url": "https://api.github.com/repos/imagely/pope-framework/zipball/a14bdc1f5153664770df00d53577a9954f1e691c",
|
20 |
+
"reference": "a14bdc1f5153664770df00d53577a9954f1e691c",
|
21 |
"shasum": "",
|
22 |
"mirrors": [
|
23 |
{
|
24 |
+
"url": "https://repo.packagist.com/imagely/dists/%package%/%version%/%reference%.%type%",
|
25 |
"preferred": true
|
26 |
}
|
27 |
]
|
32 |
"./lib/autoload.php"
|
33 |
]
|
34 |
},
|
35 |
+
"notification-url": "https://repo.packagist.com/imagely/downloads/",
|
36 |
"license": [
|
37 |
"GPL-2.0-only"
|
38 |
],
|
44 |
],
|
45 |
"description": "A component framework inspired by Zope 3. Pope is \"PHP's Zope\".",
|
46 |
"support": {
|
47 |
+
"source": "https://github.com/imagely/pope-framework/tree/v0.16",
|
48 |
+
"issues": "https://github.com/imagely/pope-framework/issues"
|
49 |
},
|
50 |
+
"time": "2020-06-11T20:23:55+00:00"
|
51 |
}
|
52 |
],
|
53 |
"packages-dev": [
|
54 |
{
|
55 |
"name": "nikic/php-parser",
|
56 |
+
"version": "v4.5.0",
|
57 |
"source": {
|
58 |
"type": "git",
|
59 |
"url": "https://github.com/nikic/PHP-Parser.git",
|
60 |
+
"reference": "53c2753d756f5adb586dca79c2ec0e2654dd9463"
|
61 |
},
|
62 |
"dist": {
|
63 |
"type": "zip",
|
64 |
+
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/53c2753d756f5adb586dca79c2ec0e2654dd9463",
|
65 |
+
"reference": "53c2753d756f5adb586dca79c2ec0e2654dd9463",
|
66 |
"shasum": "",
|
67 |
"mirrors": [
|
68 |
{
|
69 |
+
"url": "https://repo.packagist.com/imagely/dists/%package%/%version%/%reference%.%type%",
|
70 |
"preferred": true
|
71 |
}
|
72 |
]
|
93 |
"PhpParser\\": "lib/PhpParser"
|
94 |
}
|
95 |
},
|
96 |
+
"notification-url": "https://repo.packagist.com/imagely/downloads/",
|
97 |
"license": [
|
98 |
"BSD-3-Clause"
|
99 |
],
|
107 |
"parser",
|
108 |
"php"
|
109 |
],
|
110 |
+
"time": "2020-06-03T07:24:19+00:00"
|
111 |
}
|
112 |
],
|
113 |
"aliases": [],
|
nggallery.php
CHANGED
@@ -4,7 +4,7 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
|
|
4 |
/**
|
5 |
* Plugin Name: NextGEN Gallery
|
6 |
* Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 28 million downloads.
|
7 |
-
* Version: 3.3.
|
8 |
* Author: Imagely
|
9 |
* Plugin URI: https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/
|
10 |
* Author URI: https://www.imagely.com
|
@@ -713,7 +713,7 @@ class C_NextGEN_Bootstrap
|
|
713 |
define('NGG_PRODUCT_URL', path_join(str_replace("\\" , '/', NGG_PLUGIN_URL), 'products'));
|
714 |
define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
|
715 |
define('NGG_PLUGIN_STARTED_AT', microtime());
|
716 |
-
define('NGG_PLUGIN_VERSION', '3.3.
|
717 |
|
718 |
define(
|
719 |
'NGG_SCRIPT_VERSION',
|
4 |
/**
|
5 |
* Plugin Name: NextGEN Gallery
|
6 |
* Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 28 million downloads.
|
7 |
+
* Version: 3.3.6
|
8 |
* Author: Imagely
|
9 |
* Plugin URI: https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/
|
10 |
* Author URI: https://www.imagely.com
|
713 |
define('NGG_PRODUCT_URL', path_join(str_replace("\\" , '/', NGG_PLUGIN_URL), 'products'));
|
714 |
define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
|
715 |
define('NGG_PLUGIN_STARTED_AT', microtime());
|
716 |
+
define('NGG_PLUGIN_VERSION', '3.3.6');
|
717 |
|
718 |
define(
|
719 |
'NGG_SCRIPT_VERSION',
|
non_pope/class.nextgen_style_manager.php
CHANGED
@@ -189,23 +189,27 @@ class C_NextGen_Style_Manager
|
|
189 |
*/
|
190 |
function get_selected_stylesheet_url($selected=FALSE)
|
191 |
{
|
192 |
-
|
193 |
$selected = $this->get_selected_stylesheet();
|
|
|
194 |
$abspath = $this->find_selected_stylesheet_abspath($selected);
|
195 |
|
196 |
// default_dir is the only resource loaded from inside the plugin directory
|
197 |
$type = 'content';
|
198 |
-
$url
|
199 |
if (0 === strpos($abspath, $this->default_dir))
|
200 |
{
|
201 |
$type = 'plugins';
|
202 |
$url = plugins_url();
|
203 |
}
|
204 |
|
205 |
-
|
|
|
|
|
|
|
206 |
C_Fs::get_instance()->get_document_root($type),
|
207 |
$url,
|
208 |
-
$
|
209 |
);
|
210 |
|
211 |
return rtrim(str_replace('\\', '/', $retval), "/");
|
189 |
*/
|
190 |
function get_selected_stylesheet_url($selected=FALSE)
|
191 |
{
|
192 |
+
if (!$selected)
|
193 |
$selected = $this->get_selected_stylesheet();
|
194 |
+
|
195 |
$abspath = $this->find_selected_stylesheet_abspath($selected);
|
196 |
|
197 |
// default_dir is the only resource loaded from inside the plugin directory
|
198 |
$type = 'content';
|
199 |
+
$url = content_url();
|
200 |
if (0 === strpos($abspath, $this->default_dir))
|
201 |
{
|
202 |
$type = 'plugins';
|
203 |
$url = plugins_url();
|
204 |
}
|
205 |
|
206 |
+
// Credit to Sam Soysa for this line -- Windows servers have so many special needs.
|
207 |
+
$abspath = str_replace('\\', '/', $abspath);
|
208 |
+
|
209 |
+
$retval = str_replace(
|
210 |
C_Fs::get_instance()->get_document_root($type),
|
211 |
$url,
|
212 |
+
$abspath
|
213 |
);
|
214 |
|
215 |
return rtrim(str_replace('\\', '/', $retval), "/");
|
products/photocrati_nextgen/modules/fs/module.fs.php
CHANGED
@@ -19,7 +19,7 @@ class M_Fs extends C_Base_Module
|
|
19 |
'photocrati-fs',
|
20 |
'Filesystem',
|
21 |
'Provides a filesystem abstraction layer for Pope modules',
|
22 |
-
'3.
|
23 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
24 |
'Imagely',
|
25 |
'https://www.imagely.com'
|
19 |
'photocrati-fs',
|
20 |
'Filesystem',
|
21 |
'Provides a filesystem abstraction layer for Pope modules',
|
22 |
+
'3.3.6',
|
23 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
24 |
'Imagely',
|
25 |
'https://www.imagely.com'
|
products/photocrati_nextgen/modules/lightbox/module.lightbox.php
CHANGED
@@ -23,7 +23,7 @@ class M_Lightbox extends C_Base_Module
|
|
23 |
'photocrati-lightbox',
|
24 |
'Lightbox',
|
25 |
"Provides integration with several JavaScript lightbox effect libraries",
|
26 |
-
'3.
|
27 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
28 |
'Imagely',
|
29 |
'https://www.imagely.com'
|
23 |
'photocrati-lightbox',
|
24 |
'Lightbox',
|
25 |
"Provides integration with several JavaScript lightbox effect libraries",
|
26 |
+
'3.3.6',
|
27 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
28 |
'Imagely',
|
29 |
'https://www.imagely.com'
|
products/photocrati_nextgen/modules/lightbox/package.module.lightbox.php
CHANGED
@@ -56,7 +56,7 @@ class C_Lightbox_Library_Manager
|
|
56 |
$simplelightbox = new C_NGG_Lightbox('simplelightbox');
|
57 |
$simplelightbox->title = __('Simplelightbox', 'nggallery');
|
58 |
$simplelightbox->code = 'class="ngg-simplelightbox" rel="%GALLERY_NAME%"';
|
59 |
-
$simplelightbox->styles = array('photocrati-lightbox#simplelightbox/
|
60 |
$simplelightbox->scripts = array('photocrati-lightbox#simplelightbox/simple-lightbox.js', 'photocrati-lightbox#simplelightbox/nextgen_simple_lightbox_init.js');
|
61 |
$this->register('simplelightbox', $simplelightbox);
|
62 |
// Add Fancybox
|
56 |
$simplelightbox = new C_NGG_Lightbox('simplelightbox');
|
57 |
$simplelightbox->title = __('Simplelightbox', 'nggallery');
|
58 |
$simplelightbox->code = 'class="ngg-simplelightbox" rel="%GALLERY_NAME%"';
|
59 |
+
$simplelightbox->styles = array('photocrati-lightbox#simplelightbox/simple-lightbox.css');
|
60 |
$simplelightbox->scripts = array('photocrati-lightbox#simplelightbox/simple-lightbox.js', 'photocrati-lightbox#simplelightbox/nextgen_simple_lightbox_init.js');
|
61 |
$this->register('simplelightbox', $simplelightbox);
|
62 |
// Add Fancybox
|
products/photocrati_nextgen/modules/lightbox/static/simplelightbox/simple-lightbox.css
ADDED
@@ -0,0 +1,230 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
By André Rinas, www.andrerinas.de
|
3 |
+
Documentation, www.simplelightbox.de
|
4 |
+
Available for use under the MIT License
|
5 |
+
Version 2.1.5
|
6 |
+
*/
|
7 |
+
body.hidden-scroll {
|
8 |
+
overflow: hidden; }
|
9 |
+
|
10 |
+
.sl-overlay {
|
11 |
+
position: fixed;
|
12 |
+
left: 0;
|
13 |
+
right: 0;
|
14 |
+
top: 0;
|
15 |
+
bottom: 0;
|
16 |
+
background: #fff;
|
17 |
+
opacity: 0.7;
|
18 |
+
display: none;
|
19 |
+
z-index: 1035; }
|
20 |
+
|
21 |
+
.sl-wrapper {
|
22 |
+
z-index: 1040; }
|
23 |
+
.sl-wrapper * {
|
24 |
+
box-sizing: border-box; }
|
25 |
+
.sl-wrapper button {
|
26 |
+
border: 0 none;
|
27 |
+
background: transparent;
|
28 |
+
font-size: 28px;
|
29 |
+
padding: 0;
|
30 |
+
cursor: pointer; }
|
31 |
+
.sl-wrapper button:hover {
|
32 |
+
opacity: 0.7; }
|
33 |
+
.sl-wrapper .sl-close {
|
34 |
+
display: none;
|
35 |
+
position: fixed;
|
36 |
+
right: 30px;
|
37 |
+
top: 30px;
|
38 |
+
z-index: 10060;
|
39 |
+
margin-top: -14px;
|
40 |
+
margin-right: -14px;
|
41 |
+
height: 44px;
|
42 |
+
width: 44px;
|
43 |
+
line-height: 44px;
|
44 |
+
font-family: Arial, Baskerville, monospace;
|
45 |
+
color: #000;
|
46 |
+
font-size: 3rem; }
|
47 |
+
.sl-wrapper .sl-close:focus {
|
48 |
+
outline: none; }
|
49 |
+
.sl-wrapper .sl-counter {
|
50 |
+
display: none;
|
51 |
+
position: fixed;
|
52 |
+
top: 30px;
|
53 |
+
left: 30px;
|
54 |
+
z-index: 1060;
|
55 |
+
color: #000;
|
56 |
+
font-size: 1rem; }
|
57 |
+
.sl-wrapper .sl-navigation {
|
58 |
+
width: 100%;
|
59 |
+
display: none; }
|
60 |
+
.sl-wrapper .sl-navigation button {
|
61 |
+
position: fixed;
|
62 |
+
top: 50%;
|
63 |
+
margin-top: -22px;
|
64 |
+
height: 44px;
|
65 |
+
width: 22px;
|
66 |
+
line-height: 44px;
|
67 |
+
text-align: center;
|
68 |
+
display: block;
|
69 |
+
z-index: 10060;
|
70 |
+
font-family: Arial, Baskerville, monospace;
|
71 |
+
color: #000; }
|
72 |
+
.sl-wrapper .sl-navigation button.sl-next {
|
73 |
+
right: 5px;
|
74 |
+
font-size: 2rem; }
|
75 |
+
.sl-wrapper .sl-navigation button.sl-prev {
|
76 |
+
left: 5px;
|
77 |
+
font-size: 2rem; }
|
78 |
+
.sl-wrapper .sl-navigation button:focus {
|
79 |
+
outline: none; }
|
80 |
+
@media (min-width: 35.5em) {
|
81 |
+
.sl-wrapper .sl-navigation button {
|
82 |
+
width: 44px; }
|
83 |
+
.sl-wrapper .sl-navigation button.sl-next {
|
84 |
+
right: 10px;
|
85 |
+
font-size: 3rem; }
|
86 |
+
.sl-wrapper .sl-navigation button.sl-prev {
|
87 |
+
left: 10px;
|
88 |
+
font-size: 3rem; } }
|
89 |
+
@media (min-width: 50em) {
|
90 |
+
.sl-wrapper .sl-navigation button {
|
91 |
+
width: 44px; }
|
92 |
+
.sl-wrapper .sl-navigation button.sl-next {
|
93 |
+
right: 20px;
|
94 |
+
font-size: 3rem; }
|
95 |
+
.sl-wrapper .sl-navigation button.sl-prev {
|
96 |
+
left: 20px;
|
97 |
+
font-size: 3rem; } }
|
98 |
+
.sl-wrapper.sl-dir-rtl .sl-navigation {
|
99 |
+
direction: ltr; }
|
100 |
+
.sl-wrapper .sl-image {
|
101 |
+
position: fixed;
|
102 |
+
-ms-touch-action: none;
|
103 |
+
touch-action: none;
|
104 |
+
z-index: 10000; }
|
105 |
+
.sl-wrapper .sl-image img {
|
106 |
+
margin: 0;
|
107 |
+
padding: 0;
|
108 |
+
display: block;
|
109 |
+
border: 0 none;
|
110 |
+
width: 100%;
|
111 |
+
height: auto; }
|
112 |
+
@media (min-width: 35.5em) {
|
113 |
+
.sl-wrapper .sl-image img {
|
114 |
+
border: 0 none; } }
|
115 |
+
@media (min-width: 50em) {
|
116 |
+
.sl-wrapper .sl-image img {
|
117 |
+
border: 0 none; } }
|
118 |
+
.sl-wrapper .sl-image iframe {
|
119 |
+
background: #000;
|
120 |
+
border: 0 none; }
|
121 |
+
@media (min-width: 35.5em) {
|
122 |
+
.sl-wrapper .sl-image iframe {
|
123 |
+
border: 0 none; } }
|
124 |
+
@media (min-width: 50em) {
|
125 |
+
.sl-wrapper .sl-image iframe {
|
126 |
+
border: 0 none; } }
|
127 |
+
.sl-wrapper .sl-image .sl-caption {
|
128 |
+
display: none;
|
129 |
+
padding: 10px;
|
130 |
+
color: #fff;
|
131 |
+
background: rgba(0, 0, 0, 0.8);
|
132 |
+
font-size: 1rem;
|
133 |
+
position: absolute;
|
134 |
+
bottom: 0;
|
135 |
+
left: 0;
|
136 |
+
right: 0; }
|
137 |
+
.sl-wrapper .sl-image .sl-caption.pos-top {
|
138 |
+
bottom: auto;
|
139 |
+
top: 0; }
|
140 |
+
.sl-wrapper .sl-image .sl-caption.pos-outside {
|
141 |
+
bottom: auto; }
|
142 |
+
.sl-wrapper .sl-image .sl-download {
|
143 |
+
display: none;
|
144 |
+
position: absolute;
|
145 |
+
bottom: 5px;
|
146 |
+
right: 5px;
|
147 |
+
color: #000;
|
148 |
+
z-index: 1060; }
|
149 |
+
|
150 |
+
.sl-spinner {
|
151 |
+
display: none;
|
152 |
+
border: 5px solid #333;
|
153 |
+
border-radius: 40px;
|
154 |
+
height: 40px;
|
155 |
+
left: 50%;
|
156 |
+
margin: -20px 0 0 -20px;
|
157 |
+
opacity: 0;
|
158 |
+
position: fixed;
|
159 |
+
top: 50%;
|
160 |
+
width: 40px;
|
161 |
+
z-index: 1007;
|
162 |
+
-webkit-animation: pulsate 1s ease-out infinite;
|
163 |
+
-moz-animation: pulsate 1s ease-out infinite;
|
164 |
+
-ms-animation: pulsate 1s ease-out infinite;
|
165 |
+
-o-animation: pulsate 1s ease-out infinite;
|
166 |
+
animation: pulsate 1s ease-out infinite; }
|
167 |
+
|
168 |
+
.sl-scrollbar-measure {
|
169 |
+
position: absolute;
|
170 |
+
top: -9999px;
|
171 |
+
width: 50px;
|
172 |
+
height: 50px;
|
173 |
+
overflow: scroll; }
|
174 |
+
|
175 |
+
.sl-transition {
|
176 |
+
transition: -moz-transform ease 200ms;
|
177 |
+
transition: -ms-transform ease 200ms;
|
178 |
+
transition: -o-transform ease 200ms;
|
179 |
+
transition: -webkit-transform ease 200ms;
|
180 |
+
transition: transform ease 200ms; }
|
181 |
+
|
182 |
+
@-webkit-keyframes pulsate {
|
183 |
+
0% {
|
184 |
+
transform: scale(0.1);
|
185 |
+
opacity: 0.0; }
|
186 |
+
50% {
|
187 |
+
opacity: 1; }
|
188 |
+
100% {
|
189 |
+
transform: scale(1.2);
|
190 |
+
opacity: 0; } }
|
191 |
+
|
192 |
+
@keyframes pulsate {
|
193 |
+
0% {
|
194 |
+
transform: scale(0.1);
|
195 |
+
opacity: 0.0; }
|
196 |
+
50% {
|
197 |
+
opacity: 1; }
|
198 |
+
100% {
|
199 |
+
transform: scale(1.2);
|
200 |
+
opacity: 0; } }
|
201 |
+
|
202 |
+
@-moz-keyframes pulsate {
|
203 |
+
0% {
|
204 |
+
transform: scale(0.1);
|
205 |
+
opacity: 0.0; }
|
206 |
+
50% {
|
207 |
+
opacity: 1; }
|
208 |
+
100% {
|
209 |
+
transform: scale(1.2);
|
210 |
+
opacity: 0; } }
|
211 |
+
|
212 |
+
@-o-keyframes pulsate {
|
213 |
+
0% {
|
214 |
+
transform: scale(0.1);
|
215 |
+
opacity: 0.0; }
|
216 |
+
50% {
|
217 |
+
opacity: 1; }
|
218 |
+
100% {
|
219 |
+
transform: scale(1.2);
|
220 |
+
opacity: 0; } }
|
221 |
+
|
222 |
+
@-ms-keyframes pulsate {
|
223 |
+
0% {
|
224 |
+
transform: scale(0.1);
|
225 |
+
opacity: 0.0; }
|
226 |
+
50% {
|
227 |
+
opacity: 1; }
|
228 |
+
100% {
|
229 |
+
transform: scale(1.2);
|
230 |
+
opacity: 0; } }
|
products/photocrati_nextgen/modules/lightbox/static/simplelightbox/simple-lightbox.js
CHANGED
@@ -1,581 +1,1564 @@
|
|
1 |
-
|
2 |
-
By André Rinas, www.andrerinas.de
|
3 |
-
|
4 |
-
|
|
|
5 |
*/
|
6 |
-
;
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
By André Rinas, www.andrerinas.de
|
3 |
+
Documentation, www.simplelightbox.de
|
4 |
+
Available for use under the MIT License
|
5 |
+
Version 2.1.5
|
6 |
*/
|
7 |
+
"use strict";
|
8 |
+
|
9 |
+
function _createForOfIteratorHelper(o) { if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) { var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var it, normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
10 |
+
|
11 |
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
12 |
+
|
13 |
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
14 |
+
|
15 |
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
16 |
+
|
17 |
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
18 |
+
|
19 |
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
20 |
+
|
21 |
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
22 |
+
|
23 |
+
var SimpleLightbox = /*#__PURE__*/function () {
|
24 |
+
function SimpleLightbox(elements, options) {
|
25 |
+
var _this = this;
|
26 |
+
|
27 |
+
_classCallCheck(this, SimpleLightbox);
|
28 |
+
|
29 |
+
_defineProperty(this, "defaultOptions", {
|
30 |
+
sourceAttr: 'href',
|
31 |
+
overlay: true,
|
32 |
+
spinner: true,
|
33 |
+
nav: true,
|
34 |
+
navText: ['‹', '›'],
|
35 |
+
captions: true,
|
36 |
+
captionDelay: 0,
|
37 |
+
captionSelector: 'img',
|
38 |
+
captionType: 'attr',
|
39 |
+
captionsData: 'title',
|
40 |
+
captionPosition: 'bottom',
|
41 |
+
captionClass: '',
|
42 |
+
close: true,
|
43 |
+
closeText: '×',
|
44 |
+
swipeClose: true,
|
45 |
+
showCounter: true,
|
46 |
+
fileExt: 'png|jpg|jpeg|gif|webp',
|
47 |
+
animationSlide: true,
|
48 |
+
animationSpeed: 250,
|
49 |
+
preloading: true,
|
50 |
+
enableKeyboard: true,
|
51 |
+
loop: true,
|
52 |
+
rel: false,
|
53 |
+
docClose: true,
|
54 |
+
swipeTolerance: 50,
|
55 |
+
className: 'simple-lightbox',
|
56 |
+
widthRatio: 0.8,
|
57 |
+
heightRatio: 0.9,
|
58 |
+
scaleImageToRatio: false,
|
59 |
+
disableRightClick: false,
|
60 |
+
disableScroll: true,
|
61 |
+
alertError: true,
|
62 |
+
alertErrorMessage: 'Image not found, next image will be loaded',
|
63 |
+
additionalHtml: false,
|
64 |
+
history: true,
|
65 |
+
throttleInterval: 0,
|
66 |
+
doubleTapZoom: 2,
|
67 |
+
maxZoom: 10,
|
68 |
+
htmlClass: 'has-lightbox',
|
69 |
+
rtl: false
|
70 |
+
});
|
71 |
+
|
72 |
+
_defineProperty(this, "transitionPrefix", void 0);
|
73 |
+
|
74 |
+
_defineProperty(this, "transitionCapable", false);
|
75 |
+
|
76 |
+
_defineProperty(this, "isTouchDevice", 'ontouchstart' in window);
|
77 |
+
|
78 |
+
_defineProperty(this, "initialLocationHash", void 0);
|
79 |
+
|
80 |
+
_defineProperty(this, "pushStateSupport", 'pushState' in history);
|
81 |
+
|
82 |
+
_defineProperty(this, "isOpen", false);
|
83 |
+
|
84 |
+
_defineProperty(this, "isAnimating", false);
|
85 |
+
|
86 |
+
_defineProperty(this, "isClosing", false);
|
87 |
+
|
88 |
+
_defineProperty(this, "urlChangedOnce", false);
|
89 |
+
|
90 |
+
_defineProperty(this, "hashReseted", false);
|
91 |
+
|
92 |
+
_defineProperty(this, "historyHasChanges", false);
|
93 |
+
|
94 |
+
_defineProperty(this, "historyUpdateTimeout", null);
|
95 |
+
|
96 |
+
_defineProperty(this, "currentImage", void 0);
|
97 |
+
|
98 |
+
_defineProperty(this, "eventNamespace", 'simplelightbox');
|
99 |
+
|
100 |
+
_defineProperty(this, "domNodes", {});
|
101 |
+
|
102 |
+
_defineProperty(this, "loadedImages", []);
|
103 |
+
|
104 |
+
_defineProperty(this, "initialImageIndex", 0);
|
105 |
+
|
106 |
+
_defineProperty(this, "currentImageIndex", 0);
|
107 |
+
|
108 |
+
_defineProperty(this, "initialSelector", null);
|
109 |
+
|
110 |
+
_defineProperty(this, "globalScrollbarWidth", 0);
|
111 |
+
|
112 |
+
_defineProperty(this, "controlCoordinates", {
|
113 |
+
swipeDiff: 0,
|
114 |
+
swipeYDiff: 0,
|
115 |
+
swipeStart: 0,
|
116 |
+
swipeEnd: 0,
|
117 |
+
swipeYStart: 0,
|
118 |
+
swipeYEnd: 0,
|
119 |
+
mousedown: false,
|
120 |
+
imageLeft: 0,
|
121 |
+
zoomed: false,
|
122 |
+
containerHeight: 0,
|
123 |
+
containerWidth: 0,
|
124 |
+
containerOffsetX: 0,
|
125 |
+
containerOffsetY: 0,
|
126 |
+
imgHeight: 0,
|
127 |
+
imgWidth: 0,
|
128 |
+
capture: false,
|
129 |
+
initialOffsetX: 0,
|
130 |
+
initialOffsetY: 0,
|
131 |
+
initialPointerOffsetX: 0,
|
132 |
+
initialPointerOffsetY: 0,
|
133 |
+
initialPointerOffsetX2: 0,
|
134 |
+
initialPointerOffsetY2: 0,
|
135 |
+
initialScale: 1,
|
136 |
+
initialPinchDistance: 0,
|
137 |
+
pointerOffsetX: 0,
|
138 |
+
pointerOffsetY: 0,
|
139 |
+
pointerOffsetX2: 0,
|
140 |
+
pointerOffsetY2: 0,
|
141 |
+
targetOffsetX: 0,
|
142 |
+
targetOffsetY: 0,
|
143 |
+
targetScale: 0,
|
144 |
+
pinchOffsetX: 0,
|
145 |
+
pinchOffsetY: 0,
|
146 |
+
limitOffsetX: 0,
|
147 |
+
limitOffsetY: 0,
|
148 |
+
scaleDifference: 0,
|
149 |
+
targetPinchDistance: 0,
|
150 |
+
touchCount: 0,
|
151 |
+
doubleTapped: false,
|
152 |
+
touchmoveCount: 0
|
153 |
+
});
|
154 |
+
|
155 |
+
this.options = Object.assign(this.defaultOptions, options);
|
156 |
+
|
157 |
+
if (typeof elements === 'string') {
|
158 |
+
this.initialSelector = elements;
|
159 |
+
this.elements = Array.from(document.querySelectorAll(elements));
|
160 |
+
} else {
|
161 |
+
this.elements = typeof elements.length !== 'undefined' && elements.length > 0 ? Array.from(elements) : [elements];
|
162 |
+
}
|
163 |
+
|
164 |
+
this.relatedElements = [];
|
165 |
+
this.transitionPrefix = this.calculateTransitionPrefix();
|
166 |
+
this.transitionCapable = this.transitionPrefix !== false;
|
167 |
+
this.initialLocationHash = this.hash; // this should be handled by attribute selector IMHO! => 'a[rel=bla]'...
|
168 |
+
|
169 |
+
if (this.options.rel) {
|
170 |
+
this.elements = this.getRelated(this.options.rel);
|
171 |
+
}
|
172 |
+
|
173 |
+
this.createDomNodes();
|
174 |
+
|
175 |
+
if (this.options.close) {
|
176 |
+
this.domNodes.wrapper.appendChild(this.domNodes.closeButton);
|
177 |
+
}
|
178 |
+
|
179 |
+
if (this.options.nav) {
|
180 |
+
this.domNodes.wrapper.appendChild(this.domNodes.navigation);
|
181 |
+
}
|
182 |
+
|
183 |
+
if (this.options.spinner) {
|
184 |
+
this.domNodes.wrapper.appendChild(this.domNodes.spinner);
|
185 |
+
}
|
186 |
+
|
187 |
+
this.addEventListener(this.elements, 'click.' + this.eventNamespace, function (event) {
|
188 |
+
if (_this.isValidLink(event.currentTarget)) {
|
189 |
+
event.preventDefault();
|
190 |
+
|
191 |
+
if (_this.isAnimating) {
|
192 |
+
return false;
|
193 |
+
}
|
194 |
+
|
195 |
+
_this.initialImageIndex = _this.elements.indexOf(event.currentTarget);
|
196 |
+
|
197 |
+
_this.openImage(event.currentTarget);
|
198 |
+
}
|
199 |
+
}); // close addEventListener click addEventListener doc
|
200 |
+
|
201 |
+
if (this.options.docClose) {
|
202 |
+
this.addEventListener(this.domNodes.overlay, ['click.' + this.eventNamespace, 'touchstart.' + this.eventNamespace], function (event) {
|
203 |
+
if (_this.isOpen) {
|
204 |
+
_this.close();
|
205 |
+
}
|
206 |
+
});
|
207 |
+
} // disable rightclick
|
208 |
+
|
209 |
+
|
210 |
+
if (this.options.disableRightClick) {
|
211 |
+
this.addEventListener(document.body, 'contextmenu.' + this.eventNamespace, function (event) {
|
212 |
+
if (event.target.classList.contains('sl-overlay')) {
|
213 |
+
event.preventDefault();
|
214 |
+
}
|
215 |
+
});
|
216 |
+
} // keyboard-control
|
217 |
+
|
218 |
+
|
219 |
+
if (this.options.enableKeyboard) {
|
220 |
+
this.addEventListener(document.body, 'keyup.' + this.eventNamespace, this.throttle(function (event) {
|
221 |
+
_this.controlCoordinates.swipeDiff = 0; // keyboard control only if lightbox is open
|
222 |
+
|
223 |
+
if (_this.isAnimating && event.key === 'Escape') {
|
224 |
+
_this.currentImage.setAttribute('src', '');
|
225 |
+
|
226 |
+
_this.isAnimating = false;
|
227 |
+
return _this.close();
|
228 |
+
}
|
229 |
+
|
230 |
+
if (_this.isOpen) {
|
231 |
+
event.preventDefault();
|
232 |
+
|
233 |
+
if (event.key === 'Escape') {
|
234 |
+
_this.close();
|
235 |
+
}
|
236 |
+
|
237 |
+
if (!_this.isAnimating && ['ArrowLeft', 'ArrowRight'].indexOf(event.key) > -1) {
|
238 |
+
_this.loadImage(event.key === 'ArrowRight' ? 1 : -1);
|
239 |
+
}
|
240 |
+
}
|
241 |
+
}, this.options.throttleInterval));
|
242 |
+
}
|
243 |
+
|
244 |
+
this.addEvents();
|
245 |
+
}
|
246 |
+
|
247 |
+
_createClass(SimpleLightbox, [{
|
248 |
+
key: "createDomNodes",
|
249 |
+
value: function createDomNodes() {
|
250 |
+
this.domNodes.overlay = document.createElement('div');
|
251 |
+
this.domNodes.overlay.classList.add('sl-overlay');
|
252 |
+
this.domNodes.overlay.dataset.opacityTarget = ".7";
|
253 |
+
this.domNodes.closeButton = document.createElement('button');
|
254 |
+
this.domNodes.closeButton.classList.add('sl-close');
|
255 |
+
this.domNodes.closeButton.innerHTML = this.options.closeText;
|
256 |
+
this.domNodes.spinner = document.createElement('div');
|
257 |
+
this.domNodes.spinner.classList.add('sl-spinner');
|
258 |
+
this.domNodes.spinner.innerHTML = '<div></div>';
|
259 |
+
this.domNodes.navigation = document.createElement('div');
|
260 |
+
this.domNodes.navigation.classList.add('sl-navigation');
|
261 |
+
this.domNodes.navigation.innerHTML = "<button class=\"sl-prev\">".concat(this.options.navText[0], "</button><button class=\"sl-next\">").concat(this.options.navText[1], "</button>");
|
262 |
+
this.domNodes.counter = document.createElement('div');
|
263 |
+
this.domNodes.counter.classList.add('sl-counter');
|
264 |
+
this.domNodes.counter.innerHTML = '<span class="sl-current"></span>/<span class="sl-total"></span>';
|
265 |
+
this.domNodes.caption = document.createElement('div');
|
266 |
+
this.domNodes.caption.classList.add('sl-caption', 'pos-' + this.options.captionPosition);
|
267 |
+
|
268 |
+
if (this.options.captionClass) {
|
269 |
+
this.domNodes.caption.classList.add(this.options.captionClass);
|
270 |
+
}
|
271 |
+
|
272 |
+
this.domNodes.image = document.createElement('div');
|
273 |
+
this.domNodes.image.classList.add('sl-image');
|
274 |
+
this.domNodes.wrapper = document.createElement('div');
|
275 |
+
this.domNodes.wrapper.classList.add('sl-wrapper');
|
276 |
+
|
277 |
+
if (this.options.className) {
|
278 |
+
this.domNodes.wrapper.classList.add(this.options.className);
|
279 |
+
}
|
280 |
+
|
281 |
+
if (this.options.rtl) {
|
282 |
+
this.domNodes.wrapper.classList.add('sl-dir-rtl');
|
283 |
+
}
|
284 |
+
}
|
285 |
+
}, {
|
286 |
+
key: "throttle",
|
287 |
+
value: function throttle(func, limit) {
|
288 |
+
var inThrottle;
|
289 |
+
return function () {
|
290 |
+
if (!inThrottle) {
|
291 |
+
func.apply(this, arguments);
|
292 |
+
inThrottle = true;
|
293 |
+
setTimeout(function () {
|
294 |
+
return inThrottle = false;
|
295 |
+
}, limit);
|
296 |
+
}
|
297 |
+
};
|
298 |
+
}
|
299 |
+
}, {
|
300 |
+
key: "isValidLink",
|
301 |
+
value: function isValidLink(element) {
|
302 |
+
return !this.options.fileExt || 'pathname' in element && new RegExp('(' + this.options.fileExt + ')$', 'i').test(element.pathname);
|
303 |
+
}
|
304 |
+
}, {
|
305 |
+
key: "calculateTransitionPrefix",
|
306 |
+
value: function calculateTransitionPrefix() {
|
307 |
+
var s = (document.body || document.documentElement).style;
|
308 |
+
return 'transition' in s ? '' : 'WebkitTransition' in s ? '-webkit-' : 'MozTransition' in s ? '-moz-' : 'OTransition' in s ? '-o' : false;
|
309 |
+
}
|
310 |
+
}, {
|
311 |
+
key: "toggleScrollbar",
|
312 |
+
value: function toggleScrollbar(type) {
|
313 |
+
var scrollbarWidth = 0;
|
314 |
+
|
315 |
+
if (type === 'hide') {
|
316 |
+
var fullWindowWidth = window.innerWidth;
|
317 |
+
|
318 |
+
if (!fullWindowWidth) {
|
319 |
+
var documentElementRect = document.documentElement.getBoundingClientRect();
|
320 |
+
fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left);
|
321 |
+
}
|
322 |
+
|
323 |
+
if (document.body.clientWidth < fullWindowWidth) {
|
324 |
+
var scrollDiv = document.createElement('div'),
|
325 |
+
paddingRight = parseInt(document.body.style.paddingRight || 0, 10);
|
326 |
+
scrollDiv.classList.add('sl-scrollbar-measure');
|
327 |
+
document.body.appendChild(scrollDiv);
|
328 |
+
scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
|
329 |
+
document.body.removeChild(scrollDiv);
|
330 |
+
document.body.dataset.originalPaddingRight = paddingRight;
|
331 |
+
|
332 |
+
if (scrollbarWidth > 0) {
|
333 |
+
document.body.classList.add('hidden-scroll');
|
334 |
+
document.body.style.paddingRight = paddingRight + scrollbarWidth + 'px';
|
335 |
+
}
|
336 |
+
}
|
337 |
+
} else {
|
338 |
+
document.body.classList.remove('hidden-scroll');
|
339 |
+
document.body.style.paddingRight = document.body.dataset.originalPaddingRight;
|
340 |
+
}
|
341 |
+
|
342 |
+
return scrollbarWidth;
|
343 |
+
}
|
344 |
+
}, {
|
345 |
+
key: "close",
|
346 |
+
value: function close() {
|
347 |
+
var _this2 = this;
|
348 |
+
|
349 |
+
if (!this.isOpen || this.isAnimating || this.isClosing) {
|
350 |
+
return false;
|
351 |
+
}
|
352 |
+
|
353 |
+
this.isClosing = true;
|
354 |
+
var element = this.relatedElements[this.currentImageIndex];
|
355 |
+
element.dispatchEvent(new Event('close.simplelightbox'));
|
356 |
+
|
357 |
+
if (this.options.history) {
|
358 |
+
this.historyHasChanges = false;
|
359 |
+
|
360 |
+
if (!this.hashReseted) {
|
361 |
+
this.resetHash();
|
362 |
+
}
|
363 |
+
}
|
364 |
+
|
365 |
+
this.fadeOut(document.querySelectorAll('.sl-image img, .sl-overlay, .sl-close, .sl-navigation, .sl-image .sl-caption, .sl-counter'), 300, function () {
|
366 |
+
if (_this2.options.disableScroll) {
|
367 |
+
_this2.toggleScrollbar('show');
|
368 |
+
}
|
369 |
+
|
370 |
+
if (_this2.options.htmlClass && _this2.options.htmlClass !== '') {
|
371 |
+
document.querySelector('html').classList.remove(_this2.options.htmlClass);
|
372 |
+
}
|
373 |
+
|
374 |
+
document.body.removeChild(_this2.domNodes.wrapper);
|
375 |
+
document.body.removeChild(_this2.domNodes.overlay);
|
376 |
+
_this2.domNodes.additionalHtml = null;
|
377 |
+
element.dispatchEvent(new Event('closed.simplelightbox'));
|
378 |
+
_this2.isClosing = false;
|
379 |
+
});
|
380 |
+
this.currentImage = null;
|
381 |
+
this.isOpen = false;
|
382 |
+
this.isAnimating = false; // reset touchcontrol coordinates
|
383 |
+
|
384 |
+
for (var key in this.controlCoordinates) {
|
385 |
+
this.controlCoordinates[key] = 0;
|
386 |
+
}
|
387 |
+
|
388 |
+
this.controlCoordinates.mousedown = false;
|
389 |
+
this.controlCoordinates.zoomed = false;
|
390 |
+
this.controlCoordinates.capture = false;
|
391 |
+
this.controlCoordinates.initialScale = this.minMax(1, 1, this.options.maxZoom);
|
392 |
+
this.controlCoordinates.doubleTapped = false;
|
393 |
+
}
|
394 |
+
}, {
|
395 |
+
key: "preload",
|
396 |
+
value: function preload() {
|
397 |
+
var _this3 = this;
|
398 |
+
|
399 |
+
var index = this.currentImageIndex,
|
400 |
+
length = this.relatedElements.length,
|
401 |
+
next = index + 1 < 0 ? length - 1 : index + 1 >= length - 1 ? 0 : index + 1,
|
402 |
+
prev = index - 1 < 0 ? length - 1 : index - 1 >= length - 1 ? 0 : index - 1,
|
403 |
+
nextImage = new Image(),
|
404 |
+
prevImage = new Image();
|
405 |
+
nextImage.addEventListener('load', function (event) {
|
406 |
+
var src = event.target.getAttribute('src');
|
407 |
+
|
408 |
+
if (_this3.loadedImages.indexOf(src) === -1) {
|
409 |
+
//is this condition even required... setting multiple times will not change usage...
|
410 |
+
_this3.loadedImages.push(src);
|
411 |
+
}
|
412 |
+
|
413 |
+
_this3.relatedElements[index].dispatchEvent(new Event('nextImageLoaded.' + _this3.eventNamespace));
|
414 |
+
});
|
415 |
+
nextImage.setAttribute('src', this.relatedElements[next].getAttribute(this.options.sourceAttr));
|
416 |
+
prevImage.addEventListener('load', function (event) {
|
417 |
+
var src = event.target.getAttribute('src');
|
418 |
+
|
419 |
+
if (_this3.loadedImages.indexOf(src) === -1) {
|
420 |
+
_this3.loadedImages.push(src);
|
421 |
+
}
|
422 |
+
|
423 |
+
_this3.relatedElements[index].dispatchEvent(new Event('prevImageLoaded.' + _this3.eventNamespace));
|
424 |
+
});
|
425 |
+
prevImage.setAttribute('src', this.relatedElements[prev].getAttribute(this.options.sourceAttr));
|
426 |
+
}
|
427 |
+
}, {
|
428 |
+
key: "loadImage",
|
429 |
+
value: function loadImage(direction) {
|
430 |
+
var _this4 = this;
|
431 |
+
|
432 |
+
var slideDirection = direction;
|
433 |
+
|
434 |
+
if (this.options.rtl) {
|
435 |
+
direction = -direction;
|
436 |
+
}
|
437 |
+
|
438 |
+
this.relatedElements[this.currentImageIndex].dispatchEvent(new Event('change.' + this.eventNamespace));
|
439 |
+
this.relatedElements[this.currentImageIndex].dispatchEvent(new Event((direction === 1 ? 'next' : 'prev') + '.' + this.eventNamespace));
|
440 |
+
var newIndex = this.currentImageIndex + direction;
|
441 |
+
|
442 |
+
if (this.isAnimating || (newIndex < 0 || newIndex >= this.relatedElements.length) && this.options.loop === false) {
|
443 |
+
return false;
|
444 |
+
}
|
445 |
+
|
446 |
+
this.currentImageIndex = newIndex < 0 ? this.relatedElements.length - 1 : newIndex > this.relatedElements.length - 1 ? 0 : newIndex;
|
447 |
+
this.domNodes.counter.querySelector('.sl-current').innerHTML = this.currentImageIndex + 1;
|
448 |
+
|
449 |
+
if (this.options.animationSlide) {
|
450 |
+
this.slide(this.options.animationSpeed / 1000, -100 * slideDirection - this.controlCoordinates.swipeDiff + 'px');
|
451 |
+
}
|
452 |
+
|
453 |
+
this.fadeOut(this.domNodes.image, 300, function () {
|
454 |
+
_this4.isAnimating = true;
|
455 |
+
setTimeout(function () {
|
456 |
+
var element = _this4.relatedElements[_this4.currentImageIndex];
|
457 |
+
|
458 |
+
_this4.currentImage.setAttribute('src', element.getAttribute(_this4.options.sourceAttr));
|
459 |
+
|
460 |
+
if (_this4.loadedImages.indexOf(element.getAttribute(_this4.options.sourceAttr)) === -1) {
|
461 |
+
_this4.show(_this4.domNodes.spinner);
|
462 |
+
}
|
463 |
+
|
464 |
+
if (_this4.domNodes.image.contains(_this4.domNodes.caption)) {
|
465 |
+
_this4.domNodes.image.removeChild(_this4.domNodes.caption);
|
466 |
+
}
|
467 |
+
|
468 |
+
_this4.adjustImage(slideDirection);
|
469 |
+
|
470 |
+
if (_this4.options.preloading) _this4.preload();
|
471 |
+
}, 100);
|
472 |
+
});
|
473 |
+
}
|
474 |
+
}, {
|
475 |
+
key: "adjustImage",
|
476 |
+
value: function adjustImage(direction) {
|
477 |
+
var _this5 = this;
|
478 |
+
|
479 |
+
if (!this.currentImage) {
|
480 |
+
return false;
|
481 |
+
}
|
482 |
+
|
483 |
+
var tmpImage = new Image(),
|
484 |
+
windowWidth = window.innerWidth * this.options.widthRatio,
|
485 |
+
windowHeight = window.innerHeight * this.options.heightRatio;
|
486 |
+
tmpImage.setAttribute('src', this.currentImage.getAttribute('src'));
|
487 |
+
this.currentImage.dataset.scale = 1;
|
488 |
+
this.currentImage.dataset.translateX = 0;
|
489 |
+
this.currentImage.dataset.translateY = 0;
|
490 |
+
this.zoomPanElement(0, 0, 1);
|
491 |
+
tmpImage.addEventListener('error', function (event) {
|
492 |
+
_this5.relatedElements[_this5.currentImageIndex].dispatchEvent(new Event('error.' + _this5.eventNamespace));
|
493 |
+
|
494 |
+
_this5.isAnimating = false;
|
495 |
+
_this5.isOpen = false;
|
496 |
+
_this5.domNodes.spinner.style.display = 'none';
|
497 |
+
var dirIsDefined = direction === 1 || direction === -1;
|
498 |
+
|
499 |
+
if (_this5.initialImageIndex === _this5.currentImageIndex && dirIsDefined) {
|
500 |
+
return _this5.close();
|
501 |
+
}
|
502 |
+
|
503 |
+
if (_this5.options.alertError) {
|
504 |
+
alert(_this5.options.alertErrorMessage);
|
505 |
+
}
|
506 |
+
|
507 |
+
_this5.loadImage(dirIsDefined ? direction : 1);
|
508 |
+
});
|
509 |
+
tmpImage.addEventListener('load', function (event) {
|
510 |
+
if (typeof direction !== 'undefined') {
|
511 |
+
_this5.relatedElements[_this5.currentImageIndex].dispatchEvent(new Event('changed.' + _this5.eventNamespace));
|
512 |
+
|
513 |
+
_this5.relatedElements[_this5.currentImageIndex].dispatchEvent(new Event((direction === 1 ? 'nextDone' : 'prevDone') + '.' + _this5.eventNamespace));
|
514 |
+
} // history
|
515 |
+
|
516 |
+
|
517 |
+
if (_this5.options.history) {
|
518 |
+
_this5.updateURL();
|
519 |
+
}
|
520 |
+
|
521 |
+
if (_this5.loadedImages.indexOf(_this5.currentImage.getAttribute('src')) === -1) {
|
522 |
+
_this5.loadedImages.push(_this5.currentImage.getAttribute('src'));
|
523 |
+
}
|
524 |
+
|
525 |
+
var imageWidth = event.target.width,
|
526 |
+
imageHeight = event.target.height;
|
527 |
+
|
528 |
+
if (_this5.options.scaleImageToRatio || imageWidth > windowWidth || imageHeight > windowHeight) {
|
529 |
+
var ratio = imageWidth / imageHeight > windowWidth / windowHeight ? imageWidth / windowWidth : imageHeight / windowHeight;
|
530 |
+
imageWidth /= ratio;
|
531 |
+
imageHeight /= ratio;
|
532 |
+
}
|
533 |
+
|
534 |
+
_this5.domNodes.image.style.top = (window.innerHeight - imageHeight) / 2 + 'px';
|
535 |
+
_this5.domNodes.image.style.left = (window.innerWidth - imageWidth - _this5.globalScrollbarWidth) / 2 + 'px';
|
536 |
+
_this5.domNodes.image.style.width = imageWidth + 'px';
|
537 |
+
_this5.domNodes.image.style.height = imageHeight + 'px';
|
538 |
+
_this5.domNodes.spinner.style.display = 'none';
|
539 |
+
|
540 |
+
_this5.fadeIn(_this5.currentImage, 300);
|
541 |
+
|
542 |
+
_this5.isOpen = true;
|
543 |
+
var captionContainer = _this5.options.captionSelector === 'self' ? _this5.relatedElements[_this5.currentImageIndex] : _this5.relatedElements[_this5.currentImageIndex].querySelector(_this5.options.captionSelector),
|
544 |
+
captionText;
|
545 |
+
|
546 |
+
if (_this5.options.captions && captionContainer) {
|
547 |
+
if (_this5.options.captionType === 'data') {
|
548 |
+
captionText = captionContainer.dataset[_this5.options.captionsData];
|
549 |
+
} else if (_this5.options.captionType === 'text') {
|
550 |
+
captionText = captionContainer.innerHTML;
|
551 |
+
} else {
|
552 |
+
captionText = captionContainer.getAttribute(_this5.options.captionsData);
|
553 |
+
}
|
554 |
+
}
|
555 |
+
|
556 |
+
if (!_this5.options.loop) {
|
557 |
+
if (_this5.currentImageIndex === 0) {
|
558 |
+
_this5.hide(_this5.domNodes.navigation.querySelector('.sl-prev'));
|
559 |
+
}
|
560 |
+
|
561 |
+
if (_this5.currentImageIndex >= _this5.relatedElements.length - 1) {
|
562 |
+
_this5.hide(_this5.domNodes.navigation.querySelector('.sl-next'));
|
563 |
+
}
|
564 |
+
|
565 |
+
if (_this5.currentImageIndex > 0) {
|
566 |
+
_this5.show(_this5.domNodes.navigation.querySelector('.sl-prev'));
|
567 |
+
}
|
568 |
+
|
569 |
+
if (_this5.currentImageIndex < _this5.relatedElements.length - 1) {
|
570 |
+
_this5.show(_this5.domNodes.navigation.querySelector('.sl-next'));
|
571 |
+
}
|
572 |
+
}
|
573 |
+
|
574 |
+
if (_this5.relatedElements.length === 1) {
|
575 |
+
_this5.hide(_this5.domNodes.navigation.querySelectorAll('.sl-prev, .sl-next'));
|
576 |
+
} else {
|
577 |
+
_this5.show(_this5.domNodes.navigation.querySelectorAll('.sl-prev, .sl-next'));
|
578 |
+
}
|
579 |
+
|
580 |
+
if (direction === 1 || direction === -1) {
|
581 |
+
if (_this5.options.animationSlide) {
|
582 |
+
_this5.slide(0, 100 * direction + 'px');
|
583 |
+
|
584 |
+
setTimeout(function () {
|
585 |
+
_this5.slide(_this5.options.animationSpeed / 1000, 0 + 'px');
|
586 |
+
}, 50);
|
587 |
+
}
|
588 |
+
|
589 |
+
_this5.fadeIn(_this5.domNodes.image, 300, function () {
|
590 |
+
_this5.isAnimating = false;
|
591 |
+
|
592 |
+
_this5.setCaption(captionText, imageWidth);
|
593 |
+
});
|
594 |
+
} else {
|
595 |
+
_this5.isAnimating = false;
|
596 |
+
|
597 |
+
_this5.setCaption(captionText, imageWidth);
|
598 |
+
}
|
599 |
+
|
600 |
+
if (_this5.options.additionalHtml && !_this5.domNodes.additionalHtml) {
|
601 |
+
_this5.domNodes.additionalHtml = document.createElement('div');
|
602 |
+
|
603 |
+
_this5.domNodes.additionalHtml.classList.add('sl-additional-html');
|
604 |
+
|
605 |
+
_this5.domNodes.additionalHtml.innerHTML = _this5.options.additionalHtml;
|
606 |
+
|
607 |
+
_this5.domNodes.image.appendChild(_this5.domNodes.additionalHtml);
|
608 |
+
}
|
609 |
+
});
|
610 |
+
}
|
611 |
+
}, {
|
612 |
+
key: "zoomPanElement",
|
613 |
+
value: function zoomPanElement(targetOffsetX, targetOffsetY, targetScale) {
|
614 |
+
this.currentImage.style[this.transitionPrefix + 'transform'] = 'translate(' + targetOffsetX + ',' + targetOffsetY + ') scale(' + targetScale + ')';
|
615 |
+
}
|
616 |
+
}, {
|
617 |
+
key: "minMax",
|
618 |
+
value: function minMax(value, min, max) {
|
619 |
+
return value < min ? min : value > max ? max : value;
|
620 |
+
}
|
621 |
+
}, {
|
622 |
+
key: "setZoomData",
|
623 |
+
value: function setZoomData(initialScale, targetOffsetX, targetOffsetY) {
|
624 |
+
this.currentImage.dataset.scale = initialScale;
|
625 |
+
this.currentImage.dataset.translateX = targetOffsetX;
|
626 |
+
this.currentImage.dataset.translateY = targetOffsetY;
|
627 |
+
}
|
628 |
+
}, {
|
629 |
+
key: "hashchangeHandler",
|
630 |
+
value: function hashchangeHandler() {
|
631 |
+
if (this.isOpen && this.hash === this.initialLocationHash) {
|
632 |
+
this.hashReseted = true;
|
633 |
+
this.close();
|
634 |
+
}
|
635 |
+
}
|
636 |
+
}, {
|
637 |
+
key: "addEvents",
|
638 |
+
value: function addEvents() {
|
639 |
+
var _this6 = this;
|
640 |
+
|
641 |
+
// resize/responsive
|
642 |
+
this.addEventListener(window, 'resize.' + this.eventNamespace, function (event) {
|
643 |
+
//this.adjustImage.bind(this)
|
644 |
+
if (_this6.isOpen) {
|
645 |
+
_this6.adjustImage();
|
646 |
+
}
|
647 |
+
});
|
648 |
+
this.addEventListener(this.domNodes.closeButton, ['click.' + this.eventNamespace, 'touchstart.' + this.eventNamespace], this.close.bind(this));
|
649 |
+
|
650 |
+
if (this.options.history) {
|
651 |
+
setTimeout(function () {
|
652 |
+
_this6.addEventListener(window, 'hashchange.' + _this6.eventNamespace, function (event) {
|
653 |
+
if (_this6.isOpen) {
|
654 |
+
_this6.hashchangeHandler();
|
655 |
+
}
|
656 |
+
});
|
657 |
+
}, 40);
|
658 |
+
}
|
659 |
+
|
660 |
+
this.addEventListener(this.domNodes.navigation.getElementsByTagName('button'), 'click.' + this.eventNamespace, function (event) {
|
661 |
+
if (!event.currentTarget.tagName.match(/button/i)) {
|
662 |
+
return true;
|
663 |
+
}
|
664 |
+
|
665 |
+
event.preventDefault();
|
666 |
+
_this6.controlCoordinates.swipeDiff = 0;
|
667 |
+
|
668 |
+
_this6.loadImage(event.currentTarget.classList.contains('sl-next') ? 1 : -1);
|
669 |
+
});
|
670 |
+
this.addEventListener(this.domNodes.image, ['touchstart.' + this.eventNamespace, 'mousedown.' + this.eventNamespace], function (event) {
|
671 |
+
if (event.target.tagName === 'A' && event.type === 'touchstart') {
|
672 |
+
return true;
|
673 |
+
}
|
674 |
+
|
675 |
+
if (event.type === 'mousedown') {
|
676 |
+
_this6.controlCoordinates.initialPointerOffsetX = event.clientX;
|
677 |
+
_this6.controlCoordinates.initialPointerOffsetY = event.clientY;
|
678 |
+
_this6.controlCoordinates.containerHeight = _this6.getDimensions(_this6.domNodes.image).height;
|
679 |
+
_this6.controlCoordinates.containerWidth = _this6.getDimensions(_this6.domNodes.image).width;
|
680 |
+
_this6.controlCoordinates.imgHeight = _this6.getDimensions(_this6.currentImage).height;
|
681 |
+
_this6.controlCoordinates.imgWidth = _this6.getDimensions(_this6.currentImage).width;
|
682 |
+
_this6.controlCoordinates.containerOffsetX = _this6.domNodes.image.offsetLeft;
|
683 |
+
_this6.controlCoordinates.containerOffsetY = _this6.domNodes.image.offsetTop;
|
684 |
+
_this6.controlCoordinates.initialOffsetX = parseFloat(_this6.currentImage.dataset.translateX);
|
685 |
+
_this6.controlCoordinates.initialOffsetY = parseFloat(_this6.currentImage.dataset.translateY);
|
686 |
+
_this6.controlCoordinates.capture = true;
|
687 |
+
} else {
|
688 |
+
_this6.controlCoordinates.touchCount = event.touches.length;
|
689 |
+
_this6.controlCoordinates.initialPointerOffsetX = event.touches[0].clientX;
|
690 |
+
_this6.controlCoordinates.initialPointerOffsetY = event.touches[0].clientY;
|
691 |
+
_this6.controlCoordinates.containerHeight = _this6.getDimensions(_this6.domNodes.image).height;
|
692 |
+
_this6.controlCoordinates.containerWidth = _this6.getDimensions(_this6.domNodes.image).width;
|
693 |
+
_this6.controlCoordinates.imgHeight = _this6.getDimensions(_this6.currentImage).height;
|
694 |
+
_this6.controlCoordinates.imgWidth = _this6.getDimensions(_this6.currentImage).width;
|
695 |
+
_this6.controlCoordinates.containerOffsetX = _this6.domNodes.image.offsetLeft;
|
696 |
+
_this6.controlCoordinates.containerOffsetY = _this6.domNodes.image.offsetTop;
|
697 |
+
|
698 |
+
if (_this6.controlCoordinates.touchCount === 1)
|
699 |
+
/* Single touch */
|
700 |
+
{
|
701 |
+
if (!_this6.controlCoordinates.doubleTapped) {
|
702 |
+
_this6.controlCoordinates.doubleTapped = true;
|
703 |
+
setTimeout(function () {
|
704 |
+
_this6.controlCoordinates.doubleTapped = false;
|
705 |
+
}, 300);
|
706 |
+
} else {
|
707 |
+
_this6.currentImage.classList.add('sl-transition');
|
708 |
+
|
709 |
+
if (!_this6.controlCoordinates.zoomed) {
|
710 |
+
_this6.controlCoordinates.initialScale = _this6.options.doubleTapZoom;
|
711 |
+
|
712 |
+
_this6.setZoomData(_this6.controlCoordinates.initialScale, 0, 0);
|
713 |
+
|
714 |
+
_this6.zoomPanElement(0 + "px", 0 + "px", _this6.controlCoordinates.initialScale);
|
715 |
+
|
716 |
+
if (!_this6.domNodes.caption.style.opacity && _this6.domNodes.caption.style.display !== 'none') {
|
717 |
+
_this6.fadeOut(_this6.domNodes.caption, 200);
|
718 |
+
}
|
719 |
+
|
720 |
+
_this6.controlCoordinates.zoomed = true;
|
721 |
+
} else {
|
722 |
+
_this6.controlCoordinates.initialScale = 1;
|
723 |
+
|
724 |
+
_this6.setZoomData(_this6.controlCoordinates.initialScale, 0, 0);
|
725 |
+
|
726 |
+
_this6.zoomPanElement(0 + "px", 0 + "px", _this6.controlCoordinates.initialScale);
|
727 |
+
|
728 |
+
_this6.controlCoordinates.zoomed = false;
|
729 |
+
}
|
730 |
+
|
731 |
+
setTimeout(function () {
|
732 |
+
if (_this6.currentImage) {
|
733 |
+
_this6.currentImage.classList.remove('sl-transition');
|
734 |
+
}
|
735 |
+
}, 200);
|
736 |
+
return false;
|
737 |
+
}
|
738 |
+
|
739 |
+
_this6.controlCoordinates.initialOffsetX = parseFloat(_this6.currentImage.dataset.translateX);
|
740 |
+
_this6.controlCoordinates.initialOffsetY = parseFloat(_this6.currentImage.dataset.translateY);
|
741 |
+
} else if (_this6.controlCoordinates.touchCount === 2)
|
742 |
+
/* Pinch */
|
743 |
+
{
|
744 |
+
_this6.controlCoordinates.initialPointerOffsetX2 = event.touches[1].clientX;
|
745 |
+
_this6.controlCoordinates.initialPointerOffsetY2 = event.touches[1].clientY;
|
746 |
+
_this6.controlCoordinates.initialOffsetX = parseFloat(_this6.currentImage.dataset.translateX);
|
747 |
+
_this6.controlCoordinates.initialOffsetY = parseFloat(_this6.currentImage.dataset.translateY);
|
748 |
+
_this6.controlCoordinates.pinchOffsetX = (_this6.controlCoordinates.initialPointerOffsetX + _this6.controlCoordinates.initialPointerOffsetX2) / 2;
|
749 |
+
_this6.controlCoordinates.pinchOffsetY = (_this6.controlCoordinates.initialPointerOffsetY + _this6.controlCoordinates.initialPointerOffsetY2) / 2;
|
750 |
+
_this6.controlCoordinates.initialPinchDistance = Math.sqrt((_this6.controlCoordinates.initialPointerOffsetX - _this6.controlCoordinates.initialPointerOffsetX2) * (_this6.controlCoordinates.initialPointerOffsetX - _this6.controlCoordinates.initialPointerOffsetX2) + (_this6.controlCoordinates.initialPointerOffsetY - _this6.controlCoordinates.initialPointerOffsetY2) * (_this6.controlCoordinates.initialPointerOffsetY - _this6.controlCoordinates.initialPointerOffsetY2));
|
751 |
+
}
|
752 |
+
|
753 |
+
_this6.controlCoordinates.capture = true;
|
754 |
+
}
|
755 |
+
|
756 |
+
if (_this6.controlCoordinates.mousedown) return true;
|
757 |
+
|
758 |
+
if (_this6.transitionCapable) {
|
759 |
+
_this6.controlCoordinates.imageLeft = parseInt(_this6.domNodes.image.style.left, 10);
|
760 |
+
}
|
761 |
+
|
762 |
+
_this6.controlCoordinates.mousedown = true;
|
763 |
+
_this6.controlCoordinates.swipeDiff = 0;
|
764 |
+
_this6.controlCoordinates.swipeYDiff = 0;
|
765 |
+
_this6.controlCoordinates.swipeStart = event.pageX || event.touches[0].pageX;
|
766 |
+
_this6.controlCoordinates.swipeYStart = event.pageY || event.touches[0].pageY;
|
767 |
+
return false;
|
768 |
+
});
|
769 |
+
this.addEventListener(this.domNodes.image, ['touchmove.' + this.eventNamespace, 'mousemove.' + this.eventNamespace, 'MSPointerMove'], function (event) {
|
770 |
+
if (!_this6.controlCoordinates.mousedown) {
|
771 |
+
return true;
|
772 |
+
}
|
773 |
+
|
774 |
+
event.preventDefault();
|
775 |
+
|
776 |
+
if (event.type === 'touchmove') {
|
777 |
+
if (_this6.controlCoordinates.capture === false) {
|
778 |
+
return false;
|
779 |
+
}
|
780 |
+
|
781 |
+
_this6.controlCoordinates.pointerOffsetX = event.touches[0].clientX;
|
782 |
+
_this6.controlCoordinates.pointerOffsetY = event.touches[0].clientY;
|
783 |
+
_this6.controlCoordinates.touchCount = event.touches.length;
|
784 |
+
_this6.controlCoordinates.touchmoveCount++;
|
785 |
+
|
786 |
+
if (_this6.controlCoordinates.touchCount > 1)
|
787 |
+
/* Pinch */
|
788 |
+
{
|
789 |
+
_this6.controlCoordinates.pointerOffsetX2 = event.touches[1].clientX;
|
790 |
+
_this6.controlCoordinates.pointerOffsetY2 = event.touches[1].clientY;
|
791 |
+
_this6.controlCoordinates.targetPinchDistance = Math.sqrt((_this6.controlCoordinates.pointerOffsetX - _this6.controlCoordinates.pointerOffsetX2) * (_this6.controlCoordinates.pointerOffsetX - _this6.controlCoordinates.pointerOffsetX2) + (_this6.controlCoordinates.pointerOffsetY - _this6.controlCoordinates.pointerOffsetY2) * (_this6.controlCoordinates.pointerOffsetY - _this6.controlCoordinates.pointerOffsetY2));
|
792 |
+
|
793 |
+
if (_this6.controlCoordinates.initialPinchDistance === null) {
|
794 |
+
_this6.controlCoordinates.initialPinchDistance = _this6.controlCoordinates.targetPinchDistance;
|
795 |
+
}
|
796 |
+
|
797 |
+
if (Math.abs(_this6.controlCoordinates.initialPinchDistance - _this6.controlCoordinates.targetPinchDistance) >= 1) {
|
798 |
+
/* Initialize helpers */
|
799 |
+
_this6.controlCoordinates.targetScale = _this6.minMax(_this6.controlCoordinates.targetPinchDistance / _this6.controlCoordinates.initialPinchDistance * _this6.controlCoordinates.initialScale, 1, _this6.options.maxZoom);
|
800 |
+
_this6.controlCoordinates.limitOffsetX = (_this6.controlCoordinates.imgWidth * _this6.controlCoordinates.targetScale - _this6.controlCoordinates.containerWidth) / 2;
|
801 |
+
_this6.controlCoordinates.limitOffsetY = (_this6.controlCoordinates.imgHeight * _this6.controlCoordinates.targetScale - _this6.controlCoordinates.containerHeight) / 2;
|
802 |
+
_this6.controlCoordinates.scaleDifference = _this6.controlCoordinates.targetScale - _this6.controlCoordinates.initialScale;
|
803 |
+
_this6.controlCoordinates.targetOffsetX = _this6.controlCoordinates.imgWidth * _this6.controlCoordinates.targetScale <= _this6.controlCoordinates.containerWidth ? 0 : _this6.minMax(_this6.controlCoordinates.initialOffsetX - (_this6.controlCoordinates.pinchOffsetX - _this6.controlCoordinates.containerOffsetX - _this6.controlCoordinates.containerWidth / 2 - _this6.controlCoordinates.initialOffsetX) / (_this6.controlCoordinates.targetScale - _this6.controlCoordinates.scaleDifference) * _this6.controlCoordinates.scaleDifference, _this6.controlCoordinates.limitOffsetX * -1, _this6.controlCoordinates.limitOffsetX);
|
804 |
+
_this6.controlCoordinates.targetOffsetY = _this6.controlCoordinates.imgHeight * _this6.controlCoordinates.targetScale <= _this6.controlCoordinates.containerHeight ? 0 : _this6.minMax(_this6.controlCoordinates.initialOffsetY - (_this6.controlCoordinates.pinchOffsetY - _this6.controlCoordinates.containerOffsetY - _this6.controlCoordinates.containerHeight / 2 - _this6.controlCoordinates.initialOffsetY) / (_this6.controlCoordinates.targetScale - _this6.controlCoordinates.scaleDifference) * _this6.controlCoordinates.scaleDifference, _this6.controlCoordinates.limitOffsetY * -1, _this6.controlCoordinates.limitOffsetY);
|
805 |
+
|
806 |
+
_this6.zoomPanElement(_this6.controlCoordinates.targetOffsetX + "px", _this6.controlCoordinates.targetOffsetY + "px", _this6.controlCoordinates.targetScale);
|
807 |
+
|
808 |
+
if (_this6.controlCoordinates.targetScale > 1) {
|
809 |
+
_this6.controlCoordinates.zoomed = true;
|
810 |
+
|
811 |
+
if (!_this6.domNodes.caption.style.opacity && _this6.domNodes.caption.style.display !== 'none') {
|
812 |
+
_this6.fadeOut(_this6.domNodes.caption, 200);
|
813 |
+
}
|
814 |
+
}
|
815 |
+
|
816 |
+
_this6.controlCoordinates.initialPinchDistance = _this6.controlCoordinates.targetPinchDistance;
|
817 |
+
_this6.controlCoordinates.initialScale = _this6.controlCoordinates.targetScale;
|
818 |
+
_this6.controlCoordinates.initialOffsetX = _this6.controlCoordinates.targetOffsetX;
|
819 |
+
_this6.controlCoordinates.initialOffsetY = _this6.controlCoordinates.targetOffsetY;
|
820 |
+
}
|
821 |
+
} else {
|
822 |
+
_this6.controlCoordinates.targetScale = _this6.controlCoordinates.initialScale;
|
823 |
+
_this6.controlCoordinates.limitOffsetX = (_this6.controlCoordinates.imgWidth * _this6.controlCoordinates.targetScale - _this6.controlCoordinates.containerWidth) / 2;
|
824 |
+
_this6.controlCoordinates.limitOffsetY = (_this6.controlCoordinates.imgHeight * _this6.controlCoordinates.targetScale - _this6.controlCoordinates.containerHeight) / 2;
|
825 |
+
_this6.controlCoordinates.targetOffsetX = _this6.controlCoordinates.imgWidth * _this6.controlCoordinates.targetScale <= _this6.controlCoordinates.containerWidth ? 0 : _this6.minMax(_this6.controlCoordinates.pointerOffsetX - (_this6.controlCoordinates.initialPointerOffsetX - _this6.controlCoordinates.initialOffsetX), _this6.controlCoordinates.limitOffsetX * -1, _this6.controlCoordinates.limitOffsetX);
|
826 |
+
_this6.controlCoordinates.targetOffsetY = _this6.controlCoordinates.imgHeight * _this6.controlCoordinates.targetScale <= _this6.controlCoordinates.containerHeight ? 0 : _this6.minMax(_this6.controlCoordinates.pointerOffsetY - (_this6.controlCoordinates.initialPointerOffsetY - _this6.controlCoordinates.initialOffsetY), _this6.controlCoordinates.limitOffsetY * -1, _this6.controlCoordinates.limitOffsetY);
|
827 |
+
|
828 |
+
if (Math.abs(_this6.controlCoordinates.targetOffsetX) === Math.abs(_this6.controlCoordinates.limitOffsetX)) {
|
829 |
+
_this6.controlCoordinates.initialOffsetX = _this6.controlCoordinates.targetOffsetX;
|
830 |
+
_this6.controlCoordinates.initialPointerOffsetX = _this6.controlCoordinates.pointerOffsetX;
|
831 |
+
}
|
832 |
+
|
833 |
+
if (Math.abs(_this6.controlCoordinates.targetOffsetY) === Math.abs(_this6.controlCoordinates.limitOffsetY)) {
|
834 |
+
_this6.controlCoordinates.initialOffsetY = _this6.controlCoordinates.targetOffsetY;
|
835 |
+
_this6.controlCoordinates.initialPointerOffsetY = _this6.controlCoordinates.pointerOffsetY;
|
836 |
+
}
|
837 |
+
|
838 |
+
_this6.setZoomData(_this6.controlCoordinates.initialScale, _this6.controlCoordinates.targetOffsetX, _this6.controlCoordinates.targetOffsetY);
|
839 |
+
|
840 |
+
_this6.zoomPanElement(_this6.controlCoordinates.targetOffsetX + "px", _this6.controlCoordinates.targetOffsetY + "px", _this6.controlCoordinates.targetScale);
|
841 |
+
}
|
842 |
+
}
|
843 |
+
/* Mouse Move implementation */
|
844 |
+
|
845 |
+
|
846 |
+
if (event.type === 'mousemove' && _this6.controlCoordinates.mousedown) {
|
847 |
+
if (event.type == 'touchmove') return true;
|
848 |
+
if (_this6.controlCoordinates.capture === false) return false;
|
849 |
+
_this6.controlCoordinates.pointerOffsetX = event.clientX;
|
850 |
+
_this6.controlCoordinates.pointerOffsetY = event.clientY;
|
851 |
+
_this6.controlCoordinates.targetScale = _this6.controlCoordinates.initialScale;
|
852 |
+
_this6.controlCoordinates.limitOffsetX = (_this6.controlCoordinates.imgWidth * _this6.controlCoordinates.targetScale - _this6.controlCoordinates.containerWidth) / 2;
|
853 |
+
_this6.controlCoordinates.limitOffsetY = (_this6.controlCoordinates.imgHeight * _this6.controlCoordinates.targetScale - _this6.controlCoordinates.containerHeight) / 2;
|
854 |
+
_this6.controlCoordinates.targetOffsetX = _this6.controlCoordinates.imgWidth * _this6.controlCoordinates.targetScale <= _this6.controlCoordinates.containerWidth ? 0 : _this6.minMax(_this6.controlCoordinates.pointerOffsetX - (_this6.controlCoordinates.initialPointerOffsetX - _this6.controlCoordinates.initialOffsetX), _this6.controlCoordinates.limitOffsetX * -1, _this6.controlCoordinates.limitOffsetX);
|
855 |
+
_this6.controlCoordinates.targetOffsetY = _this6.controlCoordinates.imgHeight * _this6.controlCoordinates.targetScale <= _this6.controlCoordinates.containerHeight ? 0 : _this6.minMax(_this6.controlCoordinates.pointerOffsetY - (_this6.controlCoordinates.initialPointerOffsetY - _this6.controlCoordinates.initialOffsetY), _this6.controlCoordinates.limitOffsetY * -1, _this6.controlCoordinates.limitOffsetY);
|
856 |
+
|
857 |
+
if (Math.abs(_this6.controlCoordinates.targetOffsetX) === Math.abs(_this6.controlCoordinates.limitOffsetX)) {
|
858 |
+
_this6.controlCoordinates.initialOffsetX = _this6.controlCoordinates.targetOffsetX;
|
859 |
+
_this6.controlCoordinates.initialPointerOffsetX = _this6.controlCoordinates.pointerOffsetX;
|
860 |
+
}
|
861 |
+
|
862 |
+
if (Math.abs(_this6.controlCoordinates.targetOffsetY) === Math.abs(_this6.controlCoordinates.limitOffsetY)) {
|
863 |
+
_this6.controlCoordinates.initialOffsetY = _this6.controlCoordinates.targetOffsetY;
|
864 |
+
_this6.controlCoordinates.initialPointerOffsetY = _this6.controlCoordinates.pointerOffsetY;
|
865 |
+
}
|
866 |
+
|
867 |
+
_this6.setZoomData(_this6.controlCoordinates.initialScale, _this6.controlCoordinates.targetOffsetX, _this6.controlCoordinates.targetOffsetY);
|
868 |
+
|
869 |
+
_this6.zoomPanElement(_this6.controlCoordinates.targetOffsetX + "px", _this6.controlCoordinates.targetOffsetY + "px", _this6.controlCoordinates.targetScale);
|
870 |
+
}
|
871 |
+
|
872 |
+
if (!_this6.controlCoordinates.zoomed) {
|
873 |
+
_this6.controlCoordinates.swipeEnd = event.pageX || event.touches[0].pageX;
|
874 |
+
_this6.controlCoordinates.swipeYEnd = event.pageY || event.touches[0].pageY;
|
875 |
+
_this6.controlCoordinates.swipeDiff = _this6.controlCoordinates.swipeStart - _this6.controlCoordinates.swipeEnd;
|
876 |
+
_this6.controlCoordinates.swipeYDiff = _this6.controlCoordinates.swipeYStart - _this6.controlCoordinates.swipeYEnd;
|
877 |
+
|
878 |
+
if (_this6.options.animationSlide) {
|
879 |
+
_this6.slide(0, -_this6.controlCoordinates.swipeDiff + 'px');
|
880 |
+
}
|
881 |
+
}
|
882 |
+
});
|
883 |
+
this.addEventListener(this.domNodes.image, ['touchend.' + this.eventNamespace, 'mouseup.' + this.eventNamespace, 'touchcancel.' + this.eventNamespace, 'mouseleave.' + this.eventNamespace, 'pointerup', 'pointercancel', 'MSPointerUp', 'MSPointerCancel'], function (event) {
|
884 |
+
if (_this6.isTouchDevice && event.type === 'touchend') {
|
885 |
+
_this6.controlCoordinates.touchCount = event.touches.length;
|
886 |
+
|
887 |
+
if (_this6.controlCoordinates.touchCount === 0)
|
888 |
+
/* No touch */
|
889 |
+
{
|
890 |
+
/* Set attributes */
|
891 |
+
_this6.setZoomData(_this6.controlCoordinates.initialScale, _this6.controlCoordinates.targetOffsetX, _this6.controlCoordinates.targetOffsetY);
|
892 |
+
|
893 |
+
if (_this6.controlCoordinates.initialScale === 1) {
|
894 |
+
_this6.controlCoordinates.zoomed = false;
|
895 |
+
|
896 |
+
if (_this6.domNodes.caption.style.display === 'none') {
|
897 |
+
_this6.fadeIn(_this6.domNodes.caption, 200);
|
898 |
+
}
|
899 |
+
}
|
900 |
+
|
901 |
+
_this6.controlCoordinates.initialPinchDistance = null;
|
902 |
+
_this6.controlCoordinates.capture = false;
|
903 |
+
} else if (_this6.controlCoordinates.touchCount === 1)
|
904 |
+
/* Single touch */
|
905 |
+
{
|
906 |
+
_this6.controlCoordinates.initialPointerOffsetX = event.touches[0].clientX;
|
907 |
+
_this6.controlCoordinates.initialPointerOffsetY = event.touches[0].clientY;
|
908 |
+
} else if (_this6.controlCoordinates.touchCount > 1)
|
909 |
+
/* Pinch */
|
910 |
+
{
|
911 |
+
_this6.controlCoordinates.initialPinchDistance = null;
|
912 |
+
}
|
913 |
+
}
|
914 |
+
|
915 |
+
if (_this6.controlCoordinates.mousedown) {
|
916 |
+
_this6.controlCoordinates.mousedown = false;
|
917 |
+
var possibleDir = true;
|
918 |
+
|
919 |
+
if (!_this6.options.loop) {
|
920 |
+
if (_this6.currentImageIndex === 0 && _this6.controlCoordinates.swipeDiff < 0) {
|
921 |
+
possibleDir = false;
|
922 |
+
}
|
923 |
+
|
924 |
+
if (_this6.currentImageIndex >= _this6.relatedElements.length - 1 && _this6.controlCoordinates.swipeDiff > 0) {
|
925 |
+
possibleDir = false;
|
926 |
+
}
|
927 |
+
}
|
928 |
+
|
929 |
+
if (Math.abs(_this6.controlCoordinates.swipeDiff) > _this6.options.swipeTolerance && possibleDir) {
|
930 |
+
_this6.loadImage(_this6.controlCoordinates.swipeDiff > 0 ? 1 : -1);
|
931 |
+
} else if (_this6.options.animationSlide) {
|
932 |
+
_this6.slide(_this6.options.animationSpeed / 1000, 0 + 'px');
|
933 |
+
}
|
934 |
+
|
935 |
+
if (_this6.options.swipeClose && Math.abs(_this6.controlCoordinates.swipeYDiff) > 50 && Math.abs(_this6.controlCoordinates.swipeDiff) < _this6.options.swipeTolerance) {
|
936 |
+
_this6.close();
|
937 |
+
}
|
938 |
+
}
|
939 |
+
});
|
940 |
+
this.addEventListener(this.domNodes.image, ['dblclick'], function (event) {
|
941 |
+
if (_this6.isTouchDevice) return;
|
942 |
+
_this6.controlCoordinates.initialPointerOffsetX = event.clientX;
|
943 |
+
_this6.controlCoordinates.initialPointerOffsetY = event.clientY;
|
944 |
+
_this6.controlCoordinates.containerHeight = _this6.getDimensions(_this6.domNodes.image).height;
|
945 |
+
_this6.controlCoordinates.containerWidth = _this6.getDimensions(_this6.domNodes.image).width;
|
946 |
+
_this6.controlCoordinates.imgHeight = _this6.getDimensions(_this6.currentImage).height;
|
947 |
+
_this6.controlCoordinates.imgWidth = _this6.getDimensions(_this6.currentImage).width;
|
948 |
+
_this6.controlCoordinates.containerOffsetX = _this6.domNodes.image.offsetLeft;
|
949 |
+
_this6.controlCoordinates.containerOffsetY = _this6.domNodes.image.offsetTop;
|
950 |
+
|
951 |
+
_this6.currentImage.classList.add('sl-transition');
|
952 |
+
|
953 |
+
if (!_this6.controlCoordinates.zoomed) {
|
954 |
+
_this6.controlCoordinates.initialScale = _this6.options.doubleTapZoom;
|
955 |
+
|
956 |
+
_this6.setZoomData(_this6.controlCoordinates.initialScale, 0, 0);
|
957 |
+
|
958 |
+
_this6.zoomPanElement(0 + "px", 0 + "px", _this6.controlCoordinates.initialScale);
|
959 |
+
|
960 |
+
if (!_this6.domNodes.caption.style.opacity && _this6.domNodes.caption.style.display !== 'none') {
|
961 |
+
_this6.fadeOut(_this6.domNodes.caption, 200);
|
962 |
+
}
|
963 |
+
|
964 |
+
_this6.controlCoordinates.zoomed = true;
|
965 |
+
} else {
|
966 |
+
_this6.controlCoordinates.initialScale = 1;
|
967 |
+
|
968 |
+
_this6.setZoomData(_this6.controlCoordinates.initialScale, 0, 0);
|
969 |
+
|
970 |
+
_this6.zoomPanElement(0 + "px", 0 + "px", _this6.controlCoordinates.initialScale);
|
971 |
+
|
972 |
+
_this6.controlCoordinates.zoomed = false;
|
973 |
+
|
974 |
+
if (_this6.domNodes.caption.style.display === 'none') {
|
975 |
+
_this6.fadeIn(_this6.domNodes.caption, 200);
|
976 |
+
}
|
977 |
+
}
|
978 |
+
|
979 |
+
setTimeout(function () {
|
980 |
+
if (_this6.currentImage) {
|
981 |
+
_this6.currentImage.classList.remove('sl-transition');
|
982 |
+
}
|
983 |
+
}, 200);
|
984 |
+
_this6.controlCoordinates.capture = true;
|
985 |
+
return false;
|
986 |
+
});
|
987 |
+
}
|
988 |
+
}, {
|
989 |
+
key: "getDimensions",
|
990 |
+
value: function getDimensions(element) {
|
991 |
+
var styles = window.getComputedStyle(element),
|
992 |
+
height = element.offsetHeight,
|
993 |
+
width = element.offsetWidth,
|
994 |
+
borderTopWidth = parseFloat(styles.borderTopWidth),
|
995 |
+
borderBottomWidth = parseFloat(styles.borderBottomWidth),
|
996 |
+
paddingTop = parseFloat(styles.paddingTop),
|
997 |
+
paddingBottom = parseFloat(styles.paddingBottom),
|
998 |
+
borderLeftWidth = parseFloat(styles.borderLeftWidth),
|
999 |
+
borderRightWidth = parseFloat(styles.borderRightWidth),
|
1000 |
+
paddingLeft = parseFloat(styles.paddingLeft),
|
1001 |
+
paddingRight = parseFloat(styles.paddingRight);
|
1002 |
+
return {
|
1003 |
+
height: height - borderBottomWidth - borderTopWidth - paddingTop - paddingBottom,
|
1004 |
+
width: width - borderLeftWidth - borderRightWidth - paddingLeft - paddingRight
|
1005 |
+
};
|
1006 |
+
}
|
1007 |
+
}, {
|
1008 |
+
key: "updateHash",
|
1009 |
+
value: function updateHash() {
|
1010 |
+
var newHash = 'pid=' + (this.currentImageIndex + 1),
|
1011 |
+
newURL = window.location.href.split('#')[0] + '#' + newHash;
|
1012 |
+
this.hashReseted = false;
|
1013 |
+
|
1014 |
+
if (this.pushStateSupport) {
|
1015 |
+
window.history[this.historyHasChanges ? 'replaceState' : 'pushState']('', document.title, newURL);
|
1016 |
+
} else {
|
1017 |
+
// what is the browser target of this?
|
1018 |
+
if (this.historyHasChanges) {
|
1019 |
+
window.location.replace(newURL);
|
1020 |
+
} else {
|
1021 |
+
window.location.hash = newHash;
|
1022 |
+
}
|
1023 |
+
}
|
1024 |
+
|
1025 |
+
if (!this.historyHasChanges) {
|
1026 |
+
this.urlChangedOnce = true;
|
1027 |
+
}
|
1028 |
+
|
1029 |
+
this.historyHasChanges = true;
|
1030 |
+
}
|
1031 |
+
}, {
|
1032 |
+
key: "resetHash",
|
1033 |
+
value: function resetHash() {
|
1034 |
+
this.hashReseted = true;
|
1035 |
+
|
1036 |
+
if (this.urlChangedOnce) {
|
1037 |
+
history.back();
|
1038 |
+
} else {
|
1039 |
+
if (this.pushStateSupport) {
|
1040 |
+
history.pushState('', document.title, window.location.pathname + window.location.search);
|
1041 |
+
} else {
|
1042 |
+
window.location.hash = '';
|
1043 |
+
}
|
1044 |
+
} //
|
1045 |
+
//in case an history operation is still pending
|
1046 |
+
|
1047 |
+
|
1048 |
+
clearTimeout(this.historyUpdateTimeout);
|
1049 |
+
}
|
1050 |
+
}, {
|
1051 |
+
key: "updateURL",
|
1052 |
+
value: function updateURL() {
|
1053 |
+
clearTimeout(this.historyUpdateTimeout);
|
1054 |
+
|
1055 |
+
if (!this.historyHasChanges) {
|
1056 |
+
this.updateHash(); // first time
|
1057 |
+
} else {
|
1058 |
+
this.historyUpdateTimeout = setTimeout(this.updateHash.bind(this), 800);
|
1059 |
+
}
|
1060 |
+
}
|
1061 |
+
}, {
|
1062 |
+
key: "setCaption",
|
1063 |
+
value: function setCaption(captionText, imageWidth) {
|
1064 |
+
var _this7 = this;
|
1065 |
+
|
1066 |
+
if (this.options.captions && captionText && captionText !== '' && typeof captionText !== "undefined") {
|
1067 |
+
this.hide(this.domNodes.caption);
|
1068 |
+
this.domNodes.caption.style.width = imageWidth + 'px';
|
1069 |
+
this.domNodes.caption.innerHTML = captionText;
|
1070 |
+
this.domNodes.image.appendChild(this.domNodes.caption);
|
1071 |
+
setTimeout(function () {
|
1072 |
+
_this7.fadeIn(_this7.domNodes.caption, 300);
|
1073 |
+
}, this.options.captionDelay);
|
1074 |
+
}
|
1075 |
+
}
|
1076 |
+
}, {
|
1077 |
+
key: "slide",
|
1078 |
+
value: function slide(speed, pos) {
|
1079 |
+
if (!this.transitionCapable) {
|
1080 |
+
return this.domNodes.image.style.left = pos;
|
1081 |
+
}
|
1082 |
+
|
1083 |
+
this.domNodes.image.style[this.transitionPrefix + 'transform'] = 'translateX(' + pos + ')';
|
1084 |
+
this.domNodes.image.style[this.transitionPrefix + 'transition'] = this.transitionPrefix + 'transform ' + speed + 's linear';
|
1085 |
+
}
|
1086 |
+
}, {
|
1087 |
+
key: "getRelated",
|
1088 |
+
value: function getRelated(rel) {
|
1089 |
+
var elems;
|
1090 |
+
|
1091 |
+
if (rel && rel !== false && rel !== 'nofollow') {
|
1092 |
+
elems = Array.from(this.elements).filter(function (element) {
|
1093 |
+
return element.getAttribute('rel') === rel;
|
1094 |
+
});
|
1095 |
+
} else {
|
1096 |
+
elems = this.elements;
|
1097 |
+
}
|
1098 |
+
|
1099 |
+
return elems;
|
1100 |
+
}
|
1101 |
+
}, {
|
1102 |
+
key: "openImage",
|
1103 |
+
value: function openImage(element) {
|
1104 |
+
var _this8 = this;
|
1105 |
+
|
1106 |
+
element.dispatchEvent(new Event('show.' + this.eventNamespace));
|
1107 |
+
|
1108 |
+
if (this.options.disableScroll) {
|
1109 |
+
this.globalScrollbarWidth = this.toggleScrollbar('hide');
|
1110 |
+
}
|
1111 |
+
|
1112 |
+
if (this.options.htmlClass && this.options.htmlClass !== '') {
|
1113 |
+
document.querySelector('html').classList.add(this.options.htmlClass);
|
1114 |
+
}
|
1115 |
+
|
1116 |
+
document.body.appendChild(this.domNodes.wrapper);
|
1117 |
+
this.domNodes.wrapper.appendChild(this.domNodes.image);
|
1118 |
+
|
1119 |
+
if (this.options.overlay) {
|
1120 |
+
document.body.appendChild(this.domNodes.overlay);
|
1121 |
+
}
|
1122 |
+
|
1123 |
+
this.relatedElements = this.getRelated(element.rel);
|
1124 |
+
|
1125 |
+
if (this.options.showCounter) {
|
1126 |
+
if (this.relatedElements.length == 1 && this.domNodes.wrapper.contains(this.domNodes.counter)) {
|
1127 |
+
this.domNodes.wrapper.removeChild(this.domNodes.counter);
|
1128 |
+
} else if (this.relatedElements.length > 1 && !this.domNodes.wrapper.contains(this.domNodes.counter)) {
|
1129 |
+
this.domNodes.wrapper.appendChild(this.domNodes.counter);
|
1130 |
+
}
|
1131 |
+
}
|
1132 |
+
|
1133 |
+
this.isAnimating = true;
|
1134 |
+
this.currentImageIndex = this.relatedElements.indexOf(element);
|
1135 |
+
var targetURL = element.getAttribute(this.options.sourceAttr);
|
1136 |
+
this.currentImage = document.createElement('img');
|
1137 |
+
this.currentImage.style.display = 'none';
|
1138 |
+
this.currentImage.setAttribute('src', targetURL);
|
1139 |
+
this.currentImage.dataset.scale = 1;
|
1140 |
+
this.currentImage.dataset.translateX = 0;
|
1141 |
+
this.currentImage.dataset.translateY = 0;
|
1142 |
+
|
1143 |
+
if (this.loadedImages.indexOf(targetURL) === -1) {
|
1144 |
+
this.loadedImages.push(targetURL);
|
1145 |
+
}
|
1146 |
+
|
1147 |
+
this.domNodes.image.innerHTML = '';
|
1148 |
+
this.domNodes.image.setAttribute('style', '');
|
1149 |
+
this.domNodes.image.appendChild(this.currentImage);
|
1150 |
+
this.fadeIn(this.domNodes.overlay, 300);
|
1151 |
+
this.fadeIn([this.domNodes.counter, this.domNodes.navigation, this.domNodes.closeButton], 300);
|
1152 |
+
this.show(this.domNodes.spinner);
|
1153 |
+
this.domNodes.counter.querySelector('.sl-current').innerHTML = this.currentImageIndex + 1;
|
1154 |
+
this.domNodes.counter.querySelector('.sl-total').innerHTML = this.relatedElements.length;
|
1155 |
+
this.adjustImage();
|
1156 |
+
|
1157 |
+
if (this.options.preloading) {
|
1158 |
+
this.preload();
|
1159 |
+
}
|
1160 |
+
|
1161 |
+
setTimeout(function () {
|
1162 |
+
element.dispatchEvent(new Event('shown.' + _this8.eventNamespace));
|
1163 |
+
}, this.options.animationSpeed);
|
1164 |
+
} // utility
|
1165 |
+
|
1166 |
+
}, {
|
1167 |
+
key: "addEventListener",
|
1168 |
+
value: function addEventListener(elements, events, callback, opts) {
|
1169 |
+
elements = this.wrap(elements);
|
1170 |
+
events = this.wrap(events);
|
1171 |
+
|
1172 |
+
var _iterator = _createForOfIteratorHelper(elements),
|
1173 |
+
_step;
|
1174 |
+
|
1175 |
+
try {
|
1176 |
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
1177 |
+
var element = _step.value;
|
1178 |
+
|
1179 |
+
if (!element.namespaces) {
|
1180 |
+
element.namespaces = {};
|
1181 |
+
} // save the namespaces addEventListener the DOM element itself
|
1182 |
+
|
1183 |
+
|
1184 |
+
var _iterator2 = _createForOfIteratorHelper(events),
|
1185 |
+
_step2;
|
1186 |
+
|
1187 |
+
try {
|
1188 |
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
1189 |
+
var event = _step2.value;
|
1190 |
+
var options = opts || false;
|
1191 |
+
element.namespaces[event] = callback;
|
1192 |
+
element.addEventListener(event.split('.')[0], callback, options);
|
1193 |
+
}
|
1194 |
+
} catch (err) {
|
1195 |
+
_iterator2.e(err);
|
1196 |
+
} finally {
|
1197 |
+
_iterator2.f();
|
1198 |
+
}
|
1199 |
+
}
|
1200 |
+
} catch (err) {
|
1201 |
+
_iterator.e(err);
|
1202 |
+
} finally {
|
1203 |
+
_iterator.f();
|
1204 |
+
}
|
1205 |
+
}
|
1206 |
+
}, {
|
1207 |
+
key: "removeEventListener",
|
1208 |
+
value: function removeEventListener(elements, events) {
|
1209 |
+
elements = this.wrap(elements);
|
1210 |
+
events = this.wrap(events);
|
1211 |
+
|
1212 |
+
var _iterator3 = _createForOfIteratorHelper(elements),
|
1213 |
+
_step3;
|
1214 |
+
|
1215 |
+
try {
|
1216 |
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
1217 |
+
var element = _step3.value;
|
1218 |
+
|
1219 |
+
var _iterator4 = _createForOfIteratorHelper(events),
|
1220 |
+
_step4;
|
1221 |
+
|
1222 |
+
try {
|
1223 |
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
1224 |
+
var event = _step4.value;
|
1225 |
+
element.removeEventListener(event.split('.')[0], element.namespaces[event]);
|
1226 |
+
delete element.namespaces[event];
|
1227 |
+
}
|
1228 |
+
} catch (err) {
|
1229 |
+
_iterator4.e(err);
|
1230 |
+
} finally {
|
1231 |
+
_iterator4.f();
|
1232 |
+
}
|
1233 |
+
}
|
1234 |
+
} catch (err) {
|
1235 |
+
_iterator3.e(err);
|
1236 |
+
} finally {
|
1237 |
+
_iterator3.f();
|
1238 |
+
}
|
1239 |
+
}
|
1240 |
+
}, {
|
1241 |
+
key: "fadeOut",
|
1242 |
+
value: function fadeOut(elements, duration, callback) {
|
1243 |
+
var _this9 = this;
|
1244 |
+
|
1245 |
+
elements = this.wrap(elements);
|
1246 |
+
|
1247 |
+
var _iterator5 = _createForOfIteratorHelper(elements),
|
1248 |
+
_step5;
|
1249 |
+
|
1250 |
+
try {
|
1251 |
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
1252 |
+
var element = _step5.value;
|
1253 |
+
element.style.opacity = 1;
|
1254 |
+
}
|
1255 |
+
} catch (err) {
|
1256 |
+
_iterator5.e(err);
|
1257 |
+
} finally {
|
1258 |
+
_iterator5.f();
|
1259 |
+
}
|
1260 |
+
|
1261 |
+
var step = 16.66666 / (duration || 300),
|
1262 |
+
fade = function fade() {
|
1263 |
+
var currentOpacity = parseFloat(elements[0].style.opacity);
|
1264 |
+
|
1265 |
+
if ((currentOpacity -= step) < 0) {
|
1266 |
+
var _iterator6 = _createForOfIteratorHelper(elements),
|
1267 |
+
_step6;
|
1268 |
+
|
1269 |
+
try {
|
1270 |
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
1271 |
+
var element = _step6.value;
|
1272 |
+
element.style.display = "none";
|
1273 |
+
element.style.opacity = '';
|
1274 |
+
}
|
1275 |
+
} catch (err) {
|
1276 |
+
_iterator6.e(err);
|
1277 |
+
} finally {
|
1278 |
+
_iterator6.f();
|
1279 |
+
}
|
1280 |
+
|
1281 |
+
callback && callback.call(_this9, elements);
|
1282 |
+
} else {
|
1283 |
+
var _iterator7 = _createForOfIteratorHelper(elements),
|
1284 |
+
_step7;
|
1285 |
+
|
1286 |
+
try {
|
1287 |
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
1288 |
+
var _element = _step7.value;
|
1289 |
+
_element.style.opacity = currentOpacity;
|
1290 |
+
}
|
1291 |
+
} catch (err) {
|
1292 |
+
_iterator7.e(err);
|
1293 |
+
} finally {
|
1294 |
+
_iterator7.f();
|
1295 |
+
}
|
1296 |
+
|
1297 |
+
requestAnimationFrame(fade);
|
1298 |
+
}
|
1299 |
+
};
|
1300 |
+
|
1301 |
+
fade();
|
1302 |
+
}
|
1303 |
+
}, {
|
1304 |
+
key: "fadeIn",
|
1305 |
+
value: function fadeIn(elements, duration, callback, display) {
|
1306 |
+
var _this10 = this;
|
1307 |
+
|
1308 |
+
elements = this.wrap(elements);
|
1309 |
+
|
1310 |
+
var _iterator8 = _createForOfIteratorHelper(elements),
|
1311 |
+
_step8;
|
1312 |
+
|
1313 |
+
try {
|
1314 |
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
1315 |
+
var element = _step8.value;
|
1316 |
+
element.style.opacity = 0;
|
1317 |
+
element.style.display = display || "block";
|
1318 |
+
}
|
1319 |
+
} catch (err) {
|
1320 |
+
_iterator8.e(err);
|
1321 |
+
} finally {
|
1322 |
+
_iterator8.f();
|
1323 |
+
}
|
1324 |
+
|
1325 |
+
var opacityTarget = parseFloat(elements[0].dataset.opacityTarget || 1),
|
1326 |
+
step = 16.66666 * opacityTarget / (duration || 300),
|
1327 |
+
fade = function fade() {
|
1328 |
+
var currentOpacity = parseFloat(elements[0].style.opacity);
|
1329 |
+
|
1330 |
+
if (!((currentOpacity += step) > opacityTarget)) {
|
1331 |
+
var _iterator9 = _createForOfIteratorHelper(elements),
|
1332 |
+
_step9;
|
1333 |
+
|
1334 |
+
try {
|
1335 |
+
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
1336 |
+
var element = _step9.value;
|
1337 |
+
element.style.opacity = currentOpacity;
|
1338 |
+
}
|
1339 |
+
} catch (err) {
|
1340 |
+
_iterator9.e(err);
|
1341 |
+
} finally {
|
1342 |
+
_iterator9.f();
|
1343 |
+
}
|
1344 |
+
|
1345 |
+
requestAnimationFrame(fade);
|
1346 |
+
} else {
|
1347 |
+
var _iterator10 = _createForOfIteratorHelper(elements),
|
1348 |
+
_step10;
|
1349 |
+
|
1350 |
+
try {
|
1351 |
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
1352 |
+
var _element2 = _step10.value;
|
1353 |
+
_element2.style.opacity = '';
|
1354 |
+
}
|
1355 |
+
} catch (err) {
|
1356 |
+
_iterator10.e(err);
|
1357 |
+
} finally {
|
1358 |
+
_iterator10.f();
|
1359 |
+
}
|
1360 |
+
|
1361 |
+
callback && callback.call(_this10, elements);
|
1362 |
+
}
|
1363 |
+
};
|
1364 |
+
|
1365 |
+
fade();
|
1366 |
+
}
|
1367 |
+
}, {
|
1368 |
+
key: "hide",
|
1369 |
+
value: function hide(elements) {
|
1370 |
+
elements = this.wrap(elements);
|
1371 |
+
|
1372 |
+
var _iterator11 = _createForOfIteratorHelper(elements),
|
1373 |
+
_step11;
|
1374 |
+
|
1375 |
+
try {
|
1376 |
+
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
1377 |
+
var element = _step11.value;
|
1378 |
+
element.dataset.initialDisplay = element.style.display;
|
1379 |
+
element.style.display = 'none';
|
1380 |
+
}
|
1381 |
+
} catch (err) {
|
1382 |
+
_iterator11.e(err);
|
1383 |
+
} finally {
|
1384 |
+
_iterator11.f();
|
1385 |
+
}
|
1386 |
+
}
|
1387 |
+
}, {
|
1388 |
+
key: "show",
|
1389 |
+
value: function show(elements, display) {
|
1390 |
+
elements = this.wrap(elements);
|
1391 |
+
|
1392 |
+
var _iterator12 = _createForOfIteratorHelper(elements),
|
1393 |
+
_step12;
|
1394 |
+
|
1395 |
+
try {
|
1396 |
+
for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
|
1397 |
+
var element = _step12.value;
|
1398 |
+
element.style.display = element.dataset.initialDisplay || display || 'block';
|
1399 |
+
}
|
1400 |
+
} catch (err) {
|
1401 |
+
_iterator12.e(err);
|
1402 |
+
} finally {
|
1403 |
+
_iterator12.f();
|
1404 |
+
}
|
1405 |
+
}
|
1406 |
+
}, {
|
1407 |
+
key: "wrap",
|
1408 |
+
value: function wrap(input) {
|
1409 |
+
return typeof input[Symbol.iterator] === 'function' && typeof input !== 'string' ? input : [input];
|
1410 |
+
}
|
1411 |
+
}, {
|
1412 |
+
key: "on",
|
1413 |
+
value: function on(events, callback) {
|
1414 |
+
events = this.wrap(events);
|
1415 |
+
|
1416 |
+
var _iterator13 = _createForOfIteratorHelper(this.elements),
|
1417 |
+
_step13;
|
1418 |
+
|
1419 |
+
try {
|
1420 |
+
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
|
1421 |
+
var element = _step13.value;
|
1422 |
+
|
1423 |
+
if (!element.fullyNamespacedEvents) {
|
1424 |
+
element.fullyNamespacedEvents = {};
|
1425 |
+
}
|
1426 |
+
|
1427 |
+
var _iterator14 = _createForOfIteratorHelper(events),
|
1428 |
+
_step14;
|
1429 |
+
|
1430 |
+
try {
|
1431 |
+
for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
|
1432 |
+
var event = _step14.value;
|
1433 |
+
element.fullyNamespacedEvents[event] = callback;
|
1434 |
+
element.addEventListener(event, callback);
|
1435 |
+
}
|
1436 |
+
} catch (err) {
|
1437 |
+
_iterator14.e(err);
|
1438 |
+
} finally {
|
1439 |
+
_iterator14.f();
|
1440 |
+
}
|
1441 |
+
}
|
1442 |
+
} catch (err) {
|
1443 |
+
_iterator13.e(err);
|
1444 |
+
} finally {
|
1445 |
+
_iterator13.f();
|
1446 |
+
}
|
1447 |
+
|
1448 |
+
return this;
|
1449 |
+
}
|
1450 |
+
}, {
|
1451 |
+
key: "off",
|
1452 |
+
value: function off(events) {
|
1453 |
+
events = this.wrap(events);
|
1454 |
+
|
1455 |
+
var _iterator15 = _createForOfIteratorHelper(this.elements),
|
1456 |
+
_step15;
|
1457 |
+
|
1458 |
+
try {
|
1459 |
+
for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
|
1460 |
+
var element = _step15.value;
|
1461 |
+
|
1462 |
+
var _iterator16 = _createForOfIteratorHelper(events),
|
1463 |
+
_step16;
|
1464 |
+
|
1465 |
+
try {
|
1466 |
+
for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
|
1467 |
+
var event = _step16.value;
|
1468 |
+
|
1469 |
+
if (typeof element.fullyNamespacedEvents !== 'undefined' && event in element.fullyNamespacedEvents) {
|
1470 |
+
element.removeEventListener(event, element.fullyNamespacedEvents[event]);
|
1471 |
+
}
|
1472 |
+
}
|
1473 |
+
} catch (err) {
|
1474 |
+
_iterator16.e(err);
|
1475 |
+
} finally {
|
1476 |
+
_iterator16.f();
|
1477 |
+
}
|
1478 |
+
}
|
1479 |
+
} catch (err) {
|
1480 |
+
_iterator15.e(err);
|
1481 |
+
} finally {
|
1482 |
+
_iterator15.f();
|
1483 |
+
}
|
1484 |
+
|
1485 |
+
return this;
|
1486 |
+
} // api
|
1487 |
+
|
1488 |
+
}, {
|
1489 |
+
key: "open",
|
1490 |
+
value: function open(elem) {
|
1491 |
+
elem = elem || this.elements[0];
|
1492 |
+
|
1493 |
+
if (typeof jQuery !== "undefined" && elem instanceof jQuery) {
|
1494 |
+
elem = elem.get(0);
|
1495 |
+
}
|
1496 |
+
|
1497 |
+
this.initialImageIndex = this.elements.indexOf(elem);
|
1498 |
+
|
1499 |
+
if (this.initialImageIndex > -1) {
|
1500 |
+
this.openImage(elem);
|
1501 |
+
}
|
1502 |
+
}
|
1503 |
+
}, {
|
1504 |
+
key: "next",
|
1505 |
+
value: function next() {
|
1506 |
+
this.loadImage(1);
|
1507 |
+
}
|
1508 |
+
}, {
|
1509 |
+
key: "prev",
|
1510 |
+
value: function prev() {
|
1511 |
+
this.loadImage(-1);
|
1512 |
+
} //close is exposed anyways..
|
1513 |
+
|
1514 |
+
}, {
|
1515 |
+
key: "destroy",
|
1516 |
+
value: function destroy() {
|
1517 |
+
//remove all custom event listeners from elements
|
1518 |
+
this.off(['close.' + this.eventNamespace, 'closed.' + this.eventNamespace, 'nextImageLoaded.' + this.eventNamespace, 'prevImageLoaded.' + this.eventNamespace, 'change.' + this.eventNamespace, 'nextDone.' + this.eventNamespace, 'prevDone.' + this.eventNamespace, 'error.' + this.eventNamespace, 'changed.' + this.eventNamespace, 'next.' + this.eventNamespace, 'prev.' + this.eventNamespace, 'show.' + this.eventNamespace, 'shown.' + this.eventNamespace]);
|
1519 |
+
this.removeEventListener(this.elements, 'click.' + this.eventNamespace);
|
1520 |
+
this.removeEventListener(document.body, 'contextmenu.' + this.eventNamespace);
|
1521 |
+
this.removeEventListener(document.body, 'keyup.' + this.eventNamespace);
|
1522 |
+
this.removeEventListener(this.domNodes.navigation.getElementsByTagName('button'), 'click.' + this.eventNamespace);
|
1523 |
+
this.removeEventListener(this.domNodes.closeButton, 'click.' + this.eventNamespace);
|
1524 |
+
this.removeEventListener(window, 'resize.' + this.eventNamespace);
|
1525 |
+
this.removeEventListener(window, 'hashchange.' + this.eventNamespace);
|
1526 |
+
this.close();
|
1527 |
+
|
1528 |
+
if (this.isOpen) {
|
1529 |
+
document.body.removeChild(this.domNodes.wrapper);
|
1530 |
+
document.body.removeChild(this.domNodes.overlay);
|
1531 |
+
}
|
1532 |
+
|
1533 |
+
this.elements = null;
|
1534 |
+
}
|
1535 |
+
}, {
|
1536 |
+
key: "refresh",
|
1537 |
+
value: function refresh() {
|
1538 |
+
if (!this.initialSelector) {
|
1539 |
+
throw 'refreshing only works when you initialize using a selector!';
|
1540 |
+
}
|
1541 |
+
|
1542 |
+
var options = this.options,
|
1543 |
+
selector = this.initialSelector;
|
1544 |
+
this.destroy();
|
1545 |
+
this.constructor(selector, options);
|
1546 |
+
return this;
|
1547 |
+
}
|
1548 |
+
}, {
|
1549 |
+
key: "hash",
|
1550 |
+
get: function get() {
|
1551 |
+
return window.location.hash.substring(1);
|
1552 |
+
}
|
1553 |
+
}]);
|
1554 |
+
|
1555 |
+
return SimpleLightbox;
|
1556 |
+
}();
|
1557 |
+
|
1558 |
+
(function ($, window, document, undefined) {
|
1559 |
+
'use strict';
|
1560 |
+
|
1561 |
+
$.fn.simpleLightbox = function (options) {
|
1562 |
+
return new SimpleLightbox(this.get(), options);
|
1563 |
+
};
|
1564 |
+
})(jQuery, window, document);
|
products/photocrati_nextgen/modules/lightbox/static/simplelightbox/simple-lightbox.min.css
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
By André Rinas, www.andrerinas.de
|
3 |
+
Documentation, www.simplelightbox.de
|
4 |
+
Available for use under the MIT License
|
5 |
+
Version 2.1.5
|
6 |
+
*/body.hidden-scroll{overflow:hidden}.sl-overlay{position:fixed;left:0;right:0;top:0;bottom:0;background:#fff;opacity:.7;display:none;z-index:1035}.sl-wrapper .sl-close,.sl-wrapper .sl-counter{top:30px;color:#000;position:fixed;display:none}.sl-wrapper{z-index:1040}.sl-wrapper *{box-sizing:border-box}.sl-wrapper button{border:0;background:0 0;font-size:28px;padding:0;cursor:pointer}.sl-wrapper button:hover{opacity:.7}.sl-wrapper .sl-close{right:30px;z-index:10060;margin-top:-14px;margin-right:-14px;height:44px;width:44px;line-height:44px;font-family:Arial,Baskerville,monospace;font-size:3rem}.sl-wrapper .sl-close:focus{outline:0}.sl-wrapper .sl-counter{left:30px;z-index:1060;font-size:1rem}.sl-wrapper .sl-navigation{width:100%;display:none}.sl-wrapper .sl-navigation button{position:fixed;top:50%;margin-top:-22px;height:44px;width:22px;line-height:44px;text-align:center;display:block;z-index:10060;font-family:Arial,Baskerville,monospace;color:#000}.sl-wrapper .sl-navigation button.sl-next{right:5px;font-size:2rem}.sl-wrapper .sl-navigation button.sl-prev{left:5px;font-size:2rem}.sl-wrapper .sl-navigation button:focus{outline:0}@media (min-width:35.5em){.sl-wrapper .sl-navigation button{width:44px}.sl-wrapper .sl-navigation button.sl-next{right:10px;font-size:3rem}.sl-wrapper .sl-navigation button.sl-prev{left:10px;font-size:3rem}.sl-wrapper .sl-image img{border:0}}@media (min-width:50em){.sl-wrapper .sl-navigation button{width:44px}.sl-wrapper .sl-navigation button.sl-next{right:20px;font-size:3rem}.sl-wrapper .sl-navigation button.sl-prev{left:20px;font-size:3rem}.sl-wrapper .sl-image img{border:0}}.sl-wrapper.sl-dir-rtl .sl-navigation{direction:ltr}.sl-wrapper .sl-image{position:fixed;-ms-touch-action:none;touch-action:none;z-index:10000}.sl-wrapper .sl-image img{margin:0;padding:0;display:block;border:0;width:100%;height:auto}.sl-wrapper .sl-image iframe{background:#000;border:0}@media (min-width:35.5em){.sl-wrapper .sl-image iframe{border:0}}@media (min-width:50em){.sl-wrapper .sl-image iframe{border:0}}.sl-wrapper .sl-image .sl-caption{display:none;padding:10px;color:#fff;background:rgba(0,0,0,.8);font-size:1rem;position:absolute;bottom:0;left:0;right:0}.sl-wrapper .sl-image .sl-caption.pos-top{bottom:auto;top:0}.sl-wrapper .sl-image .sl-caption.pos-outside{bottom:auto}.sl-wrapper .sl-image .sl-download{display:none;position:absolute;bottom:5px;right:5px;color:#000;z-index:1060}.sl-spinner{display:none;border:5px solid #333;border-radius:40px;height:40px;left:50%;margin:-20px 0 0 -20px;opacity:0;position:fixed;top:50%;width:40px;z-index:1007;-webkit-animation:pulsate 1s ease-out infinite;-moz-animation:pulsate 1s ease-out infinite;-ms-animation:pulsate 1s ease-out infinite;-o-animation:pulsate 1s ease-out infinite;animation:pulsate 1s ease-out infinite}.sl-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.sl-transition{transition:-moz-transform ease .2s;transition:-ms-transform ease .2s;transition:-o-transform ease .2s;transition:-webkit-transform ease .2s;transition:transform ease .2s}@-webkit-keyframes pulsate{0%{transform:scale(.1);opacity:0}50%{opacity:1}100%{transform:scale(1.2);opacity:0}}@keyframes pulsate{0%{transform:scale(.1);opacity:0}50%{opacity:1}100%{transform:scale(1.2);opacity:0}}@-moz-keyframes pulsate{0%{transform:scale(.1);opacity:0}50%{opacity:1}100%{transform:scale(1.2);opacity:0}}@-o-keyframes pulsate{0%{transform:scale(.1);opacity:0}50%{opacity:1}100%{transform:scale(1.2);opacity:0}}@-ms-keyframes pulsate{0%,100%{opacity:0}0%{transform:scale(.1)}50%{opacity:1}100%{transform:scale(1.2)}}
|
products/photocrati_nextgen/modules/lightbox/static/simplelightbox/simple-lightbox.min.js
CHANGED
@@ -1 +1,2 @@
|
|
1 |
-
!function(t,e,i,n){"use strict";t.fn.simpleLightbox=function(n){var a,n=t.extend({sourceAttr:"href",overlay:!0,spinner:!0,nav:!0,navText:["‹","›"],captions:!0,captionDelay:0,captionSelector:"img",captionType:"attr",captionsData:"title",captionPosition:"bottom",captionClass:"",close:!0,closeText:"×",swipeClose:!0,showCounter:!0,fileExt:"png|jpg|jpeg|gif",animationSlide:!0,animationSpeed:250,preloading:!0,enableKeyboard:!0,loop:!0,rel:!1,docClose:!0,swipeTolerance:50,className:"simple-lightbox",widthRatio:.8,heightRatio:.9,scaleImageToRatio:!1,disableRightClick:!1,disableScroll:!0,alertError:!0,alertErrorMessage:"Image not found, next image will be loaded",additionalHtml:!1,history:!0,throttleInterval:0},n),o=(e.navigator.pointerEnabled||e.navigator.msPointerEnabled,0),s=0,l=t(),r=function(){var t=i.body||i.documentElement;return t=t.style,""===t.WebkitTransition?"-webkit-":""===t.MozTransition?"-moz-":""===t.OTransition?"-o-":""===t.transition&&""},c=!1,p=[],d=n.rel&&!1!==n.rel?function(e,i){return i.filter(function(){return t(this).attr("rel")===e})}(n.rel,t(this)):this,r=r(),h=0,u=!1!==r,g="pushState"in history,f=!1,m=e.location,v=function(){return m.hash.substring(1)},b=v(),x=function(){var t=(v(),"pid="+(M+1)),e=m.href.split("#")[0]+"#"+t;g?history[f?"replaceState":"pushState"]("",i.title,e):f?m.replace(e):m.hash=t,f=!0},y=function(){g?history.pushState("",i.title,m.pathname+m.search):m.hash="",clearTimeout(a)},w=function(){f?a=setTimeout(x,800):x()},T=function(t,e){var i;return function(){var n=arguments,a=this;i||(t.apply(a,n),i=!0,setTimeout(function(){return i=!1},e))}},E="simplelb",C=t("<div>").addClass("sl-overlay"),S=t("<button>").addClass("sl-close").html(n.closeText),I=t("<div>").addClass("sl-spinner").html("<div></div>"),k=t("<div>").addClass("sl-navigation").html('<button class="sl-prev">'+n.navText[0]+'</button><button class="sl-next">'+n.navText[1]+"</button>"),q=t("<div>").addClass("sl-counter").html('<span class="sl-current"></span>/<span class="sl-total"></span>'),D=!1,M=0,R=t("<div>").addClass("sl-caption "+n.captionClass+" pos-"+n.captionPosition),A=t("<div>").addClass("sl-image"),O=t("<div>").addClass("sl-wrapper").addClass(n.className),P=function(e){if(!n.fileExt)return!0;var i=/\.([0-9a-z]+)(?=[?#])|(\.)(?:[\w]+)$/gim,a=t(e).attr(n.sourceAttr).match(i);return a&&"a"==t(e).prop("tagName").toLowerCase()&&new RegExp(".("+n.fileExt+")$","i").test(a)},z=function(e){e.trigger(t.Event("show.simplelightbox")),n.disableScroll&&(h=$("hide")),O.appendTo("body"),A.appendTo(O),n.overlay&&C.appendTo(t("body")),D=!0,M=d.index(e),l=t("<img/>").hide().attr("src",e.attr(n.sourceAttr)),-1==p.indexOf(e.attr(n.sourceAttr))&&p.push(e.attr(n.sourceAttr)),A.html("").attr("style",""),l.appendTo(A),N(),C.fadeIn("fast"),t(".sl-close").fadeIn("fast"),I.show(),k.fadeIn("fast"),t(".sl-wrapper .sl-counter .sl-current").text(M+1),q.fadeIn("fast"),L(),n.preloading&&j(),setTimeout(function(){e.trigger(t.Event("shown.simplelightbox"))},n.animationSpeed)},L=function(i){if(l.length){var a=new Image,o=t(e).width()*n.widthRatio,s=t(e).height()*n.heightRatio;a.src=l.attr("src"),t(a).on("error",function(e){d.eq(M).trigger(t.Event("error.simplelightbox")),D=!1,c=!0,I.hide(),n.alertError&&alert(n.alertErrorMessage),H(1==i||-1==i?i:1)}),a.onload=function(){void 0!==i&&d.eq(M).trigger(t.Event("changed.simplelightbox")).trigger(t.Event((1===i?"nextDone":"prevDone")+".simplelightbox")),n.history&&w(),-1==p.indexOf(l.attr("src"))&&p.push(l.attr("src"));var r=a.width,g=a.height;if(n.scaleImageToRatio||r>o||g>s){var f=r/g>o/s?r/o:g/s;r/=f,g/=f}t(".sl-image").css({top:(t(e).height()-g)/2+"px",left:(t(e).width()-r-h)/2+"px"}),I.hide(),l.css({width:r+"px",height:g+"px"}).fadeIn("fast"),c=!0;var m,v="self"==n.captionSelector?d.eq(M):d.eq(M).find(n.captionSelector);if(m="data"==n.captionType?v.data(n.captionsData):"text"==n.captionType?v.html():v.prop(n.captionsData),n.loop||(0===M&&t(".sl-prev").hide(),M>=d.length-1&&t(".sl-next").hide(),M>0&&t(".sl-prev").show(),M<d.length-1&&t(".sl-next").show()),1==d.length&&t(".sl-prev, .sl-next").hide(),1==i||-1==i){var b={opacity:1};n.animationSlide&&(u?(X(0,100*i+"px"),setTimeout(function(){X(n.animationSpeed/1e3,"0px")},50)):b.left=parseInt(t(".sl-image").css("left"))+100*i+"px"),t(".sl-image").animate(b,n.animationSpeed,function(){D=!1,W(m,r)})}else D=!1,W(m,r);n.additionalHtml&&0===t(".sl-additional-html").length&&t("<div>").html(n.additionalHtml).addClass("sl-additional-html").appendTo(t(".sl-image"))}}},W=function(e,i){""!==e&&void 0!==e&&n.captions&&R.html(e).css({width:i+"px"}).hide().appendTo(t(".sl-image")).delay(n.captionDelay).fadeIn("fast")},X=function(e,i){var n={};n[r+"transform"]="translateX("+i+")",n[r+"transition"]=r+"transform "+e+"s linear",t(".sl-image").css(n)},N=function(){t(e).on("resize."+E,L),t(i).on("click.simplelb touchstart."+E,".sl-close",function(t){t.preventDefault(),c&&K()}),n.history&&setTimeout(function(){t(e).on("hashchange."+E,function(){if(c&&v()===b)return void K()})},40),k.on("click."+E,"button",T(function(e){e.preventDefault(),o=0,H(t(this).hasClass("sl-next")?1:-1)},n.throttleInterval));var a=0,l=0,r=0,p=0,h=!1,g=0;A.on("touchstart.simplelb mousedown."+E,function(t){return!!h||(u&&(g=parseInt(A.css("left"))),h=!0,o=0,s=0,a=t.originalEvent.pageX||t.originalEvent.touches[0].pageX,r=t.originalEvent.pageY||t.originalEvent.touches[0].pageY,!1)}).on("touchmove.simplelb mousemove.simplelb pointermove MSPointerMove",function(t){if(!h)return!0;t.preventDefault(),l=t.originalEvent.pageX||t.originalEvent.touches[0].pageX,p=t.originalEvent.pageY||t.originalEvent.touches[0].pageY,o=a-l,s=r-p,n.animationSlide&&(u?X(0,-o+"px"):A.css("left",g-o+"px"))}).on("touchend.simplelb mouseup.simplelb touchcancel.simplelb mouseleave.simplelb pointerup pointercancel MSPointerUp MSPointerCancel",function(t){if(h){h=!1;var e=!0;n.loop||(0===M&&o<0&&(e=!1),M>=d.length-1&&o>0&&(e=!1)),Math.abs(o)>n.swipeTolerance&&e?H(o>0?1:-1):n.animationSlide&&(u?X(n.animationSpeed/1e3,"0px"):A.animate({left:g+"px"},n.animationSpeed/2)),n.swipeClose&&Math.abs(s)>50&&Math.abs(o)<n.swipeTolerance&&K()}})},Y=function(){k.off("click","button"),t(i).off("click."+E,".sl-close"),t(e).off("resize."+E),t(e).off("hashchange."+E)},j=function(){var e=M+1<0?d.length-1:M+1>=d.length-1?0:M+1,i=M-1<0?d.length-1:M-1>=d.length-1?0:M-1;t("<img />").attr("src",d.eq(e).attr(n.sourceAttr)).on("load",function(){-1==p.indexOf(t(this).attr("src"))&&p.push(t(this).attr("src")),d.eq(M).trigger(t.Event("nextImageLoaded.simplelightbox"))}),t("<img />").attr("src",d.eq(i).attr(n.sourceAttr)).on("load",function(){-1==p.indexOf(t(this).attr("src"))&&p.push(t(this).attr("src")),d.eq(M).trigger(t.Event("prevImageLoaded.simplelightbox"))})},H=function(e){d.eq(M).trigger(t.Event("change.simplelightbox")).trigger(t.Event((1===e?"next":"prev")+".simplelightbox"));var i=M+e;if(!(D||(i<0||i>=d.length)&&!1===n.loop)){M=i<0?d.length-1:i>d.length-1?0:i,t(".sl-wrapper .sl-counter .sl-current").text(M+1);var a={opacity:0};n.animationSlide&&(u?X(n.animationSpeed/1e3,-100*e-o+"px"):a.left=parseInt(t(".sl-image").css("left"))+-100*e+"px"),t(".sl-image").animate(a,n.animationSpeed,function(){setTimeout(function(){var i=d.eq(M);l.attr("src",i.attr(n.sourceAttr)),-1==p.indexOf(i.attr(n.sourceAttr))&&I.show(),t(".sl-caption").remove(),L(e),n.preloading&&j()},100)})}},K=function(){if(!D){var e=d.eq(M),i=!1;e.trigger(t.Event("close.simplelightbox")),n.history&&y(),t(".sl-image img, .sl-overlay, .sl-close, .sl-navigation, .sl-image .sl-caption, .sl-counter").fadeOut("fast",function(){n.disableScroll&&$("show"),t(".sl-wrapper, .sl-overlay").remove(),Y(),i||e.trigger(t.Event("closed.simplelightbox")),i=!0}),l=t(),c=!1,D=!1}},$=function(n){var a=0;if("hide"==n){var o=e.innerWidth;if(!o){var s=i.documentElement.getBoundingClientRect();o=s.right-Math.abs(s.left)}if(i.body.clientWidth<o){var l=i.createElement("div"),r=parseInt(t("body").css("padding-right"),10);l.className="sl-scrollbar-measure",t("body").append(l),a=l.offsetWidth-l.clientWidth,t(i.body)[0].removeChild(l),t("body").data("padding",r),a>0&&t("body").addClass("hidden-scroll").css({"padding-right":r+a})}}else t("body").removeClass("hidden-scroll").css({"padding-right":t("body").data("padding")});return a};return function(){n.close&&S.appendTo(O),n.showCounter&&d.length>1&&(q.appendTo(O),q.find(".sl-total").text(d.length)),n.nav&&k.appendTo(O),n.spinner&&I.appendTo(O)}(),d.on("click."+E,function(e){if(P(this)){if(e.preventDefault(),D)return!1;z(t(this))}}),t(i).on("click.simplelb touchstart."+E,function(e){c&&n.docClose&&0===t(e.target).closest(".sl-image").length&&0===t(e.target).closest(".sl-navigation").length&&K()}),n.disableRightClick&&t(i).on("contextmenu",".sl-image img",function(t){return!1}),n.enableKeyboard&&t(i).on("keyup."+E,T(function(t){if(o=0,c){t.preventDefault();var e=t.keyCode;27==e&&K(),37!=e&&39!=t.keyCode||H(39==t.keyCode?1:-1)}},n.throttleInterval)),this.open=function(e){e=e||t(this[0]),z(e)},this.next=function(){H(1)},this.prev=function(){H(-1)},this.close=function(){K()},this.destroy=function(){t(i).off("click."+E).off("keyup."+E),K(),t(".sl-overlay, .sl-wrapper").remove(),this.off("click")},this.refresh=function(){this.destroy(),t(this).simpleLightbox(n)},this}}(jQuery,window,document);
|
|
1 |
+
"use strict";function _createForOfIteratorHelper(t){if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=_unsupportedIterableToArray(t))){var e=0,o=function(){};return{s:o,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,n,s=!0,a=!1;return{s:function(){i=t[Symbol.iterator]()},n:function(){var t=i.next();return s=t.done,t},e:function(t){a=!0,n=t},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw n}}}}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var o=Object.prototype.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(o):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var o=0,i=new Array(e);o<e;o++)i[o]=t[o];return i}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var o=0;o<e.length;o++){var i=e[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function _createClass(t,e,o){return e&&_defineProperties(t.prototype,e),o&&_defineProperties(t,o),t}function _defineProperty(t,e,o){return e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}var SimpleLightbox=function(){function t(e,o){var i=this;_classCallCheck(this,t),_defineProperty(this,"defaultOptions",{sourceAttr:"href",overlay:!0,spinner:!0,nav:!0,navText:["‹","›"],captions:!0,captionDelay:0,captionSelector:"img",captionType:"attr",captionsData:"title",captionPosition:"bottom",captionClass:"",close:!0,closeText:"×",swipeClose:!0,showCounter:!0,fileExt:"png|jpg|jpeg|gif|webp",animationSlide:!0,animationSpeed:250,preloading:!0,enableKeyboard:!0,loop:!0,rel:!1,docClose:!0,swipeTolerance:50,className:"simple-lightbox",widthRatio:.8,heightRatio:.9,scaleImageToRatio:!1,disableRightClick:!1,disableScroll:!0,alertError:!0,alertErrorMessage:"Image not found, next image will be loaded",additionalHtml:!1,history:!0,throttleInterval:0,doubleTapZoom:2,maxZoom:10,htmlClass:"has-lightbox",rtl:!1}),_defineProperty(this,"transitionPrefix",void 0),_defineProperty(this,"transitionCapable",!1),_defineProperty(this,"isTouchDevice","ontouchstart"in window),_defineProperty(this,"initialLocationHash",void 0),_defineProperty(this,"pushStateSupport","pushState"in history),_defineProperty(this,"isOpen",!1),_defineProperty(this,"isAnimating",!1),_defineProperty(this,"isClosing",!1),_defineProperty(this,"urlChangedOnce",!1),_defineProperty(this,"hashReseted",!1),_defineProperty(this,"historyHasChanges",!1),_defineProperty(this,"historyUpdateTimeout",null),_defineProperty(this,"currentImage",void 0),_defineProperty(this,"eventNamespace","simplelightbox"),_defineProperty(this,"domNodes",{}),_defineProperty(this,"loadedImages",[]),_defineProperty(this,"initialImageIndex",0),_defineProperty(this,"currentImageIndex",0),_defineProperty(this,"initialSelector",null),_defineProperty(this,"globalScrollbarWidth",0),_defineProperty(this,"controlCoordinates",{swipeDiff:0,swipeYDiff:0,swipeStart:0,swipeEnd:0,swipeYStart:0,swipeYEnd:0,mousedown:!1,imageLeft:0,zoomed:!1,containerHeight:0,containerWidth:0,containerOffsetX:0,containerOffsetY:0,imgHeight:0,imgWidth:0,capture:!1,initialOffsetX:0,initialOffsetY:0,initialPointerOffsetX:0,initialPointerOffsetY:0,initialPointerOffsetX2:0,initialPointerOffsetY2:0,initialScale:1,initialPinchDistance:0,pointerOffsetX:0,pointerOffsetY:0,pointerOffsetX2:0,pointerOffsetY2:0,targetOffsetX:0,targetOffsetY:0,targetScale:0,pinchOffsetX:0,pinchOffsetY:0,limitOffsetX:0,limitOffsetY:0,scaleDifference:0,targetPinchDistance:0,touchCount:0,doubleTapped:!1,touchmoveCount:0}),this.options=Object.assign(this.defaultOptions,o),"string"==typeof e?(this.initialSelector=e,this.elements=Array.from(document.querySelectorAll(e))):this.elements=void 0!==e.length&&e.length>0?Array.from(e):[e],this.relatedElements=[],this.transitionPrefix=this.calculateTransitionPrefix(),this.transitionCapable=!1!==this.transitionPrefix,this.initialLocationHash=this.hash,this.options.rel&&(this.elements=this.getRelated(this.options.rel)),this.createDomNodes(),this.options.close&&this.domNodes.wrapper.appendChild(this.domNodes.closeButton),this.options.nav&&this.domNodes.wrapper.appendChild(this.domNodes.navigation),this.options.spinner&&this.domNodes.wrapper.appendChild(this.domNodes.spinner),this.addEventListener(this.elements,"click."+this.eventNamespace,function(t){if(i.isValidLink(t.currentTarget)){if(t.preventDefault(),i.isAnimating)return!1;i.initialImageIndex=i.elements.indexOf(t.currentTarget),i.openImage(t.currentTarget)}}),this.options.docClose&&this.addEventListener(this.domNodes.overlay,["click."+this.eventNamespace,"touchstart."+this.eventNamespace],function(t){i.isOpen&&i.close()}),this.options.disableRightClick&&this.addEventListener(document.body,"contextmenu."+this.eventNamespace,function(t){t.target.classList.contains("sl-overlay")&&t.preventDefault()}),this.options.enableKeyboard&&this.addEventListener(document.body,"keyup."+this.eventNamespace,this.throttle(function(t){if(i.controlCoordinates.swipeDiff=0,i.isAnimating&&"Escape"===t.key)return i.currentImage.setAttribute("src",""),i.isAnimating=!1,i.close();i.isOpen&&(t.preventDefault(),"Escape"===t.key&&i.close(),!i.isAnimating&&["ArrowLeft","ArrowRight"].indexOf(t.key)>-1&&i.loadImage("ArrowRight"===t.key?1:-1))},this.options.throttleInterval)),this.addEvents()}return _createClass(t,[{key:"createDomNodes",value:function(){this.domNodes.overlay=document.createElement("div"),this.domNodes.overlay.classList.add("sl-overlay"),this.domNodes.overlay.dataset.opacityTarget=".7",this.domNodes.closeButton=document.createElement("button"),this.domNodes.closeButton.classList.add("sl-close"),this.domNodes.closeButton.innerHTML=this.options.closeText,this.domNodes.spinner=document.createElement("div"),this.domNodes.spinner.classList.add("sl-spinner"),this.domNodes.spinner.innerHTML="<div></div>",this.domNodes.navigation=document.createElement("div"),this.domNodes.navigation.classList.add("sl-navigation"),this.domNodes.navigation.innerHTML='<button class="sl-prev">'.concat(this.options.navText[0],'</button><button class="sl-next">').concat(this.options.navText[1],"</button>"),this.domNodes.counter=document.createElement("div"),this.domNodes.counter.classList.add("sl-counter"),this.domNodes.counter.innerHTML='<span class="sl-current"></span>/<span class="sl-total"></span>',this.domNodes.caption=document.createElement("div"),this.domNodes.caption.classList.add("sl-caption","pos-"+this.options.captionPosition),this.options.captionClass&&this.domNodes.caption.classList.add(this.options.captionClass),this.domNodes.image=document.createElement("div"),this.domNodes.image.classList.add("sl-image"),this.domNodes.wrapper=document.createElement("div"),this.domNodes.wrapper.classList.add("sl-wrapper"),this.options.className&&this.domNodes.wrapper.classList.add(this.options.className),this.options.rtl&&this.domNodes.wrapper.classList.add("sl-dir-rtl")}},{key:"throttle",value:function(t,e){var o;return function(){o||(t.apply(this,arguments),o=!0,setTimeout(function(){return o=!1},e))}}},{key:"isValidLink",value:function(t){return!this.options.fileExt||"pathname"in t&&new RegExp("("+this.options.fileExt+")$","i").test(t.pathname)}},{key:"calculateTransitionPrefix",value:function(){var t=(document.body||document.documentElement).style;return"transition"in t?"":"WebkitTransition"in t?"-webkit-":"MozTransition"in t?"-moz-":"OTransition"in t&&"-o"}},{key:"toggleScrollbar",value:function(t){var e=0;if("hide"===t){var o=window.innerWidth;if(!o){var i=document.documentElement.getBoundingClientRect();o=i.right-Math.abs(i.left)}if(document.body.clientWidth<o){var n=document.createElement("div"),s=parseInt(document.body.style.paddingRight||0,10);n.classList.add("sl-scrollbar-measure"),document.body.appendChild(n),e=n.offsetWidth-n.clientWidth,document.body.removeChild(n),document.body.dataset.originalPaddingRight=s,e>0&&(document.body.classList.add("hidden-scroll"),document.body.style.paddingRight=s+e+"px")}}else document.body.classList.remove("hidden-scroll"),document.body.style.paddingRight=document.body.dataset.originalPaddingRight;return e}},{key:"close",value:function(){var t=this;if(!this.isOpen||this.isAnimating||this.isClosing)return!1;this.isClosing=!0;var e=this.relatedElements[this.currentImageIndex];e.dispatchEvent(new Event("close.simplelightbox")),this.options.history&&(this.historyHasChanges=!1,this.hashReseted||this.resetHash()),this.fadeOut(document.querySelectorAll(".sl-image img, .sl-overlay, .sl-close, .sl-navigation, .sl-image .sl-caption, .sl-counter"),300,function(){t.options.disableScroll&&t.toggleScrollbar("show"),t.options.htmlClass&&""!==t.options.htmlClass&&document.querySelector("html").classList.remove(t.options.htmlClass),document.body.removeChild(t.domNodes.wrapper),document.body.removeChild(t.domNodes.overlay),t.domNodes.additionalHtml=null,e.dispatchEvent(new Event("closed.simplelightbox")),t.isClosing=!1}),this.currentImage=null,this.isOpen=!1,this.isAnimating=!1;for(var o in this.controlCoordinates)this.controlCoordinates[o]=0;this.controlCoordinates.mousedown=!1,this.controlCoordinates.zoomed=!1,this.controlCoordinates.capture=!1,this.controlCoordinates.initialScale=this.minMax(1,1,this.options.maxZoom),this.controlCoordinates.doubleTapped=!1}},{key:"preload",value:function(){var t=this,e=this.currentImageIndex,o=this.relatedElements.length,i=e+1<0?o-1:e+1>=o-1?0:e+1,n=e-1<0?o-1:e-1>=o-1?0:e-1,s=new Image,a=new Image;s.addEventListener("load",function(o){var i=o.target.getAttribute("src");-1===t.loadedImages.indexOf(i)&&t.loadedImages.push(i),t.relatedElements[e].dispatchEvent(new Event("nextImageLoaded."+t.eventNamespace))}),s.setAttribute("src",this.relatedElements[i].getAttribute(this.options.sourceAttr)),a.addEventListener("load",function(o){var i=o.target.getAttribute("src");-1===t.loadedImages.indexOf(i)&&t.loadedImages.push(i),t.relatedElements[e].dispatchEvent(new Event("prevImageLoaded."+t.eventNamespace))}),a.setAttribute("src",this.relatedElements[n].getAttribute(this.options.sourceAttr))}},{key:"loadImage",value:function(t){var e=this,o=t;this.options.rtl&&(t=-t),this.relatedElements[this.currentImageIndex].dispatchEvent(new Event("change."+this.eventNamespace)),this.relatedElements[this.currentImageIndex].dispatchEvent(new Event((1===t?"next":"prev")+"."+this.eventNamespace));var i=this.currentImageIndex+t;if(this.isAnimating||(i<0||i>=this.relatedElements.length)&&!1===this.options.loop)return!1;this.currentImageIndex=i<0?this.relatedElements.length-1:i>this.relatedElements.length-1?0:i,this.domNodes.counter.querySelector(".sl-current").innerHTML=this.currentImageIndex+1,this.options.animationSlide&&this.slide(this.options.animationSpeed/1e3,-100*o-this.controlCoordinates.swipeDiff+"px"),this.fadeOut(this.domNodes.image,300,function(){e.isAnimating=!0,setTimeout(function(){var t=e.relatedElements[e.currentImageIndex];e.currentImage.setAttribute("src",t.getAttribute(e.options.sourceAttr)),-1===e.loadedImages.indexOf(t.getAttribute(e.options.sourceAttr))&&e.show(e.domNodes.spinner),e.domNodes.image.contains(e.domNodes.caption)&&e.domNodes.image.removeChild(e.domNodes.caption),e.adjustImage(o),e.options.preloading&&e.preload()},100)})}},{key:"adjustImage",value:function(t){var e=this;if(!this.currentImage)return!1;var o=new Image,i=window.innerWidth*this.options.widthRatio,n=window.innerHeight*this.options.heightRatio;o.setAttribute("src",this.currentImage.getAttribute("src")),this.currentImage.dataset.scale=1,this.currentImage.dataset.translateX=0,this.currentImage.dataset.translateY=0,this.zoomPanElement(0,0,1),o.addEventListener("error",function(o){e.relatedElements[e.currentImageIndex].dispatchEvent(new Event("error."+e.eventNamespace)),e.isAnimating=!1,e.isOpen=!1,e.domNodes.spinner.style.display="none";var i=1===t||-1===t;if(e.initialImageIndex===e.currentImageIndex&&i)return e.close();e.options.alertError&&alert(e.options.alertErrorMessage),e.loadImage(i?t:1)}),o.addEventListener("load",function(o){void 0!==t&&(e.relatedElements[e.currentImageIndex].dispatchEvent(new Event("changed."+e.eventNamespace)),e.relatedElements[e.currentImageIndex].dispatchEvent(new Event((1===t?"nextDone":"prevDone")+"."+e.eventNamespace))),e.options.history&&e.updateURL(),-1===e.loadedImages.indexOf(e.currentImage.getAttribute("src"))&&e.loadedImages.push(e.currentImage.getAttribute("src"));var s=o.target.width,a=o.target.height;if(e.options.scaleImageToRatio||s>i||a>n){var r=s/a>i/n?s/i:a/n;s/=r,a/=r}e.domNodes.image.style.top=(window.innerHeight-a)/2+"px",e.domNodes.image.style.left=(window.innerWidth-s-e.globalScrollbarWidth)/2+"px",e.domNodes.image.style.width=s+"px",e.domNodes.image.style.height=a+"px",e.domNodes.spinner.style.display="none",e.fadeIn(e.currentImage,300),e.isOpen=!0;var l,d="self"===e.options.captionSelector?e.relatedElements[e.currentImageIndex]:e.relatedElements[e.currentImageIndex].querySelector(e.options.captionSelector);e.options.captions&&d&&(l="data"===e.options.captionType?d.dataset[e.options.captionsData]:"text"===e.options.captionType?d.innerHTML:d.getAttribute(e.options.captionsData)),e.options.loop||(0===e.currentImageIndex&&e.hide(e.domNodes.navigation.querySelector(".sl-prev")),e.currentImageIndex>=e.relatedElements.length-1&&e.hide(e.domNodes.navigation.querySelector(".sl-next")),e.currentImageIndex>0&&e.show(e.domNodes.navigation.querySelector(".sl-prev")),e.currentImageIndex<e.relatedElements.length-1&&e.show(e.domNodes.navigation.querySelector(".sl-next"))),1===e.relatedElements.length?e.hide(e.domNodes.navigation.querySelectorAll(".sl-prev, .sl-next")):e.show(e.domNodes.navigation.querySelectorAll(".sl-prev, .sl-next")),1===t||-1===t?(e.options.animationSlide&&(e.slide(0,100*t+"px"),setTimeout(function(){e.slide(e.options.animationSpeed/1e3,"0px")},50)),e.fadeIn(e.domNodes.image,300,function(){e.isAnimating=!1,e.setCaption(l,s)})):(e.isAnimating=!1,e.setCaption(l,s)),e.options.additionalHtml&&!e.domNodes.additionalHtml&&(e.domNodes.additionalHtml=document.createElement("div"),e.domNodes.additionalHtml.classList.add("sl-additional-html"),e.domNodes.additionalHtml.innerHTML=e.options.additionalHtml,e.domNodes.image.appendChild(e.domNodes.additionalHtml))})}},{key:"zoomPanElement",value:function(t,e,o){this.currentImage.style[this.transitionPrefix+"transform"]="translate("+t+","+e+") scale("+o+")"}},{key:"minMax",value:function(t,e,o){return t<e?e:t>o?o:t}},{key:"setZoomData",value:function(t,e,o){this.currentImage.dataset.scale=t,this.currentImage.dataset.translateX=e,this.currentImage.dataset.translateY=o}},{key:"hashchangeHandler",value:function(){this.isOpen&&this.hash===this.initialLocationHash&&(this.hashReseted=!0,this.close())}},{key:"addEvents",value:function(){var t=this;this.addEventListener(window,"resize."+this.eventNamespace,function(e){t.isOpen&&t.adjustImage()}),this.addEventListener(this.domNodes.closeButton,["click."+this.eventNamespace,"touchstart."+this.eventNamespace],this.close.bind(this)),this.options.history&&setTimeout(function(){t.addEventListener(window,"hashchange."+t.eventNamespace,function(e){t.isOpen&&t.hashchangeHandler()})},40),this.addEventListener(this.domNodes.navigation.getElementsByTagName("button"),"click."+this.eventNamespace,function(e){if(!e.currentTarget.tagName.match(/button/i))return!0;e.preventDefault(),t.controlCoordinates.swipeDiff=0,t.loadImage(e.currentTarget.classList.contains("sl-next")?1:-1)}),this.addEventListener(this.domNodes.image,["touchstart."+this.eventNamespace,"mousedown."+this.eventNamespace],function(e){if("A"===e.target.tagName&&"touchstart"===e.type)return!0;if("mousedown"===e.type)t.controlCoordinates.initialPointerOffsetX=e.clientX,t.controlCoordinates.initialPointerOffsetY=e.clientY,t.controlCoordinates.containerHeight=t.getDimensions(t.domNodes.image).height,t.controlCoordinates.containerWidth=t.getDimensions(t.domNodes.image).width,t.controlCoordinates.imgHeight=t.getDimensions(t.currentImage).height,t.controlCoordinates.imgWidth=t.getDimensions(t.currentImage).width,t.controlCoordinates.containerOffsetX=t.domNodes.image.offsetLeft,t.controlCoordinates.containerOffsetY=t.domNodes.image.offsetTop,t.controlCoordinates.initialOffsetX=parseFloat(t.currentImage.dataset.translateX),t.controlCoordinates.initialOffsetY=parseFloat(t.currentImage.dataset.translateY),t.controlCoordinates.capture=!0;else{if(t.controlCoordinates.touchCount=e.touches.length,t.controlCoordinates.initialPointerOffsetX=e.touches[0].clientX,t.controlCoordinates.initialPointerOffsetY=e.touches[0].clientY,t.controlCoordinates.containerHeight=t.getDimensions(t.domNodes.image).height,t.controlCoordinates.containerWidth=t.getDimensions(t.domNodes.image).width,t.controlCoordinates.imgHeight=t.getDimensions(t.currentImage).height,t.controlCoordinates.imgWidth=t.getDimensions(t.currentImage).width,t.controlCoordinates.containerOffsetX=t.domNodes.image.offsetLeft,t.controlCoordinates.containerOffsetY=t.domNodes.image.offsetTop,1===t.controlCoordinates.touchCount){if(t.controlCoordinates.doubleTapped)return t.currentImage.classList.add("sl-transition"),t.controlCoordinates.zoomed?(t.controlCoordinates.initialScale=1,t.setZoomData(t.controlCoordinates.initialScale,0,0),t.zoomPanElement("0px","0px",t.controlCoordinates.initialScale),t.controlCoordinates.zoomed=!1):(t.controlCoordinates.initialScale=t.options.doubleTapZoom,t.setZoomData(t.controlCoordinates.initialScale,0,0),t.zoomPanElement("0px","0px",t.controlCoordinates.initialScale),t.domNodes.caption.style.opacity||"none"===t.domNodes.caption.style.display||t.fadeOut(t.domNodes.caption,200),t.controlCoordinates.zoomed=!0),setTimeout(function(){t.currentImage&&t.currentImage.classList.remove("sl-transition")},200),!1;t.controlCoordinates.doubleTapped=!0,setTimeout(function(){t.controlCoordinates.doubleTapped=!1},300),t.controlCoordinates.initialOffsetX=parseFloat(t.currentImage.dataset.translateX),t.controlCoordinates.initialOffsetY=parseFloat(t.currentImage.dataset.translateY)}else 2===t.controlCoordinates.touchCount&&(t.controlCoordinates.initialPointerOffsetX2=e.touches[1].clientX,t.controlCoordinates.initialPointerOffsetY2=e.touches[1].clientY,t.controlCoordinates.initialOffsetX=parseFloat(t.currentImage.dataset.translateX),t.controlCoordinates.initialOffsetY=parseFloat(t.currentImage.dataset.translateY),t.controlCoordinates.pinchOffsetX=(t.controlCoordinates.initialPointerOffsetX+t.controlCoordinates.initialPointerOffsetX2)/2,t.controlCoordinates.pinchOffsetY=(t.controlCoordinates.initialPointerOffsetY+t.controlCoordinates.initialPointerOffsetY2)/2,t.controlCoordinates.initialPinchDistance=Math.sqrt((t.controlCoordinates.initialPointerOffsetX-t.controlCoordinates.initialPointerOffsetX2)*(t.controlCoordinates.initialPointerOffsetX-t.controlCoordinates.initialPointerOffsetX2)+(t.controlCoordinates.initialPointerOffsetY-t.controlCoordinates.initialPointerOffsetY2)*(t.controlCoordinates.initialPointerOffsetY-t.controlCoordinates.initialPointerOffsetY2)));t.controlCoordinates.capture=!0}return!!t.controlCoordinates.mousedown||(t.transitionCapable&&(t.controlCoordinates.imageLeft=parseInt(t.domNodes.image.style.left,10)),t.controlCoordinates.mousedown=!0,t.controlCoordinates.swipeDiff=0,t.controlCoordinates.swipeYDiff=0,t.controlCoordinates.swipeStart=e.pageX||e.touches[0].pageX,t.controlCoordinates.swipeYStart=e.pageY||e.touches[0].pageY,!1)}),this.addEventListener(this.domNodes.image,["touchmove."+this.eventNamespace,"mousemove."+this.eventNamespace,"MSPointerMove"],function(e){if(!t.controlCoordinates.mousedown)return!0;if(e.preventDefault(),"touchmove"===e.type){if(!1===t.controlCoordinates.capture)return!1;t.controlCoordinates.pointerOffsetX=e.touches[0].clientX,t.controlCoordinates.pointerOffsetY=e.touches[0].clientY,t.controlCoordinates.touchCount=e.touches.length,t.controlCoordinates.touchmoveCount++,t.controlCoordinates.touchCount>1?(t.controlCoordinates.pointerOffsetX2=e.touches[1].clientX,t.controlCoordinates.pointerOffsetY2=e.touches[1].clientY,t.controlCoordinates.targetPinchDistance=Math.sqrt((t.controlCoordinates.pointerOffsetX-t.controlCoordinates.pointerOffsetX2)*(t.controlCoordinates.pointerOffsetX-t.controlCoordinates.pointerOffsetX2)+(t.controlCoordinates.pointerOffsetY-t.controlCoordinates.pointerOffsetY2)*(t.controlCoordinates.pointerOffsetY-t.controlCoordinates.pointerOffsetY2)),null===t.controlCoordinates.initialPinchDistance&&(t.controlCoordinates.initialPinchDistance=t.controlCoordinates.targetPinchDistance),Math.abs(t.controlCoordinates.initialPinchDistance-t.controlCoordinates.targetPinchDistance)>=1&&(t.controlCoordinates.targetScale=t.minMax(t.controlCoordinates.targetPinchDistance/t.controlCoordinates.initialPinchDistance*t.controlCoordinates.initialScale,1,t.options.maxZoom),t.controlCoordinates.limitOffsetX=(t.controlCoordinates.imgWidth*t.controlCoordinates.targetScale-t.controlCoordinates.containerWidth)/2,t.controlCoordinates.limitOffsetY=(t.controlCoordinates.imgHeight*t.controlCoordinates.targetScale-t.controlCoordinates.containerHeight)/2,t.controlCoordinates.scaleDifference=t.controlCoordinates.targetScale-t.controlCoordinates.initialScale,t.controlCoordinates.targetOffsetX=t.controlCoordinates.imgWidth*t.controlCoordinates.targetScale<=t.controlCoordinates.containerWidth?0:t.minMax(t.controlCoordinates.initialOffsetX-(t.controlCoordinates.pinchOffsetX-t.controlCoordinates.containerOffsetX-t.controlCoordinates.containerWidth/2-t.controlCoordinates.initialOffsetX)/(t.controlCoordinates.targetScale-t.controlCoordinates.scaleDifference)*t.controlCoordinates.scaleDifference,-1*t.controlCoordinates.limitOffsetX,t.controlCoordinates.limitOffsetX),t.controlCoordinates.targetOffsetY=t.controlCoordinates.imgHeight*t.controlCoordinates.targetScale<=t.controlCoordinates.containerHeight?0:t.minMax(t.controlCoordinates.initialOffsetY-(t.controlCoordinates.pinchOffsetY-t.controlCoordinates.containerOffsetY-t.controlCoordinates.containerHeight/2-t.controlCoordinates.initialOffsetY)/(t.controlCoordinates.targetScale-t.controlCoordinates.scaleDifference)*t.controlCoordinates.scaleDifference,-1*t.controlCoordinates.limitOffsetY,t.controlCoordinates.limitOffsetY),t.zoomPanElement(t.controlCoordinates.targetOffsetX+"px",t.controlCoordinates.targetOffsetY+"px",t.controlCoordinates.targetScale),t.controlCoordinates.targetScale>1&&(t.controlCoordinates.zoomed=!0,t.domNodes.caption.style.opacity||"none"===t.domNodes.caption.style.display||t.fadeOut(t.domNodes.caption,200)),t.controlCoordinates.initialPinchDistance=t.controlCoordinates.targetPinchDistance,t.controlCoordinates.initialScale=t.controlCoordinates.targetScale,t.controlCoordinates.initialOffsetX=t.controlCoordinates.targetOffsetX,t.controlCoordinates.initialOffsetY=t.controlCoordinates.targetOffsetY)):(t.controlCoordinates.targetScale=t.controlCoordinates.initialScale,t.controlCoordinates.limitOffsetX=(t.controlCoordinates.imgWidth*t.controlCoordinates.targetScale-t.controlCoordinates.containerWidth)/2,t.controlCoordinates.limitOffsetY=(t.controlCoordinates.imgHeight*t.controlCoordinates.targetScale-t.controlCoordinates.containerHeight)/2,t.controlCoordinates.targetOffsetX=t.controlCoordinates.imgWidth*t.controlCoordinates.targetScale<=t.controlCoordinates.containerWidth?0:t.minMax(t.controlCoordinates.pointerOffsetX-(t.controlCoordinates.initialPointerOffsetX-t.controlCoordinates.initialOffsetX),-1*t.controlCoordinates.limitOffsetX,t.controlCoordinates.limitOffsetX),t.controlCoordinates.targetOffsetY=t.controlCoordinates.imgHeight*t.controlCoordinates.targetScale<=t.controlCoordinates.containerHeight?0:t.minMax(t.controlCoordinates.pointerOffsetY-(t.controlCoordinates.initialPointerOffsetY-t.controlCoordinates.initialOffsetY),-1*t.controlCoordinates.limitOffsetY,t.controlCoordinates.limitOffsetY),Math.abs(t.controlCoordinates.targetOffsetX)===Math.abs(t.controlCoordinates.limitOffsetX)&&(t.controlCoordinates.initialOffsetX=t.controlCoordinates.targetOffsetX,t.controlCoordinates.initialPointerOffsetX=t.controlCoordinates.pointerOffsetX),Math.abs(t.controlCoordinates.targetOffsetY)===Math.abs(t.controlCoordinates.limitOffsetY)&&(t.controlCoordinates.initialOffsetY=t.controlCoordinates.targetOffsetY,t.controlCoordinates.initialPointerOffsetY=t.controlCoordinates.pointerOffsetY),t.setZoomData(t.controlCoordinates.initialScale,t.controlCoordinates.targetOffsetX,t.controlCoordinates.targetOffsetY),t.zoomPanElement(t.controlCoordinates.targetOffsetX+"px",t.controlCoordinates.targetOffsetY+"px",t.controlCoordinates.targetScale))}if("mousemove"===e.type&&t.controlCoordinates.mousedown){if("touchmove"==e.type)return!0;if(!1===t.controlCoordinates.capture)return!1;t.controlCoordinates.pointerOffsetX=e.clientX,t.controlCoordinates.pointerOffsetY=e.clientY,t.controlCoordinates.targetScale=t.controlCoordinates.initialScale,t.controlCoordinates.limitOffsetX=(t.controlCoordinates.imgWidth*t.controlCoordinates.targetScale-t.controlCoordinates.containerWidth)/2,t.controlCoordinates.limitOffsetY=(t.controlCoordinates.imgHeight*t.controlCoordinates.targetScale-t.controlCoordinates.containerHeight)/2,t.controlCoordinates.targetOffsetX=t.controlCoordinates.imgWidth*t.controlCoordinates.targetScale<=t.controlCoordinates.containerWidth?0:t.minMax(t.controlCoordinates.pointerOffsetX-(t.controlCoordinates.initialPointerOffsetX-t.controlCoordinates.initialOffsetX),-1*t.controlCoordinates.limitOffsetX,t.controlCoordinates.limitOffsetX),t.controlCoordinates.targetOffsetY=t.controlCoordinates.imgHeight*t.controlCoordinates.targetScale<=t.controlCoordinates.containerHeight?0:t.minMax(t.controlCoordinates.pointerOffsetY-(t.controlCoordinates.initialPointerOffsetY-t.controlCoordinates.initialOffsetY),-1*t.controlCoordinates.limitOffsetY,t.controlCoordinates.limitOffsetY),Math.abs(t.controlCoordinates.targetOffsetX)===Math.abs(t.controlCoordinates.limitOffsetX)&&(t.controlCoordinates.initialOffsetX=t.controlCoordinates.targetOffsetX,t.controlCoordinates.initialPointerOffsetX=t.controlCoordinates.pointerOffsetX),Math.abs(t.controlCoordinates.targetOffsetY)===Math.abs(t.controlCoordinates.limitOffsetY)&&(t.controlCoordinates.initialOffsetY=t.controlCoordinates.targetOffsetY,t.controlCoordinates.initialPointerOffsetY=t.controlCoordinates.pointerOffsetY),t.setZoomData(t.controlCoordinates.initialScale,t.controlCoordinates.targetOffsetX,t.controlCoordinates.targetOffsetY),t.zoomPanElement(t.controlCoordinates.targetOffsetX+"px",t.controlCoordinates.targetOffsetY+"px",t.controlCoordinates.targetScale)}t.controlCoordinates.zoomed||(t.controlCoordinates.swipeEnd=e.pageX||e.touches[0].pageX,t.controlCoordinates.swipeYEnd=e.pageY||e.touches[0].pageY,t.controlCoordinates.swipeDiff=t.controlCoordinates.swipeStart-t.controlCoordinates.swipeEnd,t.controlCoordinates.swipeYDiff=t.controlCoordinates.swipeYStart-t.controlCoordinates.swipeYEnd,t.options.animationSlide&&t.slide(0,-t.controlCoordinates.swipeDiff+"px"))}),this.addEventListener(this.domNodes.image,["touchend."+this.eventNamespace,"mouseup."+this.eventNamespace,"touchcancel."+this.eventNamespace,"mouseleave."+this.eventNamespace,"pointerup","pointercancel","MSPointerUp","MSPointerCancel"],function(e){if(t.isTouchDevice&&"touchend"===e.type&&(t.controlCoordinates.touchCount=e.touches.length,0===t.controlCoordinates.touchCount?(t.setZoomData(t.controlCoordinates.initialScale,t.controlCoordinates.targetOffsetX,t.controlCoordinates.targetOffsetY),1===t.controlCoordinates.initialScale&&(t.controlCoordinates.zoomed=!1,"none"===t.domNodes.caption.style.display&&t.fadeIn(t.domNodes.caption,200)),t.controlCoordinates.initialPinchDistance=null,t.controlCoordinates.capture=!1):1===t.controlCoordinates.touchCount?(t.controlCoordinates.initialPointerOffsetX=e.touches[0].clientX,t.controlCoordinates.initialPointerOffsetY=e.touches[0].clientY):t.controlCoordinates.touchCount>1&&(t.controlCoordinates.initialPinchDistance=null)),t.controlCoordinates.mousedown){t.controlCoordinates.mousedown=!1;var o=!0;t.options.loop||(0===t.currentImageIndex&&t.controlCoordinates.swipeDiff<0&&(o=!1),t.currentImageIndex>=t.relatedElements.length-1&&t.controlCoordinates.swipeDiff>0&&(o=!1)),Math.abs(t.controlCoordinates.swipeDiff)>t.options.swipeTolerance&&o?t.loadImage(t.controlCoordinates.swipeDiff>0?1:-1):t.options.animationSlide&&t.slide(t.options.animationSpeed/1e3,"0px"),t.options.swipeClose&&Math.abs(t.controlCoordinates.swipeYDiff)>50&&Math.abs(t.controlCoordinates.swipeDiff)<t.options.swipeTolerance&&t.close()}}),this.addEventListener(this.domNodes.image,["dblclick"],function(e){if(!t.isTouchDevice)return t.controlCoordinates.initialPointerOffsetX=e.clientX,t.controlCoordinates.initialPointerOffsetY=e.clientY,t.controlCoordinates.containerHeight=t.getDimensions(t.domNodes.image).height,t.controlCoordinates.containerWidth=t.getDimensions(t.domNodes.image).width,t.controlCoordinates.imgHeight=t.getDimensions(t.currentImage).height,t.controlCoordinates.imgWidth=t.getDimensions(t.currentImage).width,t.controlCoordinates.containerOffsetX=t.domNodes.image.offsetLeft,t.controlCoordinates.containerOffsetY=t.domNodes.image.offsetTop,t.currentImage.classList.add("sl-transition"),t.controlCoordinates.zoomed?(t.controlCoordinates.initialScale=1,t.setZoomData(t.controlCoordinates.initialScale,0,0),t.zoomPanElement("0px","0px",t.controlCoordinates.initialScale),t.controlCoordinates.zoomed=!1,"none"===t.domNodes.caption.style.display&&t.fadeIn(t.domNodes.caption,200)):(t.controlCoordinates.initialScale=t.options.doubleTapZoom,t.setZoomData(t.controlCoordinates.initialScale,0,0),t.zoomPanElement("0px","0px",t.controlCoordinates.initialScale),t.domNodes.caption.style.opacity||"none"===t.domNodes.caption.style.display||t.fadeOut(t.domNodes.caption,200),t.controlCoordinates.zoomed=!0),setTimeout(function(){t.currentImage&&t.currentImage.classList.remove("sl-transition")},200),t.controlCoordinates.capture=!0,!1})}},{key:"getDimensions",value:function(t){var e=window.getComputedStyle(t),o=t.offsetHeight,i=t.offsetWidth,n=parseFloat(e.borderTopWidth);return{height:o-parseFloat(e.borderBottomWidth)-n-parseFloat(e.paddingTop)-parseFloat(e.paddingBottom),width:i-parseFloat(e.borderLeftWidth)-parseFloat(e.borderRightWidth)-parseFloat(e.paddingLeft)-parseFloat(e.paddingRight)}}},{key:"updateHash",value:function(){var t="pid="+(this.currentImageIndex+1),e=window.location.href.split("#")[0]+"#"+t;this.hashReseted=!1,this.pushStateSupport?window.history[this.historyHasChanges?"replaceState":"pushState"]("",document.title,e):this.historyHasChanges?window.location.replace(e):window.location.hash=t,this.historyHasChanges||(this.urlChangedOnce=!0),this.historyHasChanges=!0}},{key:"resetHash",value:function(){this.hashReseted=!0,this.urlChangedOnce?history.back():this.pushStateSupport?history.pushState("",document.title,window.location.pathname+window.location.search):window.location.hash="",clearTimeout(this.historyUpdateTimeout)}},{key:"updateURL",value:function(){clearTimeout(this.historyUpdateTimeout),this.historyHasChanges?this.historyUpdateTimeout=setTimeout(this.updateHash.bind(this),800):this.updateHash()}},{key:"setCaption",value:function(t,e){var o=this;this.options.captions&&t&&""!==t&&void 0!==t&&(this.hide(this.domNodes.caption),this.domNodes.caption.style.width=e+"px",this.domNodes.caption.innerHTML=t,this.domNodes.image.appendChild(this.domNodes.caption),setTimeout(function(){o.fadeIn(o.domNodes.caption,300)},this.options.captionDelay))}},{key:"slide",
|
2 |
+
value:function(t,e){if(!this.transitionCapable)return this.domNodes.image.style.left=e;this.domNodes.image.style[this.transitionPrefix+"transform"]="translateX("+e+")",this.domNodes.image.style[this.transitionPrefix+"transition"]=this.transitionPrefix+"transform "+t+"s linear"}},{key:"getRelated",value:function(t){return t&&!1!==t&&"nofollow"!==t?Array.from(this.elements).filter(function(e){return e.getAttribute("rel")===t}):this.elements}},{key:"openImage",value:function(t){var e=this;t.dispatchEvent(new Event("show."+this.eventNamespace)),this.options.disableScroll&&(this.globalScrollbarWidth=this.toggleScrollbar("hide")),this.options.htmlClass&&""!==this.options.htmlClass&&document.querySelector("html").classList.add(this.options.htmlClass),document.body.appendChild(this.domNodes.wrapper),this.domNodes.wrapper.appendChild(this.domNodes.image),this.options.overlay&&document.body.appendChild(this.domNodes.overlay),this.relatedElements=this.getRelated(t.rel),this.options.showCounter&&(1==this.relatedElements.length&&this.domNodes.wrapper.contains(this.domNodes.counter)?this.domNodes.wrapper.removeChild(this.domNodes.counter):this.relatedElements.length>1&&!this.domNodes.wrapper.contains(this.domNodes.counter)&&this.domNodes.wrapper.appendChild(this.domNodes.counter)),this.isAnimating=!0,this.currentImageIndex=this.relatedElements.indexOf(t);var o=t.getAttribute(this.options.sourceAttr);this.currentImage=document.createElement("img"),this.currentImage.style.display="none",this.currentImage.setAttribute("src",o),this.currentImage.dataset.scale=1,this.currentImage.dataset.translateX=0,this.currentImage.dataset.translateY=0,-1===this.loadedImages.indexOf(o)&&this.loadedImages.push(o),this.domNodes.image.innerHTML="",this.domNodes.image.setAttribute("style",""),this.domNodes.image.appendChild(this.currentImage),this.fadeIn(this.domNodes.overlay,300),this.fadeIn([this.domNodes.counter,this.domNodes.navigation,this.domNodes.closeButton],300),this.show(this.domNodes.spinner),this.domNodes.counter.querySelector(".sl-current").innerHTML=this.currentImageIndex+1,this.domNodes.counter.querySelector(".sl-total").innerHTML=this.relatedElements.length,this.adjustImage(),this.options.preloading&&this.preload(),setTimeout(function(){t.dispatchEvent(new Event("shown."+e.eventNamespace))},this.options.animationSpeed)}},{key:"addEventListener",value:function(t,e,o,i){t=this.wrap(t),e=this.wrap(e);var n,s=_createForOfIteratorHelper(t);try{for(s.s();!(n=s.n()).done;){var a=n.value;a.namespaces||(a.namespaces={});var r,l=_createForOfIteratorHelper(e);try{for(l.s();!(r=l.n()).done;){var d=r.value,c=i||!1;a.namespaces[d]=o,a.addEventListener(d.split(".")[0],o,c)}}catch(t){l.e(t)}finally{l.f()}}}catch(t){s.e(t)}finally{s.f()}}},{key:"removeEventListener",value:function(t,e){t=this.wrap(t),e=this.wrap(e);var o,i=_createForOfIteratorHelper(t);try{for(i.s();!(o=i.n()).done;){var n,s=o.value,a=_createForOfIteratorHelper(e);try{for(a.s();!(n=a.n()).done;){var r=n.value;s.removeEventListener(r.split(".")[0],s.namespaces[r]),delete s.namespaces[r]}}catch(t){a.e(t)}finally{a.f()}}}catch(t){i.e(t)}finally{i.f()}}},{key:"fadeOut",value:function(t,e,o){var i=this;t=this.wrap(t);var n,s=_createForOfIteratorHelper(t);try{for(s.s();!(n=s.n()).done;){n.value.style.opacity=1}}catch(t){s.e(t)}finally{s.f()}var a=16.66666/(e||300);!function e(){var n=parseFloat(t[0].style.opacity);if((n-=a)<0){var s,r=_createForOfIteratorHelper(t);try{for(r.s();!(s=r.n()).done;){var l=s.value;l.style.display="none",l.style.opacity=""}}catch(t){r.e(t)}finally{r.f()}o&&o.call(i,t)}else{var d,c=_createForOfIteratorHelper(t);try{for(c.s();!(d=c.n()).done;){d.value.style.opacity=n}}catch(t){c.e(t)}finally{c.f()}requestAnimationFrame(e)}}()}},{key:"fadeIn",value:function(t,e,o,i){var n=this;t=this.wrap(t);var s,a=_createForOfIteratorHelper(t);try{for(a.s();!(s=a.n()).done;){var r=s.value;r.style.opacity=0,r.style.display=i||"block"}}catch(t){a.e(t)}finally{a.f()}var l=parseFloat(t[0].dataset.opacityTarget||1),d=16.66666*l/(e||300);!function e(){var i=parseFloat(t[0].style.opacity);if((i+=d)>l){var s,a=_createForOfIteratorHelper(t);try{for(a.s();!(s=a.n()).done;){s.value.style.opacity=""}}catch(t){a.e(t)}finally{a.f()}o&&o.call(n,t)}else{var r,c=_createForOfIteratorHelper(t);try{for(c.s();!(r=c.n()).done;){r.value.style.opacity=i}}catch(t){c.e(t)}finally{c.f()}requestAnimationFrame(e)}}()}},{key:"hide",value:function(t){t=this.wrap(t);var e,o=_createForOfIteratorHelper(t);try{for(o.s();!(e=o.n()).done;){var i=e.value;i.dataset.initialDisplay=i.style.display,i.style.display="none"}}catch(t){o.e(t)}finally{o.f()}}},{key:"show",value:function(t,e){t=this.wrap(t);var o,i=_createForOfIteratorHelper(t);try{for(i.s();!(o=i.n()).done;){var n=o.value;n.style.display=n.dataset.initialDisplay||e||"block"}}catch(t){i.e(t)}finally{i.f()}}},{key:"wrap",value:function(t){return"function"==typeof t[Symbol.iterator]&&"string"!=typeof t?t:[t]}},{key:"on",value:function(t,e){t=this.wrap(t);var o,i=_createForOfIteratorHelper(this.elements);try{for(i.s();!(o=i.n()).done;){var n=o.value;n.fullyNamespacedEvents||(n.fullyNamespacedEvents={});var s,a=_createForOfIteratorHelper(t);try{for(a.s();!(s=a.n()).done;){var r=s.value;n.fullyNamespacedEvents[r]=e,n.addEventListener(r,e)}}catch(t){a.e(t)}finally{a.f()}}}catch(t){i.e(t)}finally{i.f()}return this}},{key:"off",value:function(t){t=this.wrap(t);var e,o=_createForOfIteratorHelper(this.elements);try{for(o.s();!(e=o.n()).done;){var i,n=e.value,s=_createForOfIteratorHelper(t);try{for(s.s();!(i=s.n()).done;){var a=i.value;void 0!==n.fullyNamespacedEvents&&a in n.fullyNamespacedEvents&&n.removeEventListener(a,n.fullyNamespacedEvents[a])}}catch(t){s.e(t)}finally{s.f()}}}catch(t){o.e(t)}finally{o.f()}return this}},{key:"open",value:function(t){t=t||this.elements[0],"undefined"!=typeof jQuery&&t instanceof jQuery&&(t=t.get(0)),this.initialImageIndex=this.elements.indexOf(t),this.initialImageIndex>-1&&this.openImage(t)}},{key:"next",value:function(){this.loadImage(1)}},{key:"prev",value:function(){this.loadImage(-1)}},{key:"destroy",value:function(){this.off(["close."+this.eventNamespace,"closed."+this.eventNamespace,"nextImageLoaded."+this.eventNamespace,"prevImageLoaded."+this.eventNamespace,"change."+this.eventNamespace,"nextDone."+this.eventNamespace,"prevDone."+this.eventNamespace,"error."+this.eventNamespace,"changed."+this.eventNamespace,"next."+this.eventNamespace,"prev."+this.eventNamespace,"show."+this.eventNamespace,"shown."+this.eventNamespace]),this.removeEventListener(this.elements,"click."+this.eventNamespace),this.removeEventListener(document.body,"contextmenu."+this.eventNamespace),this.removeEventListener(document.body,"keyup."+this.eventNamespace),this.removeEventListener(this.domNodes.navigation.getElementsByTagName("button"),"click."+this.eventNamespace),this.removeEventListener(this.domNodes.closeButton,"click."+this.eventNamespace),this.removeEventListener(window,"resize."+this.eventNamespace),this.removeEventListener(window,"hashchange."+this.eventNamespace),this.close(),this.isOpen&&(document.body.removeChild(this.domNodes.wrapper),document.body.removeChild(this.domNodes.overlay)),this.elements=null}},{key:"refresh",value:function(){if(!this.initialSelector)throw"refreshing only works when you initialize using a selector!";var t=this.options,e=this.initialSelector;return this.destroy(),this.constructor(e,t),this}},{key:"hash",get:function(){return window.location.hash.substring(1)}}]),t}();!function(t,e,o,i){t.fn.simpleLightbox=function(t){return new SimpleLightbox(this.get(),t)}}(jQuery,window,document);
|
products/photocrati_nextgen/modules/lightbox/static/simplelightbox/simplelightbox.css
DELETED
@@ -1,298 +0,0 @@
|
|
1 |
-
/* line 27, ../sass/simplelightbox.scss */
|
2 |
-
body.hidden-scroll {
|
3 |
-
overflow: hidden;
|
4 |
-
}
|
5 |
-
|
6 |
-
/* line 30, ../sass/simplelightbox.scss */
|
7 |
-
.sl-overlay {
|
8 |
-
position: fixed;
|
9 |
-
left: 0;
|
10 |
-
right: 0;
|
11 |
-
top: 0;
|
12 |
-
bottom: 0;
|
13 |
-
background: #fff;
|
14 |
-
opacity: 0.95;
|
15 |
-
display: none;
|
16 |
-
z-index: 100050;
|
17 |
-
}
|
18 |
-
|
19 |
-
/* line 41, ../sass/simplelightbox.scss */
|
20 |
-
.sl-wrapper {
|
21 |
-
z-index: 100040;
|
22 |
-
}
|
23 |
-
/* line 43, ../sass/simplelightbox.scss */
|
24 |
-
.sl-wrapper button {
|
25 |
-
border: 0 none;
|
26 |
-
background: transparent;
|
27 |
-
font-size: 28px;
|
28 |
-
padding: 0;
|
29 |
-
cursor: pointer;
|
30 |
-
}
|
31 |
-
/* line 49, ../sass/simplelightbox.scss */
|
32 |
-
.sl-wrapper button:hover {
|
33 |
-
opacity: 0.7;
|
34 |
-
}
|
35 |
-
/* line 54, ../sass/simplelightbox.scss */
|
36 |
-
.sl-wrapper .sl-close {
|
37 |
-
display: none;
|
38 |
-
position: fixed;
|
39 |
-
right: 30px;
|
40 |
-
top: 30px;
|
41 |
-
z-index: 100060;
|
42 |
-
margin-top: -14px;
|
43 |
-
margin-right: -14px;
|
44 |
-
height: 44px;
|
45 |
-
width: 44px;
|
46 |
-
line-height: 44px;
|
47 |
-
font-family: Arial, Baskerville, monospace;
|
48 |
-
color: #000;
|
49 |
-
font-size: 3rem;
|
50 |
-
}
|
51 |
-
/* line 69, ../sass/simplelightbox.scss */
|
52 |
-
.sl-wrapper .sl-close:focus {
|
53 |
-
outline: none;
|
54 |
-
}
|
55 |
-
/* line 74, ../sass/simplelightbox.scss */
|
56 |
-
.sl-wrapper .sl-counter {
|
57 |
-
display: none;
|
58 |
-
position: fixed;
|
59 |
-
top: 30px;
|
60 |
-
left: 30px;
|
61 |
-
z-index: 100060;
|
62 |
-
color: #000;
|
63 |
-
font-size: 1rem;
|
64 |
-
}
|
65 |
-
/* line 84, ../sass/simplelightbox.scss */
|
66 |
-
.sl-wrapper .sl-navigation {
|
67 |
-
width: 100%;
|
68 |
-
display: none;
|
69 |
-
}
|
70 |
-
/* line 87, ../sass/simplelightbox.scss */
|
71 |
-
.sl-wrapper .sl-navigation button {
|
72 |
-
position: fixed;
|
73 |
-
top: 50%;
|
74 |
-
margin-top: -22px;
|
75 |
-
height: 44px;
|
76 |
-
width: 22px;
|
77 |
-
line-height: 44px;
|
78 |
-
text-align: center;
|
79 |
-
display: block;
|
80 |
-
z-index: 100060;
|
81 |
-
font-family: Arial, Baskerville, monospace;
|
82 |
-
color: #000;
|
83 |
-
}
|
84 |
-
/* line 99, ../sass/simplelightbox.scss */
|
85 |
-
.sl-wrapper .sl-navigation button.sl-next {
|
86 |
-
right: 5px;
|
87 |
-
font-size: 2rem;
|
88 |
-
}
|
89 |
-
/* line 104, ../sass/simplelightbox.scss */
|
90 |
-
.sl-wrapper .sl-navigation button.sl-prev {
|
91 |
-
left: 5px;
|
92 |
-
font-size: 2rem;
|
93 |
-
}
|
94 |
-
/* line 109, ../sass/simplelightbox.scss */
|
95 |
-
.sl-wrapper .sl-navigation button:focus {
|
96 |
-
outline: none;
|
97 |
-
}
|
98 |
-
@media (min-width: 35.5em) {
|
99 |
-
/* line 87, ../sass/simplelightbox.scss */
|
100 |
-
.sl-wrapper .sl-navigation button {
|
101 |
-
width: 44px;
|
102 |
-
}
|
103 |
-
/* line 116, ../sass/simplelightbox.scss */
|
104 |
-
.sl-wrapper .sl-navigation button.sl-next {
|
105 |
-
right: 10px;
|
106 |
-
font-size: 3rem;
|
107 |
-
}
|
108 |
-
/* line 121, ../sass/simplelightbox.scss */
|
109 |
-
.sl-wrapper .sl-navigation button.sl-prev {
|
110 |
-
left: 10px;
|
111 |
-
font-size: 3rem;
|
112 |
-
}
|
113 |
-
}
|
114 |
-
@media (min-width: 50em) {
|
115 |
-
/* line 87, ../sass/simplelightbox.scss */
|
116 |
-
.sl-wrapper .sl-navigation button {
|
117 |
-
width: 44px;
|
118 |
-
}
|
119 |
-
/* line 129, ../sass/simplelightbox.scss */
|
120 |
-
.sl-wrapper .sl-navigation button.sl-next {
|
121 |
-
right: 20px;
|
122 |
-
font-size: 3rem;
|
123 |
-
}
|
124 |
-
/* line 134, ../sass/simplelightbox.scss */
|
125 |
-
.sl-wrapper .sl-navigation button.sl-prev {
|
126 |
-
left: 20px;
|
127 |
-
font-size: 3rem;
|
128 |
-
}
|
129 |
-
}
|
130 |
-
/* line 142, ../sass/simplelightbox.scss */
|
131 |
-
.sl-wrapper .sl-image {
|
132 |
-
position: fixed;
|
133 |
-
-ms-touch-action: none;
|
134 |
-
touch-action: none;
|
135 |
-
z-index: 100060;
|
136 |
-
}
|
137 |
-
/* line 147, ../sass/simplelightbox.scss */
|
138 |
-
.sl-wrapper .sl-image img {
|
139 |
-
margin: 0;
|
140 |
-
padding: 0;
|
141 |
-
display: block;
|
142 |
-
border: 0 none;
|
143 |
-
}
|
144 |
-
@media (min-width: 35.5em) {
|
145 |
-
/* line 147, ../sass/simplelightbox.scss */
|
146 |
-
.sl-wrapper .sl-image img {
|
147 |
-
border: 0 none;
|
148 |
-
}
|
149 |
-
}
|
150 |
-
@media (min-width: 50em) {
|
151 |
-
/* line 147, ../sass/simplelightbox.scss */
|
152 |
-
.sl-wrapper .sl-image img {
|
153 |
-
border: 0 none;
|
154 |
-
}
|
155 |
-
}
|
156 |
-
/* line 160, ../sass/simplelightbox.scss */
|
157 |
-
.sl-wrapper .sl-image iframe {
|
158 |
-
background: #000;
|
159 |
-
border: 0 none;
|
160 |
-
}
|
161 |
-
@media (min-width: 35.5em) {
|
162 |
-
/* line 160, ../sass/simplelightbox.scss */
|
163 |
-
.sl-wrapper .sl-image iframe {
|
164 |
-
border: 0 none;
|
165 |
-
}
|
166 |
-
}
|
167 |
-
@media (min-width: 50em) {
|
168 |
-
/* line 160, ../sass/simplelightbox.scss */
|
169 |
-
.sl-wrapper .sl-image iframe {
|
170 |
-
border: 0 none;
|
171 |
-
}
|
172 |
-
}
|
173 |
-
/* line 170, ../sass/simplelightbox.scss */
|
174 |
-
.sl-wrapper .sl-image .sl-caption {
|
175 |
-
display: none;
|
176 |
-
padding: 10px;
|
177 |
-
color: #fff;
|
178 |
-
background: rgba(0, 0, 0, 0.8);
|
179 |
-
font-size: 1rem;
|
180 |
-
position: absolute;
|
181 |
-
bottom: 0;
|
182 |
-
left: 0;
|
183 |
-
right: 0;
|
184 |
-
box-sizing: border-box; /* Added by Imagely @ 2018-09-24 for compatibility with Photocrati theme */
|
185 |
-
}
|
186 |
-
/* line 181, ../sass/simplelightbox.scss */
|
187 |
-
.sl-wrapper .sl-image .sl-caption.pos-top {
|
188 |
-
bottom: auto;
|
189 |
-
top: 0;
|
190 |
-
}
|
191 |
-
/* line 186, ../sass/simplelightbox.scss */
|
192 |
-
.sl-wrapper .sl-image .sl-caption.pos-outside {
|
193 |
-
bottom: auto;
|
194 |
-
}
|
195 |
-
/* line 191, ../sass/simplelightbox.scss */
|
196 |
-
.sl-wrapper .sl-image .sl-download {
|
197 |
-
display: none;
|
198 |
-
position: absolute;
|
199 |
-
bottom: 5px;
|
200 |
-
right: 5px;
|
201 |
-
color: #000;
|
202 |
-
z-index: 100060;
|
203 |
-
}
|
204 |
-
|
205 |
-
/* line 202, ../sass/simplelightbox.scss */
|
206 |
-
.sl-spinner {
|
207 |
-
display: none;
|
208 |
-
border: 5px solid #333;
|
209 |
-
border-radius: 40px;
|
210 |
-
height: 40px;
|
211 |
-
left: 50%;
|
212 |
-
margin: -20px 0 0 -20px;
|
213 |
-
opacity: 0;
|
214 |
-
position: fixed;
|
215 |
-
top: 50%;
|
216 |
-
width: 40px;
|
217 |
-
z-index: 100007;
|
218 |
-
-webkit-animation: pulsate 1s ease-out infinite;
|
219 |
-
-moz-animation: pulsate 1s ease-out infinite;
|
220 |
-
-ms-animation: pulsate 1s ease-out infinite;
|
221 |
-
-o-animation: pulsate 1s ease-out infinite;
|
222 |
-
animation: pulsate 1s ease-out infinite;
|
223 |
-
}
|
224 |
-
|
225 |
-
/* line 221, ../sass/simplelightbox.scss */
|
226 |
-
.sl-scrollbar-measure {
|
227 |
-
position: absolute;
|
228 |
-
top: -9999px;
|
229 |
-
width: 50px;
|
230 |
-
height: 50px;
|
231 |
-
overflow: scroll;
|
232 |
-
}
|
233 |
-
|
234 |
-
@-webkit-keyframes pulsate {
|
235 |
-
0% {
|
236 |
-
transform: scale(0.1);
|
237 |
-
opacity: 0.0;
|
238 |
-
}
|
239 |
-
50% {
|
240 |
-
opacity: 1;
|
241 |
-
}
|
242 |
-
100% {
|
243 |
-
transform: scale(1.2);
|
244 |
-
opacity: 0;
|
245 |
-
}
|
246 |
-
}
|
247 |
-
@keyframes pulsate {
|
248 |
-
0% {
|
249 |
-
transform: scale(0.1);
|
250 |
-
opacity: 0.0;
|
251 |
-
}
|
252 |
-
50% {
|
253 |
-
opacity: 1;
|
254 |
-
}
|
255 |
-
100% {
|
256 |
-
transform: scale(1.2);
|
257 |
-
opacity: 0;
|
258 |
-
}
|
259 |
-
}
|
260 |
-
@-moz-keyframes pulsate {
|
261 |
-
0% {
|
262 |
-
transform: scale(0.1);
|
263 |
-
opacity: 0.0;
|
264 |
-
}
|
265 |
-
50% {
|
266 |
-
opacity: 1;
|
267 |
-
}
|
268 |
-
100% {
|
269 |
-
transform: scale(1.2);
|
270 |
-
opacity: 0;
|
271 |
-
}
|
272 |
-
}
|
273 |
-
@-o-keyframes pulsate {
|
274 |
-
0% {
|
275 |
-
transform: scale(0.1);
|
276 |
-
opacity: 0.0;
|
277 |
-
}
|
278 |
-
50% {
|
279 |
-
opacity: 1;
|
280 |
-
}
|
281 |
-
100% {
|
282 |
-
transform: scale(1.2);
|
283 |
-
opacity: 0;
|
284 |
-
}
|
285 |
-
}
|
286 |
-
@-ms-keyframes pulsate {
|
287 |
-
0% {
|
288 |
-
transform: scale(0.1);
|
289 |
-
opacity: 0.0;
|
290 |
-
}
|
291 |
-
50% {
|
292 |
-
opacity: 1;
|
293 |
-
}
|
294 |
-
100% {
|
295 |
-
transform: scale(1.2);
|
296 |
-
opacity: 0;
|
297 |
-
}
|
298 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
products/photocrati_nextgen/modules/lightbox/static/simplelightbox/simplelightbox.min.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
.sl-wrapper .sl-close:focus,.sl-wrapper .sl-navigation button:focus{outline:0}body.hidden-scroll{overflow:hidden}.sl-overlay{position:fixed;left:0;right:0;top:0;bottom:0;background:#fff;opacity:.95;display:none;z-index:100050}.sl-wrapper .sl-close,.sl-wrapper .sl-counter{top:30px;color:#000;position:fixed;display:none}.sl-wrapper{z-index:100040}.sl-wrapper button{border:0;background:0 0;font-size:28px;padding:0;cursor:pointer}.sl-wrapper button:hover{opacity:.7}.sl-wrapper .sl-close{right:30px;z-index:100060;margin-top:-14px;margin-right:-14px;height:44px;width:44px;line-height:44px;font-family:Arial,Baskerville,monospace;font-size:3rem}.sl-wrapper .sl-counter{left:30px;z-index:100060;font-size:1rem}.sl-wrapper .sl-navigation{width:100%;display:none}.sl-wrapper .sl-navigation button{position:fixed;top:50%;margin-top:-22px;height:44px;width:22px;line-height:44px;text-align:center;display:block;z-index:100060;font-family:Arial,Baskerville,monospace;color:#000}.sl-wrapper .sl-navigation button.sl-next{right:5px;font-size:2rem}.sl-wrapper .sl-navigation button.sl-prev{left:5px;font-size:2rem}.sl-wrapper .sl-image{position:fixed;-ms-touch-action:none;touch-action:none;z-index:100060}.sl-wrapper .sl-image img{margin:0;padding:0;display:block;border:0}.sl-wrapper .sl-image iframe{background:#000;border:0}@media (min-width:35.5em){.sl-wrapper .sl-navigation button{width:44px}.sl-wrapper .sl-navigation button.sl-next{right:10px;font-size:3rem}.sl-wrapper .sl-navigation button.sl-prev{left:10px;font-size:3rem}.sl-wrapper .sl-image iframe,.sl-wrapper .sl-image img{border:0}}@media (min-width:50em){.sl-wrapper .sl-navigation button{width:44px}.sl-wrapper .sl-navigation button.sl-next{right:20px;font-size:3rem}.sl-wrapper .sl-navigation button.sl-prev{left:20px;font-size:3rem}.sl-wrapper .sl-image iframe,.sl-wrapper .sl-image img{border:0}}.sl-wrapper .sl-image .sl-caption{display:none;padding:10px;color:#fff;background:rgba(0,0,0,.8);font-size:1rem;position:absolute;bottom:0;left:0;right:0;box-sizing:border-box}.sl-wrapper .sl-image .sl-caption.pos-top{bottom:auto;top:0}.sl-wrapper .sl-image .sl-caption.pos-outside{bottom:auto}.sl-wrapper .sl-image .sl-download{display:none;position:absolute;bottom:5px;right:5px;color:#000;z-index:100060}.sl-spinner{display:none;border:5px solid #333;border-radius:40px;height:40px;left:50%;margin:-20px 0 0 -20px;opacity:0;position:fixed;top:50%;width:40px;z-index:100007;-webkit-animation:pulsate 1s ease-out infinite;-moz-animation:pulsate 1s ease-out infinite;-ms-animation:pulsate 1s ease-out infinite;-o-animation:pulsate 1s ease-out infinite;animation:pulsate 1s ease-out infinite}.sl-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@-webkit-keyframes pulsate{0%{transform:scale(.1);opacity:0}50%{opacity:1}100%{transform:scale(1.2);opacity:0}}@keyframes pulsate{0%{transform:scale(.1);opacity:0}50%{opacity:1}100%{transform:scale(1.2);opacity:0}}@-moz-keyframes pulsate{0%{transform:scale(.1);opacity:0}50%{opacity:1}100%{transform:scale(1.2);opacity:0}}@-o-keyframes pulsate{0%{transform:scale(.1);opacity:0}50%{opacity:1}100%{transform:scale(1.2);opacity:0}}@-ms-keyframes pulsate{0%,100%{opacity:0}0%{transform:scale(.1)}50%{opacity:1}100%{transform:scale(1.2)}}
|
|
products/photocrati_nextgen/modules/nextgen_admin/module.nextgen_admin.php
CHANGED
@@ -496,35 +496,41 @@ class M_NextGen_Admin extends C_Base_Module
|
|
496 |
$wizard->set_step_target('add_page_menu', '#menu-pages a[href*="post-new.php?post_type=page"]', 'right center', 'left center');
|
497 |
$wizard->set_step_view('add_page_menu', '#menu-pages a[href*="post-new.php?post_type=page"]');
|
498 |
|
499 |
-
if ($this->is_block_editor())
|
|
|
|
|
500 |
$wizard->add_step('input_page_title');
|
501 |
$wizard->set_step_text('input_page_title', __('Type in a title for your page.', 'nggallery'));
|
502 |
$wizard->set_step_target('input_page_title', '.editor-post-title__input', 'bottom center', 'top center');
|
503 |
$wizard->set_step_view('input_page_title', '.editor-post-title__input');
|
504 |
-
|
|
|
505 |
$wizard->add_step('add_block');
|
506 |
$wizard->set_step_text('add_block', __('Now click the button to insert a block.', 'nggallery'));
|
507 |
-
$wizard->set_step_target('add_block', 'button.editor-inserter__toggle', 'right center', 'left center');
|
508 |
-
$wizard->set_step_view('add_block', 'button.editor-inserter__toggle');
|
509 |
$wizard->set_step_lazy('add_block', true);
|
510 |
|
|
|
511 |
$wizard->add_step('search_nextgen');
|
512 |
$wizard->set_step_text('search_nextgen', __('Type "nextgen" to search for the NextGEN block.', 'nggallery'));
|
513 |
-
$wizard->set_step_target('search_nextgen', 'input.editor-inserter__search', 'right center', 'left center');
|
514 |
-
$wizard->set_step_view('search_nextgen', 'input.editor-inserter__search');
|
515 |
$wizard->set_step_lazy('search_nextgen', true);
|
516 |
|
|
|
517 |
$wizard->add_step('add_ngg_block');
|
518 |
-
$wizard->set_step_text('add_ngg_block', __('Click on the NextGEN block to add it.', 'nggallery'));
|
519 |
-
$wizard->set_step_target('add_ngg_block', 'button.editor-block-list-item-imagely-nextgen-gallery', 'right center', 'left center');
|
520 |
-
$wizard->set_step_view('add_ngg_block', 'button.editor-block-list-item-imagely-nextgen-gallery');
|
521 |
$wizard->set_step_lazy('add_ngg_block', true);
|
522 |
-
$wizard->set_step_condition('add_ngg_block', 'wait', '1500');
|
523 |
|
|
|
524 |
$wizard->add_step('add-ngg-gallery');
|
525 |
-
$wizard->set_step_text('add-ngg-gallery', __('Now click the "Add Gallery" button to open NextGEN\'s Insert Gallery Window.', 'nggallery'));
|
526 |
-
$wizard->set_step_target('add-ngg-gallery', '.add-ngg-gallery', 'bottom center', 'top center');
|
527 |
-
$wizard->set_step_view('add-ngg-gallery', '.add-ngg-gallery');
|
528 |
$wizard->set_step_lazy('add-ngg-gallery', true);
|
529 |
}
|
530 |
else {
|
496 |
$wizard->set_step_target('add_page_menu', '#menu-pages a[href*="post-new.php?post_type=page"]', 'right center', 'left center');
|
497 |
$wizard->set_step_view('add_page_menu', '#menu-pages a[href*="post-new.php?post_type=page"]');
|
498 |
|
499 |
+
if ($this->is_block_editor())
|
500 |
+
{
|
501 |
+
// Input page title
|
502 |
$wizard->add_step('input_page_title');
|
503 |
$wizard->set_step_text('input_page_title', __('Type in a title for your page.', 'nggallery'));
|
504 |
$wizard->set_step_target('input_page_title', '.editor-post-title__input', 'bottom center', 'top center');
|
505 |
$wizard->set_step_view('input_page_title', '.editor-post-title__input');
|
506 |
+
|
507 |
+
// Add NextGen block
|
508 |
$wizard->add_step('add_block');
|
509 |
$wizard->set_step_text('add_block', __('Now click the button to insert a block.', 'nggallery'));
|
510 |
+
$wizard->set_step_target('add_block', 'button.block-editor-inserter__toggle', 'right center', 'left center');
|
511 |
+
$wizard->set_step_view('add_block', 'button.block-editor-inserter__toggle');
|
512 |
$wizard->set_step_lazy('add_block', true);
|
513 |
|
514 |
+
// Search for NextGen block
|
515 |
$wizard->add_step('search_nextgen');
|
516 |
$wizard->set_step_text('search_nextgen', __('Type "nextgen" to search for the NextGEN block.', 'nggallery'));
|
517 |
+
$wizard->set_step_target( 'search_nextgen', 'input.block-editor-inserter__search', 'right center', 'left center');
|
518 |
+
$wizard->set_step_view( 'search_nextgen', 'input.block-editor-inserter__search');
|
519 |
$wizard->set_step_lazy('search_nextgen', true);
|
520 |
|
521 |
+
// Select NextGen block
|
522 |
$wizard->add_step('add_ngg_block');
|
523 |
+
$wizard->set_step_text( 'add_ngg_block', __('Click on the NextGEN block to add it.', 'nggallery'));
|
524 |
+
$wizard->set_step_target( 'add_ngg_block', 'button.editor-block-list-item-imagely-nextgen-gallery', 'right center', 'left center');
|
525 |
+
$wizard->set_step_view( 'add_ngg_block', 'button.editor-block-list-item-imagely-nextgen-gallery');
|
526 |
$wizard->set_step_lazy('add_ngg_block', true);
|
527 |
+
$wizard->set_step_condition( 'add_ngg_block', 'wait', '1500');
|
528 |
|
529 |
+
// Insert a NextGen Gallery
|
530 |
$wizard->add_step('add-ngg-gallery');
|
531 |
+
$wizard->set_step_text( 'add-ngg-gallery', __('Now click the "Add Gallery" button to open NextGEN\'s Insert Gallery Window.', 'nggallery'));
|
532 |
+
$wizard->set_step_target( 'add-ngg-gallery', '.add-ngg-gallery', 'bottom center', 'top center');
|
533 |
+
$wizard->set_step_view( 'add-ngg-gallery', '.add-ngg-gallery');
|
534 |
$wizard->set_step_lazy('add-ngg-gallery', true);
|
535 |
}
|
536 |
else {
|
products/photocrati_nextgen/modules/nextgen_admin/static/ngg_progressbar.js
CHANGED
@@ -3,6 +3,7 @@
|
|
3 |
$.nggProgressBar = function(options){
|
4 |
var progressBar = {
|
5 |
defaults: {
|
|
|
6 |
starting_value: 0,
|
7 |
infinite: false,
|
8 |
in_progress_text: 'In progress...',
|
3 |
$.nggProgressBar = function(options){
|
4 |
var progressBar = {
|
5 |
defaults: {
|
6 |
+
title: '',
|
7 |
starting_value: 0,
|
8 |
infinite: false,
|
9 |
in_progress_text: 'In progress...',
|
products/photocrati_nextgen/modules/nextgen_admin/static/ngg_progressbar.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(t){t.nggProgressBar=function(i){var e={defaults:{starting_value:0,infinite:!1,in_progress_text:"In progress...",finished_text:"Done!"},init:function(i){this.options=t.extend(this.defaults,i),this.gritter_id=this.find_gritter(window).add({progressBar:this,sticky:!0,title:this.options.title,text:"<div class='ngg_progressbar'><div></div></div>"}),this.find_gritter_el(window),this.options.infinite&&this.gritter_el.find(".ngg_progressbar").addClass("infinite"),this.set(this.options.starting_value)},set:function(t,i){isNaN(t)&&(i=t,t=100),t+="%",void 0===i&&(i=t),this.status_el.animate({width:t}).text(i)},close:function(t){void 0===t&&(t=1e3);var i=this.find_gritter(window),e=this.gritter_id;setTimeout(function(){i.remove(e)},t)},find_parent:function(t){var i=t;try{for(;i.document!==i.parent.document;)i=i.parent}catch(t){"undefined"!=typeof console&&console.log(t)}return i},find_gritter:function(t){return this.find_parent(t).jQuery.gritter},find_gritter_el:function(i){var e="#gritter-item-"+this.gritter_id;return this.gritter_el=t(e),0==this.gritter_el.length&&(this.gritter_el=this.find_parent(i).jQuery(e)),this.status_el=this.gritter_el.find(".ngg_progressbar:first div"),this.gritter_el.data("nggProgressBar",this),this.gritter_el}};return e.init(i),e}}(jQuery);
|
1 |
+
!function(t){t.nggProgressBar=function(i){var e={defaults:{title:"",starting_value:0,infinite:!1,in_progress_text:"In progress...",finished_text:"Done!"},init:function(i){this.options=t.extend(this.defaults,i),this.gritter_id=this.find_gritter(window).add({progressBar:this,sticky:!0,title:this.options.title,text:"<div class='ngg_progressbar'><div></div></div>"}),this.find_gritter_el(window),this.options.infinite&&this.gritter_el.find(".ngg_progressbar").addClass("infinite"),this.set(this.options.starting_value)},set:function(t,i){isNaN(t)&&(i=t,t=100),t+="%",void 0===i&&(i=t),this.status_el.animate({width:t}).text(i)},close:function(t){void 0===t&&(t=1e3);var i=this.find_gritter(window),e=this.gritter_id;setTimeout(function(){i.remove(e)},t)},find_parent:function(t){var i=t;try{for(;i.document!==i.parent.document;)i=i.parent}catch(t){"undefined"!=typeof console&&console.log(t)}return i},find_gritter:function(t){return this.find_parent(t).jQuery.gritter},find_gritter_el:function(i){var e="#gritter-item-"+this.gritter_id;return this.gritter_el=t(e),0==this.gritter_el.length&&(this.gritter_el=this.find_parent(i).jQuery(e)),this.status_el=this.gritter_el.find(".ngg_progressbar:first div"),this.gritter_el.data("nggProgressBar",this),this.gritter_el}};return e.init(i),e}}(jQuery);
|
products/photocrati_nextgen/modules/nextgen_basic_album/module.nextgen_basic_album.php
CHANGED
@@ -26,7 +26,7 @@ class M_NextGen_Basic_Album extends C_Base_Module
|
|
26 |
NGG_BASIC_ALBUM,
|
27 |
'NextGEN Basic Album',
|
28 |
"Provides support for NextGEN's Basic Album",
|
29 |
-
'3.
|
30 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
31 |
'Imagely',
|
32 |
'https://www.imagely.com'
|
26 |
NGG_BASIC_ALBUM,
|
27 |
'NextGEN Basic Album',
|
28 |
"Provides support for NextGEN's Basic Album",
|
29 |
+
'3.3.6',
|
30 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
31 |
'Imagely',
|
32 |
'https://www.imagely.com'
|
products/photocrati_nextgen/modules/nextgen_basic_album/package.module.nextgen_basic_album.php
CHANGED
@@ -437,16 +437,7 @@ class A_NextGen_Basic_Album_Controller extends Mixin_NextGen_Basic_Pagination
|
|
437 |
return '';
|
438 |
}
|
439 |
$GLOBALS['nggShowGallery'] = TRUE;
|
440 |
-
|
441 |
-
// the user passed in a gallery id instead
|
442 |
-
$mapper = C_Gallery_Mapper::get_instance();
|
443 |
-
$tmp = $mapper->select()->where(array('slug = %s', $gallery))->limit(1)->run_query();
|
444 |
-
// NextGen turns "This & That" into "this-&-that" when assigning gallery slugs
|
445 |
-
if (empty($tmp) && strpos($gallery, '&') !== FALSE) {
|
446 |
-
$tmp = $mapper->select()->where(array('slug = %s', str_replace('&', '&', $gallery)))->limit(1)->run_query();
|
447 |
-
}
|
448 |
-
$result = reset($tmp);
|
449 |
-
unset($tmp);
|
450 |
if ($result) {
|
451 |
$gallery = $result->{$result->id_field};
|
452 |
}
|
@@ -464,9 +455,7 @@ class A_NextGen_Basic_Album_Controller extends Mixin_NextGen_Basic_Pagination
|
|
464 |
} else {
|
465 |
if ($album = $this->param('album')) {
|
466 |
// Are we to display a sub-album?
|
467 |
-
$
|
468 |
-
$result = $mapper->select()->where(array('slug = %s', $album))->limit(1)->run_query();
|
469 |
-
$result = array_pop($result);
|
470 |
$album_sub = $result ? $result->{$result->id_field} : null;
|
471 |
if ($album_sub != null) {
|
472 |
$album = $album_sub;
|
437 |
return '';
|
438 |
}
|
439 |
$GLOBALS['nggShowGallery'] = TRUE;
|
440 |
+
$result = C_Gallery_Mapper::get_instance()->get_by_slug($gallery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
441 |
if ($result) {
|
442 |
$gallery = $result->{$result->id_field};
|
443 |
}
|
455 |
} else {
|
456 |
if ($album = $this->param('album')) {
|
457 |
// Are we to display a sub-album?
|
458 |
+
$result = C_Album_Mapper::get_instance()->get_by_slug($album);
|
|
|
|
|
459 |
$album_sub = $result ? $result->{$result->id_field} : null;
|
460 |
if ($album_sub != null) {
|
461 |
$album = $album_sub;
|
products/photocrati_nextgen/modules/nextgen_data/module.nextgen_data.php
CHANGED
@@ -22,7 +22,7 @@ class M_NextGen_Data extends C_Base_Module
|
|
22 |
'photocrati-nextgen-data',
|
23 |
'NextGEN Data Tier',
|
24 |
"Provides a data tier for NextGEN gallery based on the DataMapper module",
|
25 |
-
'3.3.
|
26 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
27 |
'Imagely',
|
28 |
'https://www.imagely.com'
|
22 |
'photocrati-nextgen-data',
|
23 |
'NextGEN Data Tier',
|
24 |
"Provides a data tier for NextGEN gallery based on the DataMapper module",
|
25 |
+
'3.3.6',
|
26 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
27 |
'Imagely',
|
28 |
'https://www.imagely.com'
|
products/photocrati_nextgen/modules/nextgen_data/package.module.nextgen_data.php
CHANGED
@@ -212,6 +212,14 @@ class Mixin_Album_Mapper extends Mixin
|
|
212 |
}
|
213 |
return $retval;
|
214 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
/**
|
216 |
* Sets the defaults for an album
|
217 |
* @param C_DataMapper_Model|C_Album|stdClass $entity
|
@@ -840,6 +848,21 @@ class Mixin_Gallery_Mapper extends Mixin
|
|
840 |
{
|
841 |
return $entity->title;
|
842 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
843 |
function _save_entity($entity)
|
844 |
{
|
845 |
$storage = C_Gallery_Storage::get_instance();
|
@@ -3446,11 +3469,15 @@ class Mixin_GalleryStorage_Base extends Mixin
|
|
3446 |
}
|
3447 |
/**
|
3448 |
* Sets a NGG image as a post thumbnail for the given post
|
|
|
|
|
|
|
|
|
|
|
3449 |
*/
|
3450 |
function set_post_thumbnail($postId, $image, $only_create_attachment = FALSE)
|
3451 |
{
|
3452 |
$retval = FALSE;
|
3453 |
-
// attachment_id or FALSE
|
3454 |
// Get the post ID
|
3455 |
if (is_object($postId)) {
|
3456 |
$post = $postId;
|
@@ -4009,7 +4036,7 @@ class Mixin_GalleryStorage_Base_Dynamic extends Mixin
|
|
4009 |
$params = $this->object->get_image_size_params($image, $size, $params, $skip_defaults);
|
4010 |
$settings = C_NextGen_Settings::get_instance();
|
4011 |
// Get the image filename
|
4012 |
-
$filename = $this->object->
|
4013 |
$thumbnail = null;
|
4014 |
if ($size == 'full' && $settings->imgBackup == 1) {
|
4015 |
// XXX change this? 'full' should be the resized path and 'original' the _backup path
|
@@ -4313,6 +4340,11 @@ class Mixin_GalleryStorage_Base_Getters extends Mixin
|
|
4313 |
}
|
4314 |
function get_gallery_relpath($gallery)
|
4315 |
{
|
|
|
|
|
|
|
|
|
|
|
4316 |
return str_replace($this->object->get_gallery_root(), '', $this->get_gallery_abspath($gallery));
|
4317 |
}
|
4318 |
/**
|
@@ -5049,14 +5081,16 @@ class Mixin_GalleryStorage_Base_Management extends Mixin
|
|
5049 |
}
|
5050 |
/**
|
5051 |
* This class contains methods C_Gallery_Storage needs to interact with (like say, importing from) the WP Media Library
|
|
|
5052 |
* * @property C_Gallery_Storage $object
|
5053 |
*/
|
5054 |
class Mixin_GalleryStorage_Base_MediaLibrary extends Mixin
|
5055 |
{
|
5056 |
/**
|
5057 |
* Copies a NGG image to the media library and returns the attachment_id
|
5058 |
-
*
|
5059 |
-
* @
|
|
|
5060 |
*/
|
5061 |
function copy_to_media_library($image)
|
5062 |
{
|
@@ -5068,23 +5102,25 @@ class Mixin_GalleryStorage_Base_MediaLibrary extends Mixin
|
|
5068 |
$image = $mapper->find($imageId);
|
5069 |
}
|
5070 |
if ($image) {
|
|
|
5071 |
$wordpress_upload_dir = wp_upload_dir();
|
5072 |
-
|
5073 |
-
|
5074 |
-
|
5075 |
-
|
5076 |
$image_abspath = C_Gallery_Storage::get_instance()->get_image_abspath($image, "full");
|
5077 |
-
$new_file_path = $
|
5078 |
$image_data = getimagesize($image_abspath);
|
5079 |
$new_file_mime = $image_data['mime'];
|
|
|
5080 |
while (file_exists($new_file_path)) {
|
5081 |
$i++;
|
5082 |
-
$new_file_path = $
|
5083 |
}
|
5084 |
if (@copy($image_abspath, $new_file_path)) {
|
5085 |
-
$upload_id = wp_insert_attachment(
|
5086 |
update_post_meta($upload_id, '_ngg_image_id', intval($image->pid));
|
5087 |
-
// wp_generate_attachment_metadata()
|
5088 |
require_once ABSPATH . 'wp-admin/includes/image.php';
|
5089 |
$image_meta = wp_generate_attachment_metadata($upload_id, $new_file_path);
|
5090 |
// Generate and save the attachment metas into the database
|
@@ -5096,6 +5132,7 @@ class Mixin_GalleryStorage_Base_MediaLibrary extends Mixin
|
|
5096 |
}
|
5097 |
/**
|
5098 |
* Delete the given NGG image from the media library
|
|
|
5099 |
* @var int|stdClass $imageId
|
5100 |
*/
|
5101 |
function delete_from_media_library($imageId)
|
@@ -5113,7 +5150,7 @@ class Mixin_GalleryStorage_Base_MediaLibrary extends Mixin
|
|
5113 |
* Determines if the given NGG image id has been uploaded to the media library
|
5114 |
*
|
5115 |
* @param integer $imageId
|
5116 |
-
* @
|
5117 |
*/
|
5118 |
function is_in_media_library($imageId)
|
5119 |
{
|
212 |
}
|
213 |
return $retval;
|
214 |
}
|
215 |
+
/**
|
216 |
+
* @param string $slug
|
217 |
+
* @return null|stdClass|C_Album
|
218 |
+
*/
|
219 |
+
public function get_by_slug($slug)
|
220 |
+
{
|
221 |
+
return array_pop($this->object->select()->where(['slug = %s', sanitize_title($slug)])->limit(1)->run_query());
|
222 |
+
}
|
223 |
/**
|
224 |
* Sets the defaults for an album
|
225 |
* @param C_DataMapper_Model|C_Album|stdClass $entity
|
848 |
{
|
849 |
return $entity->title;
|
850 |
}
|
851 |
+
/**
|
852 |
+
* @param string $slug
|
853 |
+
* @return C_Gallery|stdClass|null
|
854 |
+
*/
|
855 |
+
public function get_by_slug($slug)
|
856 |
+
{
|
857 |
+
$sanitized_slug = sanitize_title($slug);
|
858 |
+
// Try finding the gallery by slug first; if nothing is found assume that the user passed a gallery id
|
859 |
+
$retval = $this->object->select()->where(array('slug = %s', $sanitized_slug))->limit(1)->run_query();
|
860 |
+
// NextGen used to turn "This & That" into "this-&-that" when assigning gallery slugs
|
861 |
+
if (empty($retval) && strpos($slug, '&') !== FALSE) {
|
862 |
+
return $this->get_by_slug(str_replace('&', '&', $slug));
|
863 |
+
}
|
864 |
+
return reset($retval);
|
865 |
+
}
|
866 |
function _save_entity($entity)
|
867 |
{
|
868 |
$storage = C_Gallery_Storage::get_instance();
|
3469 |
}
|
3470 |
/**
|
3471 |
* Sets a NGG image as a post thumbnail for the given post
|
3472 |
+
*
|
3473 |
+
* @param int $postId
|
3474 |
+
* @param int|C_Image|stdClass $image
|
3475 |
+
* @param bool $only_create_attachment
|
3476 |
+
* @return int
|
3477 |
*/
|
3478 |
function set_post_thumbnail($postId, $image, $only_create_attachment = FALSE)
|
3479 |
{
|
3480 |
$retval = FALSE;
|
|
|
3481 |
// Get the post ID
|
3482 |
if (is_object($postId)) {
|
3483 |
$post = $postId;
|
4036 |
$params = $this->object->get_image_size_params($image, $size, $params, $skip_defaults);
|
4037 |
$settings = C_NextGen_Settings::get_instance();
|
4038 |
// Get the image filename
|
4039 |
+
$filename = $this->object->get_image_abspath($image, 'original');
|
4040 |
$thumbnail = null;
|
4041 |
if ($size == 'full' && $settings->imgBackup == 1) {
|
4042 |
// XXX change this? 'full' should be the resized path and 'original' the _backup path
|
4340 |
}
|
4341 |
function get_gallery_relpath($gallery)
|
4342 |
{
|
4343 |
+
// Special hack for home.pl: their document root is just '/'
|
4344 |
+
$root = $this->object->get_gallery_root();
|
4345 |
+
if ($root === '/') {
|
4346 |
+
return $this->get_gallery_abspath($gallery);
|
4347 |
+
}
|
4348 |
return str_replace($this->object->get_gallery_root(), '', $this->get_gallery_abspath($gallery));
|
4349 |
}
|
4350 |
/**
|
5081 |
}
|
5082 |
/**
|
5083 |
* This class contains methods C_Gallery_Storage needs to interact with (like say, importing from) the WP Media Library
|
5084 |
+
*
|
5085 |
* * @property C_Gallery_Storage $object
|
5086 |
*/
|
5087 |
class Mixin_GalleryStorage_Base_MediaLibrary extends Mixin
|
5088 |
{
|
5089 |
/**
|
5090 |
* Copies a NGG image to the media library and returns the attachment_id
|
5091 |
+
*
|
5092 |
+
* @param C_Image|int|stdClass $image
|
5093 |
+
* @return FALSE|int attachment_id
|
5094 |
*/
|
5095 |
function copy_to_media_library($image)
|
5096 |
{
|
5102 |
$image = $mapper->find($imageId);
|
5103 |
}
|
5104 |
if ($image) {
|
5105 |
+
$subdir = apply_filters('ngg_import_to_media_library_subdir', 'nggallery_import');
|
5106 |
$wordpress_upload_dir = wp_upload_dir();
|
5107 |
+
$path = $wordpress_upload_dir['path'] . DIRECTORY_SEPARATOR . $subdir;
|
5108 |
+
if (!file_exists($path)) {
|
5109 |
+
wp_mkdir_p($path);
|
5110 |
+
}
|
5111 |
$image_abspath = C_Gallery_Storage::get_instance()->get_image_abspath($image, "full");
|
5112 |
+
$new_file_path = $path . DIRECTORY_SEPARATOR . $image->filename;
|
5113 |
$image_data = getimagesize($image_abspath);
|
5114 |
$new_file_mime = $image_data['mime'];
|
5115 |
+
$i = 1;
|
5116 |
while (file_exists($new_file_path)) {
|
5117 |
$i++;
|
5118 |
+
$new_file_path = $path . DIRECTORY_SEPARATOR . $i . '_' . $image->filename;
|
5119 |
}
|
5120 |
if (@copy($image_abspath, $new_file_path)) {
|
5121 |
+
$upload_id = wp_insert_attachment(['guid' => $new_file_path, 'post_mime_type' => $new_file_mime, 'post_title' => preg_replace('/\\.[^.]+$/', '', $image->alttext), 'post_content' => '', 'post_status' => 'inherit'], $new_file_path);
|
5122 |
update_post_meta($upload_id, '_ngg_image_id', intval($image->pid));
|
5123 |
+
// wp_generate_attachment_metadata() comes from this file
|
5124 |
require_once ABSPATH . 'wp-admin/includes/image.php';
|
5125 |
$image_meta = wp_generate_attachment_metadata($upload_id, $new_file_path);
|
5126 |
// Generate and save the attachment metas into the database
|
5132 |
}
|
5133 |
/**
|
5134 |
* Delete the given NGG image from the media library
|
5135 |
+
*
|
5136 |
* @var int|stdClass $imageId
|
5137 |
*/
|
5138 |
function delete_from_media_library($imageId)
|
5150 |
* Determines if the given NGG image id has been uploaded to the media library
|
5151 |
*
|
5152 |
* @param integer $imageId
|
5153 |
+
* @return FALSE|int attachment_id
|
5154 |
*/
|
5155 |
function is_in_media_library($imageId)
|
5156 |
{
|
products/photocrati_nextgen/modules/nextgen_other_options/module.nextgen_other_options.php
CHANGED
@@ -23,7 +23,7 @@ class M_NextGen_Other_Options extends C_Base_Module
|
|
23 |
'photocrati-nextgen_other_options',
|
24 |
'Other Options',
|
25 |
'NextGEN Gallery Others Options Page',
|
26 |
-
'3.
|
27 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
28 |
'Imagely',
|
29 |
'https://www.imagely.com'
|
@@ -83,6 +83,7 @@ class M_NextGen_Other_Options extends C_Base_Module
|
|
83 |
{
|
84 |
$this->get_registry()->add_adapter('I_Ajax_Controller', 'A_Watermarking_Ajax_Actions');
|
85 |
$this->get_registry()->add_adapter('I_Ajax_Controller', 'A_Stylesheet_Ajax_Actions');
|
|
|
86 |
|
87 |
if (is_admin()) {
|
88 |
$this->get_registry()->add_adapter(
|
@@ -155,6 +156,7 @@ class M_NextGen_Other_Options extends C_Base_Module
|
|
155 |
function get_type_list()
|
156 |
{
|
157 |
return array(
|
|
|
158 |
'A_Image_Options_Form' => 'adapter.image_options_form.php',
|
159 |
'A_Lightbox_Manager_Form' => 'adapter.lightbox_manager_form.php',
|
160 |
'A_Miscellaneous_Form' => 'adapter.miscellaneous_form.php',
|
@@ -167,7 +169,6 @@ class M_NextGen_Other_Options extends C_Base_Module
|
|
167 |
'A_Watermarking_Ajax_Actions' => 'adapter.watermarking_ajax_actions.php',
|
168 |
'A_Watermarks_Form' => 'adapter.watermarks_form.php',
|
169 |
'A_Stylesheet_Ajax_Actions' => 'adapter.stylesheet_ajax_actions.php',
|
170 |
-
'C_Settings_Model' => 'class.settings_model.php',
|
171 |
'A_Custom_Lightbox_Form' => 'adapter.custom_lightbox_form.php',
|
172 |
'C_Settings_Model' => 'class.settings_model.php'
|
173 |
);
|
23 |
'photocrati-nextgen_other_options',
|
24 |
'Other Options',
|
25 |
'NextGEN Gallery Others Options Page',
|
26 |
+
'3.3.6',
|
27 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
28 |
'Imagely',
|
29 |
'https://www.imagely.com'
|
83 |
{
|
84 |
$this->get_registry()->add_adapter('I_Ajax_Controller', 'A_Watermarking_Ajax_Actions');
|
85 |
$this->get_registry()->add_adapter('I_Ajax_Controller', 'A_Stylesheet_Ajax_Actions');
|
86 |
+
$this->get_registry()->add_adapter('I_Ajax_Controller', 'A_Other_Options_Misc_Tab_Ajax');
|
87 |
|
88 |
if (is_admin()) {
|
89 |
$this->get_registry()->add_adapter(
|
156 |
function get_type_list()
|
157 |
{
|
158 |
return array(
|
159 |
+
'A_Other_Options_Misc_Tab_Ajax' => 'adapter.other_options_misc_tab_ajax.php',
|
160 |
'A_Image_Options_Form' => 'adapter.image_options_form.php',
|
161 |
'A_Lightbox_Manager_Form' => 'adapter.lightbox_manager_form.php',
|
162 |
'A_Miscellaneous_Form' => 'adapter.miscellaneous_form.php',
|
169 |
'A_Watermarking_Ajax_Actions' => 'adapter.watermarking_ajax_actions.php',
|
170 |
'A_Watermarks_Form' => 'adapter.watermarks_form.php',
|
171 |
'A_Stylesheet_Ajax_Actions' => 'adapter.stylesheet_ajax_actions.php',
|
|
|
172 |
'A_Custom_Lightbox_Form' => 'adapter.custom_lightbox_form.php',
|
173 |
'C_Settings_Model' => 'class.settings_model.php'
|
174 |
);
|
products/photocrati_nextgen/modules/nextgen_other_options/package.module.nextgen_other_options.php
CHANGED
@@ -313,8 +313,8 @@ class A_Lightbox_Manager_Form extends Mixin
|
|
313 |
}
|
314 |
}
|
315 |
/**
|
316 |
-
* Class A_Miscellaneous_Form
|
317 |
* @mixin C_Form
|
|
|
318 |
* @adapts I_Form using "miscellaneous" context
|
319 |
*/
|
320 |
class A_Miscellaneous_Form extends Mixin
|
@@ -327,9 +327,15 @@ class A_Miscellaneous_Form extends Mixin
|
|
327 |
{
|
328 |
return __('Miscellaneous', 'nggallery');
|
329 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
330 |
function render()
|
331 |
{
|
332 |
-
return $this->object->render_partial('photocrati-nextgen_other_options#misc_tab', array('mediarss_activated' => C_NextGen_Settings::get_instance()->useMediaRSS, 'mediarss_activated_label' => __('Add MediaRSS link?', 'nggallery'), 'mediarss_activated_help' => __('When enabled, adds a MediaRSS link to your header. Third-party web services can use this to publish your galleries', 'nggallery'), 'mediarss_activated_no' => __('No'), 'mediarss_activated_yes' => __('Yes'), 'galleries_in_feeds' => C_NextGen_Settings::get_instance()->galleries_in_feeds, 'galleries_in_feeds_label' => __('Display galleries in feeds', 'nggallery'), 'galleries_in_feeds_help' => __('NextGEN hides its gallery displays in feeds other than MediaRSS. This enables image galleries in feeds.', 'nggallery'), 'galleries_in_feeds_no' => __('No'), 'galleries_in_feeds_yes' => __('Yes'), 'cache_label' => __('Clear image cache', 'nggallery'), 'cache_confirmation' => __("Completely clear the NextGEN cache of all image modifications?\n\nChoose [Cancel] to Stop, [OK] to proceed.", 'nggallery'), 'slug_field' => $this->_render_text_field((object) array('name' => 'misc_settings'), 'router_param_slug', __('Permalink slug', 'nggallery'), $this->object->get_model()->router_param_slug), 'maximum_entity_count_field' => $this->_render_number_field((object) array('name' => 'misc_settings'), 'maximum_entity_count', __('Maximum image count', 'nggallery'), $this->object->get_model()->maximum_entity_count, __('This is the maximum limit of images that NextGEN will restrict itself to querying', 'nggallery') . " \n " . __('Note: This limit will not apply to slideshow widgets or random galleries if/when those galleries specify their own image limits', 'nggallery'), FALSE, '', 1), 'random_widget_cache_ttl_field' => $this->_render_number_field((object) array('name' => 'misc_settings'), 'random_widget_cache_ttl', __('Random widget cache duration', 'nggallery'), $this->object->get_model()->random_widget_cache_ttl, __('The duration of time (in minutes) that "random" widget galleries should be cached. A setting of zero will disable caching.', 'nggallery'), FALSE, '', 0), 'alternate_random_method_field' => $this->_render_radio_field((object) array('name' => 'misc_settings'), 'use_alternate_random_method', __('Use alternative method of retrieving random image galleries', 'nggallery'), C_NextGen_Settings::get_instance()->use_alternate_random_method, __("Some web hosts' database servers disable or disrupt queries using 'ORDER BY RAND()' which can cause galleries to lose their randomness. NextGen provides an alternative (but not completely random) method to determine what images are fed into 'random' galleries.", 'nggallery')), '
|
333 |
}
|
334 |
function cache_action()
|
335 |
{
|
@@ -386,6 +392,37 @@ class A_Other_Options_Controller extends Mixin
|
|
386 |
return 'NextGEN Change options';
|
387 |
}
|
388 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
389 |
/**
|
390 |
* Class A_Other_Options_Page
|
391 |
* @mixin C_NextGen_Admin_Page_Manager
|
313 |
}
|
314 |
}
|
315 |
/**
|
|
|
316 |
* @mixin C_Form
|
317 |
+
* @property C_MVC_Controller $object
|
318 |
* @adapts I_Form using "miscellaneous" context
|
319 |
*/
|
320 |
class A_Miscellaneous_Form extends Mixin
|
327 |
{
|
328 |
return __('Miscellaneous', 'nggallery');
|
329 |
}
|
330 |
+
function enqueue_static_resources()
|
331 |
+
{
|
332 |
+
wp_enqueue_script('ngg-progressbar');
|
333 |
+
wp_enqueue_script('jquery-ui-dialog');
|
334 |
+
wp_enqueue_style('nggadmin');
|
335 |
+
}
|
336 |
function render()
|
337 |
{
|
338 |
+
return $this->object->render_partial('photocrati-nextgen_other_options#misc_tab', array('mediarss_activated' => C_NextGen_Settings::get_instance()->useMediaRSS, 'mediarss_activated_label' => __('Add MediaRSS link?', 'nggallery'), 'mediarss_activated_help' => __('When enabled, adds a MediaRSS link to your header. Third-party web services can use this to publish your galleries', 'nggallery'), 'mediarss_activated_no' => __('No'), 'mediarss_activated_yes' => __('Yes'), 'galleries_in_feeds' => C_NextGen_Settings::get_instance()->galleries_in_feeds, 'galleries_in_feeds_label' => __('Display galleries in feeds', 'nggallery'), 'galleries_in_feeds_help' => __('NextGEN hides its gallery displays in feeds other than MediaRSS. This enables image galleries in feeds.', 'nggallery'), 'galleries_in_feeds_no' => __('No'), 'galleries_in_feeds_yes' => __('Yes'), 'cache_label' => __('Clear image cache', 'nggallery'), 'cache_confirmation' => __("Completely clear the NextGEN cache of all image modifications?\n\nChoose [Cancel] to Stop, [OK] to proceed.", 'nggallery'), 'update_legacy_featured_images_field' => $this->object->render_partial('photocrati-nextgen_other_options#update_legacy_featured_images_field', ['i18n' => ['label' => __('Update legacy page featured images', 'nggallery'), 'confirmation' => __('Continue? This will copy all NextGen 1.x page featured images into the media library.', 'nggallery'), 'tooltip' => __('WordPress 5.4 is incompatible with NextGen 1.x page featured images and they must be updated in a bulk process to correct them. This button will launch a background process (with a progress bar) that imports each NextGen image into the Media Library. This process can be resumed if you close the popup window or this browser window.', 'nggallery'), 'header' => __('Updating legacy page featured images', 'nggallery'), 'no_images_found' => __('No legacy page featured images were found.', 'nggallery'), 'operation_finished' => __('Operation complete. Legacy featured images have been corrected.', 'nggallery')]], TRUE), 'slug_field' => $this->_render_text_field((object) array('name' => 'misc_settings'), 'router_param_slug', __('Permalink slug', 'nggallery'), $this->object->get_model()->router_param_slug), 'maximum_entity_count_field' => $this->_render_number_field((object) array('name' => 'misc_settings'), 'maximum_entity_count', __('Maximum image count', 'nggallery'), $this->object->get_model()->maximum_entity_count, __('This is the maximum limit of images that NextGEN will restrict itself to querying', 'nggallery') . " \n " . __('Note: This limit will not apply to slideshow widgets or random galleries if/when those galleries specify their own image limits', 'nggallery'), FALSE, '', 1), 'random_widget_cache_ttl_field' => $this->_render_number_field((object) array('name' => 'misc_settings'), 'random_widget_cache_ttl', __('Random widget cache duration', 'nggallery'), $this->object->get_model()->random_widget_cache_ttl, __('The duration of time (in minutes) that "random" widget galleries should be cached. A setting of zero will disable caching.', 'nggallery'), FALSE, '', 0), 'alternate_random_method_field' => $this->_render_radio_field((object) array('name' => 'misc_settings'), 'use_alternate_random_method', __('Use alternative method of retrieving random image galleries', 'nggallery'), C_NextGen_Settings::get_instance()->use_alternate_random_method, __("Some web hosts' database servers disable or disrupt queries using 'ORDER BY RAND()' which can cause galleries to lose their randomness. NextGen provides an alternative (but not completely random) method to determine what images are fed into 'random' galleries.", 'nggallery')), 'disable_fontawesome_field' => $this->_render_radio_field((object) array('name' => 'misc_settings'), 'disable_fontawesome', __('Do not enqueue FontAwesome', 'nggallery'), C_NextGen_Settings::get_instance()->disable_fontawesome, __("Warning: your theme or another plugin must provide FontAwesome or your gallery displays may appear incorrectly", 'nggallery'))), TRUE);
|
339 |
}
|
340 |
function cache_action()
|
341 |
{
|
392 |
return 'NextGEN Change options';
|
393 |
}
|
394 |
}
|
395 |
+
/**
|
396 |
+
* @property A_Other_Options_Misc_Tab_Ajax $object
|
397 |
+
*/
|
398 |
+
class A_Other_Options_Misc_Tab_Ajax extends Mixin
|
399 |
+
{
|
400 |
+
function get_legacy_featured_images_count_action()
|
401 |
+
{
|
402 |
+
if (!current_user_can('administrator')) {
|
403 |
+
return ['error' => __('This request requires an authenticated administrator', 'nggallery')];
|
404 |
+
}
|
405 |
+
global $wpdb;
|
406 |
+
$query = "SELECT COUNT(`post_id`)\n FROM `{$wpdb->postmeta}`\n WHERE `meta_key` = '_thumbnail_id'\n AND `meta_value` LIKE 'ngg-%'";
|
407 |
+
return ['remaining' => (int) $wpdb->get_var($query)];
|
408 |
+
}
|
409 |
+
function update_legacy_featured_images_action()
|
410 |
+
{
|
411 |
+
if (!current_user_can('administrator')) {
|
412 |
+
return ['error' => __('This request requires an authenticated administrator', 'nggallery')];
|
413 |
+
}
|
414 |
+
global $wpdb;
|
415 |
+
$query = "SELECT `post_id`, `meta_value`\n FROM `{$wpdb->postmeta}`\n WHERE `meta_key` = '_thumbnail_id'\n AND `meta_value` LIKE 'ngg-%'\n LIMIT 1";
|
416 |
+
$results = $wpdb->get_results($query);
|
417 |
+
$storage = C_Gallery_Storage::get_instance();
|
418 |
+
// There's only at most one entry in $results
|
419 |
+
foreach ($results as $post) {
|
420 |
+
$image_id = str_replace('ngg-', '', $post->meta_value);
|
421 |
+
$storage->set_post_thumbnail($post->post_id, $image_id, FALSE);
|
422 |
+
}
|
423 |
+
return $this->object->get_legacy_featured_images_count_action();
|
424 |
+
}
|
425 |
+
}
|
426 |
/**
|
427 |
* Class A_Other_Options_Page
|
428 |
* @mixin C_NextGen_Admin_Page_Manager
|
products/photocrati_nextgen/modules/nextgen_other_options/templates/misc_tab.php
CHANGED
@@ -1,4 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<table>
|
|
|
2 |
<tr>
|
3 |
<td class="column1">
|
4 |
<label for="mediarss_activated"
|
@@ -31,6 +54,7 @@
|
|
31 |
/>
|
32 |
</td>
|
33 |
</tr>
|
|
|
34 |
<tr>
|
35 |
<td class="column1">
|
36 |
<label for="galleries_in_feeds"
|
@@ -63,6 +87,7 @@
|
|
63 |
/>
|
64 |
</td>
|
65 |
</tr>
|
|
|
66 |
<tr>
|
67 |
<td class='column1'>
|
68 |
<?php echo $cache_label; ?>
|
@@ -78,6 +103,8 @@
|
|
78 |
</td>
|
79 |
</tr>
|
80 |
|
|
|
|
|
81 |
<?php print $slug_field; ?>
|
82 |
|
83 |
<?php print $maximum_entity_count_field; ?>
|
@@ -87,4 +114,4 @@
|
|
87 |
<?php print $alternate_random_method_field; ?>
|
88 |
|
89 |
<?php print $disable_fontawesome_field; ?>
|
90 |
-
</table>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @var string $alternate_random_method_field
|
4 |
+
* @var string $cache_confirmation
|
5 |
+
* @var string $cache_label
|
6 |
+
* @var string $disable_fontawesome_field
|
7 |
+
* @var string $galleries_in_feeds
|
8 |
+
* @var string $galleries_in_feeds_help
|
9 |
+
* @var string $galleries_in_feeds_label
|
10 |
+
* @var string $galleries_in_feeds_no
|
11 |
+
* @var string $galleries_in_feeds_yes
|
12 |
+
* @var string $maximum_entity_count_field
|
13 |
+
* @var string $mediarss_activated
|
14 |
+
* @var string $mediarss_activated_help
|
15 |
+
* @var string $mediarss_activated_label
|
16 |
+
* @var string $mediarss_activated_no
|
17 |
+
* @var string $mediarss_activated_yes
|
18 |
+
* @var string $random_widget_cache_ttl_field
|
19 |
+
* @var string $slug_field
|
20 |
+
* @var string $update_legacy_featured_images_field
|
21 |
+
*/
|
22 |
+
?>
|
23 |
<table>
|
24 |
+
|
25 |
<tr>
|
26 |
<td class="column1">
|
27 |
<label for="mediarss_activated"
|
54 |
/>
|
55 |
</td>
|
56 |
</tr>
|
57 |
+
|
58 |
<tr>
|
59 |
<td class="column1">
|
60 |
<label for="galleries_in_feeds"
|
87 |
/>
|
88 |
</td>
|
89 |
</tr>
|
90 |
+
|
91 |
<tr>
|
92 |
<td class='column1'>
|
93 |
<?php echo $cache_label; ?>
|
103 |
</td>
|
104 |
</tr>
|
105 |
|
106 |
+
<?php print $update_legacy_featured_images_field; ?>
|
107 |
+
|
108 |
<?php print $slug_field; ?>
|
109 |
|
110 |
<?php print $maximum_entity_count_field; ?>
|
114 |
<?php print $alternate_random_method_field; ?>
|
115 |
|
116 |
<?php print $disable_fontawesome_field; ?>
|
117 |
+
</table>
|
products/photocrati_nextgen/modules/nextgen_other_options/templates/update_legacy_featured_images_field.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @var array $i18n
|
4 |
+
*/
|
5 |
+
?>
|
6 |
+
<tr>
|
7 |
+
<td class='column1'>
|
8 |
+
<label class="tooltip"
|
9 |
+
for="ngg_update_legacy_featured_images_button"
|
10 |
+
title="<?php print $i18n['tooltip']; ?>">
|
11 |
+
<?php print $i18n['label']; ?>
|
12 |
+
</label>
|
13 |
+
</td>
|
14 |
+
<td>
|
15 |
+
<input type='submit'
|
16 |
+
name="update_legacy_featured_images"
|
17 |
+
id="ngg_update_legacy_featured_images_button"
|
18 |
+
class="button delete button-primary"
|
19 |
+
value='<?php print $i18n['label']; ?>'
|
20 |
+
/>
|
21 |
+
</td>
|
22 |
+
<script>
|
23 |
+
window.addEventListener('load', function() {
|
24 |
+
/** @var {Object} photocrati_ajax */
|
25 |
+
const url_base = photocrati_ajax.url + '&action=';
|
26 |
+
const messages = {
|
27 |
+
header: '<?php print esc_js($i18n['header']); ?>',
|
28 |
+
no_images_found: '<?php print esc_js($i18n['no_images_found']); ?>',
|
29 |
+
operation_finished: '<?php print esc_js($i18n['operation_finished']); ?>'
|
30 |
+
};
|
31 |
+
|
32 |
+
nggProgressBarManager.initialize(
|
33 |
+
'ngg_update_legacy_featured_images_button',
|
34 |
+
messages,
|
35 |
+
url_base + 'get_legacy_featured_images_count',
|
36 |
+
url_base + 'update_legacy_featured_images'
|
37 |
+
);
|
38 |
+
});
|
39 |
+
</script>
|
40 |
+
</tr>
|
products/photocrati_nextgen/modules/nextgen_settings/module.nextgen_settings.php
CHANGED
@@ -18,7 +18,7 @@ class M_NextGen_Settings extends C_Base_Module
|
|
18 |
'photocrati-nextgen_settings',
|
19 |
'NextGEN Gallery Settings',
|
20 |
'Provides central management for NextGEN Gallery settings',
|
21 |
-
'3.
|
22 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
23 |
'Imagely',
|
24 |
'https://www.imagely.com'
|
@@ -40,13 +40,16 @@ class C_NextGen_Settings_Installer
|
|
40 |
private $_global_settings = array();
|
41 |
private $_local_settings = array();
|
42 |
|
|
|
|
|
|
|
43 |
function __construct()
|
44 |
{
|
45 |
$this->blog_settings = C_NextGen_Settings::get_instance();
|
46 |
$this->site_settings = C_NextGen_Global_Settings::get_instance();
|
47 |
|
48 |
-
$this->_global_settings =
|
49 |
-
|
50 |
'wpmuCSSfile' => 'nggallery.css',
|
51 |
'wpmuStyle' => FALSE,
|
52 |
'wpmuRoles' => FALSE,
|
@@ -56,15 +59,14 @@ class C_NextGen_Settings_Installer
|
|
56 |
'datamapper_driver' => 'custom_table_datamapper',
|
57 |
'maximum_entity_count' => 500,
|
58 |
'router_param_slug' => 'nggallery'
|
59 |
-
|
60 |
|
61 |
-
$this->_local_settings =
|
62 |
-
|
63 |
'deleteImg' => TRUE, // delete Images
|
64 |
'usePermalinks' => FALSE, // use permalinks for parameters
|
65 |
'permalinkSlug' => 'nggallery', // the default slug for permalinks
|
66 |
'graphicLibrary' => 'gd', // default graphic library
|
67 |
-
'imageMagickDir' => '/usr/local/bin/', // default path to ImageMagick
|
68 |
'useMediaRSS' => FALSE, // activate the global Media RSS file
|
69 |
'galleries_in_feeds' => FALSE, // enables rendered gallery output in rss/atom feeds
|
70 |
|
@@ -138,7 +140,7 @@ class C_NextGen_Settings_Installer
|
|
138 |
|
139 |
// Duration of caching of 'random' widgets image IDs
|
140 |
'random_widget_cache_ttl' => 30
|
141 |
-
|
142 |
}
|
143 |
|
144 |
function install_global_settings($reset=FALSE)
|
18 |
'photocrati-nextgen_settings',
|
19 |
'NextGEN Gallery Settings',
|
20 |
'Provides central management for NextGEN Gallery settings',
|
21 |
+
'3.3.6',
|
22 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
23 |
'Imagely',
|
24 |
'https://www.imagely.com'
|
40 |
private $_global_settings = array();
|
41 |
private $_local_settings = array();
|
42 |
|
43 |
+
public $blog_settings = NULL;
|
44 |
+
public $site_settings = NULL;
|
45 |
+
|
46 |
function __construct()
|
47 |
{
|
48 |
$this->blog_settings = C_NextGen_Settings::get_instance();
|
49 |
$this->site_settings = C_NextGen_Global_Settings::get_instance();
|
50 |
|
51 |
+
$this->_global_settings = apply_filters('ngg_default_global_settings', [
|
52 |
+
'gallerypath' => implode(DIRECTORY_SEPARATOR, array('wp-content', 'uploads', 'sites', '%BLOG_ID%', 'nggallery')) . DIRECTORY_SEPARATOR,
|
53 |
'wpmuCSSfile' => 'nggallery.css',
|
54 |
'wpmuStyle' => FALSE,
|
55 |
'wpmuRoles' => FALSE,
|
59 |
'datamapper_driver' => 'custom_table_datamapper',
|
60 |
'maximum_entity_count' => 500,
|
61 |
'router_param_slug' => 'nggallery'
|
62 |
+
]);
|
63 |
|
64 |
+
$this->_local_settings = apply_filters('ngg_default_settings', [
|
65 |
+
'gallerypath' => 'wp-content' . DIRECTORY_SEPARATOR . 'gallery' . DIRECTORY_SEPARATOR,
|
66 |
'deleteImg' => TRUE, // delete Images
|
67 |
'usePermalinks' => FALSE, // use permalinks for parameters
|
68 |
'permalinkSlug' => 'nggallery', // the default slug for permalinks
|
69 |
'graphicLibrary' => 'gd', // default graphic library
|
|
|
70 |
'useMediaRSS' => FALSE, // activate the global Media RSS file
|
71 |
'galleries_in_feeds' => FALSE, // enables rendered gallery output in rss/atom feeds
|
72 |
|
140 |
|
141 |
// Duration of caching of 'random' widgets image IDs
|
142 |
'random_widget_cache_ttl' => 30
|
143 |
+
]);
|
144 |
}
|
145 |
|
146 |
function install_global_settings($reset=FALSE)
|
products/photocrati_nextgen/modules/ngglegacy/admin/admin.php
CHANGED
@@ -161,8 +161,8 @@ class nggAdminPanel{
|
|
161 |
function add_menu() {
|
162 |
|
163 |
add_menu_page(
|
164 |
-
__('Gallery', 'nggallery'),
|
165 |
-
_n('Gallery', 'Galleries', 1, 'nggallery'),
|
166 |
'NextGEN Gallery overview',
|
167 |
NGGFOLDER,
|
168 |
array ($this, 'show_menu'),
|
161 |
function add_menu() {
|
162 |
|
163 |
add_menu_page(
|
164 |
+
__('NextGen Gallery', 'nggallery'),
|
165 |
+
_n('NextGen Gallery', 'NextGen Galleries', 1, 'nggallery'),
|
166 |
'NextGEN Gallery overview',
|
167 |
NGGFOLDER,
|
168 |
array ($this, 'show_menu'),
|
products/photocrati_nextgen/modules/ngglegacy/admin/js/ngg.progressbar.js
CHANGED
@@ -1,141 +1,285 @@
|
|
1 |
-
/*
|
2 |
-
* Progress bar Plugin for NextGEN gallery
|
3 |
-
* Version: 2.0.3
|
4 |
-
* Author : Alex Rabe
|
5 |
-
*
|
6 |
-
*/
|
7 |
(function($) {
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
// increase the height to show the note
|
80 |
div.dialog("option", "height", 220);
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
window.setTimeout(function() {
|
118 |
-
|
119 |
}, 1000);
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
|
|
|
|
|
|
|
|
141 |
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
(function($) {
|
2 |
+
nggProgressBar = {
|
3 |
+
|
4 |
+
settings: {
|
5 |
+
header: '',
|
6 |
+
id: 'progressbar',
|
7 |
+
init: false,
|
8 |
+
maxStep: 100,
|
9 |
+
wait: false,
|
10 |
+
|
11 |
+
finishedNote: 'Done!',
|
12 |
+
submitNGGFormOnFinished: true,
|
13 |
+
includeTinyMCEHackForIncrements: true
|
14 |
+
},
|
15 |
+
|
16 |
+
width: 0,
|
17 |
+
|
18 |
+
init: function(settings) {
|
19 |
+
const self = this;
|
20 |
+
|
21 |
+
settings = this.settings = $.extend({}, this.settings, {}, settings || {});
|
22 |
+
|
23 |
+
this.adjust_max_step(settings.maxStep);
|
24 |
+
|
25 |
+
if ($("#" + settings.id + "_dialog").length === 0) {
|
26 |
+
|
27 |
+
settings.header = (settings.header.length > 0) ? settings.header : '' ;
|
28 |
+
$("body").append('<div id="' + settings.id + '_dialog"><div id="' + settings.id + '" class="progressborder"><div class="' + settings.id + '"><span>0%</span></div></div></div>');
|
29 |
+
|
30 |
+
$("#" + settings.id + "_dialog").dialog({
|
31 |
+
width: 640,
|
32 |
+
resizable: true,
|
33 |
+
modal: true,
|
34 |
+
title: settings.header,
|
35 |
+
position: {
|
36 |
+
my: 'center',
|
37 |
+
at: 'center',
|
38 |
+
of: this.find_parent(window)
|
39 |
+
},
|
40 |
+
close: function(event, ui) {
|
41 |
+
self.remove_dialog(0, 0);
|
42 |
+
}
|
43 |
+
});
|
44 |
+
}
|
45 |
+
|
46 |
+
this.div = $('#' + settings.id + '_dialog');
|
47 |
+
settings.init = true;
|
48 |
+
|
49 |
+
return this.div;
|
50 |
+
},
|
51 |
+
|
52 |
+
adjust_max_step: function(maxStep) {
|
53 |
+
this.settings.maxStep = maxStep;
|
54 |
+
this.width = Math.round(( 100 / maxStep) * 100 ) /100;
|
55 |
+
},
|
56 |
+
|
57 |
+
find_parent: function(child) {
|
58 |
+
try {
|
59 |
+
if (child && child.parent) {
|
60 |
+
child = child.parent;
|
61 |
+
}
|
62 |
+
} catch (Exception) {}
|
63 |
+
|
64 |
+
return child;
|
65 |
+
},
|
66 |
+
|
67 |
+
addMessage: function(message) {
|
68 |
+
const settings = this.settings;
|
69 |
+
if (!settings.init) {
|
70 |
+
this.init();
|
71 |
+
}
|
72 |
+
|
73 |
+
const div = this.div;
|
74 |
+
if (div.find("#" + settings.id + "_message").length === 0) {
|
75 |
+
div.append('<div class="' + settings.id + '_message"><span style="display:block" id="' + settings.id + '_message">' + message + '</span></div>');
|
76 |
+
} else {
|
77 |
+
$("#" + settings.id + "_message").html(message);
|
78 |
+
}
|
79 |
+
},
|
80 |
+
|
81 |
+
addNote: function(note, detail) {
|
82 |
+
const settings = this.settings;
|
83 |
+
if (!settings.init) {
|
84 |
+
this.init();
|
85 |
+
}
|
86 |
+
|
87 |
+
const div = this.div;
|
88 |
+
settings.wait = true;
|
89 |
+
|
90 |
+
if (div.find("#" + settings.id + "_note").length === 0) {
|
91 |
+
div.append('<ul id="' + settings.id + '_note"> </ul>');
|
92 |
+
}
|
93 |
+
|
94 |
+
if (detail) {
|
95 |
+
$("#" + settings.id + "_note").append("<li>" + note + "<div class='show_details'><span>[more]</span><br />" + detail + "</div></li>");
|
96 |
+
} else {
|
97 |
+
$("#" + settings.id + "_note").append("<li>" + note + "</li>");
|
98 |
+
}
|
99 |
+
|
100 |
// increase the height to show the note
|
101 |
div.dialog("option", "height", 220);
|
102 |
+
},
|
103 |
+
|
104 |
+
increase: function(step) {
|
105 |
+
const settings = this.settings;
|
106 |
+
|
107 |
+
const value = step * this.width + "%";
|
108 |
+
const rvalue = Math.round(step * this.width) + "%";
|
109 |
+
|
110 |
+
$("#" + settings.id + " div").width(value);
|
111 |
+
$("#" + settings.id + " span").html(rvalue);
|
112 |
+
|
113 |
+
if (settings.includeTinyMCEHackForIncrements) {
|
114 |
+
// Try to restore ATP tabs
|
115 |
+
$(this.find_parent(window).document).scrollTop(0);
|
116 |
+
|
117 |
+
const tinymce_frame = $(this.find_parent(window).frameElement).parent();
|
118 |
+
const css_top = tinymce_frame.css('top');
|
119 |
+
|
120 |
+
setTimeout(function() {
|
121 |
+
tinymce_frame.css('top', 0);
|
122 |
+
}, 1);
|
123 |
+
|
124 |
+
setTimeout(function() {
|
125 |
+
tinymce_frame.css('top', css_top);
|
126 |
+
}, 3);
|
127 |
+
}
|
128 |
+
},
|
129 |
+
|
130 |
+
finished: function(message) {
|
131 |
+
const settings = this.settings;
|
132 |
+
|
133 |
+
message = (message === undefined) ? settings.finishedNote : message;
|
134 |
+
|
135 |
+
$("#" + settings.id + " div").width('100%');
|
136 |
+
$("#" + settings.id + " span").html('100%');
|
137 |
+
|
138 |
+
// In the case we add a note, we should wait for a click
|
139 |
+
const div = this.div;
|
140 |
+
const self = this;
|
141 |
+
|
142 |
+
if (settings.wait) {
|
143 |
+
$("#" + settings.id).delay(1000).hide("slow");
|
144 |
+
|
145 |
+
self.addNote(message);
|
146 |
+
|
147 |
+
div.on('click', function() {
|
148 |
+
self.remove_dialog(false, 0);
|
149 |
+
});
|
150 |
+
|
151 |
+
} else {
|
152 |
window.setTimeout(function() {
|
153 |
+
self.remove_dialog(true, 1);
|
154 |
}, 1000);
|
155 |
+
}
|
156 |
+
},
|
157 |
+
|
158 |
+
remove_dialog: function(delay, value) {
|
159 |
+
const dialog = $("#" + this.settings.id + "_dialog");
|
160 |
+
|
161 |
+
if (delay) {
|
162 |
+
dialog.delay(4000).dialog("destroy");
|
163 |
+
} else {
|
164 |
+
dialog.dialog("destroy");
|
165 |
+
}
|
166 |
+
|
167 |
+
dialog.remove();
|
168 |
+
|
169 |
+
// In the case it's the manage page, force a submit
|
170 |
+
if (this.settings.submitNGGFormOnFinished) {
|
171 |
+
const form = $('.nggform');
|
172 |
+
form.prepend("<input type=\"hidden\" name=\"ajax_callback\" value=\""+value+"\">");
|
173 |
+
if (delay)
|
174 |
+
form.delay(4000).submit();
|
175 |
+
else
|
176 |
+
form.submit();
|
177 |
+
}
|
178 |
+
}
|
179 |
+
};
|
180 |
})(jQuery);
|
181 |
+
|
182 |
+
const nggProgressBarManager = {
|
183 |
+
|
184 |
+
// The initial count of images to be processed; necessary for keeping track of our progress
|
185 |
+
starting_count: 0,
|
186 |
+
|
187 |
+
// The nggProgressBar element itself
|
188 |
+
progress_bar: null,
|
189 |
+
|
190 |
+
// The current status: in case the jQueryUI dialog is closed by the user we must stop polling
|
191 |
+
polling_status: false,
|
192 |
+
|
193 |
+
// The button that triggers this popup will be disabled while the operation is in progress
|
194 |
+
button: null,
|
195 |
+
|
196 |
+
messages: {
|
197 |
+
no_images_found: 'No images were found to operate on',
|
198 |
+
operation_finished: 'Operation has completed',
|
199 |
+
header: 'Working...'
|
200 |
+
},
|
201 |
+
|
202 |
+
initialize: function(id, messages, primary_url, secondary_url) {
|
203 |
+
const self = this;
|
204 |
+
|
205 |
+
this.messages = messages;
|
206 |
+
this.primary_url = primary_url;
|
207 |
+
this.secondary_url = (secondary_url === undefined) ? primary_url : secondary_url;
|
208 |
+
|
209 |
+
this.button = document.getElementById(id);
|
210 |
+
this.button.addEventListener('click', function(event) {
|
211 |
+
event.preventDefault();
|
212 |
+
self.button.setAttribute('disabled', 'true');
|
213 |
+
self.first_fetch();
|
214 |
+
});
|
215 |
+
},
|
216 |
+
|
217 |
+
initialize_progress_bar: function() {
|
218 |
+
if (this.progress_bar) {
|
219 |
+
return this.progress_bar;
|
220 |
+
} else {
|
221 |
+
const self = this;
|
222 |
+
|
223 |
+
// nggProgressBar is found in ngg.progressbar.js
|
224 |
+
this.progress_bar = nggProgressBar.init({
|
225 |
+
header: this.messages.header,
|
226 |
+
wait: true,
|
227 |
+
finishedNote: this.messages.operation_finished,
|
228 |
+
submitNGGFormOnFinished: false,
|
229 |
+
includeTinyMCEHackForIncrements: false
|
230 |
+
});
|
231 |
+
|
232 |
+
// Disable polling and destroy our reference
|
233 |
+
this.progress_bar.on('dialogclose', function() {
|
234 |
+
self.polling_status = false;
|
235 |
+
self.progress_bar = null;
|
236 |
+
self.button.removeAttribute('disabled');
|
237 |
+
});
|
238 |
+
}
|
239 |
+
},
|
240 |
+
|
241 |
+
first_fetch: function() {
|
242 |
+
this.initialize_progress_bar();
|
243 |
+
const self = this;
|
244 |
+
|
245 |
+
fetch(this.primary_url, {
|
246 |
+
method: 'post',
|
247 |
+
cache: 'no-cache'
|
248 |
+
}).then(function(result) { return result.json(); }).then(function(data) {
|
249 |
+
/** @property {int} data.remaining */
|
250 |
+
if (data.remaining === 0) {
|
251 |
+
self.button.removeAttribute('disabled');
|
252 |
+
nggProgressBar.finished(self.messages.no_images_found);
|
253 |
+
} else {
|
254 |
+
self.polling_status = true;
|
255 |
+
self.starting_count = data.remaining;
|
256 |
+
nggProgressBar.adjust_max_step(self.starting_count);
|
257 |
+
self.continuing_fetch();
|
258 |
+
}
|
259 |
+
});
|
260 |
+
},
|
261 |
+
|
262 |
+
continuing_fetch: function() {
|
263 |
+
const self = this;
|
264 |
+
fetch(this.secondary_url, {
|
265 |
+
method: 'post',
|
266 |
+
cache: 'no-cache'
|
267 |
+
}).then(function(result) { return result.json(); }).then(function(data) {
|
268 |
+
/** @property {int} data.remaining */
|
269 |
+
const percent = Math.round(((self.starting_count - data.remaining) / self.starting_count) * 100);
|
270 |
+
|
271 |
+
if (percent < 100) {
|
272 |
+
nggProgressBar.increase(percent);
|
273 |
+
|
274 |
+
if (self.polling_status) {
|
275 |
+
self.continuing_fetch();
|
276 |
+
}
|
277 |
+
} else {
|
278 |
+
nggProgressBar.increase(100);
|
279 |
+
nggProgressBar.finished();
|
280 |
+
|
281 |
+
self.button.removeAttribute('disabled');
|
282 |
+
}
|
283 |
+
});
|
284 |
+
}
|
285 |
+
};
|
products/photocrati_nextgen/modules/ngglegacy/admin/js/ngg.progressbar.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(t){nggProgressBar={settings:{header:"",id:"progressbar",init:!1,maxStep:100,wait:!1,finishedNote:"Done!",submitNGGFormOnFinished:!0,includeTinyMCEHackForIncrements:!0},width:0,init:function(i){const n=this;return i=this.settings=t.extend({},this.settings,{},i||{}),this.adjust_max_step(i.maxStep),0===t("#"+i.id+"_dialog").length&&(i.header=i.header.length>0?i.header:"",t("body").append('<div id="'+i.id+'_dialog"><div id="'+i.id+'" class="progressborder"><div class="'+i.id+'"><span>0%</span></div></div></div>'),t("#"+i.id+"_dialog").dialog({width:640,resizable:!0,modal:!0,title:i.header,position:{my:"center",at:"center",of:this.find_parent(window)},close:function(t,i){n.remove_dialog(0,0)}})),this.div=t("#"+i.id+"_dialog"),i.init=!0,this.div},adjust_max_step:function(t){this.settings.maxStep=t,this.width=Math.round(100/t*100)/100},find_parent:function(t){try{t&&t.parent&&(t=t.parent)}catch(t){}return t},addMessage:function(i){const n=this.settings;n.init||this.init();const e=this.div;0===e.find("#"+n.id+"_message").length?e.append('<div class="'+n.id+'_message"><span style="display:block" id="'+n.id+'_message">'+i+"</span></div>"):t("#"+n.id+"_message").html(i)},addNote:function(i,n){const e=this.settings;e.init||this.init();const s=this.div;e.wait=!0,0===s.find("#"+e.id+"_note").length&&s.append('<ul id="'+e.id+'_note"> </ul>'),n?t("#"+e.id+"_note").append("<li>"+i+"<div class='show_details'><span>[more]</span><br />"+n+"</div></li>"):t("#"+e.id+"_note").append("<li>"+i+"</li>"),s.dialog("option","height",220)},increase:function(i){const n=this.settings,e=i*this.width+"%",s=Math.round(i*this.width)+"%";if(t("#"+n.id+" div").width(e),t("#"+n.id+" span").html(s),n.includeTinyMCEHackForIncrements){t(this.find_parent(window).document).scrollTop(0);const o=t(this.find_parent(window).frameElement).parent(),a=o.css("top");setTimeout(function(){o.css("top",0)},1),setTimeout(function(){o.css("top",a)},3)}},finished:function(i){const n=this.settings;i=void 0===i?n.finishedNote:i,t("#"+n.id+" div").width("100%"),t("#"+n.id+" span").html("100%");const e=this.div,s=this;n.wait?(t("#"+n.id).delay(1e3).hide("slow"),s.addNote(i),e.on("click",function(){s.remove_dialog(!1,0)})):window.setTimeout(function(){s.remove_dialog(!0,1)},1e3)},remove_dialog:function(i,n){const e=t("#"+this.settings.id+"_dialog");if(i?e.delay(4e3).dialog("destroy"):e.dialog("destroy"),e.remove(),this.settings.submitNGGFormOnFinished){const s=t(".nggform");s.prepend('<input type="hidden" name="ajax_callback" value="'+n+'">'),i?s.delay(4e3).submit():s.submit()}}}}(jQuery);const nggProgressBarManager={starting_count:0,progress_bar:null,polling_status:!1,button:null,messages:{no_images_found:"No images were found to operate on",operation_finished:"Operation has completed",header:"Working..."},initialize:function(t,i,n,e){const s=this;this.messages=i,this.primary_url=n,this.secondary_url=void 0===e?n:e,this.button=document.getElementById(t),this.button.addEventListener("click",function(t){t.preventDefault(),s.button.setAttribute("disabled","true"),s.first_fetch()})},initialize_progress_bar:function(){if(this.progress_bar)return this.progress_bar;const t=this;this.progress_bar=nggProgressBar.init({header:this.messages.header,wait:!0,finishedNote:this.messages.operation_finished,submitNGGFormOnFinished:!1,includeTinyMCEHackForIncrements:!1}),this.progress_bar.on("dialogclose",function(){t.polling_status=!1,t.progress_bar=null,t.button.removeAttribute("disabled")})},first_fetch:function(){this.initialize_progress_bar();const t=this;fetch(this.primary_url,{method:"post",cache:"no-cache"}).then(function(t){return t.json()}).then(function(i){0===i.remaining?(t.button.removeAttribute("disabled"),nggProgressBar.finished(t.messages.no_images_found)):(t.polling_status=!0,t.starting_count=i.remaining,nggProgressBar.adjust_max_step(t.starting_count),t.continuing_fetch())})},continuing_fetch:function(){const t=this;fetch(this.secondary_url,{method:"post",cache:"no-cache"}).then(function(t){return t.json()}).then(function(i){const n=Math.round((t.starting_count-i.remaining)/t.starting_count*100);n<100?(nggProgressBar.increase(n),t.polling_status&&t.continuing_fetch()):(nggProgressBar.increase(100),nggProgressBar.finished(),t.button.removeAttribute("disabled"))})}};
|
products/photocrati_nextgen/modules/ngglegacy/admin/manage.php
CHANGED
@@ -865,11 +865,17 @@ class nggManageGallery {
|
|
865 |
$this->gallery = $mapper->find($this->gid, TRUE);
|
866 |
}
|
867 |
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
873 |
$mapper->save($this->gallery);
|
874 |
|
875 |
if ($this->gallery->is_invalid())
|
865 |
$this->gallery = $mapper->find($this->gid, TRUE);
|
866 |
}
|
867 |
|
868 |
+
if ($this->gallery)
|
869 |
+
{
|
870 |
+
foreach ($_POST as $key => $value) {
|
871 |
+
// Yet another IIS hack: gallery paths can be mangled into \\wp-content\\blah\\ which causes
|
872 |
+
// later errors when validating the gallery path: just automatically replace \\ with / here.
|
873 |
+
if ($key === 'path')
|
874 |
+
$value = str_replace('\\\\', '/', $value);
|
875 |
+
|
876 |
+
$this->gallery->$key = $value;
|
877 |
+
}
|
878 |
+
|
879 |
$mapper->save($this->gallery);
|
880 |
|
881 |
if ($this->gallery->is_invalid())
|
products/photocrati_nextgen/modules/ngglegacy/lib/core.php
CHANGED
@@ -138,19 +138,13 @@ class nggGallery {
|
|
138 |
}
|
139 |
|
140 |
/**
|
141 |
-
*
|
142 |
*
|
143 |
* @return string Path to the selected library
|
144 |
*/
|
145 |
-
static function graphic_library()
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
if ( $ngg_options['graphicLibrary'] == 'im')
|
150 |
-
return NGGALLERY_ABSPATH . '/lib/imagemagick.inc.php';
|
151 |
-
else
|
152 |
-
return NGGALLERY_ABSPATH . '/lib/gd.thumbnail.inc.php';
|
153 |
-
|
154 |
}
|
155 |
|
156 |
/**
|
138 |
}
|
139 |
|
140 |
/**
|
141 |
+
* Returns the path to lib/gd.thumbnail.inc.php
|
142 |
*
|
143 |
* @return string Path to the selected library
|
144 |
*/
|
145 |
+
static function graphic_library()
|
146 |
+
{
|
147 |
+
return NGGALLERY_ABSPATH . '/lib/gd.thumbnail.inc.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
}
|
149 |
|
150 |
/**
|
products/photocrati_nextgen/modules/ngglegacy/lib/imagemagick.inc.php
DELETED
@@ -1,596 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* imagemagick.inc.php
|
4 |
-
*
|
5 |
-
* @author Frederic De Ranter
|
6 |
-
* @copyright Copyright 2008
|
7 |
-
* @version 0.4 (PHP4)
|
8 |
-
* @based on thumbnail.inc.php by Ian Selby (gen-x-design.com)
|
9 |
-
* @since NextGEN V1.0.0
|
10 |
-
*
|
11 |
-
*/
|
12 |
-
/**
|
13 |
-
* PHP class for dynamically resizing, cropping, and rotating images for thumbnail purposes and either displaying them on-the-fly or saving them.
|
14 |
-
* with ImageMagick
|
15 |
-
*/
|
16 |
-
|
17 |
-
class ngg_Thumbnail {
|
18 |
-
/**
|
19 |
-
* Error message to display, if any
|
20 |
-
* @var string
|
21 |
-
*/
|
22 |
-
var $errmsg;
|
23 |
-
/**
|
24 |
-
* Whether or not there is an error
|
25 |
-
* @var boolean
|
26 |
-
*/
|
27 |
-
var $error;
|
28 |
-
/**
|
29 |
-
* File name and path of the image file
|
30 |
-
* @var string
|
31 |
-
*/
|
32 |
-
var $fileName;
|
33 |
-
/**
|
34 |
-
* Image meta data if any is available (jpeg/tiff) via the exif library
|
35 |
-
* @var array
|
36 |
-
*/
|
37 |
-
var $imageMeta;
|
38 |
-
/**
|
39 |
-
* Current dimensions of working image
|
40 |
-
* @var array
|
41 |
-
*/
|
42 |
-
var $currentDimensions;
|
43 |
-
/**
|
44 |
-
* New dimensions of working image
|
45 |
-
* @var array
|
46 |
-
*/
|
47 |
-
var $newDimensions;
|
48 |
-
/**
|
49 |
-
* Percentage to resize image b
|
50 |
-
* @var int
|
51 |
-
* @access private
|
52 |
-
*/
|
53 |
-
var $percent;
|
54 |
-
/**
|
55 |
-
* Maximum width of image during resize
|
56 |
-
* @var int
|
57 |
-
* @access private
|
58 |
-
*/
|
59 |
-
var $maxWidth;
|
60 |
-
/**
|
61 |
-
* Maximum height of image during resize
|
62 |
-
* @var int
|
63 |
-
* @access private
|
64 |
-
*/
|
65 |
-
var $maxHeight;
|
66 |
-
/**
|
67 |
-
* Image for Watermark
|
68 |
-
* @var string
|
69 |
-
*/
|
70 |
-
var $watermarkImgPath;
|
71 |
-
/**
|
72 |
-
* Text for Watermark
|
73 |
-
* @var string
|
74 |
-
*/
|
75 |
-
var $watermarkText;
|
76 |
-
/**
|
77 |
-
* Path to ImageMagick convert
|
78 |
-
* @var string
|
79 |
-
*/
|
80 |
-
var $imageMagickDir;
|
81 |
-
/**
|
82 |
-
* String to execute ImageMagick convert.
|
83 |
-
* @var string
|
84 |
-
*/
|
85 |
-
var $imageMagickExec;
|
86 |
-
/**
|
87 |
-
* String to execute ImageMagick composite.
|
88 |
-
* @var string
|
89 |
-
*/
|
90 |
-
var $imageMagickComp;
|
91 |
-
/**
|
92 |
-
* String to execute ImageMagick (before the filename).
|
93 |
-
* @var string
|
94 |
-
*/
|
95 |
-
var $imageMagickBefore;
|
96 |
-
|
97 |
-
/*
|
98 |
-
* in: filename, error
|
99 |
-
* out: nothing
|
100 |
-
* init of class: init of variables, detect needed memory (gd), image format (gd), detect image size (GetImageSize is general PHP, not GD), Image Meta?
|
101 |
-
*/
|
102 |
-
function __construct($fileName, $no_ErrorImage = false)
|
103 |
-
{
|
104 |
-
//initialize variables
|
105 |
-
$this->errmsg = '';
|
106 |
-
$this->error = false;
|
107 |
-
$this->currentDimensions = array();
|
108 |
-
$this->newDimensions = array();
|
109 |
-
$this->fileName = $fileName;
|
110 |
-
$this->imageMeta = array();
|
111 |
-
$this->percent = 100;
|
112 |
-
$this->maxWidth = 0;
|
113 |
-
$this->maxHeight = 0;
|
114 |
-
$this->watermarkImgPath = '';
|
115 |
-
$this->watermarkText = '';
|
116 |
-
$this->imageMagickExec = '';
|
117 |
-
$this->imageMagickComp = '';
|
118 |
-
$this->imageMagickBefore = '';
|
119 |
-
|
120 |
-
//make sure ImageMagick is installed
|
121 |
-
$this->checkVersion();
|
122 |
-
|
123 |
-
//check to see if file exists
|
124 |
-
if(!file_exists($this->fileName)) {
|
125 |
-
$this->errmsg = 'File not found';
|
126 |
-
$this->error = true;
|
127 |
-
}
|
128 |
-
//check to see if file is readable
|
129 |
-
elseif(!is_readable($this->fileName)) {
|
130 |
-
$this->errmsg = 'File is not readable';
|
131 |
-
$this->error = true;
|
132 |
-
}
|
133 |
-
|
134 |
-
if($this->error == false) {
|
135 |
-
$size = GetImageSize($this->fileName);
|
136 |
-
$this->currentDimensions = array('width'=>$size[0],'height'=>$size[1]);
|
137 |
-
}
|
138 |
-
|
139 |
-
if($this->error == true) {
|
140 |
-
// for SinglePic send the error message out
|
141 |
-
if(!$no_ErrorImage)
|
142 |
-
echo $this->errmsg;
|
143 |
-
return;
|
144 |
-
}
|
145 |
-
}
|
146 |
-
|
147 |
-
function checkVersion() {
|
148 |
-
|
149 |
-
// very often exec()or passthru() is disabled. No chance for Imagick
|
150 |
-
if ( ini_get('disable_functions') ) {
|
151 |
-
$not_allowed = ini_get('disable_functions');
|
152 |
-
if ( stristr($not_allowed, 'exec') || stristr($not_allowed, 'passthru') ) {
|
153 |
-
$this->errmsg = 'exec() or passthru() is not allowed. Could not execute Imagick';
|
154 |
-
$this->error = true;
|
155 |
-
return false;
|
156 |
-
}
|
157 |
-
}
|
158 |
-
|
159 |
-
// get the path to imageMagick
|
160 |
-
$ngg_options = get_option('ngg_options');
|
161 |
-
$this->imageMagickDir = trim( $ngg_options['imageMagickDir']);
|
162 |
-
$this->imageMagickDir = str_replace( "\\", "/", $this->imageMagickDir );
|
163 |
-
|
164 |
-
// Try to get the ImageMagick version
|
165 |
-
$magickv = $this->execute('convert', '-version');
|
166 |
-
|
167 |
-
if ( empty($magickv) ) {
|
168 |
-
$this->errmsg = 'Could not execute ImageMagick. Check path ';
|
169 |
-
$this->error = true;
|
170 |
-
return false;
|
171 |
-
}
|
172 |
-
|
173 |
-
// We need as least version 6 or higher
|
174 |
-
$helper = preg_match('/Version: ImageMagick ([0-9])/', $magickv[0], $magickversion);
|
175 |
-
if ( !$magickversion[0] > '5' ) {
|
176 |
-
$this->errmsg = 'Require ImageMagick Version 6 or higher';
|
177 |
-
$this->error = true;
|
178 |
-
return false;
|
179 |
-
}
|
180 |
-
|
181 |
-
return true;
|
182 |
-
}
|
183 |
-
|
184 |
-
|
185 |
-
/**
|
186 |
-
* Execute ImageMagick/GraphicsMagick commands
|
187 |
-
*
|
188 |
-
* @param string $cmd an ImageMagick command (eg. "convert")
|
189 |
-
* @param string $args the arguments which should be passed
|
190 |
-
* @param bool $passthru (optional) Output the result to the webserver instead
|
191 |
-
* @return array|string
|
192 |
-
*/
|
193 |
-
function execute( $cmd, $args, $passthru = false) {
|
194 |
-
|
195 |
-
// in error case we do not continue
|
196 |
-
if($this->error == true)
|
197 |
-
return '';
|
198 |
-
|
199 |
-
//if path is not empty
|
200 |
-
if ($this->imageMagickDir != '') {
|
201 |
-
// the path must have a slash at the end
|
202 |
-
if ( $this->imageMagickDir{strlen($this->imageMagickDir)-1} != '/')
|
203 |
-
$this->imageMagickDir .= '/';
|
204 |
-
}
|
205 |
-
|
206 |
-
//$args = escapeshellarg($args);
|
207 |
-
//var_dump( escapeshellcmd ( "{$this->imageMagickDir}/{$cmd} {$args}" ) ); return;
|
208 |
-
//$this->errmsg = escapeshellcmd( "{$this->imageMagickDir}{$cmd} {$args}" );
|
209 |
-
|
210 |
-
if ( !$passthru ) {
|
211 |
-
exec( "{$this->imageMagickDir}{$cmd} {$args}", $result );
|
212 |
-
//var_dump( "{$this->imageMagickDir}/{$cmd} {$args}" );
|
213 |
-
return $result;
|
214 |
-
|
215 |
-
}
|
216 |
-
//var_dump( escapeshellcmd ( "{$this->imageMagickDir}/{$cmd} {$args}" ) ); return;
|
217 |
-
|
218 |
-
// for single pic we need the direct output
|
219 |
-
header('Content-type: image/jpeg');
|
220 |
-
$this->errmsg = "{$this->imageMagickDir}{$cmd} {$args}";
|
221 |
-
return passthru( "{$this->imageMagickDir}{$cmd} {$args}" );
|
222 |
-
}
|
223 |
-
|
224 |
-
|
225 |
-
/**
|
226 |
-
* Must be called to free up allocated memory after all manipulations are done
|
227 |
-
*/
|
228 |
-
function destruct() {
|
229 |
-
//not needed for ImageMagick
|
230 |
-
return;
|
231 |
-
}
|
232 |
-
|
233 |
-
/**
|
234 |
-
* Returns the current width of the image
|
235 |
-
* @return int
|
236 |
-
*/
|
237 |
-
function getCurrentWidth() {
|
238 |
-
return $this->currentDimensions['width'];
|
239 |
-
}
|
240 |
-
|
241 |
-
/**
|
242 |
-
* Returns the current height of the image
|
243 |
-
* @return int
|
244 |
-
*/
|
245 |
-
function getCurrentHeight() {
|
246 |
-
return $this->currentDimensions['height'];
|
247 |
-
}
|
248 |
-
|
249 |
-
/**
|
250 |
-
* Calculates new image width
|
251 |
-
* @param int $width
|
252 |
-
* @param int $height
|
253 |
-
* @return array
|
254 |
-
*/
|
255 |
-
function calcWidth($width, $height) {
|
256 |
-
$newWp = (100 * $this->maxWidth) / $width;
|
257 |
-
$newHeight = ($height * $newWp) / 100;
|
258 |
-
return array('newWidth'=>intval($this->maxWidth), 'newHeight'=>intval($newHeight));
|
259 |
-
}
|
260 |
-
|
261 |
-
/**
|
262 |
-
* Calculates new image height
|
263 |
-
* @param int $width
|
264 |
-
* @param int $height
|
265 |
-
* @return array
|
266 |
-
*/
|
267 |
-
function calcHeight($width, $height) {
|
268 |
-
$newHp = (100 * $this->maxHeight) / $height;
|
269 |
-
$newWidth = ($width * $newHp) / 100;
|
270 |
-
return array('newWidth'=>intval($newWidth), 'newHeight'=>intval($this->maxHeight));
|
271 |
-
}
|
272 |
-
|
273 |
-
/**
|
274 |
-
* Calculates new image size based on percentage
|
275 |
-
* @param int $width
|
276 |
-
* @param int $height
|
277 |
-
* @return array
|
278 |
-
*/
|
279 |
-
function calcPercent($width, $height) {
|
280 |
-
$newWidth = ($width * $this->percent) / 100;
|
281 |
-
$newHeight = ($height * $this->percent) / 100;
|
282 |
-
return array('newWidth'=>intval($newWidth), 'newHeight'=>intval($newHeight));
|
283 |
-
}
|
284 |
-
|
285 |
-
/**
|
286 |
-
* Calculates new image size based on width and height, while constraining to maxWidth and maxHeight
|
287 |
-
* @param int $width
|
288 |
-
* @param int $height
|
289 |
-
*/
|
290 |
-
function calcImageSize($width,$height) {
|
291 |
-
$newSize = array('newWidth'=>$width,'newHeight'=>$height);
|
292 |
-
|
293 |
-
if($this->maxWidth > 0) {
|
294 |
-
|
295 |
-
$newSize = $this->calcWidth($width,$height);
|
296 |
-
|
297 |
-
if($this->maxHeight > 0 && $newSize['newHeight'] > $this->maxHeight) {
|
298 |
-
$newSize = $this->calcHeight($newSize['newWidth'],$newSize['newHeight']);
|
299 |
-
}
|
300 |
-
|
301 |
-
//$this->newDimensions = $newSize;
|
302 |
-
}
|
303 |
-
|
304 |
-
if($this->maxHeight > 0) {
|
305 |
-
$newSize = $this->calcHeight($width,$height);
|
306 |
-
|
307 |
-
if($this->maxWidth > 0 && $newSize['newWidth'] > $this->maxWidth) {
|
308 |
-
$newSize = $this->calcWidth($newSize['newWidth'],$newSize['newHeight']);
|
309 |
-
}
|
310 |
-
|
311 |
-
//$this->newDimensions = $newSize;
|
312 |
-
}
|
313 |
-
|
314 |
-
$this->newDimensions = $newSize;
|
315 |
-
}
|
316 |
-
|
317 |
-
/**
|
318 |
-
* Calculates new image size based percentage
|
319 |
-
* @param int $width
|
320 |
-
* @param int $height
|
321 |
-
*/
|
322 |
-
function calcImageSizePercent($width,$height) {
|
323 |
-
if($this->percent > 0) {
|
324 |
-
$this->newDimensions = $this->calcPercent($width,$height);
|
325 |
-
}
|
326 |
-
}
|
327 |
-
|
328 |
-
/**
|
329 |
-
* Resizes image to maxWidth x maxHeight
|
330 |
-
*
|
331 |
-
* @param int $maxWidth
|
332 |
-
* @param int $maxHeight
|
333 |
-
*/
|
334 |
-
|
335 |
-
function resize($maxWidth = 0, $maxHeight = 0, $resampleMode = 3) {
|
336 |
-
$this->maxWidth = $maxWidth;
|
337 |
-
$this->maxHeight = $maxHeight;
|
338 |
-
|
339 |
-
$this->calcImageSize($this->currentDimensions['width'],$this->currentDimensions['height']);
|
340 |
-
|
341 |
-
//string to resize the picture to $this->newDimensions['newWidth'],$this->newDimensions['newHeight']
|
342 |
-
//should result in: -thumbnail $this->newDimensions['newWidth']x$this->newDimensions['newHeight']
|
343 |
-
if($maxWidth=='0')
|
344 |
-
$this->imageMagickExec .= " -resize x".$maxHeight;
|
345 |
-
elseif($maxHeight=='0')
|
346 |
-
$this->imageMagickExec .= " -resize ".$maxWidth."x";
|
347 |
-
elseif($maxHeight!='0' && $maxWidth!='0')
|
348 |
-
$this->imageMagickExec .= " -resize ".$maxWidth."x".$maxHeight;
|
349 |
-
|
350 |
-
// next calculations should be done with the 'new' dimensions
|
351 |
-
$this->currentDimensions['width'] = $this->newDimensions['newWidth'];
|
352 |
-
$this->currentDimensions['height'] = $this->newDimensions['newHeight'];
|
353 |
-
|
354 |
-
}
|
355 |
-
|
356 |
-
/**
|
357 |
-
* Flip an image.
|
358 |
-
*
|
359 |
-
* @param bool $horz flip the image in horizontal mode
|
360 |
-
* @param bool $vert flip the image in vertical mode
|
361 |
-
*/
|
362 |
-
function flipImage( $horz = false, $vert = false ) {
|
363 |
-
|
364 |
-
//TODO: need to be added
|
365 |
-
|
366 |
-
}
|
367 |
-
|
368 |
-
/**
|
369 |
-
* Rotates image either 90 degrees clockwise or counter-clockwise
|
370 |
-
*
|
371 |
-
* @param string $dir
|
372 |
-
*/
|
373 |
-
function rotateImage($dir = 'CW')
|
374 |
-
{
|
375 |
-
$angle = ($dir == 'CW') ? 90 : -90;
|
376 |
-
|
377 |
-
$this->imageMagickExec .= " -rotate $angle ";
|
378 |
-
|
379 |
-
$newWidth = $this->currentDimensions['height'];
|
380 |
-
$newHeight = $this->currentDimensions['width'];
|
381 |
-
$this->currentDimensions['width'] = $newWidth;
|
382 |
-
$this->currentDimensions['height'] = $newHeight;
|
383 |
-
}
|
384 |
-
|
385 |
-
/**
|
386 |
-
* Crops the image from calculated center in a square of $cropSize pixels
|
387 |
-
*
|
388 |
-
* @param int $cropSize
|
389 |
-
*/
|
390 |
-
function cropFromCenter($cropSize, $resampleMode = 3) {
|
391 |
-
if($cropSize > $this->currentDimensions['width']) $cropSize = $this->currentDimensions['width'];
|
392 |
-
if($cropSize > $this->currentDimensions['height']) $cropSize = $this->currentDimensions['height'];
|
393 |
-
|
394 |
-
//$cropX = intval(($this->currentDimensions['width'] - $cropSize) / 2);
|
395 |
-
//$cropY = intval(($this->currentDimensions['height'] - $cropSize) / 2);
|
396 |
-
|
397 |
-
//string to crop the picture to $cropSize,$cropSize (from center)
|
398 |
-
//result: -gravity Center -crop $cropSizex$cropSize+0+0
|
399 |
-
$this->imageMagickExec .= ' -gravity Center -crop ' . $cropSize . 'x' . $cropSize . '+0+0';
|
400 |
-
|
401 |
-
// next calculations should be done with the 'new' dimensions
|
402 |
-
$this->currentDimensions['width'] = $cropSize;
|
403 |
-
$this->currentDimensions['height'] = $cropSize;
|
404 |
-
}
|
405 |
-
|
406 |
-
/**
|
407 |
-
* Advanced cropping function that crops an image using $startX and $startY as the upper-left hand corner.
|
408 |
-
*
|
409 |
-
* @param int $startX
|
410 |
-
* @param int $startY
|
411 |
-
* @param int $width
|
412 |
-
* @param int $height
|
413 |
-
*/
|
414 |
-
function crop($startX,$startY,$width,$height) {
|
415 |
-
//make sure the cropped area is not greater than the size of the image
|
416 |
-
if($width > $this->currentDimensions['width']) $width = $this->currentDimensions['width'];
|
417 |
-
if($height > $this->currentDimensions['height']) $height = $this->currentDimensions['height'];
|
418 |
-
//make sure not starting outside the image
|
419 |
-
if(($startX + $width) > $this->currentDimensions['width']) $startX = ($this->currentDimensions['width'] - $width);
|
420 |
-
if(($startY + $height) > $this->currentDimensions['height']) $startY = ($this->currentDimensions['height'] - $height);
|
421 |
-
if($startX < 0) $startX = 0;
|
422 |
-
if($startY < 0) $startY = 0;
|
423 |
-
|
424 |
-
//string to crop the picture to $width,$height (from $startX,$startY)
|
425 |
-
//result: -crop $widthx$height+$startX+$startY
|
426 |
-
$this->imageMagickExec .= ' -crop ' . $width . 'x' . $height . '+' . $startX .'+' . $startY;
|
427 |
-
|
428 |
-
$this->currentDimensions['width'] = $width;
|
429 |
-
$this->currentDimensions['height'] = $height;
|
430 |
-
}
|
431 |
-
|
432 |
-
/**
|
433 |
-
* Creates Apple-style reflection under image, optionally adding a border to main image
|
434 |
-
*
|
435 |
-
* @param int $percent
|
436 |
-
* @param int $reflection
|
437 |
-
* @param int $white
|
438 |
-
* @param bool $border
|
439 |
-
* @param string $borderColor
|
440 |
-
*/
|
441 |
-
function createReflection($percent, $reflection, $white, $border = true, $borderColor = '#a4a4a4') {
|
442 |
-
|
443 |
-
$width = $this->currentDimensions['width'];
|
444 |
-
$height = $this->currentDimensions['height'];
|
445 |
-
|
446 |
-
$reflectionHeight = intval($height * ($reflection / 100));
|
447 |
-
$newHeight = $height + $reflectionHeight;
|
448 |
-
//$reflectedPart = $height * ((100-$percent) / 100);
|
449 |
-
$reflectedsize = intval($height * ((100 - (100 - $percent) + $reflection) / 100));
|
450 |
-
|
451 |
-
$this->imageMagickBefore = "-size $width" . "x" ."$newHeight xc:white ";
|
452 |
-
|
453 |
-
if($border == true) {
|
454 |
-
$this->imageMagickBefore .= " \( ";
|
455 |
-
$this->imageMagickExec = " -bordercolor '$borderColor' -border 1 \) ";
|
456 |
-
}
|
457 |
-
|
458 |
-
$this->imageMagickExec .= " -geometry +0+0 -composite ";
|
459 |
-
$gradientWhite = 100-$white;
|
460 |
-
$this->imageMagickExec .= " \( '$this->fileName' -flip -resize $width"."x"."$reflectedsize\! \( -size $width"."x"."$reflectionHeight gradient: -fill black -colorize $gradientWhite \) +matte -compose copy_opacity -composite \) -geometry +0+$height -composite ";
|
461 |
-
|
462 |
-
$this->currentDimensions['width'] = $width;
|
463 |
-
$this->currentDimensions['height'] = $newHeight;
|
464 |
-
}
|
465 |
-
|
466 |
-
/**
|
467 |
-
* @param string $color
|
468 |
-
* @param string $wmFont
|
469 |
-
* @param int $wmSize
|
470 |
-
* @param int $wmOpaque
|
471 |
-
*/
|
472 |
-
function watermarkCreateText($color = '000000', $wmFont, $wmSize = 10, $wmOpaque = 90 ){
|
473 |
-
//create a watermark.png image with the requested text.
|
474 |
-
|
475 |
-
// set font path
|
476 |
-
$wmFontPath = NGGALLERY_ABSPATH . 'fonts/' . $wmFont;
|
477 |
-
if ( !is_readable($wmFontPath) )
|
478 |
-
return;
|
479 |
-
|
480 |
-
/*
|
481 |
-
$exec = "convert -size 800x500 xc:grey30 -font $wmFontPath -pointsize $wmSize -gravity center -draw \"fill '#$color$wmOpaque' text 0,0 '$this->watermarkText'\" stamp_fgnd.png";
|
482 |
-
$make_magick = system($exec);
|
483 |
-
$exec = "convert -size 800x500 xc:black -font $wmFontPath -pointsize $wmSize -gravity center -draw \"fill white text 1,1 '$this->watermarkText' text 0,0 '$this->watermarkText' fill black text -1,-1 '$this->watermarkText'\" +matte stamp_mask.png";
|
484 |
-
$make_magick = system($exec);
|
485 |
-
$exec = "composite -compose CopyOpacity stamp_mask.png stamp_fgnd.png watermark.png";*/
|
486 |
-
|
487 |
-
//convert the opacity between FF or 00; 100->0 and 0->FF (256)
|
488 |
-
$opacity = dechex( round( (100-$wmOpaque) * 256/100 ) );
|
489 |
-
if ($opacity == "0") {$opacity = "00";}
|
490 |
-
|
491 |
-
$cmd = "-size 800x500 xc:none -fill '#{$color}{$opacity}' -font {$wmFontPath} -pointsize {$wmSize} -gravity center -annotate 0 '{$this->watermarkText}' watermark_text.png";
|
492 |
-
$this->execute('convert', $cmd);
|
493 |
-
|
494 |
-
$cmd = "-trim +repage watermark_text.png";
|
495 |
-
$this->execute('mogrify', $cmd);
|
496 |
-
|
497 |
-
$this->watermarkImgPath = NGGALLERY_ABSPATH . 'watermark_text.png';
|
498 |
-
|
499 |
-
return;
|
500 |
-
}
|
501 |
-
|
502 |
-
/**
|
503 |
-
*
|
504 |
-
* @param string $relPOS
|
505 |
-
* @param int $xPOS
|
506 |
-
* @param int $yPOS
|
507 |
-
*/
|
508 |
-
function watermarkImage( $relPOS = 'botRight', $xPOS = 0, $yPOS = 0) {
|
509 |
-
|
510 |
-
// if it's not a valid file die...
|
511 |
-
/*if ( !is_readable($this->watermarkImgPath))
|
512 |
-
{
|
513 |
-
echo $this->watermarkImgPath;
|
514 |
-
return;
|
515 |
-
} */
|
516 |
-
|
517 |
-
$size = GetImageSize($this->watermarkImgPath);
|
518 |
-
$watermarkDimensions = array('width'=>$size[0],'height'=>$size[1]);
|
519 |
-
|
520 |
-
$sourcefile_width=$this->currentDimensions['width'];
|
521 |
-
$sourcefile_height=$this->currentDimensions['height'];
|
522 |
-
|
523 |
-
$watermarkfile_width=$watermarkDimensions['width'];
|
524 |
-
$watermarkfile_height=$watermarkDimensions['height'];
|
525 |
-
|
526 |
-
switch( substr($relPOS, 0, 3) ){
|
527 |
-
case 'top': $dest_y = 0 + $yPOS; break;
|
528 |
-
case 'mid': $dest_y = ($sourcefile_height / 2) - ($watermarkfile_height / 2); break;
|
529 |
-
case 'bot': $dest_y = $sourcefile_height - $watermarkfile_height - $yPOS; break;
|
530 |
-
default : $dest_y = 0; break;
|
531 |
-
}
|
532 |
-
switch( substr($relPOS, 3) ){
|
533 |
-
case 'Left' : $dest_x = 0 + $xPOS; break;
|
534 |
-
case 'Center': $dest_x = ($sourcefile_width / 2) - ($watermarkfile_width / 2); break;
|
535 |
-
case 'Right': $dest_x = $sourcefile_width - $watermarkfile_width - $xPOS; break;
|
536 |
-
default : $dest_x = 0; break;
|
537 |
-
}
|
538 |
-
if ($dest_y<0) {
|
539 |
-
$dest_y = $dest_y;
|
540 |
-
} else {
|
541 |
-
$dest_y = '+' . $dest_y;
|
542 |
-
}
|
543 |
-
if ($dest_x<0) {
|
544 |
-
$dest_x = $dest_x;
|
545 |
-
} else {
|
546 |
-
$dest_x = '+' . $dest_x;
|
547 |
-
}
|
548 |
-
|
549 |
-
$this->imageMagickComp .= "'$this->watermarkImgPath' -geometry $dest_x$dest_y -composite";
|
550 |
-
//" -dissolve 80% -geometry +$dest_x+$dest_y $this->watermarkImgPath";
|
551 |
-
}
|
552 |
-
|
553 |
-
/**
|
554 |
-
* Saves image as $name (can include file path), with quality of # percent if file is a jpeg
|
555 |
-
*
|
556 |
-
* @param string $name
|
557 |
-
* @param int $quality
|
558 |
-
* @return bool errorstate
|
559 |
-
*/
|
560 |
-
function save( $name, $quality = 85 ) {
|
561 |
-
$this->show($quality,$name);
|
562 |
-
if ($this->error == true) {
|
563 |
-
//$this->errmsg = 'Create Image failed. Check safe mode settings';
|
564 |
-
return false;
|
565 |
-
}
|
566 |
-
|
567 |
-
if( function_exists('do_action') )
|
568 |
-
do_action('ngg_ajax_image_save', $name);
|
569 |
-
|
570 |
-
return true;
|
571 |
-
}
|
572 |
-
|
573 |
-
/**
|
574 |
-
* Outputs the image to the screen, or saves to $name if supplied. Quality of JPEG images can be controlled with the $quality variable
|
575 |
-
*
|
576 |
-
* @param int $quality
|
577 |
-
* @param string $name
|
578 |
-
*/
|
579 |
-
function show( $quality = 85, $name = '') {
|
580 |
-
//save the image if we get a filename
|
581 |
-
if( $name != '' ) {
|
582 |
-
$args = "{$this->imageMagickBefore} ";
|
583 |
-
$args .= escapeshellarg("$this->fileName");
|
584 |
-
$args .= " $this->imageMagickExec $this->imageMagickComp -quality '$quality' ";
|
585 |
-
$args .= escapeshellarg("$name");
|
586 |
-
//$args = "{$this->imageMagickBefore} '$this->fileName' $this->imageMagickExec $this->imageMagickComp -quality $quality '$name'";
|
587 |
-
$this->execute('convert', $args);
|
588 |
-
//$this->error = true;
|
589 |
-
} else {
|
590 |
-
//return a raw image stream
|
591 |
-
$args = "{$this->imageMagickBefore} '$this->fileName' $this->imageMagickExec $this->imageMagickComp -quality $quality JPG:-";
|
592 |
-
$this->execute('convert', $args, true);
|
593 |
-
$this->error = true;
|
594 |
-
}
|
595 |
-
}
|
596 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
products/photocrati_nextgen/modules/ngglegacy/module.ngglegacy.php
CHANGED
@@ -23,7 +23,7 @@ class M_NggLegacy extends C_Base_Module
|
|
23 |
'photocrati-nextgen-legacy',
|
24 |
'NextGEN Legacy',
|
25 |
'Embeds the original version of NextGEN 1.9.3 by Alex Rabe',
|
26 |
-
'3.3.
|
27 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
28 |
'Imagely',
|
29 |
'https://www.imagely.com'
|
23 |
'photocrati-nextgen-legacy',
|
24 |
'NextGEN Legacy',
|
25 |
'Embeds the original version of NextGEN 1.9.3 by Alex Rabe',
|
26 |
+
'3.3.6',
|
27 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
28 |
'Imagely',
|
29 |
'https://www.imagely.com'
|
products/photocrati_nextgen/modules/simple_html_dom/module.simple_html_dom.php
DELETED
@@ -1,40 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/***
|
4 |
-
{
|
5 |
-
Module: photocrati-simple_html_dom
|
6 |
-
}
|
7 |
-
***/
|
8 |
-
|
9 |
-
if (!function_exists(('file_get_html'))) require_once('simplehtmldom/simple_html_dom.php');
|
10 |
-
|
11 |
-
class M_Simple_Html_Dom extends C_Base_Module
|
12 |
-
{
|
13 |
-
function define($id = 'pope-module',
|
14 |
-
$name = 'Pope Module',
|
15 |
-
$description = '',
|
16 |
-
$version = '',
|
17 |
-
$uri = '',
|
18 |
-
$author = '',
|
19 |
-
$author_uri = '',
|
20 |
-
$context = FALSE)
|
21 |
-
{
|
22 |
-
parent::define(
|
23 |
-
'photocrati-simple_html_dom',
|
24 |
-
'Simple HTML Dom',
|
25 |
-
'Provides the simple_html_dom utility for other modules to use',
|
26 |
-
'3.0.0',
|
27 |
-
'https://www.imagely.com',
|
28 |
-
'Imagely',
|
29 |
-
'https://www.imagely.com'
|
30 |
-
);
|
31 |
-
}
|
32 |
-
|
33 |
-
function get_type_list()
|
34 |
-
{
|
35 |
-
return array(
|
36 |
-
);
|
37 |
-
}
|
38 |
-
}
|
39 |
-
|
40 |
-
new M_Simple_Html_Dom();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
products/photocrati_nextgen/modules/simple_html_dom/package.module.simple_html_dom.php
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
<?php
|
|
products/photocrati_nextgen/modules/simple_html_dom/simplehtmldom/simple_html_dom.php
DELETED
@@ -1,1742 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Website: http://sourceforge.net/projects/simplehtmldom/
|
4 |
-
* Additional projects that may be used: http://sourceforge.net/projects/debugobject/
|
5 |
-
* Acknowledge: Jose Solorzano (https://sourceforge.net/projects/php-html/)
|
6 |
-
* Contributions by:
|
7 |
-
* Yousuke Kumakura (Attribute filters)
|
8 |
-
* Vadim Voituk (Negative indexes supports of "find" method)
|
9 |
-
* Antcs (Constructor with automatically load contents either text or file/url)
|
10 |
-
*
|
11 |
-
* all affected sections have comments starting with "PaperG"
|
12 |
-
*
|
13 |
-
* Paperg - Added case insensitive testing of the value of the selector.
|
14 |
-
* Paperg - Added tag_start for the starting index of tags - NOTE: This works but not accurately.
|
15 |
-
* This tag_start gets counted AFTER \r\n have been crushed out, and after the remove_noice calls so it will not reflect the REAL position of the tag in the source,
|
16 |
-
* it will almost always be smaller by some amount.
|
17 |
-
* We use this to determine how far into the file the tag in question is. This "percentage will never be accurate as the $dom->size is the "real" number of bytes the dom was created from.
|
18 |
-
* but for most purposes, it's a really good estimation.
|
19 |
-
* Paperg - Added the forceTagsClosed to the dom constructor. Forcing tags closed is great for malformed html, but it CAN lead to parsing errors.
|
20 |
-
* Allow the user to tell us how much they trust the html.
|
21 |
-
* Paperg add the text and plaintext to the selectors for the find syntax. plaintext implies text in the innertext of a node. text implies that the tag is a text node.
|
22 |
-
* This allows for us to find tags based on the text they contain.
|
23 |
-
* Create find_ancestor_tag to see if a tag is - at any level - inside of another specific tag.
|
24 |
-
* Paperg: added parse_charset so that we know about the character set of the source document.
|
25 |
-
* NOTE: If the user's system has a routine called get_last_retrieve_url_contents_content_type availalbe, we will assume it's returning the content-type header from the
|
26 |
-
* last transfer or curl_exec, and we will parse that and use it in preference to any other method of charset detection.
|
27 |
-
*
|
28 |
-
* Found infinite loop in the case of broken html in restore_noise. Rewrote to protect from that.
|
29 |
-
* PaperG (John Schlick) Added get_display_size for "IMG" tags.
|
30 |
-
*
|
31 |
-
* Licensed under The MIT License
|
32 |
-
* Redistributions of files must retain the above copyright notice.
|
33 |
-
*
|
34 |
-
* @author S.C. Chen <me578022@gmail.com>
|
35 |
-
* @author John Schlick
|
36 |
-
* @author Rus Carroll
|
37 |
-
* @version 1.5 ($Rev: 208 $)
|
38 |
-
* @package PlaceLocalInclude
|
39 |
-
* @subpackage simple_html_dom
|
40 |
-
*/
|
41 |
-
|
42 |
-
/**
|
43 |
-
* All of the Defines for the classes below.
|
44 |
-
* @author S.C. Chen <me578022@gmail.com>
|
45 |
-
*/
|
46 |
-
define('HDOM_TYPE_ELEMENT', 1);
|
47 |
-
define('HDOM_TYPE_COMMENT', 2);
|
48 |
-
define('HDOM_TYPE_TEXT', 3);
|
49 |
-
define('HDOM_TYPE_ENDTAG', 4);
|
50 |
-
define('HDOM_TYPE_ROOT', 5);
|
51 |
-
define('HDOM_TYPE_UNKNOWN', 6);
|
52 |
-
define('HDOM_QUOTE_DOUBLE', 0);
|
53 |
-
define('HDOM_QUOTE_SINGLE', 1);
|
54 |
-
define('HDOM_QUOTE_NO', 3);
|
55 |
-
define('HDOM_INFO_BEGIN', 0);
|
56 |
-
define('HDOM_INFO_END', 1);
|
57 |
-
define('HDOM_INFO_QUOTE', 2);
|
58 |
-
define('HDOM_INFO_SPACE', 3);
|
59 |
-
define('HDOM_INFO_TEXT', 4);
|
60 |
-
define('HDOM_INFO_INNER', 5);
|
61 |
-
define('HDOM_INFO_OUTER', 6);
|
62 |
-
define('HDOM_INFO_ENDSPACE',7);
|
63 |
-
define('DEFAULT_TARGET_CHARSET', 'UTF-8');
|
64 |
-
define('DEFAULT_BR_TEXT', "\r\n");
|
65 |
-
define('DEFAULT_SPAN_TEXT', " ");
|
66 |
-
define('MAX_FILE_SIZE', 600000);
|
67 |
-
// helper functions
|
68 |
-
// -----------------------------------------------------------------------------
|
69 |
-
// get html dom from file
|
70 |
-
// $maxlen is defined in the code as PHP_STREAM_COPY_ALL which is defined as -1.
|
71 |
-
function file_get_html($url, $use_include_path = false, $context=null, $offset = -1, $maxLen=-1, $lowercase = true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
|
72 |
-
{
|
73 |
-
// We DO force the tags to be terminated.
|
74 |
-
$dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText);
|
75 |
-
// For sourceforge users: uncomment the next line and comment the retreive_url_contents line 2 lines down if it is not already done.
|
76 |
-
$contents = file_get_contents($url, $use_include_path, $context, $offset);
|
77 |
-
// Paperg - use our own mechanism for getting the contents as we want to control the timeout.
|
78 |
-
//$contents = retrieve_url_contents($url);
|
79 |
-
if (empty($contents) || strlen($contents) > MAX_FILE_SIZE)
|
80 |
-
{
|
81 |
-
return false;
|
82 |
-
}
|
83 |
-
// The second parameter can force the selectors to all be lowercase.
|
84 |
-
$dom->load($contents, $lowercase, $stripRN);
|
85 |
-
return $dom;
|
86 |
-
}
|
87 |
-
|
88 |
-
// get html dom from string
|
89 |
-
function str_get_html($str, $lowercase=true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
|
90 |
-
{
|
91 |
-
$dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText);
|
92 |
-
if (empty($str) || strlen($str) > MAX_FILE_SIZE)
|
93 |
-
{
|
94 |
-
$dom->clear();
|
95 |
-
return false;
|
96 |
-
}
|
97 |
-
$dom->load($str, $lowercase, $stripRN);
|
98 |
-
return $dom;
|
99 |
-
}
|
100 |
-
|
101 |
-
// dump html dom tree
|
102 |
-
function dump_html_tree($node, $show_attr=true, $deep=0)
|
103 |
-
{
|
104 |
-
$node->dump($node);
|
105 |
-
}
|
106 |
-
|
107 |
-
|
108 |
-
/**
|
109 |
-
* simple html dom node
|
110 |
-
* PaperG - added ability for "find" routine to lowercase the value of the selector.
|
111 |
-
* PaperG - added $tag_start to track the start position of the tag in the total byte index
|
112 |
-
*
|
113 |
-
* @package PlaceLocalInclude
|
114 |
-
*/
|
115 |
-
class simple_html_dom_node
|
116 |
-
{
|
117 |
-
public $nodetype = HDOM_TYPE_TEXT;
|
118 |
-
public $tag = 'text';
|
119 |
-
public $attr = array();
|
120 |
-
public $children = array();
|
121 |
-
public $nodes = array();
|
122 |
-
public $parent = null;
|
123 |
-
// The "info" array - see HDOM_INFO_... for what each element contains.
|
124 |
-
public $_ = array();
|
125 |
-
public $tag_start = 0;
|
126 |
-
private $dom = null;
|
127 |
-
|
128 |
-
function __construct($dom)
|
129 |
-
{
|
130 |
-
$this->dom = $dom;
|
131 |
-
$dom->nodes[] = $this;
|
132 |
-
}
|
133 |
-
|
134 |
-
function __destruct()
|
135 |
-
{
|
136 |
-
$this->clear();
|
137 |
-
}
|
138 |
-
|
139 |
-
function __toString()
|
140 |
-
{
|
141 |
-
return $this->outertext();
|
142 |
-
}
|
143 |
-
|
144 |
-
// clean up memory due to php5 circular references memory leak...
|
145 |
-
function clear()
|
146 |
-
{
|
147 |
-
$this->dom = null;
|
148 |
-
$this->nodes = null;
|
149 |
-
$this->parent = null;
|
150 |
-
$this->children = null;
|
151 |
-
}
|
152 |
-
|
153 |
-
// dump node's tree
|
154 |
-
function dump($show_attr=true, $deep=0)
|
155 |
-
{
|
156 |
-
$lead = str_repeat(' ', $deep);
|
157 |
-
|
158 |
-
echo $lead.$this->tag;
|
159 |
-
if ($show_attr && count($this->attr)>0)
|
160 |
-
{
|
161 |
-
echo '(';
|
162 |
-
foreach ($this->attr as $k=>$v)
|
163 |
-
echo "[$k]=>\"".$this->$k.'", ';
|
164 |
-
echo ')';
|
165 |
-
}
|
166 |
-
echo "\n";
|
167 |
-
|
168 |
-
if ($this->nodes)
|
169 |
-
{
|
170 |
-
foreach ($this->nodes as $c)
|
171 |
-
{
|
172 |
-
$c->dump($show_attr, $deep+1);
|
173 |
-
}
|
174 |
-
}
|
175 |
-
}
|
176 |
-
|
177 |
-
|
178 |
-
// Debugging function to dump a single dom node with a bunch of information about it.
|
179 |
-
function dump_node($echo=true)
|
180 |
-
{
|
181 |
-
|
182 |
-
$string = $this->tag;
|
183 |
-
if (count($this->attr)>0)
|
184 |
-
{
|
185 |
-
$string .= '(';
|
186 |
-
foreach ($this->attr as $k=>$v)
|
187 |
-
{
|
188 |
-
$string .= "[$k]=>\"".$this->$k.'", ';
|
189 |
-
}
|
190 |
-
$string .= ')';
|
191 |
-
}
|
192 |
-
if (count($this->_)>0)
|
193 |
-
{
|
194 |
-
$string .= ' $_ (';
|
195 |
-
foreach ($this->_ as $k=>$v)
|
196 |
-
{
|
197 |
-
if (is_array($v))
|
198 |
-
{
|
199 |
-
$string .= "[$k]=>(";
|
200 |
-
foreach ($v as $k2=>$v2)
|
201 |
-
{
|
202 |
-
$string .= "[$k2]=>\"".$v2.'", ';
|
203 |
-
}
|
204 |
-
$string .= ")";
|
205 |
-
} else {
|
206 |
-
$string .= "[$k]=>\"".$v.'", ';
|
207 |
-
}
|
208 |
-
}
|
209 |
-
$string .= ")";
|
210 |
-
}
|
211 |
-
|
212 |
-
if (isset($this->text))
|
213 |
-
{
|
214 |
-
$string .= " text: (" . $this->text . ")";
|
215 |
-
}
|
216 |
-
|
217 |
-
$string .= " HDOM_INNER_INFO: '";
|
218 |
-
if (isset($node->_[HDOM_INFO_INNER]))
|
219 |
-
{
|
220 |
-
$string .= $node->_[HDOM_INFO_INNER] . "'";
|
221 |
-
}
|
222 |
-
else
|
223 |
-
{
|
224 |
-
$string .= ' NULL ';
|
225 |
-
}
|
226 |
-
|
227 |
-
$string .= " children: " . count($this->children);
|
228 |
-
$string .= " nodes: " . count($this->nodes);
|
229 |
-
$string .= " tag_start: " . $this->tag_start;
|
230 |
-
$string .= "\n";
|
231 |
-
|
232 |
-
if ($echo)
|
233 |
-
{
|
234 |
-
echo $string;
|
235 |
-
}
|
236 |
-
return $string;
|
237 |
-
}
|
238 |
-
|
239 |
-
// returns the parent of node
|
240 |
-
// If a node is passed in, it will reset the parent of the current node to that one.
|
241 |
-
function parent($parent=null)
|
242 |
-
{
|
243 |
-
// I am SURE that this doesn't work properly.
|
244 |
-
// It fails to unset the current node from it's current parents nodes or children list first.
|
245 |
-
if ($parent !== null)
|
246 |
-
{
|
247 |
-
$this->parent = $parent;
|
248 |
-
$this->parent->nodes[] = $this;
|
249 |
-
$this->parent->children[] = $this;
|
250 |
-
}
|
251 |
-
|
252 |
-
return $this->parent;
|
253 |
-
}
|
254 |
-
|
255 |
-
// verify that node has children
|
256 |
-
function has_child()
|
257 |
-
{
|
258 |
-
return !empty($this->children);
|
259 |
-
}
|
260 |
-
|
261 |
-
// returns children of node
|
262 |
-
function children($idx=-1)
|
263 |
-
{
|
264 |
-
if ($idx===-1)
|
265 |
-
{
|
266 |
-
return $this->children;
|
267 |
-
}
|
268 |
-
if (isset($this->children[$idx]))
|
269 |
-
{
|
270 |
-
return $this->children[$idx];
|
271 |
-
}
|
272 |
-
return null;
|
273 |
-
}
|
274 |
-
|
275 |
-
// returns the first child of node
|
276 |
-
function first_child()
|
277 |
-
{
|
278 |
-
if (count($this->children)>0)
|
279 |
-
{
|
280 |
-
return $this->children[0];
|
281 |
-
}
|
282 |
-
return null;
|
283 |
-
}
|
284 |
-
|
285 |
-
// returns the last child of node
|
286 |
-
function last_child()
|
287 |
-
{
|
288 |
-
if (($count=count($this->children))>0)
|
289 |
-
{
|
290 |
-
return $this->children[$count-1];
|
291 |
-
}
|
292 |
-
return null;
|
293 |
-
}
|
294 |
-
|
295 |
-
// returns the next sibling of node
|
296 |
-
function next_sibling()
|
297 |
-
{
|
298 |
-
if ($this->parent===null)
|
299 |
-
{
|
300 |
-
return null;
|
301 |
-
}
|
302 |
-
|
303 |
-
$idx = 0;
|
304 |
-
$count = count($this->parent->children);
|
305 |
-
while ($idx<$count && $this!==$this->parent->children[$idx])
|
306 |
-
{
|
307 |
-
++$idx;
|
308 |
-
}
|
309 |
-
if (++$idx>=$count)
|
310 |
-
{
|
311 |
-
return null;
|
312 |
-
}
|
313 |
-
return $this->parent->children[$idx];
|
314 |
-
}
|
315 |
-
|
316 |
-
// returns the previous sibling of node
|
317 |
-
function prev_sibling()
|
318 |
-
{
|
319 |
-
if ($this->parent===null) return null;
|
320 |
-
$idx = 0;
|
321 |
-
$count = count($this->parent->children);
|
322 |
-
while ($idx<$count && $this!==$this->parent->children[$idx])
|
323 |
-
++$idx;
|
324 |
-
if (--$idx<0) return null;
|
325 |
-
return $this->parent->children[$idx];
|
326 |
-
}
|
327 |
-
|
328 |
-
// function to locate a specific ancestor tag in the path to the root.
|
329 |
-
function find_ancestor_tag($tag)
|
330 |
-
{
|
331 |
-
global $debug_object;
|
332 |
-
if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
|
333 |
-
|
334 |
-
// Start by including ourselves in the comparison.
|
335 |
-
$returnDom = $this;
|
336 |
-
|
337 |
-
while (!is_null($returnDom))
|
338 |
-
{
|
339 |
-
if (is_object($debug_object)) { $debug_object->debug_log(2, "Current tag is: " . $returnDom->tag); }
|
340 |
-
|
341 |
-
if ($returnDom->tag == $tag)
|
342 |
-
{
|
343 |
-
break;
|
344 |
-
}
|
345 |
-
$returnDom = $returnDom->parent;
|
346 |
-
}
|
347 |
-
return $returnDom;
|
348 |
-
}
|
349 |
-
|
350 |
-
// get dom node's inner html
|
351 |
-
function innertext()
|
352 |
-
{
|
353 |
-
if (isset($this->_[HDOM_INFO_INNER])) return $this->_[HDOM_INFO_INNER];
|
354 |
-
if (isset($this->_[HDOM_INFO_TEXT])) return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]);
|
355 |
-
|
356 |
-
$ret = '';
|
357 |
-
foreach ($this->nodes as $n)
|
358 |
-
$ret .= $n->outertext();
|
359 |
-
return $ret;
|
360 |
-
}
|
361 |
-
|
362 |
-
// get dom node's outer text (with tag)
|
363 |
-
function outertext()
|
364 |
-
{
|
365 |
-
global $debug_object;
|
366 |
-
if (is_object($debug_object))
|
367 |
-
{
|
368 |
-
$text = '';
|
369 |
-
if ($this->tag == 'text')
|
370 |
-
{
|
371 |
-
if (!empty($this->text))
|
372 |
-
{
|
373 |
-
$text = " with text: " . $this->text;
|
374 |
-
}
|
375 |
-
}
|
376 |
-
$debug_object->debug_log(1, 'Innertext of tag: ' . $this->tag . $text);
|
377 |
-
}
|
378 |
-
|
379 |
-
if ($this->tag==='root') return $this->innertext();
|
380 |
-
|
381 |
-
// trigger callback
|
382 |
-
if ($this->dom && $this->dom->callback!==null)
|
383 |
-
{
|
384 |
-
call_user_func_array($this->dom->callback, array($this));
|
385 |
-
}
|
386 |
-
|
387 |
-
if (isset($this->_[HDOM_INFO_OUTER])) return $this->_[HDOM_INFO_OUTER];
|
388 |
-
if (isset($this->_[HDOM_INFO_TEXT])) return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]);
|
389 |
-
|
390 |
-
// render begin tag
|
391 |
-
if ($this->dom && $this->dom->nodes[$this->_[HDOM_INFO_BEGIN]])
|
392 |
-
{
|
393 |
-
$ret = $this->dom->nodes[$this->_[HDOM_INFO_BEGIN]]->makeup();
|
394 |
-
} else {
|
395 |
-
$ret = "";
|
396 |
-
}
|
397 |
-
|
398 |
-
// render inner text
|
399 |
-
if (isset($this->_[HDOM_INFO_INNER]))
|
400 |
-
{
|
401 |
-
// If it's a br tag... don't return the HDOM_INNER_INFO that we may or may not have added.
|
402 |
-
if ($this->tag != "br")
|
403 |
-
{
|
404 |
-
$ret .= $this->_[HDOM_INFO_INNER];
|
405 |
-
}
|
406 |
-
} else {
|
407 |
-
if ($this->nodes)
|
408 |
-
{
|
409 |
-
foreach ($this->nodes as $n)
|
410 |
-
{
|
411 |
-
$ret .= $this->convert_text($n->outertext());
|
412 |
-
}
|
413 |
-
}
|
414 |
-
}
|
415 |
-
|
416 |
-
// render end tag
|
417 |
-
if (isset($this->_[HDOM_INFO_END]) && $this->_[HDOM_INFO_END]!=0)
|
418 |
-
$ret .= '</'.$this->tag.'>';
|
419 |
-
return $ret;
|
420 |
-
}
|
421 |
-
|
422 |
-
// get dom node's plain text
|
423 |
-
function text()
|
424 |
-
{
|
425 |
-
if (isset($this->_[HDOM_INFO_INNER])) return $this->_[HDOM_INFO_INNER];
|
426 |
-
switch ($this->nodetype)
|
427 |
-
{
|
428 |
-
case HDOM_TYPE_TEXT: return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]);
|
429 |
-
case HDOM_TYPE_COMMENT: return '';
|
430 |
-
case HDOM_TYPE_UNKNOWN: return '';
|
431 |
-
}
|
432 |
-
if (strcasecmp($this->tag, 'script')===0) return '';
|
433 |
-
if (strcasecmp($this->tag, 'style')===0) return '';
|
434 |
-
|
435 |
-
$ret = '';
|
436 |
-
// In rare cases, (always node type 1 or HDOM_TYPE_ELEMENT - observed for some span tags, and some p tags) $this->nodes is set to NULL.
|
437 |
-
// NOTE: This indicates that there is a problem where it's set to NULL without a clear happening.
|
438 |
-
// WHY is this happening?
|
439 |
-
if (!is_null($this->nodes))
|
440 |
-
{
|
441 |
-
foreach ($this->nodes as $n)
|
442 |
-
{
|
443 |
-
$ret .= $this->convert_text($n->text());
|
444 |
-
}
|
445 |
-
|
446 |
-
// If this node is a span... add a space at the end of it so multiple spans don't run into each other. This is plaintext after all.
|
447 |
-
if ($this->tag == "span")
|
448 |
-
{
|
449 |
-
$ret .= $this->dom->default_span_text;
|
450 |
-
}
|
451 |
-
|
452 |
-
|
453 |
-
}
|
454 |
-
return $ret;
|
455 |
-
}
|
456 |
-
|
457 |
-
function xmltext()
|
458 |
-
{
|
459 |
-
$ret = $this->innertext();
|
460 |
-
$ret = str_ireplace('<![CDATA[', '', $ret);
|
461 |
-
$ret = str_replace(']]>', '', $ret);
|
462 |
-
return $ret;
|
463 |
-
}
|
464 |
-
|
465 |
-
// build node's text with tag
|
466 |
-
function makeup()
|
467 |
-
{
|
468 |
-
// text, comment, unknown
|
469 |
-
if (isset($this->_[HDOM_INFO_TEXT])) return $this->dom->restore_noise($this->_[HDOM_INFO_TEXT]);
|
470 |
-
|
471 |
-
$ret = '<'.$this->tag;
|
472 |
-
$i = -1;
|
473 |
-
|
474 |
-
foreach ($this->attr as $key=>$val)
|
475 |
-
{
|
476 |
-
++$i;
|
477 |
-
|
478 |
-
// skip removed attribute
|
479 |
-
if ($val===null || $val===false)
|
480 |
-
continue;
|
481 |
-
|
482 |
-
$ret .= $this->_[HDOM_INFO_SPACE][$i][0];
|
483 |
-
//no value attr: nowrap, checked selected...
|
484 |
-
if ($val===true)
|
485 |
-
$ret .= $key;
|
486 |
-
else {
|
487 |
-
switch ($this->_[HDOM_INFO_QUOTE][$i])
|
488 |
-
{
|
489 |
-
case HDOM_QUOTE_DOUBLE: $quote = '"'; break;
|
490 |
-
case HDOM_QUOTE_SINGLE: $quote = '\''; break;
|
491 |
-
default: $quote = '';
|
492 |
-
}
|
493 |
-
$ret .= $key.$this->_[HDOM_INFO_SPACE][$i][1].'='.$this->_[HDOM_INFO_SPACE][$i][2].$quote.$val.$quote;
|
494 |
-
}
|
495 |
-
}
|
496 |
-
$ret = $this->dom->restore_noise($ret);
|
497 |
-
return $ret . $this->_[HDOM_INFO_ENDSPACE] . '>';
|
498 |
-
}
|
499 |
-
|
500 |
-
// find elements by css selector
|
501 |
-
//PaperG - added ability for find to lowercase the value of the selector.
|
502 |
-
function find($selector, $idx=null, $lowercase=false)
|
503 |
-
{
|
504 |
-
$selectors = $this->parse_selector($selector);
|
505 |
-
if (($count=count($selectors))===0) return array();
|
506 |
-
$found_keys = array();
|
507 |
-
|
508 |
-
// find each selector
|
509 |
-
for ($c=0; $c<$count; ++$c)
|
510 |
-
{
|
511 |
-
// The change on the below line was documented on the sourceforge code tracker id 2788009
|
512 |
-
// used to be: if (($levle=count($selectors[0]))===0) return array();
|
513 |
-
if (($levle=count($selectors[$c]))===0) return array();
|
514 |
-
if (!isset($this->_[HDOM_INFO_BEGIN])) return array();
|
515 |
-
|
516 |
-
$head = array($this->_[HDOM_INFO_BEGIN]=>1);
|
517 |
-
|
518 |
-
// handle descendant selectors, no recursive!
|
519 |
-
for ($l=0; $l<$levle; ++$l)
|
520 |
-
{
|
521 |
-
$ret = array();
|
522 |
-
foreach ($head as $k=>$v)
|
523 |
-
{
|
524 |
-
$n = ($k===-1) ? $this->dom->root : $this->dom->nodes[$k];
|
525 |
-
//PaperG - Pass this optional parameter on to the seek function.
|
526 |
-
$n->seek($selectors[$c][$l], $ret, $lowercase);
|
527 |
-
}
|
528 |
-
$head = $ret;
|
529 |
-
}
|
530 |
-
|
531 |
-
foreach ($head as $k=>$v)
|
532 |
-
{
|
533 |
-
if (!isset($found_keys[$k]))
|
534 |
-
{
|
535 |
-
$found_keys[$k] = 1;
|
536 |
-
}
|
537 |
-
}
|
538 |
-
}
|
539 |
-
|
540 |
-
// sort keys
|
541 |
-
ksort($found_keys);
|
542 |
-
|
543 |
-
$found = array();
|
544 |
-
foreach ($found_keys as $k=>$v)
|
545 |
-
$found[] = $this->dom->nodes[$k];
|
546 |
-
|
547 |
-
// return nth-element or array
|
548 |
-
if (is_null($idx)) return $found;
|
549 |
-
else if ($idx<0) $idx = count($found) + $idx;
|
550 |
-
return (isset($found[$idx])) ? $found[$idx] : null;
|
551 |
-
}
|
552 |
-
|
553 |
-
// seek for given conditions
|
554 |
-
// PaperG - added parameter to allow for case insensitive testing of the value of a selector.
|
555 |
-
protected function seek($selector, &$ret, $lowercase=false)
|
556 |
-
{
|
557 |
-
global $debug_object;
|
558 |
-
if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
|
559 |
-
|
560 |
-
list($tag, $key, $val, $exp, $no_key) = $selector;
|
561 |
-
|
562 |
-
// xpath index
|
563 |
-
if ($tag && $key && is_numeric($key))
|
564 |
-
{
|
565 |
-
$count = 0;
|
566 |
-
foreach ($this->children as $c)
|
567 |
-
{
|
568 |
-
if ($tag==='*' || $tag===$c->tag) {
|
569 |
-
if (++$count==$key) {
|
570 |
-
$ret[$c->_[HDOM_INFO_BEGIN]] = 1;
|
571 |
-
return;
|
572 |
-
}
|
573 |
-
}
|
574 |
-
}
|
575 |
-
return;
|
576 |
-
}
|
577 |
-
|
578 |
-
$end = (!empty($this->_[HDOM_INFO_END])) ? $this->_[HDOM_INFO_END] : 0;
|
579 |
-
if ($end==0) {
|
580 |
-
$parent = $this->parent;
|
581 |
-
while (!isset($parent->_[HDOM_INFO_END]) && $parent!==null) {
|
582 |
-
$end -= 1;
|
583 |
-
$parent = $parent->parent;
|
584 |
-
}
|
585 |
-
$end += $parent->_[HDOM_INFO_END];
|
586 |
-
}
|
587 |
-
|
588 |
-
for ($i=$this->_[HDOM_INFO_BEGIN]+1; $i<$end; ++$i) {
|
589 |
-
$node = $this->dom->nodes[$i];
|
590 |
-
|
591 |
-
$pass = true;
|
592 |
-
|
593 |
-
if ($tag==='*' && !$key) {
|
594 |
-
if (in_array($node, $this->children, true))
|
595 |
-
$ret[$i] = 1;
|
596 |
-
continue;
|
597 |
-
}
|
598 |
-
|
599 |
-
// compare tag
|
600 |
-
if ($tag && $tag!=$node->tag && $tag!=='*') {$pass=false;}
|
601 |
-
// compare key
|
602 |
-
if ($pass && $key) {
|
603 |
-
if ($no_key) {
|
604 |
-
if (isset($node->attr[$key])) $pass=false;
|
605 |
-
} else {
|
606 |
-
if (($key != "plaintext") && !isset($node->attr[$key])) $pass=false;
|
607 |
-
}
|
608 |
-
}
|
609 |
-
// compare value
|
610 |
-
if ($pass && $key && $val && $val!=='*') {
|
611 |
-
// If they have told us that this is a "plaintext" search then we want the plaintext of the node - right?
|
612 |
-
if ($key == "plaintext") {
|
613 |
-
// $node->plaintext actually returns $node->text();
|
614 |
-
$nodeKeyValue = $node->text();
|
615 |
-
} else {
|
616 |
-
// this is a normal search, we want the value of that attribute of the tag.
|
617 |
-
$nodeKeyValue = $node->attr[$key];
|
618 |
-
}
|
619 |
-
if (is_object($debug_object)) {$debug_object->debug_log(2, "testing node: " . $node->tag . " for attribute: " . $key . $exp . $val . " where nodes value is: " . $nodeKeyValue);}
|
620 |
-
|
621 |
-
//PaperG - If lowercase is set, do a case insensitive test of the value of the selector.
|
622 |
-
if ($lowercase) {
|
623 |
-
$check = $this->match($exp, strtolower($val), strtolower($nodeKeyValue));
|
624 |
-
} else {
|
625 |
-
$check = $this->match($exp, $val, $nodeKeyValue);
|
626 |
-
}
|
627 |
-
if (is_object($debug_object)) {$debug_object->debug_log(2, "after match: " . ($check ? "true" : "false"));}
|
628 |
-
|
629 |
-
// handle multiple class
|
630 |
-
if (!$check && strcasecmp($key, 'class')===0) {
|
631 |
-
foreach (explode(' ',$node->attr[$key]) as $k) {
|
632 |
-
// Without this, there were cases where leading, trailing, or double spaces lead to our comparing blanks - bad form.
|
633 |
-
if (!empty($k)) {
|
634 |
-
if ($lowercase) {
|
635 |
-
$check = $this->match($exp, strtolower($val), strtolower($k));
|
636 |
-
} else {
|
637 |
-
$check = $this->match($exp, $val, $k);
|
638 |
-
}
|
639 |
-
if ($check) break;
|
640 |
-
}
|
641 |
-
}
|
642 |
-
}
|
643 |
-
if (!$check) $pass = false;
|
644 |
-
}
|
645 |
-
if ($pass) $ret[$i] = 1;
|
646 |
-
unset($node);
|
647 |
-
}
|
648 |
-
// It's passed by reference so this is actually what this function returns.
|
649 |
-
if (is_object($debug_object)) {$debug_object->debug_log(1, "EXIT - ret: ", $ret);}
|
650 |
-
}
|
651 |
-
|
652 |
-
protected function match($exp, $pattern, $value) {
|
653 |
-
global $debug_object;
|
654 |
-
if (is_object($debug_object)) {$debug_object->debug_log_entry(1);}
|
655 |
-
|
656 |
-
switch ($exp) {
|
657 |
-
case '=':
|
658 |
-
return ($value===$pattern);
|
659 |
-
case '!=':
|
660 |
-
return ($value!==$pattern);
|
661 |
-
case '^=':
|
662 |
-
return preg_match("/^".preg_quote($pattern,'/')."/", $value);
|
663 |
-
case '$=':
|
664 |
-
return preg_match("/".preg_quote($pattern,'/')."$/", $value);
|
665 |
-
case '*=':
|
666 |
-
if ($pattern[0]=='/') {
|
667 |
-
return preg_match($pattern, $value);
|
668 |
-
}
|
669 |
-
return preg_match("/".$pattern."/i", $value);
|
670 |
-
}
|
671 |
-
return false;
|
672 |
-
}
|
673 |
-
|
674 |
-
protected function parse_selector($selector_string) {
|
675 |
-
global $debug_object;
|
676 |
-
if (is_object($debug_object)) {$debug_object->debug_log_entry(1);}
|
677 |
-
|
678 |
-
// pattern of CSS selectors, modified from mootools
|
679 |
-
// Paperg: Add the colon to the attrbute, so that it properly finds <tag attr:ibute="something" > like google does.
|
680 |
-
// Note: if you try to look at this attribute, yo MUST use getAttribute since $dom->x:y will fail the php syntax check.
|
681 |
-
// Notice the \[ starting the attbute? and the @? following? This implies that an attribute can begin with an @ sign that is not captured.
|
682 |
-
// This implies that an html attribute specifier may start with an @ sign that is NOT captured by the expression.
|
683 |
-
// farther study is required to determine of this should be documented or removed.
|
684 |
-
// $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
|
685 |
-
$pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
|
686 |
-
preg_match_all($pattern, trim($selector_string).' ', $matches, PREG_SET_ORDER);
|
687 |
-
if (is_object($debug_object)) {$debug_object->debug_log(2, "Matches Array: ", $matches);}
|
688 |
-
|
689 |
-
$selectors = array();
|
690 |
-
$result = array();
|
691 |
-
//print_r($matches);
|
692 |
-
|
693 |
-
foreach ($matches as $m) {
|
694 |
-
$m[0] = trim($m[0]);
|
695 |
-
if ($m[0]==='' || $m[0]==='/' || $m[0]==='//') continue;
|
696 |
-
// for browser generated xpath
|
697 |
-
if ($m[1]==='tbody') continue;
|
698 |
-
|
699 |
-
list($tag, $key, $val, $exp, $no_key) = array($m[1], null, null, '=', false);
|
700 |
-
if (!empty($m[2])) {$key='id'; $val=$m[2];}
|
701 |
-
if (!empty($m[3])) {$key='class'; $val=$m[3];}
|
702 |
-
if (!empty($m[4])) {$key=$m[4];}
|
703 |
-
if (!empty($m[5])) {$exp=$m[5];}
|
704 |
-
if (!empty($m[6])) {$val=$m[6];}
|
705 |
-
|
706 |
-
// convert to lowercase
|
707 |
-
if ($this->dom->lowercase) {$tag=strtolower($tag); $key=strtolower($key);}
|
708 |
-
//elements that do NOT have the specified attribute
|
709 |
-
if (isset($key[0]) && $key[0]==='!') {$key=substr($key, 1); $no_key=true;}
|
710 |
-
|
711 |
-
$result[] = array($tag, $key, $val, $exp, $no_key);
|
712 |
-
if (trim($m[7])===',') {
|
713 |
-
$selectors[] = $result;
|
714 |
-
$result = array();
|
715 |
-
}
|
716 |
-
}
|
717 |
-
if (count($result)>0)
|
718 |
-
$selectors[] = $result;
|
719 |
-
return $selectors;
|
720 |
-
}
|
721 |
-
|
722 |
-
function __get($name)
|
723 |
-
{
|
724 |
-
if (isset($this->attr[$name]))
|
725 |
-
{
|
726 |
-
return $this->convert_text($this->attr[$name]);
|
727 |
-
}
|
728 |
-
switch ($name)
|
729 |
-
{
|
730 |
-
case 'outertext': return $this->outertext();
|
731 |
-
case 'innertext': return $this->innertext();
|
732 |
-
case 'plaintext': return $this->text();
|
733 |
-
case 'xmltext': return $this->xmltext();
|
734 |
-
default: return array_key_exists($name, $this->attr);
|
735 |
-
}
|
736 |
-
}
|
737 |
-
|
738 |
-
function __set($name, $value)
|
739 |
-
{
|
740 |
-
global $debug_object;
|
741 |
-
if (is_object($debug_object)) {$debug_object->debug_log_entry(1);}
|
742 |
-
|
743 |
-
switch ($name)
|
744 |
-
{
|
745 |
-
case 'outertext': return $this->_[HDOM_INFO_OUTER] = $value;
|
746 |
-
case 'innertext':
|
747 |
-
if (isset($this->_[HDOM_INFO_TEXT])) return $this->_[HDOM_INFO_TEXT] = $value;
|
748 |
-
return $this->_[HDOM_INFO_INNER] = $value;
|
749 |
-
}
|
750 |
-
if (!isset($this->attr[$name]))
|
751 |
-
{
|
752 |
-
$this->_[HDOM_INFO_SPACE][] = array(' ', '', '');
|
753 |
-
$this->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_DOUBLE;
|
754 |
-
}
|
755 |
-
$this->attr[$name] = $value;
|
756 |
-
|
757 |
-
return $value;
|
758 |
-
}
|
759 |
-
|
760 |
-
function __isset($name)
|
761 |
-
{
|
762 |
-
switch ($name)
|
763 |
-
{
|
764 |
-
case 'outertext': return true;
|
765 |
-
case 'innertext': return true;
|
766 |
-
case 'plaintext': return true;
|
767 |
-
}
|
768 |
-
//no value attr: nowrap, checked selected...
|
769 |
-
return (array_key_exists($name, $this->attr)) ? true : isset($this->attr[$name]);
|
770 |
-
}
|
771 |
-
|
772 |
-
function __unset($name) {
|
773 |
-
if (isset($this->attr[$name]))
|
774 |
-
unset($this->attr[$name]);
|
775 |
-
}
|
776 |
-
|
777 |
-
// PaperG - Function to convert the text from one character set to another if the two sets are not the same.
|
778 |
-
function convert_text($text)
|
779 |
-
{
|
780 |
-
global $debug_object;
|
781 |
-
if (is_object($debug_object)) {$debug_object->debug_log_entry(1);}
|
782 |
-
|
783 |
-
$converted_text = $text;
|
784 |
-
|
785 |
-
$sourceCharset = "";
|
786 |
-
$targetCharset = "";
|
787 |
-
|
788 |
-
if ($this->dom)
|
789 |
-
{
|
790 |
-
$sourceCharset = strtoupper($this->dom->_charset);
|
791 |
-
$targetCharset = strtoupper($this->dom->_target_charset);
|
792 |
-
}
|
793 |
-
if (is_object($debug_object)) {$debug_object->debug_log(3, "source charset: " . $sourceCharset . " target charaset: " . $targetCharset);}
|
794 |
-
|
795 |
-
if (!empty($sourceCharset) && !empty($targetCharset) && (strcasecmp($sourceCharset, $targetCharset) != 0))
|
796 |
-
{
|
797 |
-
// Check if the reported encoding could have been incorrect and the text is actually already UTF-8
|
798 |
-
if ((strcasecmp($targetCharset, 'UTF-8') == 0) && ($this->is_utf8($text)))
|
799 |
-
{
|
800 |
-
$converted_text = $text;
|
801 |
-
}
|
802 |
-
else
|
803 |
-
{
|
804 |
-
$converted_text = iconv($sourceCharset, $targetCharset, $text);
|
805 |
-
}
|
806 |
-
}
|
807 |
-
|
808 |
-
// Lets make sure that we don't have that silly BOM issue with any of the utf-8 text we output.
|
809 |
-
if ($targetCharset == 'UTF-8')
|
810 |
-
{
|
811 |
-
if (substr($converted_text, 0, 3) == "\xef\xbb\xbf")
|
812 |
-
{
|
813 |
-
$converted_text = substr($converted_text, 3);
|
814 |
-
}
|
815 |
-
if (substr($converted_text, -3) == "\xef\xbb\xbf")
|
816 |
-
{
|
817 |
-
$converted_text = substr($converted_text, 0, -3);
|
818 |
-
}
|
819 |
-
}
|
820 |
-
|
821 |
-
return $converted_text;
|
822 |
-
}
|
823 |
-
|
824 |
-
/**
|
825 |
-
* Returns true if $string is valid UTF-8 and false otherwise.
|
826 |
-
*
|
827 |
-
* @param mixed $str String to be tested
|
828 |
-
* @return boolean
|
829 |
-
*/
|
830 |
-
static function is_utf8($str)
|
831 |
-
{
|
832 |
-
$c=0; $b=0;
|
833 |
-
$bits=0;
|
834 |
-
$len=strlen($str);
|
835 |
-
for($i=0; $i<$len; $i++)
|
836 |
-
{
|
837 |
-
$c=ord($str[$i]);
|
838 |
-
if($c > 128)
|
839 |
-
{
|
840 |
-
if(($c >= 254)) return false;
|
841 |
-
elseif($c >= 252) $bits=6;
|
842 |
-
elseif($c >= 248) $bits=5;
|
843 |
-
elseif($c >= 240) $bits=4;
|
844 |
-
elseif($c >= 224) $bits=3;
|
845 |
-
elseif($c >= 192) $bits=2;
|
846 |
-
else return false;
|
847 |
-
if(($i+$bits) > $len) return false;
|
848 |
-
while($bits > 1)
|
849 |
-
{
|
850 |
-
$i++;
|
851 |
-
$b=ord($str[$i]);
|
852 |
-
if($b < 128 || $b > 191) return false;
|
853 |
-
$bits--;
|
854 |
-
}
|
855 |
-
}
|
856 |
-
}
|
857 |
-
return true;
|
858 |
-
}
|
859 |
-
/*
|
860 |
-
function is_utf8($string)
|
861 |
-
{
|
862 |
-
//this is buggy
|
863 |
-
return (utf8_encode(utf8_decode($string)) == $string);
|
864 |
-
}
|
865 |
-
*/
|
866 |
-
|
867 |
-
/**
|
868 |
-
* Function to try a few tricks to determine the displayed size of an img on the page.
|
869 |
-
* NOTE: This will ONLY work on an IMG tag. Returns FALSE on all other tag types.
|
870 |
-
*
|
871 |
-
* @author John Schlick
|
872 |
-
* @version April 19 2012
|
873 |
-
* @return array an array containing the 'height' and 'width' of the image on the page or -1 if we can't figure it out.
|
874 |
-
*/
|
875 |
-
function get_display_size()
|
876 |
-
{
|
877 |
-
global $debug_object;
|
878 |
-
|
879 |
-
$width = -1;
|
880 |
-
$height = -1;
|
881 |
-
|
882 |
-
if ($this->tag !== 'img')
|
883 |
-
{
|
884 |
-
return false;
|
885 |
-
}
|
886 |
-
|
887 |
-
// See if there is aheight or width attribute in the tag itself.
|
888 |
-
if (isset($this->attr['width']))
|
889 |
-
{
|
890 |
-
$width = $this->attr['width'];
|
891 |
-
}
|
892 |
-
|
893 |
-
if (isset($this->attr['height']))
|
894 |
-
{
|
895 |
-
$height = $this->attr['height'];
|
896 |
-
}
|
897 |
-
|
898 |
-
// Now look for an inline style.
|
899 |
-
if (isset($this->attr['style']))
|
900 |
-
{
|
901 |
-
// Thanks to user gnarf from stackoverflow for this regular expression.
|
902 |
-
$attributes = array();
|
903 |
-
preg_match_all("/([\w-]+)\s*:\s*([^;]+)\s*;?/", $this->attr['style'], $matches, PREG_SET_ORDER);
|
904 |
-
foreach ($matches as $match) {
|
905 |
-
$attributes[$match[1]] = $match[2];
|
906 |
-
}
|
907 |
-
|
908 |
-
// If there is a width in the style attributes:
|
909 |
-
if (isset($attributes['width']) && $width == -1)
|
910 |
-
{
|
911 |
-
// check that the last two characters are px (pixels)
|
912 |
-
if (strtolower(substr($attributes['width'], -2)) == 'px')
|
913 |
-
{
|
914 |
-
$proposed_width = substr($attributes['width'], 0, -2);
|
915 |
-
// Now make sure that it's an integer and not something stupid.
|
916 |
-
if (filter_var($proposed_width, FILTER_VALIDATE_INT))
|
917 |
-
{
|
918 |
-
$width = $proposed_width;
|
919 |
-
}
|
920 |
-
}
|
921 |
-
}
|
922 |
-
|
923 |
-
// If there is a width in the style attributes:
|
924 |
-
if (isset($attributes['height']) && $height == -1)
|
925 |
-
{
|
926 |
-
// check that the last two characters are px (pixels)
|
927 |
-
if (strtolower(substr($attributes['height'], -2)) == 'px')
|
928 |
-
{
|
929 |
-
$proposed_height = substr($attributes['height'], 0, -2);
|
930 |
-
// Now make sure that it's an integer and not something stupid.
|
931 |
-
if (filter_var($proposed_height, FILTER_VALIDATE_INT))
|
932 |
-
{
|
933 |
-
$height = $proposed_height;
|
934 |
-
}
|
935 |
-
}
|
936 |
-
}
|
937 |
-
|
938 |
-
}
|
939 |
-
|
940 |
-
// Future enhancement:
|
941 |
-
// Look in the tag to see if there is a class or id specified that has a height or width attribute to it.
|
942 |
-
|
943 |
-
// Far future enhancement
|
944 |
-
// Look at all the parent tags of this image to see if they specify a class or id that has an img selector that specifies a height or width
|
945 |
-
// Note that in this case, the class or id will have the img subselector for it to apply to the image.
|
946 |
-
|
947 |
-
// ridiculously far future development
|
948 |
-
// If the class or id is specified in a SEPARATE css file thats not on the page, go get it and do what we were just doing for the ones on the page.
|
949 |
-
|
950 |
-
$result = array('height' => $height,
|
951 |
-
'width' => $width);
|
952 |
-
return $result;
|
953 |
-
}
|
954 |
-
|
955 |
-
// camel naming conventions
|
956 |
-
function getAllAttributes() {return $this->attr;}
|
957 |
-
function getAttribute($name) {return $this->__get($name);}
|
958 |
-
function setAttribute($name, $value) {$this->__set($name, $value);}
|
959 |
-
function hasAttribute($name) {return $this->__isset($name);}
|
960 |
-
function removeAttribute($name) {$this->__set($name, null);}
|
961 |
-
function getElementById($id) {return $this->find("#$id", 0);}
|
962 |
-
function getElementsById($id, $idx=null) {return $this->find("#$id", $idx);}
|
963 |
-
function getElementByTagName($name) {return $this->find($name, 0);}
|
964 |
-
function getElementsByTagName($name, $idx=null) {return $this->find($name, $idx);}
|
965 |
-
function parentNode() {return $this->parent();}
|
966 |
-
function childNodes($idx=-1) {return $this->children($idx);}
|
967 |
-
function firstChild() {return $this->first_child();}
|
968 |
-
function lastChild() {return $this->last_child();}
|
969 |
-
function nextSibling() {return $this->next_sibling();}
|
970 |
-
function previousSibling() {return $this->prev_sibling();}
|
971 |
-
function hasChildNodes() {return $this->has_child();}
|
972 |
-
function nodeName() {return $this->tag;}
|
973 |
-
function appendChild($node) {$node->parent($this); return $node;}
|
974 |
-
|
975 |
-
}
|
976 |
-
|
977 |
-
/**
|
978 |
-
* simple html dom parser
|
979 |
-
* Paperg - in the find routine: allow us to specify that we want case insensitive testing of the value of the selector.
|
980 |
-
* Paperg - change $size from protected to public so we can easily access it
|
981 |
-
* Paperg - added ForceTagsClosed in the constructor which tells us whether we trust the html or not. Default is to NOT trust it.
|
982 |
-
*
|
983 |
-
* @package PlaceLocalInclude
|
984 |
-
*/
|
985 |
-
class simple_html_dom
|
986 |
-
{
|
987 |
-
public $root = null;
|
988 |
-
public $nodes = array();
|
989 |
-
public $callback = null;
|
990 |
-
public $lowercase = false;
|
991 |
-
// Used to keep track of how large the text was when we started.
|
992 |
-
public $original_size;
|
993 |
-
public $size;
|
994 |
-
protected $pos;
|
995 |
-
protected $doc;
|
996 |
-
protected $char;
|
997 |
-
protected $cursor;
|
998 |
-
protected $parent;
|
999 |
-
protected $noise = array();
|
1000 |
-
protected $token_blank = " \t\r\n";
|
1001 |
-
protected $token_equal = ' =/>';
|
1002 |
-
protected $token_slash = " />\r\n\t";
|
1003 |
-
protected $token_attr = ' >';
|
1004 |
-
// Note that this is referenced by a child node, and so it needs to be public for that node to see this information.
|
1005 |
-
public $_charset = '';
|
1006 |
-
public $_target_charset = '';
|
1007 |
-
protected $default_br_text = "";
|
1008 |
-
public $default_span_text = "";
|
1009 |
-
|
1010 |
-
// use isset instead of in_array, performance boost about 30%...
|
1011 |
-
protected $self_closing_tags = array('img'=>1, 'br'=>1, 'input'=>1, 'meta'=>1, 'link'=>1, 'hr'=>1, 'base'=>1, 'embed'=>1, 'spacer'=>1);
|
1012 |
-
protected $block_tags = array('root'=>1, 'body'=>1, 'form'=>1, 'div'=>1, 'span'=>1, 'table'=>1);
|
1013 |
-
// Known sourceforge issue #2977341
|
1014 |
-
// B tags that are not closed cause us to return everything to the end of the document.
|
1015 |
-
protected $optional_closing_tags = array(
|
1016 |
-
'tr'=>array('tr'=>1, 'td'=>1, 'th'=>1),
|
1017 |
-
'th'=>array('th'=>1),
|
1018 |
-
'td'=>array('td'=>1),
|
1019 |
-
'li'=>array('li'=>1),
|
1020 |
-
'dt'=>array('dt'=>1, 'dd'=>1),
|
1021 |
-
'dd'=>array('dd'=>1, 'dt'=>1),
|
1022 |
-
'dl'=>array('dd'=>1, 'dt'=>1),
|
1023 |
-
'p'=>array('p'=>1),
|
1024 |
-
'nobr'=>array('nobr'=>1),
|
1025 |
-
'b'=>array('b'=>1),
|
1026 |
-
'option'=>array('option'=>1),
|
1027 |
-
);
|
1028 |
-
|
1029 |
-
function __construct($str=null, $lowercase=true, $forceTagsClosed=true, $target_charset=DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
|
1030 |
-
{
|
1031 |
-
if ($str)
|
1032 |
-
{
|
1033 |
-
if (preg_match("/^http:\/\//i",$str) || is_file($str))
|
1034 |
-
{
|
1035 |
-
$this->load_file($str);
|
1036 |
-
}
|
1037 |
-
else
|
1038 |
-
{
|
1039 |
-
$this->load($str, $lowercase, $stripRN, $defaultBRText, $defaultSpanText);
|
1040 |
-
}
|
1041 |
-
}
|
1042 |
-
// Forcing tags to be closed implies that we don't trust the html, but it can lead to parsing errors if we SHOULD trust the html.
|
1043 |
-
if (!$forceTagsClosed) {
|
1044 |
-
$this->optional_closing_array=array();
|
1045 |
-
}
|
1046 |
-
$this->_target_charset = $target_charset;
|
1047 |
-
}
|
1048 |
-
|
1049 |
-
function __destruct()
|
1050 |
-
{
|
1051 |
-
$this->clear();
|
1052 |
-
}
|
1053 |
-
|
1054 |
-
// load html from string
|
1055 |
-
function load($str, $lowercase=true, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
|
1056 |
-
{
|
1057 |
-
global $debug_object;
|
1058 |
-
|
1059 |
-
// prepare
|
1060 |
-
$this->prepare($str, $lowercase, $stripRN, $defaultBRText, $defaultSpanText);
|
1061 |
-
// strip out cdata
|
1062 |
-
$this->remove_noise("'<!\[CDATA\[(.*?)\]\]>'is", true);
|
1063 |
-
// strip out comments
|
1064 |
-
$this->remove_noise("'<!--(.*?)-->'is");
|
1065 |
-
// Per sourceforge http://sourceforge.net/tracker/?func=detail&aid=2949097&group_id=218559&atid=1044037
|
1066 |
-
// Script tags removal now preceeds style tag removal.
|
1067 |
-
// strip out <script> tags
|
1068 |
-
$this->remove_noise("'<\s*script[^>]*[^/]>(.*?)<\s*/\s*script\s*>'is");
|
1069 |
-
$this->remove_noise("'<\s*script\s*>(.*?)<\s*/\s*script\s*>'is");
|
1070 |
-
// strip out <style> tags
|
1071 |
-
$this->remove_noise("'<\s*style[^>]*[^/]>(.*?)<\s*/\s*style\s*>'is");
|
1072 |
-
$this->remove_noise("'<\s*style\s*>(.*?)<\s*/\s*style\s*>'is");
|
1073 |
-
// strip out preformatted tags
|
1074 |
-
$this->remove_noise("'<\s*(?:code)[^>]*>(.*?)<\s*/\s*(?:code)\s*>'is");
|
1075 |
-
// strip out server side scripts
|
1076 |
-
$this->remove_noise("'(<\?)(.*?)(\?>)'s", true);
|
1077 |
-
// strip smarty scripts
|
1078 |
-
$this->remove_noise("'(\{\w)(.*?)(\})'s", true);
|
1079 |
-
|
1080 |
-
// parsing
|
1081 |
-
while ($this->parse());
|
1082 |
-
// end
|
1083 |
-
$this->root->_[HDOM_INFO_END] = $this->cursor;
|
1084 |
-
$this->parse_charset();
|
1085 |
-
|
1086 |
-
// make load function chainable
|
1087 |
-
return $this;
|
1088 |
-
|
1089 |
-
}
|
1090 |
-
|
1091 |
-
// load html from file
|
1092 |
-
function load_file()
|
1093 |
-
{
|
1094 |
-
$args = func_get_args();
|
1095 |
-
$this->load(call_user_func_array('file_get_contents', $args), true);
|
1096 |
-
// Throw an error if we can't properly load the dom.
|
1097 |
-
if (($error=error_get_last())!==null) {
|
1098 |
-
$this->clear();
|
1099 |
-
return false;
|
1100 |
-
}
|
1101 |
-
return $this;
|
1102 |
-
}
|
1103 |
-
|
1104 |
-
// set callback function
|
1105 |
-
function set_callback($function_name)
|
1106 |
-
{
|
1107 |
-
$this->callback = $function_name;
|
1108 |
-
}
|
1109 |
-
|
1110 |
-
// remove callback function
|
1111 |
-
function remove_callback()
|
1112 |
-
{
|
1113 |
-
$this->callback = null;
|
1114 |
-
}
|
1115 |
-
|
1116 |
-
// save dom as string
|
1117 |
-
function save($filepath='')
|
1118 |
-
{
|
1119 |
-
$ret = $this->root->innertext();
|
1120 |
-
if ($filepath!=='') file_put_contents($filepath, $ret, LOCK_EX);
|
1121 |
-
return $ret;
|
1122 |
-
}
|
1123 |
-
|
1124 |
-
// find dom node by css selector
|
1125 |
-
// Paperg - allow us to specify that we want case insensitive testing of the value of the selector.
|
1126 |
-
function find($selector, $idx=null, $lowercase=false)
|
1127 |
-
{
|
1128 |
-
return $this->root->find($selector, $idx, $lowercase);
|
1129 |
-
}
|
1130 |
-
|
1131 |
-
// clean up memory due to php5 circular references memory leak...
|
1132 |
-
function clear()
|
1133 |
-
{
|
1134 |
-
foreach ($this->nodes as $n) {$n->clear(); $n = null;}
|
1135 |
-
// This add next line is documented in the sourceforge repository. 2977248 as a fix for ongoing memory leaks that occur even with the use of clear.
|
1136 |
-
if (isset($this->children)) foreach ($this->children as $n) {$n->clear(); $n = null;}
|
1137 |
-
if (isset($this->parent)) {$this->parent->clear(); unset($this->parent);}
|
1138 |
-
if (isset($this->root)) {$this->root->clear(); unset($this->root);}
|
1139 |
-
unset($this->doc);
|
1140 |
-
unset($this->noise);
|
1141 |
-
}
|
1142 |
-
|
1143 |
-
function dump($show_attr=true)
|
1144 |
-
{
|
1145 |
-
$this->root->dump($show_attr);
|
1146 |
-
}
|
1147 |
-
|
1148 |
-
// prepare HTML data and init everything
|
1149 |
-
protected function prepare($str, $lowercase=true, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
|
1150 |
-
{
|
1151 |
-
$this->clear();
|
1152 |
-
|
1153 |
-
// set the length of content before we do anything to it.
|
1154 |
-
$this->size = strlen($str);
|
1155 |
-
// Save the original size of the html that we got in. It might be useful to someone.
|
1156 |
-
$this->original_size = $this->size;
|
1157 |
-
|
1158 |
-
//before we save the string as the doc... strip out the \r \n's if we are told to.
|
1159 |
-
if ($stripRN) {
|
1160 |
-
$str = str_replace("\r", " ", $str);
|
1161 |
-
$str = str_replace("\n", " ", $str);
|
1162 |
-
|
1163 |
-
// set the length of content since we have changed it.
|
1164 |
-
$this->size = strlen($str);
|
1165 |
-
}
|
1166 |
-
|
1167 |
-
$this->doc = $str;
|
1168 |
-
$this->pos = 0;
|
1169 |
-
$this->cursor = 1;
|
1170 |
-
$this->noise = array();
|
1171 |
-
$this->nodes = array();
|
1172 |
-
$this->lowercase = $lowercase;
|
1173 |
-
$this->default_br_text = $defaultBRText;
|
1174 |
-
$this->default_span_text = $defaultSpanText;
|
1175 |
-
$this->root = new simple_html_dom_node($this);
|
1176 |
-
$this->root->tag = 'root';
|
1177 |
-
$this->root->_[HDOM_INFO_BEGIN] = -1;
|
1178 |
-
$this->root->nodetype = HDOM_TYPE_ROOT;
|
1179 |
-
$this->parent = $this->root;
|
1180 |
-
if ($this->size>0) $this->char = $this->doc[0];
|
1181 |
-
}
|
1182 |
-
|
1183 |
-
// parse html content
|
1184 |
-
protected function parse()
|
1185 |
-
{
|
1186 |
-
if (($s = $this->copy_until_char('<'))==='')
|
1187 |
-
{
|
1188 |
-
return $this->read_tag();
|
1189 |
-
}
|
1190 |
-
|
1191 |
-
// text
|
1192 |
-
$node = new simple_html_dom_node($this);
|
1193 |
-
++$this->cursor;
|
1194 |
-
$node->_[HDOM_INFO_TEXT] = $s;
|
1195 |
-
$this->link_nodes($node, false);
|
1196 |
-
return true;
|
1197 |
-
}
|
1198 |
-
|
1199 |
-
// PAPERG - dkchou - added this to try to identify the character set of the page we have just parsed so we know better how to spit it out later.
|
1200 |
-
// NOTE: IF you provide a routine called get_last_retrieve_url_contents_content_type which returns the CURLINFO_CONTENT_TYPE from the last curl_exec
|
1201 |
-
// (or the content_type header from the last transfer), we will parse THAT, and if a charset is specified, we will use it over any other mechanism.
|
1202 |
-
protected function parse_charset()
|
1203 |
-
{
|
1204 |
-
global $debug_object;
|
1205 |
-
|
1206 |
-
$charset = null;
|
1207 |
-
|
1208 |
-
if (function_exists('get_last_retrieve_url_contents_content_type'))
|
1209 |
-
{
|
1210 |
-
$contentTypeHeader = get_last_retrieve_url_contents_content_type();
|
1211 |
-
$success = preg_match('/charset=(.+)/', $contentTypeHeader, $matches);
|
1212 |
-
if ($success)
|
1213 |
-
{
|
1214 |
-
$charset = $matches[1];
|
1215 |
-
if (is_object($debug_object)) {$debug_object->debug_log(2, 'header content-type found charset of: ' . $charset);}
|
1216 |
-
}
|
1217 |
-
|
1218 |
-
}
|
1219 |
-
|
1220 |
-
if (empty($charset))
|
1221 |
-
{
|
1222 |
-
$el = $this->root->find('meta[http-equiv=Content-Type]',0);
|
1223 |
-
if (!empty($el))
|
1224 |
-
{
|
1225 |
-
$fullvalue = $el->content;
|
1226 |
-
if (is_object($debug_object)) {$debug_object->debug_log(2, 'meta content-type tag found' . $fullvalue);}
|
1227 |
-
|
1228 |
-
if (!empty($fullvalue))
|
1229 |
-
{
|
1230 |
-
$success = preg_match('/charset=(.+)/', $fullvalue, $matches);
|
1231 |
-
if ($success)
|
1232 |
-
{
|
1233 |
-
$charset = $matches[1];
|
1234 |
-
}
|
1235 |
-
else
|
1236 |
-
{
|
1237 |
-
// If there is a meta tag, and they don't specify the character set, research says that it's typically ISO-8859-1
|
1238 |
-
if (is_object($debug_object)) {$debug_object->debug_log(2, 'meta content-type tag couldn\'t be parsed. using iso-8859 default.');}
|
1239 |
-
$charset = 'ISO-8859-1';
|
1240 |
-
}
|
1241 |
-
}
|
1242 |
-
}
|
1243 |
-
}
|
1244 |
-
|
1245 |
-
// If we couldn't find a charset above, then lets try to detect one based on the text we got...
|
1246 |
-
if (empty($charset))
|
1247 |
-
{
|
1248 |
-
// Use this in case mb_detect_charset isn't installed/loaded on this machine.
|
1249 |
-
$charset = false;
|
1250 |
-
if (function_exists('mb_detect_encoding'))
|
1251 |
-
{
|
1252 |
-
// Have php try to detect the encoding from the text given to us.
|
1253 |
-
$charset = mb_detect_encoding($this->root->plaintext . "ascii", $encoding_list = array( "UTF-8", "CP1252" ) );
|
1254 |
-
if (is_object($debug_object)) {$debug_object->debug_log(2, 'mb_detect found: ' . $charset);}
|
1255 |
-
}
|
1256 |
-
|
1257 |
-
// and if this doesn't work... then we need to just wrongheadedly assume it's UTF-8 so that we can move on - cause this will usually give us most of what we need...
|
1258 |
-
if ($charset === false)
|
1259 |
-
{
|
1260 |
-
if (is_object($debug_object)) {$debug_object->debug_log(2, 'since mb_detect failed - using default of utf-8');}
|
1261 |
-
$charset = 'UTF-8';
|
1262 |
-
}
|
1263 |
-
}
|
1264 |
-
|
1265 |
-
// Since CP1252 is a superset, if we get one of it's subsets, we want it instead.
|
1266 |
-
if ((strtolower($charset) == strtolower('ISO-8859-1')) || (strtolower($charset) == strtolower('Latin1')) || (strtolower($charset) == strtolower('Latin-1')))
|
1267 |
-
{
|
1268 |
-
if (is_object($debug_object)) {$debug_object->debug_log(2, 'replacing ' . $charset . ' with CP1252 as its a superset');}
|
1269 |
-
$charset = 'CP1252';
|
1270 |
-
}
|
1271 |
-
|
1272 |
-
if (is_object($debug_object)) {$debug_object->debug_log(1, 'EXIT - ' . $charset);}
|
1273 |
-
|
1274 |
-
return $this->_charset = $charset;
|
1275 |
-
}
|
1276 |
-
|
1277 |
-
// read tag info
|
1278 |
-
protected function read_tag()
|
1279 |
-
{
|
1280 |
-
if ($this->char!=='<')
|
1281 |
-
{
|
1282 |
-
$this->root->_[HDOM_INFO_END] = $this->cursor;
|
1283 |
-
return false;
|
1284 |
-
}
|
1285 |
-
$begin_tag_pos = $this->pos;
|
1286 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1287 |
-
|
1288 |
-
// end tag
|
1289 |
-
if ($this->char==='/')
|
1290 |
-
{
|
1291 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1292 |
-
// This represents the change in the simple_html_dom trunk from revision 180 to 181.
|
1293 |
-
// $this->skip($this->token_blank_t);
|
1294 |
-
$this->skip($this->token_blank);
|
1295 |
-
$tag = $this->copy_until_char('>');
|
1296 |
-
|
1297 |
-
// skip attributes in end tag
|
1298 |
-
if (($pos = strpos($tag, ' '))!==false)
|
1299 |
-
$tag = substr($tag, 0, $pos);
|
1300 |
-
|
1301 |
-
$parent_lower = strtolower($this->parent->tag);
|
1302 |
-
$tag_lower = strtolower($tag);
|
1303 |
-
|
1304 |
-
if ($parent_lower!==$tag_lower)
|
1305 |
-
{
|
1306 |
-
if (isset($this->optional_closing_tags[$parent_lower]) && isset($this->block_tags[$tag_lower]))
|
1307 |
-
{
|
1308 |
-
$this->parent->_[HDOM_INFO_END] = 0;
|
1309 |
-
$org_parent = $this->parent;
|
1310 |
-
|
1311 |
-
while (($this->parent->parent) && strtolower($this->parent->tag)!==$tag_lower)
|
1312 |
-
$this->parent = $this->parent->parent;
|
1313 |
-
|
1314 |
-
if (strtolower($this->parent->tag)!==$tag_lower) {
|
1315 |
-
$this->parent = $org_parent; // restore origonal parent
|
1316 |
-
if ($this->parent->parent) $this->parent = $this->parent->parent;
|
1317 |
-
$this->parent->_[HDOM_INFO_END] = $this->cursor;
|
1318 |
-
return $this->as_text_node($tag);
|
1319 |
-
}
|
1320 |
-
}
|
1321 |
-
else if (($this->parent->parent) && isset($this->block_tags[$tag_lower]))
|
1322 |
-
{
|
1323 |
-
$this->parent->_[HDOM_INFO_END] = 0;
|
1324 |
-
$org_parent = $this->parent;
|
1325 |
-
|
1326 |
-
while (($this->parent->parent) && strtolower($this->parent->tag)!==$tag_lower)
|
1327 |
-
$this->parent = $this->parent->parent;
|
1328 |
-
|
1329 |
-
if (strtolower($this->parent->tag)!==$tag_lower)
|
1330 |
-
{
|
1331 |
-
$this->parent = $org_parent; // restore origonal parent
|
1332 |
-
$this->parent->_[HDOM_INFO_END] = $this->cursor;
|
1333 |
-
return $this->as_text_node($tag);
|
1334 |
-
}
|
1335 |
-
}
|
1336 |
-
else if (($this->parent->parent) && strtolower($this->parent->parent->tag)===$tag_lower)
|
1337 |
-
{
|
1338 |
-
$this->parent->_[HDOM_INFO_END] = 0;
|
1339 |
-
$this->parent = $this->parent->parent;
|
1340 |
-
}
|
1341 |
-
else
|
1342 |
-
return $this->as_text_node($tag);
|
1343 |
-
}
|
1344 |
-
|
1345 |
-
$this->parent->_[HDOM_INFO_END] = $this->cursor;
|
1346 |
-
if ($this->parent->parent) $this->parent = $this->parent->parent;
|
1347 |
-
|
1348 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1349 |
-
return true;
|
1350 |
-
}
|
1351 |
-
|
1352 |
-
$node = new simple_html_dom_node($this);
|
1353 |
-
$node->_[HDOM_INFO_BEGIN] = $this->cursor;
|
1354 |
-
++$this->cursor;
|
1355 |
-
$tag = $this->copy_until($this->token_slash);
|
1356 |
-
$node->tag_start = $begin_tag_pos;
|
1357 |
-
|
1358 |
-
// doctype, cdata & comments...
|
1359 |
-
if (isset($tag[0]) && $tag[0]==='!') {
|
1360 |
-
$node->_[HDOM_INFO_TEXT] = '<' . $tag . $this->copy_until_char('>');
|
1361 |
-
|
1362 |
-
if (isset($tag[2]) && $tag[1]==='-' && $tag[2]==='-') {
|
1363 |
-
$node->nodetype = HDOM_TYPE_COMMENT;
|
1364 |
-
$node->tag = 'comment';
|
1365 |
-
} else {
|
1366 |
-
$node->nodetype = HDOM_TYPE_UNKNOWN;
|
1367 |
-
$node->tag = 'unknown';
|
1368 |
-
}
|
1369 |
-
if ($this->char==='>') $node->_[HDOM_INFO_TEXT].='>';
|
1370 |
-
$this->link_nodes($node, true);
|
1371 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1372 |
-
return true;
|
1373 |
-
}
|
1374 |
-
|
1375 |
-
// text
|
1376 |
-
if ($pos=strpos($tag, '<')!==false) {
|
1377 |
-
$tag = '<' . substr($tag, 0, -1);
|
1378 |
-
$node->_[HDOM_INFO_TEXT] = $tag;
|
1379 |
-
$this->link_nodes($node, false);
|
1380 |
-
$this->char = $this->doc[--$this->pos]; // prev
|
1381 |
-
return true;
|
1382 |
-
}
|
1383 |
-
|
1384 |
-
if (!preg_match("/^[\w-:]+$/", $tag)) {
|
1385 |
-
$node->_[HDOM_INFO_TEXT] = '<' . $tag . $this->copy_until('<>');
|
1386 |
-
if ($this->char==='<') {
|
1387 |
-
$this->link_nodes($node, false);
|
1388 |
-
return true;
|
1389 |
-
}
|
1390 |
-
|
1391 |
-
if ($this->char==='>') $node->_[HDOM_INFO_TEXT].='>';
|
1392 |
-
$this->link_nodes($node, false);
|
1393 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1394 |
-
return true;
|
1395 |
-
}
|
1396 |
-
|
1397 |
-
// begin tag
|
1398 |
-
$node->nodetype = HDOM_TYPE_ELEMENT;
|
1399 |
-
$tag_lower = strtolower($tag);
|
1400 |
-
$node->tag = ($this->lowercase) ? $tag_lower : $tag;
|
1401 |
-
|
1402 |
-
// handle optional closing tags
|
1403 |
-
if (isset($this->optional_closing_tags[$tag_lower]) )
|
1404 |
-
{
|
1405 |
-
while (isset($this->optional_closing_tags[$tag_lower][strtolower($this->parent->tag)]))
|
1406 |
-
{
|
1407 |
-
$this->parent->_[HDOM_INFO_END] = 0;
|
1408 |
-
$this->parent = $this->parent->parent;
|
1409 |
-
}
|
1410 |
-
$node->parent = $this->parent;
|
1411 |
-
}
|
1412 |
-
|
1413 |
-
$guard = 0; // prevent infinity loop
|
1414 |
-
$space = array($this->copy_skip($this->token_blank), '', '');
|
1415 |
-
|
1416 |
-
// attributes
|
1417 |
-
do
|
1418 |
-
{
|
1419 |
-
if ($this->char!==null && $space[0]==='')
|
1420 |
-
{
|
1421 |
-
break;
|
1422 |
-
}
|
1423 |
-
$name = $this->copy_until($this->token_equal);
|
1424 |
-
if ($guard===$this->pos)
|
1425 |
-
{
|
1426 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1427 |
-
continue;
|
1428 |
-
}
|
1429 |
-
$guard = $this->pos;
|
1430 |
-
|
1431 |
-
// handle endless '<'
|
1432 |
-
if ($this->pos>=$this->size-1 && $this->char!=='>') {
|
1433 |
-
$node->nodetype = HDOM_TYPE_TEXT;
|
1434 |
-
$node->_[HDOM_INFO_END] = 0;
|
1435 |
-
$node->_[HDOM_INFO_TEXT] = '<'.$tag . $space[0] . $name;
|
1436 |
-
$node->tag = 'text';
|
1437 |
-
$this->link_nodes($node, false);
|
1438 |
-
return true;
|
1439 |
-
}
|
1440 |
-
|
1441 |
-
// handle mismatch '<'
|
1442 |
-
if ($this->doc[$this->pos-1]=='<') {
|
1443 |
-
$node->nodetype = HDOM_TYPE_TEXT;
|
1444 |
-
$node->tag = 'text';
|
1445 |
-
$node->attr = array();
|
1446 |
-
$node->_[HDOM_INFO_END] = 0;
|
1447 |
-
$node->_[HDOM_INFO_TEXT] = substr($this->doc, $begin_tag_pos, $this->pos-$begin_tag_pos-1);
|
1448 |
-
$this->pos -= 2;
|
1449 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1450 |
-
$this->link_nodes($node, false);
|
1451 |
-
return true;
|
1452 |
-
}
|
1453 |
-
|
1454 |
-
if ($name!=='/' && $name!=='') {
|
1455 |
-
$space[1] = $this->copy_skip($this->token_blank);
|
1456 |
-
$name = $this->restore_noise($name);
|
1457 |
-
if ($this->lowercase) $name = strtolower($name);
|
1458 |
-
if ($this->char==='=') {
|
1459 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1460 |
-
$this->parse_attr($node, $name, $space);
|
1461 |
-
}
|
1462 |
-
else {
|
1463 |
-
//no value attr: nowrap, checked selected...
|
1464 |
-
$node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_NO;
|
1465 |
-
$node->attr[$name] = true;
|
1466 |
-
if ($this->char!='>') $this->char = $this->doc[--$this->pos]; // prev
|
1467 |
-
}
|
1468 |
-
$node->_[HDOM_INFO_SPACE][] = $space;
|
1469 |
-
$space = array($this->copy_skip($this->token_blank), '', '');
|
1470 |
-
}
|
1471 |
-
else
|
1472 |
-
break;
|
1473 |
-
} while ($this->char!=='>' && $this->char!=='/');
|
1474 |
-
|
1475 |
-
$this->link_nodes($node, true);
|
1476 |
-
$node->_[HDOM_INFO_ENDSPACE] = $space[0];
|
1477 |
-
|
1478 |
-
// check self closing
|
1479 |
-
if ($this->copy_until_char_escape('>')==='/')
|
1480 |
-
{
|
1481 |
-
$node->_[HDOM_INFO_ENDSPACE] .= '/';
|
1482 |
-
$node->_[HDOM_INFO_END] = 0;
|
1483 |
-
}
|
1484 |
-
else
|
1485 |
-
{
|
1486 |
-
// reset parent
|
1487 |
-
if (!isset($this->self_closing_tags[strtolower($node->tag)])) $this->parent = $node;
|
1488 |
-
}
|
1489 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1490 |
-
|
1491 |
-
// If it's a BR tag, we need to set it's text to the default text.
|
1492 |
-
// This way when we see it in plaintext, we can generate formatting that the user wants.
|
1493 |
-
// since a br tag never has sub nodes, this works well.
|
1494 |
-
if ($node->tag == "br")
|
1495 |
-
{
|
1496 |
-
$node->_[HDOM_INFO_INNER] = $this->default_br_text;
|
1497 |
-
}
|
1498 |
-
|
1499 |
-
return true;
|
1500 |
-
}
|
1501 |
-
|
1502 |
-
// parse attributes
|
1503 |
-
protected function parse_attr($node, $name, &$space)
|
1504 |
-
{
|
1505 |
-
// Per sourceforge: http://sourceforge.net/tracker/?func=detail&aid=3061408&group_id=218559&atid=1044037
|
1506 |
-
// If the attribute is already defined inside a tag, only pay atetntion to the first one as opposed to the last one.
|
1507 |
-
if (isset($node->attr[$name]))
|
1508 |
-
{
|
1509 |
-
return;
|
1510 |
-
}
|
1511 |
-
|
1512 |
-
$space[2] = $this->copy_skip($this->token_blank);
|
1513 |
-
switch ($this->char) {
|
1514 |
-
case '"':
|
1515 |
-
$node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_DOUBLE;
|
1516 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1517 |
-
$node->attr[$name] = $this->restore_noise($this->copy_until_char_escape('"'));
|
1518 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1519 |
-
break;
|
1520 |
-
case '\'':
|
1521 |
-
$node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_SINGLE;
|
1522 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1523 |
-
$node->attr[$name] = $this->restore_noise($this->copy_until_char_escape('\''));
|
1524 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1525 |
-
break;
|
1526 |
-
default:
|
1527 |
-
$node->_[HDOM_INFO_QUOTE][] = HDOM_QUOTE_NO;
|
1528 |
-
$node->attr[$name] = $this->restore_noise($this->copy_until($this->token_attr));
|
1529 |
-
}
|
1530 |
-
// PaperG: Attributes should not have \r or \n in them, that counts as html whitespace.
|
1531 |
-
$node->attr[$name] = str_replace("\r", "", $node->attr[$name]);
|
1532 |
-
$node->attr[$name] = str_replace("\n", "", $node->attr[$name]);
|
1533 |
-
// PaperG: If this is a "class" selector, lets get rid of the preceeding and trailing space since some people leave it in the multi class case.
|
1534 |
-
if ($name == "class") {
|
1535 |
-
$node->attr[$name] = trim($node->attr[$name]);
|
1536 |
-
}
|
1537 |
-
}
|
1538 |
-
|
1539 |
-
// link node's parent
|
1540 |
-
protected function link_nodes(&$node, $is_child)
|
1541 |
-
{
|
1542 |
-
$node->parent = $this->parent;
|
1543 |
-
$this->parent->nodes[] = $node;
|
1544 |
-
if ($is_child)
|
1545 |
-
{
|
1546 |
-
$this->parent->children[] = $node;
|
1547 |
-
}
|
1548 |
-
}
|
1549 |
-
|
1550 |
-
// as a text node
|
1551 |
-
protected function as_text_node($tag)
|
1552 |
-
{
|
1553 |
-
$node = new simple_html_dom_node($this);
|
1554 |
-
++$this->cursor;
|
1555 |
-
$node->_[HDOM_INFO_TEXT] = '</' . $tag . '>';
|
1556 |
-
$this->link_nodes($node, false);
|
1557 |
-
$this->char = (++$this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1558 |
-
return true;
|
1559 |
-
}
|
1560 |
-
|
1561 |
-
protected function skip($chars)
|
1562 |
-
{
|
1563 |
-
$this->pos += strspn($this->doc, $chars, $this->pos);
|
1564 |
-
$this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1565 |
-
}
|
1566 |
-
|
1567 |
-
protected function copy_skip($chars)
|
1568 |
-
{
|
1569 |
-
$pos = $this->pos;
|
1570 |
-
$len = strspn($this->doc, $chars, $pos);
|
1571 |
-
$this->pos += $len;
|
1572 |
-
$this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1573 |
-
if ($len===0) return '';
|
1574 |
-
return substr($this->doc, $pos, $len);
|
1575 |
-
}
|
1576 |
-
|
1577 |
-
protected function copy_until($chars)
|
1578 |
-
{
|
1579 |
-
$pos = $this->pos;
|
1580 |
-
$len = strcspn($this->doc, $chars, $pos);
|
1581 |
-
$this->pos += $len;
|
1582 |
-
$this->char = ($this->pos<$this->size) ? $this->doc[$this->pos] : null; // next
|
1583 |
-
return substr($this->doc, $pos, $len);
|
1584 |
-
}
|
1585 |
-
|
1586 |
-
protected function copy_until_char($char)
|
1587 |
-
{
|
1588 |
-
if ($this->char===null) return '';
|
1589 |
-
|
1590 |
-
if (($pos = strpos($this->doc, $char, $this->pos))===false) {
|
1591 |
-
$ret = substr($this->doc, $this->pos, $this->size-$this->pos);
|
1592 |
-
$this->char = null;
|
1593 |
-
$this->pos = $this->size;
|
1594 |
-
return $ret;
|
1595 |
-
}
|
1596 |
-
|
1597 |
-
if ($pos===$this->pos) return '';
|
1598 |
-
$pos_old = $this->pos;
|
1599 |
-
$this->char = $this->doc[$pos];
|
1600 |
-
$this->pos = $pos;
|
1601 |
-
return substr($this->doc, $pos_old, $pos-$pos_old);
|
1602 |
-
}
|
1603 |
-
|
1604 |
-
protected function copy_until_char_escape($char)
|
1605 |
-
{
|
1606 |
-
if ($this->char===null) return '';
|
1607 |
-
|
1608 |
-
$start = $this->pos;
|
1609 |
-
while (1)
|
1610 |
-
{
|
1611 |
-
if (($pos = strpos($this->doc, $char, $start))===false)
|
1612 |
-
{
|
1613 |
-
$ret = substr($this->doc, $this->pos, $this->size-$this->pos);
|
1614 |
-
$this->char = null;
|
1615 |
-
$this->pos = $this->size;
|
1616 |
-
return $ret;
|
1617 |
-
}
|
1618 |
-
|
1619 |
-
if ($pos===$this->pos) return '';
|
1620 |
-
|
1621 |
-
if ($this->doc[$pos-1]==='\\') {
|
1622 |
-
$start = $pos+1;
|
1623 |
-
continue;
|
1624 |
-
}
|
1625 |
-
|
1626 |
-
$pos_old = $this->pos;
|
1627 |
-
$this->char = $this->doc[$pos];
|
1628 |
-
$this->pos = $pos;
|
1629 |
-
return substr($this->doc, $pos_old, $pos-$pos_old);
|
1630 |
-
}
|
1631 |
-
return '';
|
1632 |
-
}
|
1633 |
-
|
1634 |
-
// remove noise from html content
|
1635 |
-
// save the noise in the $this->noise array.
|
1636 |
-
protected function remove_noise($pattern, $remove_tag=false)
|
1637 |
-
{
|
1638 |
-
global $debug_object;
|
1639 |
-
if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
|
1640 |
-
|
1641 |
-
$count = preg_match_all($pattern, $this->doc, $matches, PREG_SET_ORDER|PREG_OFFSET_CAPTURE);
|
1642 |
-
|
1643 |
-
for ($i=$count-1; $i>-1; --$i)
|
1644 |
-
{
|
1645 |
-
$key = '___noise___'.sprintf('% 5d', count($this->noise)+1000);
|
1646 |
-
if (is_object($debug_object)) { $debug_object->debug_log(2, 'key is: ' . $key); }
|
1647 |
-
$idx = ($remove_tag) ? 0 : 1;
|
1648 |
-
$this->noise[$key] = $matches[$i][$idx][0];
|
1649 |
-
$this->doc = substr_replace($this->doc, $key, $matches[$i][$idx][1], strlen($matches[$i][$idx][0]));
|
1650 |
-
}
|
1651 |
-
|
1652 |
-
// reset the length of content
|
1653 |
-
$this->size = strlen($this->doc);
|
1654 |
-
if ($this->size>0)
|
1655 |
-
{
|
1656 |
-
$this->char = $this->doc[0];
|
1657 |
-
}
|
1658 |
-
}
|
1659 |
-
|
1660 |
-
// restore noise to html content
|
1661 |
-
function restore_noise($text)
|
1662 |
-
{
|
1663 |
-
global $debug_object;
|
1664 |
-
if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
|
1665 |
-
|
1666 |
-
while (($pos=strpos($text, '___noise___'))!==false)
|
1667 |
-
{
|
1668 |
-
// Sometimes there is a broken piece of markup, and we don't GET the pos+11 etc... token which indicates a problem outside of us...
|
1669 |
-
if (strlen($text) > $pos+15)
|
1670 |
-
{
|
1671 |
-
$key = '___noise___'.$text[$pos+11].$text[$pos+12].$text[$pos+13].$text[$pos+14].$text[$pos+15];
|
1672 |
-
if (is_object($debug_object)) { $debug_object->debug_log(2, 'located key of: ' . $key); }
|
1673 |
-
|
1674 |
-
if (isset($this->noise[$key]))
|
1675 |
-
{
|
1676 |
-
$text = substr($text, 0, $pos).$this->noise[$key].substr($text, $pos+16);
|
1677 |
-
}
|
1678 |
-
else
|
1679 |
-
{
|
1680 |
-
// do this to prevent an infinite loop.
|
1681 |
-
$text = substr($text, 0, $pos).'UNDEFINED NOISE FOR KEY: '.$key . substr($text, $pos+16);
|
1682 |
-
}
|
1683 |
-
}
|
1684 |
-
else
|
1685 |
-
{
|
1686 |
-
// There is no valid key being given back to us... We must get rid of the ___noise___ or we will have a problem.
|
1687 |
-
$text = substr($text, 0, $pos).'NO NUMERIC NOISE KEY' . substr($text, $pos+11);
|
1688 |
-
}
|
1689 |
-
}
|
1690 |
-
return $text;
|
1691 |
-
}
|
1692 |
-
|
1693 |
-
// Sometimes we NEED one of the noise elements.
|
1694 |
-
function search_noise($text)
|
1695 |
-
{
|
1696 |
-
global $debug_object;
|
1697 |
-
if (is_object($debug_object)) { $debug_object->debug_log_entry(1); }
|
1698 |
-
|
1699 |
-
foreach($this->noise as $noiseElement)
|
1700 |
-
{
|
1701 |
-
if (strpos($noiseElement, $text)!==false)
|
1702 |
-
{
|
1703 |
-
return $noiseElement;
|
1704 |
-
}
|
1705 |
-
}
|
1706 |
-
return NULL;
|
1707 |
-
}
|
1708 |
-
function __toString()
|
1709 |
-
{
|
1710 |
-
return $this->root->innertext();
|
1711 |
-
}
|
1712 |
-
|
1713 |
-
function __get($name)
|
1714 |
-
{
|
1715 |
-
switch ($name)
|
1716 |
-
{
|
1717 |
-
case 'outertext':
|
1718 |
-
return $this->root->innertext();
|
1719 |
-
case 'innertext':
|
1720 |
-
return $this->root->innertext();
|
1721 |
-
case 'plaintext':
|
1722 |
-
return $this->root->text();
|
1723 |
-
case 'charset':
|
1724 |
-
return $this->_charset;
|
1725 |
-
case 'target_charset':
|
1726 |
-
return $this->_target_charset;
|
1727 |
-
}
|
1728 |
-
return '';
|
1729 |
-
}
|
1730 |
-
|
1731 |
-
// camel naming conventions
|
1732 |
-
function childNodes($idx=-1) {return $this->root->childNodes($idx);}
|
1733 |
-
function firstChild() {return $this->root->first_child();}
|
1734 |
-
function lastChild() {return $this->root->last_child();}
|
1735 |
-
function createElement($name, $value=null) {return @str_get_html("<$name>$value</$name>")->first_child();}
|
1736 |
-
function createTextNode($value) {return @end(str_get_html($value)->nodes);}
|
1737 |
-
function getElementById($id) {return $this->find("#$id", 0);}
|
1738 |
-
function getElementsById($id, $idx=null) {return $this->find("#$id", $idx);}
|
1739 |
-
function getElementByTagName($name) {return $this->find($name, 0);}
|
1740 |
-
function getElementsByTagName($name, $idx=-1) {return $this->find($name, $idx);}
|
1741 |
-
function loadFile() {$args = func_get_args();$this->load_file($args);}
|
1742 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
products/photocrati_nextgen/product.photocrati_nextgen.php
CHANGED
@@ -22,7 +22,6 @@ class P_Photocrati_NextGen extends C_Base_Product
|
|
22 |
'photocrati-ajax' => 'always',
|
23 |
'photocrati-datamapper' => 'always',
|
24 |
'photocrati-nextgen-legacy' => 'always',
|
25 |
-
'photocrati-simple_html_dom' => 'always',
|
26 |
'photocrati-nextgen-data' => 'always',
|
27 |
'photocrati-nextgen_block' => 'always',
|
28 |
|
@@ -119,4 +118,4 @@ class P_Photocrati_NextGen extends C_Base_Product
|
|
119 |
}
|
120 |
}
|
121 |
|
122 |
-
new P_Photocrati_NextGen();
|
22 |
'photocrati-ajax' => 'always',
|
23 |
'photocrati-datamapper' => 'always',
|
24 |
'photocrati-nextgen-legacy' => 'always',
|
|
|
25 |
'photocrati-nextgen-data' => 'always',
|
26 |
'photocrati-nextgen_block' => 'always',
|
27 |
|
118 |
}
|
119 |
}
|
120 |
|
121 |
+
new P_Photocrati_NextGen();
|
readme.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
Contributors: photocrati, imagely
|
3 |
Tags: wordpress gallery plugin, gallery, nextgen, nextgen gallery, photo gallery, image gallery, photography, slideshow, images, photo, photo album, watermark
|
4 |
Requires at least: 4.0.0
|
5 |
-
Stable tag: 3.3.
|
6 |
Tested up to: 5.4.0
|
7 |
License: GPLv2
|
8 |
Requires PHP: 5.4
|
@@ -180,6 +180,15 @@ For more information, feel free to visit the official website for the NextGEN Ga
|
|
180 |
|
181 |
== Changelog ==
|
182 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
= V3.3.5 - 04.09.2020 =
|
184 |
* Fixed: Broken dynamic images
|
185 |
|
2 |
Contributors: photocrati, imagely
|
3 |
Tags: wordpress gallery plugin, gallery, nextgen, nextgen gallery, photo gallery, image gallery, photography, slideshow, images, photo, photo album, watermark
|
4 |
Requires at least: 4.0.0
|
5 |
+
Stable tag: 3.3.6
|
6 |
Tested up to: 5.4.0
|
7 |
License: GPLv2
|
8 |
Requires PHP: 5.4
|
180 |
|
181 |
== Changelog ==
|
182 |
|
183 |
+
= V3.3.6 - 06.24.2020 =
|
184 |
+
* NEW: Added a mechanism in Other Options > Misc to update page featured images assigned with NextGen version 1 that were broken by a WordPress 5.4 API change
|
185 |
+
* NEW: Added two filters (ngg_default_settings and ngg_default_global_settings) to allow control over default settings for new networks, sites and sub-sites
|
186 |
+
* NEW: Updated SimpleLightbox to the latest version. This fixes all gallery images appearing in the lightbox if more than one gallery was on the page.
|
187 |
+
* Fixed: Album routing was broken if the albums were named using a non-latin alphabet
|
188 |
+
* Fixed: Gallery path validation was broken on some IIS servers
|
189 |
+
* Fixed: NextGen was unable to serve AJAX requests on home.pl hosting
|
190 |
+
* Fixed: Removed the unused simple_html_dom module which was causing errors with PHP 7.3
|
191 |
+
|
192 |
= V3.3.5 - 04.09.2020 =
|
193 |
* Fixed: Broken dynamic images
|
194 |
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInitd944cb3ad10f834222db970b76dd976d::getLoader();
|
vendor/composer/autoload_files.php
CHANGED
@@ -6,5 +6,5 @@ $vendorDir = dirname(dirname(__FILE__));
|
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
9 |
-
'
|
10 |
);
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
9 |
+
'a5dbe7df96665c0b6c16ae8d91231502' => $vendorDir . '/imagely/pope-framework/lib/autoload.php',
|
10 |
);
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -13,21 +13,24 @@ class ComposerAutoloaderInitb2e9b6c6be0bcb0789f9a2c43c2d9861
|
|
13 |
}
|
14 |
}
|
15 |
|
|
|
|
|
|
|
16 |
public static function getLoader()
|
17 |
{
|
18 |
if (null !== self::$loader) {
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
-
call_user_func(\Composer\Autoload\
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
@@ -48,19 +51,19 @@ class ComposerAutoloaderInitb2e9b6c6be0bcb0789f9a2c43c2d9861
|
|
48 |
$loader->register(true);
|
49 |
|
50 |
if ($useStaticLoader) {
|
51 |
-
$includeFiles = Composer\Autoload\
|
52 |
} else {
|
53 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
54 |
}
|
55 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
56 |
-
|
57 |
}
|
58 |
|
59 |
return $loader;
|
60 |
}
|
61 |
}
|
62 |
|
63 |
-
function
|
64 |
{
|
65 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
66 |
require $file;
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInitd944cb3ad10f834222db970b76dd976d
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
13 |
}
|
14 |
}
|
15 |
|
16 |
+
/**
|
17 |
+
* @return \Composer\Autoload\ClassLoader
|
18 |
+
*/
|
19 |
public static function getLoader()
|
20 |
{
|
21 |
if (null !== self::$loader) {
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
+
spl_autoload_register(array('ComposerAutoloaderInitd944cb3ad10f834222db970b76dd976d', 'loadClassLoader'), true, true);
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
+
spl_autoload_unregister(array('ComposerAutoloaderInitd944cb3ad10f834222db970b76dd976d', 'loadClassLoader'));
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require_once __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
+
call_user_func(\Composer\Autoload\ComposerStaticInitd944cb3ad10f834222db970b76dd976d::getInitializer($loader));
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
51 |
$loader->register(true);
|
52 |
|
53 |
if ($useStaticLoader) {
|
54 |
+
$includeFiles = Composer\Autoload\ComposerStaticInitd944cb3ad10f834222db970b76dd976d::$files;
|
55 |
} else {
|
56 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
57 |
}
|
58 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
59 |
+
composerRequired944cb3ad10f834222db970b76dd976d($fileIdentifier, $file);
|
60 |
}
|
61 |
|
62 |
return $loader;
|
63 |
}
|
64 |
}
|
65 |
|
66 |
+
function composerRequired944cb3ad10f834222db970b76dd976d($fileIdentifier, $file)
|
67 |
{
|
68 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
69 |
require $file;
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,10 +4,10 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $files = array (
|
10 |
-
'
|
11 |
);
|
12 |
|
13 |
public static $prefixLengthsPsr4 = array (
|
@@ -27,8 +27,8 @@ class ComposerStaticInitb2e9b6c6be0bcb0789f9a2c43c2d9861
|
|
27 |
public static function getInitializer(ClassLoader $loader)
|
28 |
{
|
29 |
return \Closure::bind(function () use ($loader) {
|
30 |
-
$loader->prefixLengthsPsr4 =
|
31 |
-
$loader->prefixDirsPsr4 =
|
32 |
|
33 |
}, null, ClassLoader::class);
|
34 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInitd944cb3ad10f834222db970b76dd976d
|
8 |
{
|
9 |
public static $files = array (
|
10 |
+
'a5dbe7df96665c0b6c16ae8d91231502' => __DIR__ . '/..' . '/imagely/pope-framework/lib/autoload.php',
|
11 |
);
|
12 |
|
13 |
public static $prefixLengthsPsr4 = array (
|
27 |
public static function getInitializer(ClassLoader $loader)
|
28 |
{
|
29 |
return \Closure::bind(function () use ($loader) {
|
30 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInitd944cb3ad10f834222db970b76dd976d::$prefixLengthsPsr4;
|
31 |
+
$loader->prefixDirsPsr4 = ComposerStaticInitd944cb3ad10f834222db970b76dd976d::$prefixDirsPsr4;
|
32 |
|
33 |
}, null, ClassLoader::class);
|
34 |
}
|
vendor/composer/installed.json
CHANGED
@@ -1,21 +1,66 @@
|
|
1 |
[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
{
|
3 |
"name": "nikic/php-parser",
|
4 |
-
"version": "v4.
|
5 |
-
"version_normalized": "4.
|
6 |
"source": {
|
7 |
"type": "git",
|
8 |
"url": "https://github.com/nikic/PHP-Parser.git",
|
9 |
-
"reference": "
|
10 |
},
|
11 |
"dist": {
|
12 |
"type": "zip",
|
13 |
-
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/
|
14 |
-
"reference": "
|
15 |
"shasum": "",
|
16 |
"mirrors": [
|
17 |
{
|
18 |
-
"url": "https://repo.packagist.com/
|
19 |
"preferred": true
|
20 |
}
|
21 |
]
|
@@ -28,7 +73,7 @@
|
|
28 |
"ircmaxell/php-yacc": "0.0.5",
|
29 |
"phpunit/phpunit": "^6.5 || ^7.0 || ^8.0"
|
30 |
},
|
31 |
-
"time": "
|
32 |
"bin": [
|
33 |
"bin/php-parse"
|
34 |
],
|
@@ -44,7 +89,7 @@
|
|
44 |
"PhpParser\\": "lib/PhpParser"
|
45 |
}
|
46 |
},
|
47 |
-
"notification-url": "https://repo.packagist.com/
|
48 |
"license": [
|
49 |
"BSD-3-Clause"
|
50 |
],
|
@@ -58,50 +103,5 @@
|
|
58 |
"parser",
|
59 |
"php"
|
60 |
]
|
61 |
-
},
|
62 |
-
{
|
63 |
-
"name": "reactr-io/pope-framework",
|
64 |
-
"version": "v0.14",
|
65 |
-
"version_normalized": "0.14.0.0",
|
66 |
-
"source": {
|
67 |
-
"type": "git",
|
68 |
-
"url": "https://github.com/reactr-io/pope-framework.git",
|
69 |
-
"reference": "a157586db8705910b33f7f05157dddcb88631110"
|
70 |
-
},
|
71 |
-
"dist": {
|
72 |
-
"type": "zip",
|
73 |
-
"url": "https://api.github.com/repos/reactr-io/pope-framework/zipball/a157586db8705910b33f7f05157dddcb88631110",
|
74 |
-
"reference": "a157586db8705910b33f7f05157dddcb88631110",
|
75 |
-
"shasum": "",
|
76 |
-
"mirrors": [
|
77 |
-
{
|
78 |
-
"url": "https://repo.packagist.com/reactr-io/dists/%package%/%version%/%reference%.%type%",
|
79 |
-
"preferred": true
|
80 |
-
}
|
81 |
-
]
|
82 |
-
},
|
83 |
-
"time": "2020-02-10T18:04:47+00:00",
|
84 |
-
"type": "library",
|
85 |
-
"installation-source": "dist",
|
86 |
-
"autoload": {
|
87 |
-
"files": [
|
88 |
-
"./lib/autoload.php"
|
89 |
-
]
|
90 |
-
},
|
91 |
-
"notification-url": "https://repo.packagist.com/reactr-io/downloads/",
|
92 |
-
"license": [
|
93 |
-
"GPL-2.0-only"
|
94 |
-
],
|
95 |
-
"authors": [
|
96 |
-
{
|
97 |
-
"name": "Imagely",
|
98 |
-
"email": "support@imagely.com"
|
99 |
-
}
|
100 |
-
],
|
101 |
-
"description": "A component framework inspired by Zope 3. Pope is \"PHP's Zope\".",
|
102 |
-
"support": {
|
103 |
-
"source": "https://github.com/reactr-io/pope-framework/tree/v0.14",
|
104 |
-
"issues": "https://github.com/reactr-io/pope-framework/issues"
|
105 |
-
}
|
106 |
}
|
107 |
]
|
1 |
[
|
2 |
+
{
|
3 |
+
"name": "imagely/pope-framework",
|
4 |
+
"version": "v0.16",
|
5 |
+
"version_normalized": "0.16.0.0",
|
6 |
+
"source": {
|
7 |
+
"type": "git",
|
8 |
+
"url": "https://github.com/imagely/pope-framework.git",
|
9 |
+
"reference": "a14bdc1f5153664770df00d53577a9954f1e691c"
|
10 |
+
},
|
11 |
+
"dist": {
|
12 |
+
"type": "zip",
|
13 |
+
"url": "https://api.github.com/repos/imagely/pope-framework/zipball/a14bdc1f5153664770df00d53577a9954f1e691c",
|
14 |
+
"reference": "a14bdc1f5153664770df00d53577a9954f1e691c",
|
15 |
+
"shasum": "",
|
16 |
+
"mirrors": [
|
17 |
+
{
|
18 |
+
"url": "https://repo.packagist.com/imagely/dists/%package%/%version%/%reference%.%type%",
|
19 |
+
"preferred": true
|
20 |
+
}
|
21 |
+
]
|
22 |
+
},
|
23 |
+
"time": "2020-06-11T20:23:55+00:00",
|
24 |
+
"type": "library",
|
25 |
+
"installation-source": "dist",
|
26 |
+
"autoload": {
|
27 |
+
"files": [
|
28 |
+
"./lib/autoload.php"
|
29 |
+
]
|
30 |
+
},
|
31 |
+
"notification-url": "https://repo.packagist.com/imagely/downloads/",
|
32 |
+
"license": [
|
33 |
+
"GPL-2.0-only"
|
34 |
+
],
|
35 |
+
"authors": [
|
36 |
+
{
|
37 |
+
"name": "Imagely",
|
38 |
+
"email": "support@imagely.com"
|
39 |
+
}
|
40 |
+
],
|
41 |
+
"description": "A component framework inspired by Zope 3. Pope is \"PHP's Zope\".",
|
42 |
+
"support": {
|
43 |
+
"source": "https://github.com/imagely/pope-framework/tree/v0.16",
|
44 |
+
"issues": "https://github.com/imagely/pope-framework/issues"
|
45 |
+
}
|
46 |
+
},
|
47 |
{
|
48 |
"name": "nikic/php-parser",
|
49 |
+
"version": "v4.5.0",
|
50 |
+
"version_normalized": "4.5.0.0",
|
51 |
"source": {
|
52 |
"type": "git",
|
53 |
"url": "https://github.com/nikic/PHP-Parser.git",
|
54 |
+
"reference": "53c2753d756f5adb586dca79c2ec0e2654dd9463"
|
55 |
},
|
56 |
"dist": {
|
57 |
"type": "zip",
|
58 |
+
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/53c2753d756f5adb586dca79c2ec0e2654dd9463",
|
59 |
+
"reference": "53c2753d756f5adb586dca79c2ec0e2654dd9463",
|
60 |
"shasum": "",
|
61 |
"mirrors": [
|
62 |
{
|
63 |
+
"url": "https://repo.packagist.com/imagely/dists/%package%/%version%/%reference%.%type%",
|
64 |
"preferred": true
|
65 |
}
|
66 |
]
|
73 |
"ircmaxell/php-yacc": "0.0.5",
|
74 |
"phpunit/phpunit": "^6.5 || ^7.0 || ^8.0"
|
75 |
},
|
76 |
+
"time": "2020-06-03T07:24:19+00:00",
|
77 |
"bin": [
|
78 |
"bin/php-parse"
|
79 |
],
|
89 |
"PhpParser\\": "lib/PhpParser"
|
90 |
}
|
91 |
},
|
92 |
+
"notification-url": "https://repo.packagist.com/imagely/downloads/",
|
93 |
"license": [
|
94 |
"BSD-3-Clause"
|
95 |
],
|
103 |
"parser",
|
104 |
"php"
|
105 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
}
|
107 |
]
|
vendor/{reactr-io → imagely}/pope-framework/README.txt
RENAMED
File without changes
|
vendor/{reactr-io → imagely}/pope-framework/composer.json
RENAMED
@@ -1,5 +1,5 @@
|
|
1 |
{
|
2 |
-
"name": "
|
3 |
"description": "A component framework inspired by Zope 3. Pope is \"PHP's Zope\".",
|
4 |
"license": "GPL-2.0-only",
|
5 |
"authors": [
|
1 |
{
|
2 |
+
"name": "imagely/pope-framework",
|
3 |
"description": "A component framework inspired by Zope 3. Pope is \"PHP's Zope\".",
|
4 |
"license": "GPL-2.0-only",
|
5 |
"authors": [
|
vendor/{reactr-io → imagely}/pope-framework/lib/autoload.php
RENAMED
File without changes
|
vendor/{reactr-io → imagely}/pope-framework/lib/class.base_module.php
RENAMED
@@ -63,14 +63,18 @@ abstract class C_Base_Module
|
|
63 |
|
64 |
function load()
|
65 |
{
|
66 |
-
// Package files may not exist until releases are built
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
|
|
|
|
|
|
|
|
74 |
}
|
75 |
|
76 |
function get_package_abspath()
|
63 |
|
64 |
function load()
|
65 |
{
|
66 |
+
// Package files may not exist until releases are built; do not use require_once() here
|
67 |
+
$path = $this->get_package_abspath();
|
68 |
+
ini_set('track_errors', true);
|
69 |
+
if (@file_exists($path))
|
70 |
+
include_once($path);
|
71 |
+
|
72 |
+
if (isset($php_errormsg) && defined('NGG_DEBUG') && constant('NGG_DEBUG'))
|
73 |
+
error_log($php_errormsg);
|
74 |
+
|
75 |
+
$this->_register_utilities();
|
76 |
+
$this->_register_adapters();
|
77 |
+
$this->_register_hooks();
|
78 |
}
|
79 |
|
80 |
function get_package_abspath()
|
vendor/{reactr-io → imagely}/pope-framework/lib/class.base_product.php
RENAMED
File without changes
|
vendor/{reactr-io → imagely}/pope-framework/lib/class.component.php
RENAMED
File without changes
|
vendor/{reactr-io → imagely}/pope-framework/lib/class.component_factory.php
RENAMED
File without changes
|
vendor/{reactr-io → imagely}/pope-framework/lib/class.component_registry.php
RENAMED
@@ -57,7 +57,9 @@ class C_Component_Registry
|
|
57 |
static $already_required = array();
|
58 |
$relpath = basename($module_file_abspath);
|
59 |
if (!in_array($relpath, $already_required)) {
|
60 |
-
|
|
|
|
|
61 |
$already_required[] = $relpath;
|
62 |
}
|
63 |
}
|
@@ -787,7 +789,7 @@ class C_Component_Registry
|
|
787 |
{
|
788 |
$retval = array();
|
789 |
static $recursive_level = 0;
|
790 |
-
static $exclusions = array('..', '.', 'error_log', 'README', 'CHANGELOG', 'readme.txt', 'changelog.txt');
|
791 |
$recursive_level++;
|
792 |
|
793 |
$abspath = str_replace(array('\\', '/'), DIRECTORY_SEPARATOR, $abspath);
|
@@ -908,4 +910,4 @@ class C_Component_Registry
|
|
908 |
}
|
909 |
}
|
910 |
}
|
911 |
-
}
|
57 |
static $already_required = array();
|
58 |
$relpath = basename($module_file_abspath);
|
59 |
if (!in_array($relpath, $already_required)) {
|
60 |
+
ini_set('track_errors', true);
|
61 |
+
@require_once($module_file_abspath);
|
62 |
+
if (isset($php_errormsg) && defined('NGG_DEBUG') && constant('NGG_DEBUG')) error_log($php_errormsg);
|
63 |
$already_required[] = $relpath;
|
64 |
}
|
65 |
}
|
789 |
{
|
790 |
$retval = array();
|
791 |
static $recursive_level = 0;
|
792 |
+
static $exclusions = array('..', '.', 'error_log', 'README', 'CHANGELOG', 'readme.txt', 'changelog.txt', 'LICENSE');
|
793 |
$recursive_level++;
|
794 |
|
795 |
$abspath = str_replace(array('\\', '/'), DIRECTORY_SEPARATOR, $abspath);
|
910 |
}
|
911 |
}
|
912 |
}
|
913 |
+
}
|
vendor/{reactr-io → imagely}/pope-framework/lib/class.extensibleobject.php
RENAMED
@@ -511,9 +511,10 @@ class ExtensibleObject extends PopeHelpers
|
|
511 |
);
|
512 |
}
|
513 |
elseif ($this->_throw_error) {
|
514 |
-
|
|
|
515 |
print_r(debug_backtrace());
|
516 |
-
throw new Exception("`{$method}` not defined for "
|
517 |
}
|
518 |
}
|
519 |
|
511 |
);
|
512 |
}
|
513 |
elseif ($this->_throw_error) {
|
514 |
+
$klass = function_exists('get_called_class') ? get_called_class() : get_class();
|
515 |
+
if (defined('POPE_DEBUG') && constant('POPE_DEBUG'))
|
516 |
print_r(debug_backtrace());
|
517 |
+
throw new Exception("`{$method}` not defined for {$klass}");
|
518 |
}
|
519 |
}
|
520 |
|
vendor/{reactr-io → imagely}/pope-framework/lib/class.pope_cache.php
RENAMED
File without changes
|
vendor/{reactr-io → imagely}/pope-framework/lib/interface.component.php
RENAMED
File without changes
|
vendor/{reactr-io → imagely}/pope-framework/lib/interface.component_factory.php
RENAMED
File without changes
|
vendor/{reactr-io → imagely}/pope-framework/lib/interface.pope_module.php
RENAMED
File without changes
|
vendor/nikic/php-parser/grammar/php7.y
CHANGED
@@ -232,7 +232,7 @@ non_empty_statement:
|
|
232 |
| T_RETURN optional_expr semi { $$ = Stmt\Return_[$2]; }
|
233 |
| T_GLOBAL global_var_list semi { $$ = Stmt\Global_[$2]; }
|
234 |
| T_STATIC static_var_list semi { $$ = Stmt\Static_[$2]; }
|
235 |
-
| T_ECHO
|
236 |
| T_INLINE_HTML { $$ = Stmt\InlineHTML[$1]; }
|
237 |
| expr semi { $$ = Stmt\Expression[$1]; }
|
238 |
| T_UNSET '(' variables_list ')' semi { $$ = Stmt\Unset_[$3]; }
|
@@ -269,7 +269,7 @@ name_union:
|
|
269 |
;
|
270 |
|
271 |
catch:
|
272 |
-
T_CATCH '(' name_union
|
273 |
{ $$ = Stmt\Catch_[$3, $4, $7]; }
|
274 |
;
|
275 |
|
@@ -632,10 +632,14 @@ property_declaration:
|
|
632 |
| property_decl_name '=' expr { $$ = Stmt\PropertyProperty[$1, $3]; }
|
633 |
;
|
634 |
|
635 |
-
|
636 |
non_empty_expr_list no_comma { $$ = $1; }
|
637 |
;
|
638 |
|
|
|
|
|
|
|
|
|
639 |
non_empty_expr_list:
|
640 |
non_empty_expr_list ',' expr { push($1, $3); }
|
641 |
| expr { init($1); }
|
@@ -643,7 +647,7 @@ non_empty_expr_list:
|
|
643 |
|
644 |
for_expr:
|
645 |
/* empty */ { $$ = array(); }
|
646 |
-
|
|
647 |
;
|
648 |
|
649 |
expr:
|
@@ -706,7 +710,7 @@ expr:
|
|
706 |
| expr '?' expr ':' expr { $$ = Expr\Ternary[$1, $3, $5]; }
|
707 |
| expr '?' ':' expr { $$ = Expr\Ternary[$1, null, $4]; }
|
708 |
| expr T_COALESCE expr { $$ = Expr\BinaryOp\Coalesce[$1, $3]; }
|
709 |
-
| T_ISSET '('
|
710 |
| T_EMPTY '(' expr ')' { $$ = Expr\Empty_[$3]; }
|
711 |
| T_INCLUDE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_INCLUDE]; }
|
712 |
| T_INCLUDE_ONCE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_INCLUDE_ONCE]; }
|
@@ -800,12 +804,13 @@ name:
|
|
800 |
class_name_reference:
|
801 |
class_name { $$ = $1; }
|
802 |
| new_variable { $$ = $1; }
|
|
|
803 |
| error { $$ = Expr\Error[]; $this->errorState = 2; }
|
804 |
;
|
805 |
|
806 |
class_name_or_var:
|
807 |
class_name { $$ = $1; }
|
808 |
-
|
|
809 |
;
|
810 |
|
811 |
exit_expr:
|
@@ -827,9 +832,20 @@ ctor_arguments:
|
|
827 |
|
828 |
constant:
|
829 |
name { $$ = Expr\ConstFetch[$1]; }
|
830 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
831 |
{ $$ = Expr\ClassConstFetch[$1, $3]; }
|
832 |
-
/* We interpret
|
833 |
an unfinished static property fetch or unfinished scoped call. */
|
834 |
| class_name_or_var T_PAAMAYIM_NEKUDOTAYIM error
|
835 |
{ $$ = Expr\ClassConstFetch[$1, new Expr\Error(stackAttributes(#3))]; $this->errorState = 2; }
|
@@ -849,28 +865,21 @@ dereferencable_scalar:
|
|
849 |
| T_CONSTANT_ENCAPSED_STRING
|
850 |
{ $attrs = attributes(); $attrs['kind'] = strKind($1);
|
851 |
$$ = new Scalar\String_(Scalar\String_::parse($1), $attrs); }
|
|
|
|
|
|
|
852 |
;
|
853 |
|
854 |
scalar:
|
855 |
T_LNUMBER { $$ = $this->parseLNumber($1, attributes()); }
|
856 |
| T_DNUMBER { $$ = Scalar\DNumber[Scalar\DNumber::parse($1)]; }
|
857 |
-
| T_LINE { $$ = Scalar\MagicConst\Line[]; }
|
858 |
-
| T_FILE { $$ = Scalar\MagicConst\File[]; }
|
859 |
-
| T_DIR { $$ = Scalar\MagicConst\Dir[]; }
|
860 |
-
| T_CLASS_C { $$ = Scalar\MagicConst\Class_[]; }
|
861 |
-
| T_TRAIT_C { $$ = Scalar\MagicConst\Trait_[]; }
|
862 |
-
| T_METHOD_C { $$ = Scalar\MagicConst\Method[]; }
|
863 |
-
| T_FUNC_C { $$ = Scalar\MagicConst\Function_[]; }
|
864 |
-
| T_NS_C { $$ = Scalar\MagicConst\Namespace_[]; }
|
865 |
| dereferencable_scalar { $$ = $1; }
|
866 |
| constant { $$ = $1; }
|
|
|
867 |
| T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC
|
868 |
{ $$ = $this->parseDocString($1, $2, $3, attributes(), stackAttributes(#3), true); }
|
869 |
| T_START_HEREDOC T_END_HEREDOC
|
870 |
{ $$ = $this->parseDocString($1, '', $2, attributes(), stackAttributes(#2), true); }
|
871 |
-
| '"' encaps_list '"'
|
872 |
-
{ $attrs = attributes(); $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED;
|
873 |
-
parseEncapsed($2, '"', true); $$ = new Scalar\Encapsed($2, $attrs); }
|
874 |
| T_START_HEREDOC encaps_list T_END_HEREDOC
|
875 |
{ $$ = $this->parseDocString($1, $2, $3, attributes(), stackAttributes(#3), true); }
|
876 |
;
|
@@ -880,10 +889,16 @@ optional_expr:
|
|
880 |
| expr { $$ = $1; }
|
881 |
;
|
882 |
|
883 |
-
|
884 |
variable { $$ = $1; }
|
885 |
| '(' expr ')' { $$ = $2; }
|
886 |
| dereferencable_scalar { $$ = $1; }
|
|
|
|
|
|
|
|
|
|
|
|
|
887 |
;
|
888 |
|
889 |
callable_expr:
|
@@ -894,18 +909,23 @@ callable_expr:
|
|
894 |
|
895 |
callable_variable:
|
896 |
simple_variable { $$ = Expr\Variable[$1]; }
|
897 |
-
|
|
898 |
-
|
|
899 |
-
| dereferencable '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; }
|
900 |
| function_call { $$ = $1; }
|
901 |
-
|
|
902 |
{ $$ = Expr\MethodCall[$1, $3, $4]; }
|
903 |
;
|
904 |
|
|
|
|
|
|
|
|
|
|
|
905 |
variable:
|
906 |
callable_variable { $$ = $1; }
|
907 |
| static_member { $$ = $1; }
|
908 |
-
|
|
|
|
909 |
;
|
910 |
|
911 |
simple_variable:
|
@@ -950,22 +970,7 @@ property_name:
|
|
950 |
;
|
951 |
|
952 |
list_expr:
|
953 |
-
T_LIST '('
|
954 |
-
;
|
955 |
-
|
956 |
-
list_expr_elements:
|
957 |
-
list_expr_elements ',' list_expr_element { push($1, $3); }
|
958 |
-
| list_expr_element { init($1); }
|
959 |
-
;
|
960 |
-
|
961 |
-
list_expr_element:
|
962 |
-
variable { $$ = Expr\ArrayItem[$1, null, false]; }
|
963 |
-
| '&' variable { $$ = Expr\ArrayItem[$2, null, true]; }
|
964 |
-
| list_expr { $$ = Expr\ArrayItem[$1, null, false]; }
|
965 |
-
| expr T_DOUBLE_ARROW variable { $$ = Expr\ArrayItem[$3, $1, false]; }
|
966 |
-
| expr T_DOUBLE_ARROW '&' variable { $$ = Expr\ArrayItem[$4, $1, true]; }
|
967 |
-
| expr T_DOUBLE_ARROW list_expr { $$ = Expr\ArrayItem[$3, $1, false]; }
|
968 |
-
| /* empty */ { $$ = null; }
|
969 |
;
|
970 |
|
971 |
array_pair_list:
|
@@ -985,10 +990,12 @@ inner_array_pair_list:
|
|
985 |
;
|
986 |
|
987 |
array_pair:
|
988 |
-
expr
|
989 |
-
| expr { $$ = Expr\ArrayItem[$1, null, false]; }
|
990 |
-
| expr T_DOUBLE_ARROW '&' variable { $$ = Expr\ArrayItem[$4, $1, true]; }
|
991 |
| '&' variable { $$ = Expr\ArrayItem[$2, null, true]; }
|
|
|
|
|
|
|
|
|
992 |
| T_ELLIPSIS expr { $$ = Expr\ArrayItem[$2, null, false, attributes(), true]; }
|
993 |
| /* empty */ { $$ = null; }
|
994 |
;
|
232 |
| T_RETURN optional_expr semi { $$ = Stmt\Return_[$2]; }
|
233 |
| T_GLOBAL global_var_list semi { $$ = Stmt\Global_[$2]; }
|
234 |
| T_STATIC static_var_list semi { $$ = Stmt\Static_[$2]; }
|
235 |
+
| T_ECHO expr_list_forbid_comma semi { $$ = Stmt\Echo_[$2]; }
|
236 |
| T_INLINE_HTML { $$ = Stmt\InlineHTML[$1]; }
|
237 |
| expr semi { $$ = Stmt\Expression[$1]; }
|
238 |
| T_UNSET '(' variables_list ')' semi { $$ = Stmt\Unset_[$3]; }
|
269 |
;
|
270 |
|
271 |
catch:
|
272 |
+
T_CATCH '(' name_union optional_plain_variable ')' '{' inner_statement_list '}'
|
273 |
{ $$ = Stmt\Catch_[$3, $4, $7]; }
|
274 |
;
|
275 |
|
632 |
| property_decl_name '=' expr { $$ = Stmt\PropertyProperty[$1, $3]; }
|
633 |
;
|
634 |
|
635 |
+
expr_list_forbid_comma:
|
636 |
non_empty_expr_list no_comma { $$ = $1; }
|
637 |
;
|
638 |
|
639 |
+
expr_list_allow_comma:
|
640 |
+
non_empty_expr_list optional_comma { $$ = $1; }
|
641 |
+
;
|
642 |
+
|
643 |
non_empty_expr_list:
|
644 |
non_empty_expr_list ',' expr { push($1, $3); }
|
645 |
| expr { init($1); }
|
647 |
|
648 |
for_expr:
|
649 |
/* empty */ { $$ = array(); }
|
650 |
+
| expr_list_forbid_comma { $$ = $1; }
|
651 |
;
|
652 |
|
653 |
expr:
|
710 |
| expr '?' expr ':' expr { $$ = Expr\Ternary[$1, $3, $5]; }
|
711 |
| expr '?' ':' expr { $$ = Expr\Ternary[$1, null, $4]; }
|
712 |
| expr T_COALESCE expr { $$ = Expr\BinaryOp\Coalesce[$1, $3]; }
|
713 |
+
| T_ISSET '(' expr_list_allow_comma ')' { $$ = Expr\Isset_[$3]; }
|
714 |
| T_EMPTY '(' expr ')' { $$ = Expr\Empty_[$3]; }
|
715 |
| T_INCLUDE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_INCLUDE]; }
|
716 |
| T_INCLUDE_ONCE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_INCLUDE_ONCE]; }
|
804 |
class_name_reference:
|
805 |
class_name { $$ = $1; }
|
806 |
| new_variable { $$ = $1; }
|
807 |
+
| '(' expr ')' { $$ = $2; }
|
808 |
| error { $$ = Expr\Error[]; $this->errorState = 2; }
|
809 |
;
|
810 |
|
811 |
class_name_or_var:
|
812 |
class_name { $$ = $1; }
|
813 |
+
| fully_dereferencable { $$ = $1; }
|
814 |
;
|
815 |
|
816 |
exit_expr:
|
832 |
|
833 |
constant:
|
834 |
name { $$ = Expr\ConstFetch[$1]; }
|
835 |
+
| T_LINE { $$ = Scalar\MagicConst\Line[]; }
|
836 |
+
| T_FILE { $$ = Scalar\MagicConst\File[]; }
|
837 |
+
| T_DIR { $$ = Scalar\MagicConst\Dir[]; }
|
838 |
+
| T_CLASS_C { $$ = Scalar\MagicConst\Class_[]; }
|
839 |
+
| T_TRAIT_C { $$ = Scalar\MagicConst\Trait_[]; }
|
840 |
+
| T_METHOD_C { $$ = Scalar\MagicConst\Method[]; }
|
841 |
+
| T_FUNC_C { $$ = Scalar\MagicConst\Function_[]; }
|
842 |
+
| T_NS_C { $$ = Scalar\MagicConst\Namespace_[]; }
|
843 |
+
;
|
844 |
+
|
845 |
+
class_constant:
|
846 |
+
class_name_or_var T_PAAMAYIM_NEKUDOTAYIM identifier_ex
|
847 |
{ $$ = Expr\ClassConstFetch[$1, $3]; }
|
848 |
+
/* We interpret an isolated FOO:: as an unfinished class constant fetch. It could also be
|
849 |
an unfinished static property fetch or unfinished scoped call. */
|
850 |
| class_name_or_var T_PAAMAYIM_NEKUDOTAYIM error
|
851 |
{ $$ = Expr\ClassConstFetch[$1, new Expr\Error(stackAttributes(#3))]; $this->errorState = 2; }
|
865 |
| T_CONSTANT_ENCAPSED_STRING
|
866 |
{ $attrs = attributes(); $attrs['kind'] = strKind($1);
|
867 |
$$ = new Scalar\String_(Scalar\String_::parse($1), $attrs); }
|
868 |
+
| '"' encaps_list '"'
|
869 |
+
{ $attrs = attributes(); $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED;
|
870 |
+
parseEncapsed($2, '"', true); $$ = new Scalar\Encapsed($2, $attrs); }
|
871 |
;
|
872 |
|
873 |
scalar:
|
874 |
T_LNUMBER { $$ = $this->parseLNumber($1, attributes()); }
|
875 |
| T_DNUMBER { $$ = Scalar\DNumber[Scalar\DNumber::parse($1)]; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
876 |
| dereferencable_scalar { $$ = $1; }
|
877 |
| constant { $$ = $1; }
|
878 |
+
| class_constant { $$ = $1; }
|
879 |
| T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC
|
880 |
{ $$ = $this->parseDocString($1, $2, $3, attributes(), stackAttributes(#3), true); }
|
881 |
| T_START_HEREDOC T_END_HEREDOC
|
882 |
{ $$ = $this->parseDocString($1, '', $2, attributes(), stackAttributes(#2), true); }
|
|
|
|
|
|
|
883 |
| T_START_HEREDOC encaps_list T_END_HEREDOC
|
884 |
{ $$ = $this->parseDocString($1, $2, $3, attributes(), stackAttributes(#3), true); }
|
885 |
;
|
889 |
| expr { $$ = $1; }
|
890 |
;
|
891 |
|
892 |
+
fully_dereferencable:
|
893 |
variable { $$ = $1; }
|
894 |
| '(' expr ')' { $$ = $2; }
|
895 |
| dereferencable_scalar { $$ = $1; }
|
896 |
+
| class_constant { $$ = $1; }
|
897 |
+
;
|
898 |
+
|
899 |
+
array_object_dereferencable:
|
900 |
+
fully_dereferencable { $$ = $1; }
|
901 |
+
| constant { $$ = $1; }
|
902 |
;
|
903 |
|
904 |
callable_expr:
|
909 |
|
910 |
callable_variable:
|
911 |
simple_variable { $$ = Expr\Variable[$1]; }
|
912 |
+
| array_object_dereferencable '[' optional_expr ']' { $$ = Expr\ArrayDimFetch[$1, $3]; }
|
913 |
+
| array_object_dereferencable '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; }
|
|
|
914 |
| function_call { $$ = $1; }
|
915 |
+
| array_object_dereferencable T_OBJECT_OPERATOR property_name argument_list
|
916 |
{ $$ = Expr\MethodCall[$1, $3, $4]; }
|
917 |
;
|
918 |
|
919 |
+
optional_plain_variable:
|
920 |
+
/* empty */ { $$ = null; }
|
921 |
+
| plain_variable { $$ = $1; }
|
922 |
+
;
|
923 |
+
|
924 |
variable:
|
925 |
callable_variable { $$ = $1; }
|
926 |
| static_member { $$ = $1; }
|
927 |
+
| array_object_dereferencable T_OBJECT_OPERATOR property_name
|
928 |
+
{ $$ = Expr\PropertyFetch[$1, $3]; }
|
929 |
;
|
930 |
|
931 |
simple_variable:
|
970 |
;
|
971 |
|
972 |
list_expr:
|
973 |
+
T_LIST '(' inner_array_pair_list ')' { $$ = Expr\List_[$3]; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
974 |
;
|
975 |
|
976 |
array_pair_list:
|
990 |
;
|
991 |
|
992 |
array_pair:
|
993 |
+
expr { $$ = Expr\ArrayItem[$1, null, false]; }
|
|
|
|
|
994 |
| '&' variable { $$ = Expr\ArrayItem[$2, null, true]; }
|
995 |
+
| list_expr { $$ = Expr\ArrayItem[$1, null, false]; }
|
996 |
+
| expr T_DOUBLE_ARROW expr { $$ = Expr\ArrayItem[$3, $1, false]; }
|
997 |
+
| expr T_DOUBLE_ARROW '&' variable { $$ = Expr\ArrayItem[$4, $1, true]; }
|
998 |
+
| expr T_DOUBLE_ARROW list_expr { $$ = Expr\ArrayItem[$3, $1, false]; }
|
999 |
| T_ELLIPSIS expr { $$ = Expr\ArrayItem[$2, null, false, attributes(), true]; }
|
1000 |
| /* empty */ { $$ = null; }
|
1001 |
;
|
vendor/nikic/php-parser/grammar/rebuildParsers.php
CHANGED
@@ -178,7 +178,7 @@ function resolveMacros($code) {
|
|
178 |
|
179 |
return '$startAttributes = ' . $args[1] . ';'
|
180 |
. ' if (isset($startAttributes[\'comments\']))'
|
181 |
-
. ' { ' . $args[0] . ' = new Stmt\Nop($this->
|
182 |
. ' else { ' . $args[0] . ' = null; }';
|
183 |
}
|
184 |
|
178 |
|
179 |
return '$startAttributes = ' . $args[1] . ';'
|
180 |
. ' if (isset($startAttributes[\'comments\']))'
|
181 |
+
. ' { ' . $args[0] . ' = new Stmt\Nop($this->createCommentNopAttributes($startAttributes[\'comments\'])); }'
|
182 |
. ' else { ' . $args[0] . ' = null; }';
|
183 |
}
|
184 |
|
vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php
CHANGED
@@ -44,7 +44,7 @@ class Param implements PhpParser\Builder
|
|
44 |
/**
|
45 |
* Sets type for the parameter.
|
46 |
*
|
47 |
-
* @param string|Node\Name|Node\NullableType $type Parameter type
|
48 |
*
|
49 |
* @return $this The builder instance (for fluid interface)
|
50 |
*/
|
@@ -60,7 +60,7 @@ class Param implements PhpParser\Builder
|
|
60 |
/**
|
61 |
* Sets type for the parameter.
|
62 |
*
|
63 |
-
* @param string|Node\Name|Node\NullableType $type Parameter type
|
64 |
*
|
65 |
* @return $this The builder instance (for fluid interface)
|
66 |
*
|
44 |
/**
|
45 |
* Sets type for the parameter.
|
46 |
*
|
47 |
+
* @param string|Node\Name|Node\NullableType|Node\UnionType $type Parameter type
|
48 |
*
|
49 |
* @return $this The builder instance (for fluid interface)
|
50 |
*/
|
60 |
/**
|
61 |
* Sets type for the parameter.
|
62 |
*
|
63 |
+
* @param string|Node\Name|Node\NullableType|Node\UnionType $type Parameter type
|
64 |
*
|
65 |
* @return $this The builder instance (for fluid interface)
|
66 |
*
|
vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php
CHANGED
@@ -8,6 +8,7 @@ use PhpParser\Node\Name;
|
|
8 |
use PhpParser\Node\NullableType;
|
9 |
use PhpParser\Node\Scalar;
|
10 |
use PhpParser\Node\Stmt;
|
|
|
11 |
|
12 |
/**
|
13 |
* This class defines helpers used in the implementation of builders. Don't use it directly.
|
@@ -158,16 +159,19 @@ final class BuilderHelpers
|
|
158 |
* In particular, builtin types become Identifiers, custom types become Names and nullables
|
159 |
* are wrapped in NullableType nodes.
|
160 |
*
|
161 |
-
* @param string|Name|Identifier|NullableType $type The type to normalize
|
162 |
*
|
163 |
-
* @return Name|Identifier|NullableType The normalized type
|
164 |
*/
|
165 |
public static function normalizeType($type) {
|
166 |
if (!is_string($type)) {
|
167 |
-
if (
|
168 |
-
|
|
|
|
|
169 |
throw new \LogicException(
|
170 |
-
'Type must be a string, or an instance of Name, Identifier or
|
|
|
171 |
}
|
172 |
return $type;
|
173 |
}
|
@@ -179,7 +183,7 @@ final class BuilderHelpers
|
|
179 |
}
|
180 |
|
181 |
$builtinTypes = [
|
182 |
-
'array', 'callable', 'string', 'int', 'float', 'bool', 'iterable', 'void', 'object'
|
183 |
];
|
184 |
|
185 |
$lowerType = strtolower($type);
|
@@ -193,7 +197,11 @@ final class BuilderHelpers
|
|
193 |
throw new \LogicException('void type cannot be nullable');
|
194 |
}
|
195 |
|
196 |
-
|
|
|
|
|
|
|
|
|
197 |
}
|
198 |
|
199 |
/**
|
8 |
use PhpParser\Node\NullableType;
|
9 |
use PhpParser\Node\Scalar;
|
10 |
use PhpParser\Node\Stmt;
|
11 |
+
use PhpParser\Node\UnionType;
|
12 |
|
13 |
/**
|
14 |
* This class defines helpers used in the implementation of builders. Don't use it directly.
|
159 |
* In particular, builtin types become Identifiers, custom types become Names and nullables
|
160 |
* are wrapped in NullableType nodes.
|
161 |
*
|
162 |
+
* @param string|Name|Identifier|NullableType|UnionType $type The type to normalize
|
163 |
*
|
164 |
+
* @return Name|Identifier|NullableType|UnionType The normalized type
|
165 |
*/
|
166 |
public static function normalizeType($type) {
|
167 |
if (!is_string($type)) {
|
168 |
+
if (
|
169 |
+
!$type instanceof Name && !$type instanceof Identifier &&
|
170 |
+
!$type instanceof NullableType && !$type instanceof UnionType
|
171 |
+
) {
|
172 |
throw new \LogicException(
|
173 |
+
'Type must be a string, or an instance of Name, Identifier, NullableType or UnionType'
|
174 |
+
);
|
175 |
}
|
176 |
return $type;
|
177 |
}
|
183 |
}
|
184 |
|
185 |
$builtinTypes = [
|
186 |
+
'array', 'callable', 'string', 'int', 'float', 'bool', 'iterable', 'void', 'object', 'mixed'
|
187 |
];
|
188 |
|
189 |
$lowerType = strtolower($type);
|
197 |
throw new \LogicException('void type cannot be nullable');
|
198 |
}
|
199 |
|
200 |
+
if ($nullable && (string) $type === 'mixed') {
|
201 |
+
throw new \LogicException('mixed type cannot be nullable');
|
202 |
+
}
|
203 |
+
|
204 |
+
return $nullable ? new NullableType($type) : $type;
|
205 |
}
|
206 |
|
207 |
/**
|
vendor/nikic/php-parser/lib/PhpParser/Comment.php
CHANGED
@@ -5,9 +5,12 @@ namespace PhpParser;
|
|
5 |
class Comment implements \JsonSerializable
|
6 |
{
|
7 |
protected $text;
|
8 |
-
protected $
|
9 |
-
protected $
|
10 |
-
protected $
|
|
|
|
|
|
|
11 |
|
12 |
/**
|
13 |
* Constructs a comment node.
|
@@ -18,12 +21,17 @@ class Comment implements \JsonSerializable
|
|
18 |
* @param int $startTokenPos Token offset the comment started on
|
19 |
*/
|
20 |
public function __construct(
|
21 |
-
string $text,
|
|
|
|
|
22 |
) {
|
23 |
$this->text = $text;
|
24 |
-
$this->
|
25 |
-
$this->
|
26 |
-
$this->
|
|
|
|
|
|
|
27 |
}
|
28 |
|
29 |
/**
|
@@ -38,28 +46,88 @@ class Comment implements \JsonSerializable
|
|
38 |
/**
|
39 |
* Gets the line number the comment started on.
|
40 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
* @return int Line number
|
42 |
*/
|
43 |
public function getLine() : int {
|
44 |
-
return $this->
|
45 |
}
|
46 |
|
47 |
/**
|
48 |
* Gets the file offset the comment started on.
|
49 |
*
|
|
|
|
|
50 |
* @return int File offset
|
51 |
*/
|
52 |
public function getFilePos() : int {
|
53 |
-
return $this->
|
54 |
}
|
55 |
|
56 |
/**
|
57 |
* Gets the token offset the comment started on.
|
58 |
*
|
|
|
|
|
59 |
* @return int Token offset
|
60 |
*/
|
61 |
public function getTokenPos() : int {
|
62 |
-
return $this->
|
63 |
}
|
64 |
|
65 |
/**
|
@@ -159,9 +227,13 @@ class Comment implements \JsonSerializable
|
|
159 |
return [
|
160 |
'nodeType' => $type,
|
161 |
'text' => $this->text,
|
162 |
-
|
163 |
-
'
|
164 |
-
'
|
|
|
|
|
|
|
|
|
165 |
];
|
166 |
}
|
167 |
}
|
5 |
class Comment implements \JsonSerializable
|
6 |
{
|
7 |
protected $text;
|
8 |
+
protected $startLine;
|
9 |
+
protected $startFilePos;
|
10 |
+
protected $startTokenPos;
|
11 |
+
protected $endLine;
|
12 |
+
protected $endFilePos;
|
13 |
+
protected $endTokenPos;
|
14 |
|
15 |
/**
|
16 |
* Constructs a comment node.
|
21 |
* @param int $startTokenPos Token offset the comment started on
|
22 |
*/
|
23 |
public function __construct(
|
24 |
+
string $text,
|
25 |
+
int $startLine = -1, int $startFilePos = -1, int $startTokenPos = -1,
|
26 |
+
int $endLine = -1, int $endFilePos = -1, int $endTokenPos = -1
|
27 |
) {
|
28 |
$this->text = $text;
|
29 |
+
$this->startLine = $startLine;
|
30 |
+
$this->startFilePos = $startFilePos;
|
31 |
+
$this->startTokenPos = $startTokenPos;
|
32 |
+
$this->endLine = $endLine;
|
33 |
+
$this->endFilePos = $endFilePos;
|
34 |
+
$this->endTokenPos = $endTokenPos;
|
35 |
}
|
36 |
|
37 |
/**
|
46 |
/**
|
47 |
* Gets the line number the comment started on.
|
48 |
*
|
49 |
+
* @return int Line number (or -1 if not available)
|
50 |
+
*/
|
51 |
+
public function getStartLine() : int {
|
52 |
+
return $this->startLine;
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Gets the file offset the comment started on.
|
57 |
+
*
|
58 |
+
* @return int File offset (or -1 if not available)
|
59 |
+
*/
|
60 |
+
public function getStartFilePos() : int {
|
61 |
+
return $this->startFilePos;
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Gets the token offset the comment started on.
|
66 |
+
*
|
67 |
+
* @return int Token offset (or -1 if not available)
|
68 |
+
*/
|
69 |
+
public function getStartTokenPos() : int {
|
70 |
+
return $this->startTokenPos;
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Gets the line number the comment ends on.
|
75 |
+
*
|
76 |
+
* @return int Line number (or -1 if not available)
|
77 |
+
*/
|
78 |
+
public function getEndLine() : int {
|
79 |
+
return $this->endLine;
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Gets the file offset the comment ends on.
|
84 |
+
*
|
85 |
+
* @return int File offset (or -1 if not available)
|
86 |
+
*/
|
87 |
+
public function getEndFilePos() : int {
|
88 |
+
return $this->endFilePos;
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Gets the token offset the comment ends on.
|
93 |
+
*
|
94 |
+
* @return int Token offset (or -1 if not available)
|
95 |
+
*/
|
96 |
+
public function getEndTokenPos() : int {
|
97 |
+
return $this->endTokenPos;
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Gets the line number the comment started on.
|
102 |
+
*
|
103 |
+
* @deprecated Use getStartLine() instead
|
104 |
+
*
|
105 |
* @return int Line number
|
106 |
*/
|
107 |
public function getLine() : int {
|
108 |
+
return $this->startLine;
|
109 |
}
|
110 |
|
111 |
/**
|
112 |
* Gets the file offset the comment started on.
|
113 |
*
|
114 |
+
* @deprecated Use getStartFilePos() instead
|
115 |
+
*
|
116 |
* @return int File offset
|
117 |
*/
|
118 |
public function getFilePos() : int {
|
119 |
+
return $this->startFilePos;
|
120 |
}
|
121 |
|
122 |
/**
|
123 |
* Gets the token offset the comment started on.
|
124 |
*
|
125 |
+
* @deprecated Use getStartTokenPos() instead
|
126 |
+
*
|
127 |
* @return int Token offset
|
128 |
*/
|
129 |
public function getTokenPos() : int {
|
130 |
+
return $this->startTokenPos;
|
131 |
}
|
132 |
|
133 |
/**
|
227 |
return [
|
228 |
'nodeType' => $type,
|
229 |
'text' => $this->text,
|
230 |
+
// TODO: Rename these to include "start".
|
231 |
+
'line' => $this->startLine,
|
232 |
+
'filePos' => $this->startFilePos,
|
233 |
+
'tokenPos' => $this->startTokenPos,
|
234 |
+
'endLine' => $this->endLine,
|
235 |
+
'endFilePos' => $this->endFilePos,
|
236 |
+
'endTokenPos' => $this->endTokenPos,
|
237 |
];
|
238 |
}
|
239 |
}
|
vendor/nikic/php-parser/lib/PhpParser/JsonDecoder.php
CHANGED
@@ -73,7 +73,9 @@ class JsonDecoder
|
|
73 |
}
|
74 |
|
75 |
return new $className(
|
76 |
-
$value['text'],
|
|
|
|
|
77 |
);
|
78 |
}
|
79 |
|
73 |
}
|
74 |
|
75 |
return new $className(
|
76 |
+
$value['text'],
|
77 |
+
$value['line'] ?? -1, $value['filePos'] ?? -1, $value['tokenPos'] ?? -1,
|
78 |
+
$value['endLine'] ?? -1, $value['endFilePos'] ?? -1, $value['endTokenPos'] ?? -1
|
79 |
);
|
80 |
}
|
81 |
|
vendor/nikic/php-parser/lib/PhpParser/Lexer.php
CHANGED
@@ -300,17 +300,23 @@ class Lexer
|
|
300 |
$this->line += substr_count($value, "\n");
|
301 |
$this->filePos += \strlen($value);
|
302 |
} else {
|
|
|
|
|
|
|
|
|
|
|
303 |
if (\T_COMMENT === $token[0] || \T_DOC_COMMENT === $token[0]) {
|
304 |
if ($this->attributeCommentsUsed) {
|
305 |
$comment = \T_DOC_COMMENT === $token[0]
|
306 |
-
? new Comment\Doc($token[1],
|
307 |
-
|
|
|
|
|
|
|
|
|
308 |
$startAttributes['comments'][] = $comment;
|
309 |
}
|
310 |
}
|
311 |
-
|
312 |
-
$this->line += substr_count($token[1], "\n");
|
313 |
-
$this->filePos += \strlen($token[1]);
|
314 |
continue;
|
315 |
}
|
316 |
|
300 |
$this->line += substr_count($value, "\n");
|
301 |
$this->filePos += \strlen($value);
|
302 |
} else {
|
303 |
+
$origLine = $this->line;
|
304 |
+
$origFilePos = $this->filePos;
|
305 |
+
$this->line += substr_count($token[1], "\n");
|
306 |
+
$this->filePos += \strlen($token[1]);
|
307 |
+
|
308 |
if (\T_COMMENT === $token[0] || \T_DOC_COMMENT === $token[0]) {
|
309 |
if ($this->attributeCommentsUsed) {
|
310 |
$comment = \T_DOC_COMMENT === $token[0]
|
311 |
+
? new Comment\Doc($token[1],
|
312 |
+
$origLine, $origFilePos, $this->pos,
|
313 |
+
$this->line, $this->filePos - 1, $this->pos)
|
314 |
+
: new Comment($token[1],
|
315 |
+
$origLine, $origFilePos, $this->pos,
|
316 |
+
$this->line, $this->filePos - 1, $this->pos);
|
317 |
$startAttributes['comments'][] = $comment;
|
318 |
}
|
319 |
}
|
|
|
|
|
|
|
320 |
continue;
|
321 |
}
|
322 |
|
vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php
CHANGED
@@ -21,7 +21,8 @@ final class NumericLiteralSeparatorEmulator implements TokenEmulatorInterface
|
|
21 |
return false;
|
22 |
}
|
23 |
|
24 |
-
return preg_match('~[0-
|
|
|
25 |
}
|
26 |
|
27 |
public function emulate(string $code, array $tokens): array
|
21 |
return false;
|
22 |
}
|
23 |
|
24 |
+
return preg_match('~[0-9]_[0-9]~', $code)
|
25 |
+
|| preg_match('~0x[0-9a-f]+_[0-9a-f]~i', $code);
|
26 |
}
|
27 |
|
28 |
public function emulate(string $code, array $tokens): array
|
vendor/nikic/php-parser/lib/PhpParser/Node.php
CHANGED
@@ -95,8 +95,6 @@ interface Node
|
|
95 |
/**
|
96 |
* Gets the doc comment of the node.
|
97 |
*
|
98 |
-
* The doc comment has to be the last comment associated with the node.
|
99 |
-
*
|
100 |
* @return null|Comment\Doc Doc comment object or null
|
101 |
*/
|
102 |
public function getDocComment();
|
95 |
/**
|
96 |
* Gets the doc comment of the node.
|
97 |
*
|
|
|
|
|
98 |
* @return null|Comment\Doc Doc comment object or null
|
99 |
*/
|
100 |
public function getDocComment();
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php
CHANGED
@@ -9,7 +9,7 @@ class Catch_ extends Node\Stmt
|
|
9 |
{
|
10 |
/** @var Node\Name[] Types of exceptions to catch */
|
11 |
public $types;
|
12 |
-
/** @var Expr\Variable Variable for exception */
|
13 |
public $var;
|
14 |
/** @var Node\Stmt[] Statements */
|
15 |
public $stmts;
|
@@ -17,13 +17,13 @@ class Catch_ extends Node\Stmt
|
|
17 |
/**
|
18 |
* Constructs a catch node.
|
19 |
*
|
20 |
-
* @param Node\Name[]
|
21 |
-
* @param Expr\Variable
|
22 |
-
* @param Node\Stmt[]
|
23 |
-
* @param array
|
24 |
*/
|
25 |
public function __construct(
|
26 |
-
array $types, Expr\Variable $var, array $stmts = [], array $attributes = []
|
27 |
) {
|
28 |
$this->attributes = $attributes;
|
29 |
$this->types = $types;
|
@@ -34,7 +34,7 @@ class Catch_ extends Node\Stmt
|
|
34 |
public function getSubNodeNames() : array {
|
35 |
return ['types', 'var', 'stmts'];
|
36 |
}
|
37 |
-
|
38 |
public function getType() : string {
|
39 |
return 'Stmt_Catch';
|
40 |
}
|
9 |
{
|
10 |
/** @var Node\Name[] Types of exceptions to catch */
|
11 |
public $types;
|
12 |
+
/** @var Expr\Variable|null Variable for exception */
|
13 |
public $var;
|
14 |
/** @var Node\Stmt[] Statements */
|
15 |
public $stmts;
|
17 |
/**
|
18 |
* Constructs a catch node.
|
19 |
*
|
20 |
+
* @param Node\Name[] $types Types of exceptions to catch
|
21 |
+
* @param Expr\Variable|null $var Variable for exception
|
22 |
+
* @param Node\Stmt[] $stmts Statements
|
23 |
+
* @param array $attributes Additional attributes
|
24 |
*/
|
25 |
public function __construct(
|
26 |
+
array $types, Expr\Variable $var = null, array $stmts = [], array $attributes = []
|
27 |
) {
|
28 |
$this->attributes = $attributes;
|
29 |
$this->types = $types;
|
34 |
public function getSubNodeNames() : array {
|
35 |
return ['types', 'var', 'stmts'];
|
36 |
}
|
37 |
+
|
38 |
public function getType() : string {
|
39 |
return 'Stmt_Catch';
|
40 |
}
|
vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php
CHANGED
@@ -53,6 +53,26 @@ abstract class ClassLike extends Node\Stmt
|
|
53 |
return $properties;
|
54 |
}
|
55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
/**
|
57 |
* Gets all methods defined directly in this class/interface/trait
|
58 |
*
|
53 |
return $properties;
|
54 |
}
|
55 |
|
56 |
+
/**
|
57 |
+
* Gets property with the given name defined directly in this class/interface/trait.
|
58 |
+
*
|
59 |
+
* @param string $name Name of the property
|
60 |
+
*
|
61 |
+
* @return Property|null Property node or null if the property does not exist
|
62 |
+
*/
|
63 |
+
public function getProperty(string $name) {
|
64 |
+
foreach ($this->stmts as $stmt) {
|
65 |
+
if ($stmt instanceof Property) {
|
66 |
+
foreach ($stmt->props as $prop) {
|
67 |
+
if ($prop instanceof PropertyProperty && $name === $prop->name->toString()) {
|
68 |
+
return $stmt;
|
69 |
+
}
|
70 |
+
}
|
71 |
+
}
|
72 |
+
}
|
73 |
+
return null;
|
74 |
+
}
|
75 |
+
|
76 |
/**
|
77 |
* Gets all methods defined directly in this class/interface/trait
|
78 |
*
|
vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php
CHANGED
@@ -108,22 +108,18 @@ abstract class NodeAbstract implements Node, \JsonSerializable
|
|
108 |
/**
|
109 |
* Gets the doc comment of the node.
|
110 |
*
|
111 |
-
* The doc comment has to be the last comment associated with the node.
|
112 |
-
*
|
113 |
* @return null|Comment\Doc Doc comment object or null
|
114 |
*/
|
115 |
public function getDocComment() {
|
116 |
$comments = $this->getComments();
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
if (!$lastComment instanceof Comment\Doc) {
|
123 |
-
return null;
|
124 |
}
|
125 |
|
126 |
-
return
|
127 |
}
|
128 |
|
129 |
/**
|
@@ -135,16 +131,17 @@ abstract class NodeAbstract implements Node, \JsonSerializable
|
|
135 |
*/
|
136 |
public function setDocComment(Comment\Doc $docComment) {
|
137 |
$comments = $this->getComments();
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
$comments[] = $docComment;
|
146 |
}
|
147 |
|
|
|
|
|
148 |
$this->setAttribute('comments', $comments);
|
149 |
}
|
150 |
|
108 |
/**
|
109 |
* Gets the doc comment of the node.
|
110 |
*
|
|
|
|
|
111 |
* @return null|Comment\Doc Doc comment object or null
|
112 |
*/
|
113 |
public function getDocComment() {
|
114 |
$comments = $this->getComments();
|
115 |
+
for ($i = count($comments) - 1; $i >= 0; $i--) {
|
116 |
+
$comment = $comments[$i];
|
117 |
+
if ($comment instanceof Comment\Doc) {
|
118 |
+
return $comment;
|
119 |
+
}
|
|
|
|
|
120 |
}
|
121 |
|
122 |
+
return null;
|
123 |
}
|
124 |
|
125 |
/**
|
131 |
*/
|
132 |
public function setDocComment(Comment\Doc $docComment) {
|
133 |
$comments = $this->getComments();
|
134 |
+
for ($i = count($comments) - 1; $i >= 0; $i--) {
|
135 |
+
if ($comments[$i] instanceof Comment\Doc) {
|
136 |
+
// Replace existing doc comment.
|
137 |
+
$comments[$i] = $docComment;
|
138 |
+
$this->setAttribute('comments', $comments);
|
139 |
+
return;
|
140 |
+
}
|
|
|
141 |
}
|
142 |
|
143 |
+
// Append new doc comment.
|
144 |
+
$comments[] = $docComment;
|
145 |
$this->setAttribute('comments', $comments);
|
146 |
}
|
147 |
|
vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php
CHANGED
@@ -944,7 +944,7 @@ class Php5 extends \PhpParser\ParserAbstract
|
|
944 |
$this->semValue = array();
|
945 |
},
|
946 |
4 => function ($stackPos) {
|
947 |
-
$startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->
|
948 |
if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)];
|
949 |
},
|
950 |
5 => function ($stackPos) {
|
@@ -1317,7 +1317,7 @@ class Php5 extends \PhpParser\ParserAbstract
|
|
1317 |
$this->semValue = array();
|
1318 |
},
|
1319 |
126 => function ($stackPos) {
|
1320 |
-
$startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->
|
1321 |
if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)];
|
1322 |
},
|
1323 |
127 => function ($stackPos) {
|
@@ -1715,7 +1715,7 @@ class Php5 extends \PhpParser\ParserAbstract
|
|
1715 |
$this->semValue = array();
|
1716 |
},
|
1717 |
255 => function ($stackPos) {
|
1718 |
-
$startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->
|
1719 |
if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)];
|
1720 |
},
|
1721 |
256 => function ($stackPos) {
|
944 |
$this->semValue = array();
|
945 |
},
|
946 |
4 => function ($stackPos) {
|
947 |
+
$startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; };
|
948 |
if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)];
|
949 |
},
|
950 |
5 => function ($stackPos) {
|
1317 |
$this->semValue = array();
|
1318 |
},
|
1319 |
126 => function ($stackPos) {
|
1320 |
+
$startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; };
|
1321 |
if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)];
|
1322 |
},
|
1323 |
127 => function ($stackPos) {
|
1715 |
$this->semValue = array();
|
1716 |
},
|
1717 |
255 => function ($stackPos) {
|
1718 |
+
$startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; };
|
1719 |
if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)];
|
1720 |
},
|
1721 |
256 => function ($stackPos) {
|
vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php
CHANGED
@@ -18,16 +18,16 @@ use PhpParser\Node\Stmt;
|
|
18 |
class Php7 extends \PhpParser\ParserAbstract
|
19 |
{
|
20 |
protected $tokenToSymbolMapSize = 394;
|
21 |
-
protected $actionTableSize =
|
22 |
-
protected $gotoTableSize =
|
23 |
|
24 |
protected $invalidSymbol = 159;
|
25 |
protected $errorSymbol = 1;
|
26 |
protected $defaultAction = -32766;
|
27 |
protected $unexpectedTokenRule = 32767;
|
28 |
|
29 |
-
protected $YY2TBLSTATE =
|
30 |
-
protected $numNonLeafStates =
|
31 |
|
32 |
protected $symbolToName = array(
|
33 |
"EOF",
|
@@ -235,422 +235,413 @@ class Php7 extends \PhpParser\ParserAbstract
|
|
235 |
);
|
236 |
|
237 |
protected $action = array(
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
526, 573, 988, 985, 0, 1001,-32766, 1043,-32766,-32766,
|
333 |
-
-32766,-32766,-32766,-32766,-32767,-32767,-32767,-32767,-32767, 1072,
|
334 |
-
1073, 774, 580, 1087, 1127, 536
|
335 |
);
|
336 |
|
337 |
protected $actionCheck = array(
|
338 |
-
2, 3, 4, 5, 6,
|
339 |
-
12,
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
117, 118, 119, 55,
|
344 |
-
|
345 |
-
72, 73, 74, 75,
|
346 |
-
|
347 |
92, 93, 94, 95, 96, 97, 98, 99, 100, 101,
|
348 |
102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
|
349 |
112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
|
350 |
-
122, 123, 124, 125, 126, 127, 128, 129,
|
351 |
-
132, 133, 134, 135, 136, 137, 138, 139,
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
150, 150, 150,
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
152,
|
420 |
-
|
421 |
-
|
422 |
-
152, 152,
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
153, 153, 153,
|
427 |
-
|
428 |
-
|
429 |
-
154,
|
430 |
-
154,
|
431 |
-
154,
|
432 |
-
154, 154, 154, 154, -1, 155, 29, 156, 31, 32,
|
433 |
-
33, 34, 35, 36, 37, 38, 39, 40, 41, 156,
|
434 |
-
156, 150, 151, 156, 156, 156
|
435 |
);
|
436 |
|
437 |
protected $actionBase = array(
|
438 |
-
0,
|
439 |
-
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
497 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
498 |
-
0, 0,
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
516 |
-
0, 0, 0,
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
0,
|
528 |
-
|
529 |
-
0,
|
530 |
-
|
531 |
-
0, 0, 0, 0,
|
532 |
-
|
533 |
-
566, 566, 0, 0, 0, 566
|
534 |
);
|
535 |
|
536 |
protected $actionDefault = array(
|
537 |
3,32767,32767,32767,32767,32767,32767,32767,32767, 92,
|
538 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
539 |
-
32767,32767,32767,32767, 513, 513, 513, 94,
|
540 |
-
|
541 |
-
|
542 |
-
397,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
543 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
544 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
545 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
546 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
547 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
548 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
549 |
-
32767, 92,32767,32767,32767,32767,32767,32767,32767,32767,
|
550 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
551 |
-
32767,32767,32767,32767,
|
|
|
|
|
552 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
553 |
-
32767,32767,32767,32767,
|
554 |
-
512, 262,
|
555 |
-
|
556 |
328, 329, 330, 331, 332, 333, 334, 335, 336, 337,
|
557 |
-
338,
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
94, 417,32767,32767,32767,32767,32767,32767,32767,32767,
|
567 |
-
32767,32767, 426,32767,32767, 92,32767,32767, 92, 174,
|
568 |
-
230, 232, 179,32767, 434,32767,32767,32767,32767,32767,
|
569 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
570 |
-
|
571 |
-
|
572 |
-
459,32767, 459, 459,32767,32767,32767,32767,32767, 179,
|
573 |
-
32767,32767,32767,32767, 94, 432, 432, 92, 92, 92,
|
574 |
-
92, 427,32767, 179, 179,32767,32767,32767,32767,32767,
|
575 |
-
179, 91, 91, 91, 91, 179, 179, 91, 194,32767,
|
576 |
-
192, 192, 91,32767, 93,32767, 93, 196,32767, 473,
|
577 |
-
196, 91, 179, 91, 216, 216, 408, 181, 255, 93,
|
578 |
-
255, 255, 93, 408, 255, 179, 255, 91, 91,32767,
|
579 |
-
91, 255,32767,32767,32767, 85,32767,32767,32767,32767,
|
580 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
581 |
-
|
582 |
-
|
583 |
-
32767,
|
584 |
-
|
585 |
-
32767,32767,32767,32767,
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
|
|
|
|
|
|
|
|
|
|
590 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
591 |
-
|
592 |
-
|
593 |
-
32767,32767,
|
|
|
|
|
|
|
|
|
594 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
595 |
-
|
596 |
-
|
597 |
-
|
|
|
|
|
598 |
);
|
599 |
|
600 |
protected $goto = array(
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
0, 0, 0, 0,
|
643 |
-
0,
|
644 |
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
645 |
-
0, 0, 0, 874, 0, 1084, 1084, 874, 0, 0,
|
646 |
-
482, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
647 |
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
648 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
649 |
-
|
650 |
-
0, 0, 0, 0, 0, 0, 0, 0,
|
651 |
-
|
652 |
-
0, 0,
|
653 |
-
|
|
|
|
|
654 |
);
|
655 |
|
656 |
protected $gotoCheck = array(
|
@@ -665,86 +656,84 @@ class Php7 extends \PhpParser\ParserAbstract
|
|
665 |
33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
|
666 |
33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
|
667 |
33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
|
668 |
-
33, 33, 33, 33, 33, 33, 33,
|
669 |
-
|
670 |
-
|
671 |
-
10,
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
138, 138, 138, 138,
|
676 |
-
|
677 |
-
|
678 |
-
10, 10, 10, 10,
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
13, 13,
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
63, 63, 63, 63,
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
-1, -1, -1, -1,
|
699 |
-
-1,
|
700 |
-
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
701 |
-
-1, -1, -1, 98, -1, 98, 98, 98, -1, -1,
|
702 |
-
8, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
703 |
-
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
704 |
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
705 |
-
|
|
|
|
|
|
|
|
|
706 |
-1, -1, -1, -1, -1, -1, -1, -1, 8, -1,
|
707 |
-
|
708 |
-
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
709 |
-
-1, -1, -1, -1, 8, -1, 8
|
710 |
);
|
711 |
|
712 |
protected $gotoBase = array(
|
713 |
-
0, 0, -
|
714 |
-
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
0, 0,
|
719 |
-
0, 0, 0,
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
0, 0,
|
725 |
-
0, 0, 0,
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
);
|
730 |
|
731 |
protected $gotoDefault = array(
|
732 |
-
-32768,
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
323, 324,
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
);
|
749 |
|
750 |
protected $ruleToNonTerminal = array(
|
@@ -765,21 +754,21 @@ class Php7 extends \PhpParser\ParserAbstract
|
|
765 |
38, 38, 40, 40, 40, 40, 40, 40, 40, 40,
|
766 |
40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
|
767 |
40, 40, 40, 40, 40, 40, 40, 16, 16, 59,
|
768 |
-
59, 62, 62, 61, 60, 60, 53,
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
42, 42, 44, 44, 54, 54, 54, 54,
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
|
784 |
33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
|
785 |
33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
|
@@ -788,20 +777,20 @@ class Php7 extends \PhpParser\ParserAbstract
|
|
788 |
33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
|
789 |
33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
|
790 |
33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
|
791 |
-
33, 33, 33, 33, 33,
|
792 |
-
|
793 |
-
63, 63,
|
794 |
-
122,
|
795 |
-
138,
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
);
|
806 |
|
807 |
protected $ruleToLength = array(
|
@@ -836,27 +825,27 @@ class Php7 extends \PhpParser\ParserAbstract
|
|
836 |
3, 1, 1, 3, 0, 2, 4, 5, 4, 4,
|
837 |
4, 3, 1, 1, 1, 1, 1, 1, 0, 1,
|
838 |
1, 2, 1, 1, 1, 1, 1, 1, 2, 1,
|
839 |
-
3, 1, 1, 3, 2, 3, 1, 0, 1,
|
840 |
-
3, 3, 3, 4, 1, 2, 3, 3, 3,
|
841 |
-
3, 3, 3, 3, 3, 3, 3, 3, 3, 2,
|
842 |
-
2, 2, 2, 3, 3, 3, 3, 3, 3, 3,
|
843 |
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
844 |
2, 2, 2, 2, 3, 3, 3, 3, 3, 3,
|
845 |
-
3, 3, 3, 3, 3,
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
2,
|
850 |
-
|
851 |
-
|
852 |
-
1,
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
|
|
|
|
860 |
1, 4, 3, 3, 3, 6, 3, 1, 1, 2,
|
861 |
1
|
862 |
);
|
@@ -876,7 +865,7 @@ class Php7 extends \PhpParser\ParserAbstract
|
|
876 |
$this->semValue = array();
|
877 |
},
|
878 |
4 => function ($stackPos) {
|
879 |
-
$startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->
|
880 |
if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)];
|
881 |
},
|
882 |
5 => function ($stackPos) {
|
@@ -1282,7 +1271,7 @@ class Php7 extends \PhpParser\ParserAbstract
|
|
1282 |
$this->semValue = array();
|
1283 |
},
|
1284 |
137 => function ($stackPos) {
|
1285 |
-
$startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->
|
1286 |
if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)];
|
1287 |
},
|
1288 |
138 => function ($stackPos) {
|
@@ -1710,7 +1699,7 @@ class Php7 extends \PhpParser\ParserAbstract
|
|
1710 |
$this->semValue = array();
|
1711 |
},
|
1712 |
276 => function ($stackPos) {
|
1713 |
-
$startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->
|
1714 |
if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)];
|
1715 |
},
|
1716 |
277 => function ($stackPos) {
|
@@ -1830,22 +1819,22 @@ class Php7 extends \PhpParser\ParserAbstract
|
|
1830 |
$this->semValue = $this->semStack[$stackPos-(2-1)];
|
1831 |
},
|
1832 |
315 => function ($stackPos) {
|
1833 |
-
$this->
|
1834 |
},
|
1835 |
316 => function ($stackPos) {
|
1836 |
-
$this->
|
1837 |
},
|
1838 |
317 => function ($stackPos) {
|
1839 |
-
$this->semValue = array();
|
1840 |
},
|
1841 |
318 => function ($stackPos) {
|
1842 |
-
$this->semValue =
|
1843 |
},
|
1844 |
319 => function ($stackPos) {
|
1845 |
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
1846 |
},
|
1847 |
320 => function ($stackPos) {
|
1848 |
-
$this->semValue =
|
1849 |
},
|
1850 |
321 => function ($stackPos) {
|
1851 |
$this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
@@ -1854,427 +1843,427 @@ class Php7 extends \PhpParser\ParserAbstract
|
|
1854 |
$this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1855 |
},
|
1856 |
323 => function ($stackPos) {
|
1857 |
-
$this->semValue = new Expr\
|
1858 |
},
|
1859 |
324 => function ($stackPos) {
|
1860 |
-
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
1861 |
},
|
1862 |
325 => function ($stackPos) {
|
1863 |
-
$this->semValue =
|
1864 |
},
|
1865 |
326 => function ($stackPos) {
|
1866 |
-
$this->semValue = new Expr\
|
1867 |
},
|
1868 |
327 => function ($stackPos) {
|
1869 |
-
$this->semValue = new Expr\AssignOp\
|
1870 |
},
|
1871 |
328 => function ($stackPos) {
|
1872 |
-
$this->semValue = new Expr\AssignOp\
|
1873 |
},
|
1874 |
329 => function ($stackPos) {
|
1875 |
-
$this->semValue = new Expr\AssignOp\
|
1876 |
},
|
1877 |
330 => function ($stackPos) {
|
1878 |
-
$this->semValue = new Expr\AssignOp\
|
1879 |
},
|
1880 |
331 => function ($stackPos) {
|
1881 |
-
$this->semValue = new Expr\AssignOp\
|
1882 |
},
|
1883 |
332 => function ($stackPos) {
|
1884 |
-
$this->semValue = new Expr\AssignOp\
|
1885 |
},
|
1886 |
333 => function ($stackPos) {
|
1887 |
-
$this->semValue = new Expr\AssignOp\
|
1888 |
},
|
1889 |
334 => function ($stackPos) {
|
1890 |
-
$this->semValue = new Expr\AssignOp\
|
1891 |
},
|
1892 |
335 => function ($stackPos) {
|
1893 |
-
$this->semValue = new Expr\AssignOp\
|
1894 |
},
|
1895 |
336 => function ($stackPos) {
|
1896 |
-
$this->semValue = new Expr\AssignOp\
|
1897 |
},
|
1898 |
337 => function ($stackPos) {
|
1899 |
-
$this->semValue = new Expr\AssignOp\
|
1900 |
},
|
1901 |
338 => function ($stackPos) {
|
1902 |
-
$this->semValue = new Expr\AssignOp\
|
1903 |
},
|
1904 |
339 => function ($stackPos) {
|
1905 |
-
$this->semValue = new Expr\
|
1906 |
},
|
1907 |
340 => function ($stackPos) {
|
1908 |
-
$this->semValue = new Expr\
|
1909 |
},
|
1910 |
341 => function ($stackPos) {
|
1911 |
-
$this->semValue = new Expr\
|
1912 |
},
|
1913 |
342 => function ($stackPos) {
|
1914 |
-
$this->semValue = new Expr\
|
1915 |
},
|
1916 |
343 => function ($stackPos) {
|
1917 |
-
$this->semValue = new Expr\
|
1918 |
},
|
1919 |
344 => function ($stackPos) {
|
1920 |
-
$this->semValue = new Expr\BinaryOp\
|
1921 |
},
|
1922 |
345 => function ($stackPos) {
|
1923 |
-
$this->semValue = new Expr\BinaryOp\
|
1924 |
},
|
1925 |
346 => function ($stackPos) {
|
1926 |
-
$this->semValue = new Expr\BinaryOp\
|
1927 |
},
|
1928 |
347 => function ($stackPos) {
|
1929 |
-
$this->semValue = new Expr\BinaryOp\
|
1930 |
},
|
1931 |
348 => function ($stackPos) {
|
1932 |
-
$this->semValue = new Expr\BinaryOp\
|
1933 |
},
|
1934 |
349 => function ($stackPos) {
|
1935 |
-
$this->semValue = new Expr\BinaryOp\
|
1936 |
},
|
1937 |
350 => function ($stackPos) {
|
1938 |
-
$this->semValue = new Expr\BinaryOp\
|
1939 |
},
|
1940 |
351 => function ($stackPos) {
|
1941 |
-
$this->semValue = new Expr\BinaryOp\
|
1942 |
},
|
1943 |
352 => function ($stackPos) {
|
1944 |
-
$this->semValue = new Expr\BinaryOp\
|
1945 |
},
|
1946 |
353 => function ($stackPos) {
|
1947 |
-
$this->semValue = new Expr\BinaryOp\
|
1948 |
},
|
1949 |
354 => function ($stackPos) {
|
1950 |
-
$this->semValue = new Expr\BinaryOp\
|
1951 |
},
|
1952 |
355 => function ($stackPos) {
|
1953 |
-
$this->semValue = new Expr\BinaryOp\
|
1954 |
},
|
1955 |
356 => function ($stackPos) {
|
1956 |
-
$this->semValue = new Expr\BinaryOp\
|
1957 |
},
|
1958 |
357 => function ($stackPos) {
|
1959 |
-
$this->semValue = new Expr\BinaryOp\
|
1960 |
},
|
1961 |
358 => function ($stackPos) {
|
1962 |
-
$this->semValue = new Expr\BinaryOp\
|
1963 |
},
|
1964 |
359 => function ($stackPos) {
|
1965 |
-
$this->semValue = new Expr\BinaryOp\
|
1966 |
},
|
1967 |
360 => function ($stackPos) {
|
1968 |
-
$this->semValue = new Expr\
|
1969 |
},
|
1970 |
361 => function ($stackPos) {
|
1971 |
-
$this->semValue = new Expr\
|
1972 |
},
|
1973 |
362 => function ($stackPos) {
|
1974 |
-
$this->semValue = new Expr\
|
1975 |
},
|
1976 |
363 => function ($stackPos) {
|
1977 |
-
$this->semValue = new Expr\
|
1978 |
},
|
1979 |
364 => function ($stackPos) {
|
1980 |
-
$this->semValue = new Expr\
|
1981 |
},
|
1982 |
365 => function ($stackPos) {
|
1983 |
-
$this->semValue = new Expr\BinaryOp\
|
1984 |
},
|
1985 |
366 => function ($stackPos) {
|
1986 |
-
$this->semValue = new Expr\BinaryOp\
|
1987 |
},
|
1988 |
367 => function ($stackPos) {
|
1989 |
-
$this->semValue = new Expr\BinaryOp\
|
1990 |
},
|
1991 |
368 => function ($stackPos) {
|
1992 |
-
$this->semValue = new Expr\BinaryOp\
|
1993 |
},
|
1994 |
369 => function ($stackPos) {
|
1995 |
-
$this->semValue = new Expr\BinaryOp\
|
1996 |
},
|
1997 |
370 => function ($stackPos) {
|
1998 |
-
$this->semValue = new Expr\BinaryOp\
|
1999 |
},
|
2000 |
371 => function ($stackPos) {
|
2001 |
-
$this->semValue = new Expr\BinaryOp\
|
2002 |
},
|
2003 |
372 => function ($stackPos) {
|
2004 |
-
$this->semValue = new Expr\BinaryOp\
|
2005 |
},
|
2006 |
373 => function ($stackPos) {
|
2007 |
-
$this->semValue = new Expr\
|
2008 |
},
|
2009 |
374 => function ($stackPos) {
|
2010 |
-
$this->semValue = $this->semStack[$stackPos-(3-
|
2011 |
},
|
2012 |
375 => function ($stackPos) {
|
2013 |
-
$this->semValue =
|
2014 |
},
|
2015 |
376 => function ($stackPos) {
|
2016 |
-
$this->semValue = new Expr\Ternary($this->semStack[$stackPos-(
|
2017 |
},
|
2018 |
377 => function ($stackPos) {
|
2019 |
-
$this->semValue = new Expr\
|
2020 |
},
|
2021 |
378 => function ($stackPos) {
|
2022 |
-
$this->semValue = new Expr\
|
2023 |
},
|
2024 |
379 => function ($stackPos) {
|
2025 |
-
$this->semValue = new Expr\
|
2026 |
},
|
2027 |
380 => function ($stackPos) {
|
2028 |
-
$this->semValue = new Expr\
|
2029 |
},
|
2030 |
381 => function ($stackPos) {
|
2031 |
-
$this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::
|
2032 |
},
|
2033 |
382 => function ($stackPos) {
|
2034 |
-
$this->semValue = new Expr\
|
2035 |
},
|
2036 |
383 => function ($stackPos) {
|
2037 |
-
$this->semValue = new Expr\
|
2038 |
},
|
2039 |
384 => function ($stackPos) {
|
2040 |
-
$this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::
|
2041 |
},
|
2042 |
385 => function ($stackPos) {
|
2043 |
-
$this->semValue = new Expr\
|
2044 |
},
|
2045 |
386 => function ($stackPos) {
|
|
|
|
|
|
|
2046 |
$attrs = $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes;
|
2047 |
$attrs['kind'] = $this->getFloatCastKind($this->semStack[$stackPos-(2-1)]);
|
2048 |
$this->semValue = new Expr\Cast\Double($this->semStack[$stackPos-(2-2)], $attrs);
|
2049 |
},
|
2050 |
-
|
2051 |
$this->semValue = new Expr\Cast\String_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2052 |
},
|
2053 |
-
|
2054 |
$this->semValue = new Expr\Cast\Array_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2055 |
},
|
2056 |
-
|
2057 |
$this->semValue = new Expr\Cast\Object_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2058 |
},
|
2059 |
-
|
2060 |
$this->semValue = new Expr\Cast\Bool_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2061 |
},
|
2062 |
-
|
2063 |
$this->semValue = new Expr\Cast\Unset_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2064 |
},
|
2065 |
-
|
2066 |
$attrs = $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes;
|
2067 |
$attrs['kind'] = strtolower($this->semStack[$stackPos-(2-1)]) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE;
|
2068 |
$this->semValue = new Expr\Exit_($this->semStack[$stackPos-(2-2)], $attrs);
|
2069 |
},
|
2070 |
-
|
2071 |
$this->semValue = new Expr\ErrorSuppress($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2072 |
},
|
2073 |
-
|
2074 |
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2075 |
},
|
2076 |
-
|
2077 |
$this->semValue = new Expr\ShellExec($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
2078 |
},
|
2079 |
-
|
2080 |
$this->semValue = new Expr\Print_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2081 |
},
|
2082 |
-
|
2083 |
$this->semValue = new Expr\Yield_(null, null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
|
2084 |
},
|
2085 |
-
|
2086 |
$this->semValue = new Expr\Yield_($this->semStack[$stackPos-(2-2)], null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2087 |
},
|
2088 |
-
|
2089 |
$this->semValue = new Expr\Yield_($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
|
2090 |
},
|
2091 |
-
|
2092 |
$this->semValue = new Expr\YieldFrom($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2093 |
},
|
2094 |
-
|
2095 |
$this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'returnType' => $this->semStack[$stackPos-(8-6)], 'expr' => $this->semStack[$stackPos-(8-8)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes);
|
2096 |
},
|
2097 |
-
|
2098 |
$this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes);
|
2099 |
},
|
2100 |
-
|
2101 |
$this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'uses' => $this->semStack[$stackPos-(8-6)], 'returnType' => $this->semStack[$stackPos-(8-7)], 'stmts' => $this->semStack[$stackPos-(8-8)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes);
|
2102 |
},
|
2103 |
-
|
2104 |
$this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'uses' => $this->semStack[$stackPos-(9-7)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes);
|
2105 |
},
|
2106 |
-
|
2107 |
$this->semValue = array(new Stmt\Class_(null, ['type' => 0, 'extends' => $this->semStack[$stackPos-(7-3)], 'implements' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes), $this->semStack[$stackPos-(7-2)]);
|
2108 |
$this->checkClass($this->semValue[0], -1);
|
2109 |
},
|
2110 |
-
406 => function ($stackPos) {
|
2111 |
-
$this->semValue = new Expr\New_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
2112 |
-
},
|
2113 |
407 => function ($stackPos) {
|
2114 |
-
|
2115 |
},
|
2116 |
408 => function ($stackPos) {
|
2117 |
-
$this->semValue =
|
2118 |
},
|
2119 |
409 => function ($stackPos) {
|
2120 |
-
$this->semValue =
|
2121 |
},
|
2122 |
410 => function ($stackPos) {
|
2123 |
-
$this->semValue = $this->semStack[$stackPos-(
|
2124 |
},
|
2125 |
411 => function ($stackPos) {
|
2126 |
-
$this->semValue =
|
2127 |
},
|
2128 |
412 => function ($stackPos) {
|
2129 |
-
$this->
|
2130 |
},
|
2131 |
413 => function ($stackPos) {
|
2132 |
-
$this->
|
2133 |
},
|
2134 |
414 => function ($stackPos) {
|
2135 |
-
$this->semValue = new Expr\
|
2136 |
},
|
2137 |
415 => function ($stackPos) {
|
2138 |
$this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2139 |
},
|
2140 |
416 => function ($stackPos) {
|
2141 |
-
$this->semValue = new Expr\
|
2142 |
},
|
2143 |
417 => function ($stackPos) {
|
2144 |
-
$this->semValue = new
|
2145 |
},
|
2146 |
418 => function ($stackPos) {
|
2147 |
-
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2148 |
},
|
2149 |
419 => function ($stackPos) {
|
2150 |
-
$this->semValue =
|
2151 |
},
|
2152 |
420 => function ($stackPos) {
|
2153 |
-
$this->semValue = new Name
|
2154 |
},
|
2155 |
421 => function ($stackPos) {
|
2156 |
-
$this->semValue = new Name\
|
2157 |
},
|
2158 |
422 => function ($stackPos) {
|
2159 |
-
$this->semValue = $this->semStack[$stackPos-(
|
2160 |
},
|
2161 |
423 => function ($stackPos) {
|
2162 |
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2163 |
},
|
2164 |
424 => function ($stackPos) {
|
2165 |
-
$this->semValue =
|
2166 |
},
|
2167 |
425 => function ($stackPos) {
|
2168 |
-
$this->semValue = $this->semStack[$stackPos-(
|
2169 |
},
|
2170 |
426 => function ($stackPos) {
|
2171 |
-
$this->semValue = $this->
|
2172 |
},
|
2173 |
427 => function ($stackPos) {
|
2174 |
-
$this->semValue =
|
2175 |
},
|
2176 |
428 => function ($stackPos) {
|
2177 |
-
$this->semValue = $this->semStack[$stackPos-(
|
2178 |
},
|
2179 |
429 => function ($stackPos) {
|
2180 |
-
$this->semValue =
|
2181 |
},
|
2182 |
430 => function ($stackPos) {
|
2183 |
-
$this->semValue =
|
2184 |
},
|
2185 |
431 => function ($stackPos) {
|
2186 |
-
|
2187 |
},
|
2188 |
432 => function ($stackPos) {
|
2189 |
-
$this->semValue = array();
|
2190 |
},
|
2191 |
433 => function ($stackPos) {
|
2192 |
-
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2193 |
},
|
2194 |
434 => function ($stackPos) {
|
2195 |
-
$this->semValue =
|
2196 |
},
|
2197 |
435 => function ($stackPos) {
|
2198 |
-
$this->semValue =
|
2199 |
},
|
2200 |
436 => function ($stackPos) {
|
2201 |
-
$this->semValue = new Expr\
|
2202 |
},
|
2203 |
437 => function ($stackPos) {
|
2204 |
-
$
|
2205 |
-
$this->semValue = new Expr\Array_($this->semStack[$stackPos-(3-2)], $attrs);
|
2206 |
},
|
2207 |
438 => function ($stackPos) {
|
2208 |
-
$
|
2209 |
-
$this->semValue = new Expr\Array_($this->semStack[$stackPos-(4-3)], $attrs);
|
2210 |
},
|
2211 |
439 => function ($stackPos) {
|
2212 |
-
$this->semValue = $this->
|
2213 |
},
|
2214 |
440 => function ($stackPos) {
|
2215 |
-
$
|
2216 |
-
$this->semValue = new Scalar\String_(Scalar\String_::parse($this->semStack[$stackPos-(1-1)]), $attrs);
|
2217 |
},
|
2218 |
441 => function ($stackPos) {
|
2219 |
-
$this->semValue =
|
2220 |
},
|
2221 |
442 => function ($stackPos) {
|
2222 |
-
$this->semValue = new Scalar\
|
2223 |
},
|
2224 |
443 => function ($stackPos) {
|
2225 |
-
$this->semValue = new Scalar\MagicConst\
|
2226 |
},
|
2227 |
444 => function ($stackPos) {
|
2228 |
-
$this->semValue = new Scalar\MagicConst\
|
2229 |
},
|
2230 |
445 => function ($stackPos) {
|
2231 |
-
$this->semValue = new
|
2232 |
},
|
2233 |
446 => function ($stackPos) {
|
2234 |
-
$this->semValue = new
|
2235 |
},
|
2236 |
447 => function ($stackPos) {
|
2237 |
-
$
|
|
|
2238 |
},
|
2239 |
448 => function ($stackPos) {
|
2240 |
-
$
|
|
|
2241 |
},
|
2242 |
449 => function ($stackPos) {
|
2243 |
-
$this->semValue =
|
2244 |
},
|
2245 |
450 => function ($stackPos) {
|
2246 |
-
$this->
|
|
|
2247 |
},
|
2248 |
451 => function ($stackPos) {
|
2249 |
-
$
|
|
|
2250 |
},
|
2251 |
452 => function ($stackPos) {
|
2252 |
-
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2253 |
},
|
2254 |
453 => function ($stackPos) {
|
2255 |
-
$this->semValue =
|
2256 |
},
|
2257 |
454 => function ($stackPos) {
|
2258 |
-
$this->semValue = $this->
|
2259 |
},
|
2260 |
455 => function ($stackPos) {
|
2261 |
-
$
|
2262 |
-
foreach ($this->semStack[$stackPos-(3-2)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '"', true); } }; $this->semValue = new Scalar\Encapsed($this->semStack[$stackPos-(3-2)], $attrs);
|
2263 |
},
|
2264 |
456 => function ($stackPos) {
|
2265 |
-
$this->semValue = $this->
|
2266 |
},
|
2267 |
457 => function ($stackPos) {
|
2268 |
-
$this->semValue =
|
2269 |
},
|
2270 |
458 => function ($stackPos) {
|
2271 |
-
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2272 |
},
|
2273 |
459 => function ($stackPos) {
|
2274 |
-
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2275 |
},
|
2276 |
460 => function ($stackPos) {
|
2277 |
-
$this->semValue =
|
2278 |
},
|
2279 |
461 => function ($stackPos) {
|
2280 |
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
@@ -2289,145 +2278,145 @@ class Php7 extends \PhpParser\ParserAbstract
|
|
2289 |
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2290 |
},
|
2291 |
465 => function ($stackPos) {
|
2292 |
-
$this->semValue =
|
2293 |
},
|
2294 |
466 => function ($stackPos) {
|
2295 |
-
$this->semValue =
|
2296 |
},
|
2297 |
467 => function ($stackPos) {
|
2298 |
-
$this->semValue =
|
2299 |
},
|
2300 |
468 => function ($stackPos) {
|
2301 |
-
$this->semValue =
|
2302 |
},
|
2303 |
469 => function ($stackPos) {
|
2304 |
-
$this->semValue = $this->semStack[$stackPos-(
|
2305 |
},
|
2306 |
470 => function ($stackPos) {
|
2307 |
-
$this->semValue =
|
2308 |
},
|
2309 |
471 => function ($stackPos) {
|
2310 |
-
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2311 |
},
|
2312 |
472 => function ($stackPos) {
|
2313 |
-
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2314 |
},
|
2315 |
473 => function ($stackPos) {
|
2316 |
-
$this->semValue = new Expr\
|
2317 |
},
|
2318 |
474 => function ($stackPos) {
|
2319 |
-
$this->semValue =
|
2320 |
},
|
2321 |
475 => function ($stackPos) {
|
2322 |
-
$this->semValue = $this->semStack[$stackPos-(4-3)];
|
2323 |
},
|
2324 |
476 => function ($stackPos) {
|
2325 |
-
$this->semValue =
|
2326 |
},
|
2327 |
477 => function ($stackPos) {
|
2328 |
-
$this->semValue =
|
2329 |
},
|
2330 |
478 => function ($stackPos) {
|
2331 |
-
$
|
2332 |
},
|
2333 |
479 => function ($stackPos) {
|
2334 |
-
$this->semValue =
|
2335 |
},
|
2336 |
480 => function ($stackPos) {
|
2337 |
-
$this->semValue = new Expr\
|
2338 |
},
|
2339 |
481 => function ($stackPos) {
|
2340 |
-
$this->semValue =
|
2341 |
},
|
2342 |
482 => function ($stackPos) {
|
2343 |
-
$this->semValue =
|
2344 |
},
|
2345 |
483 => function ($stackPos) {
|
2346 |
-
$this->semValue = new Expr\
|
2347 |
},
|
2348 |
484 => function ($stackPos) {
|
2349 |
-
$this->semValue = new Expr\
|
2350 |
},
|
2351 |
485 => function ($stackPos) {
|
2352 |
-
$
|
2353 |
},
|
2354 |
486 => function ($stackPos) {
|
2355 |
-
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2356 |
},
|
2357 |
487 => function ($stackPos) {
|
2358 |
-
$this->semValue = $this->semStack[$stackPos-(
|
2359 |
},
|
2360 |
488 => function ($stackPos) {
|
2361 |
-
$this->semValue = new Expr\
|
2362 |
},
|
2363 |
489 => function ($stackPos) {
|
2364 |
-
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2365 |
},
|
2366 |
490 => function ($stackPos) {
|
2367 |
-
$this->semValue = $this->semStack[$stackPos-(3-
|
2368 |
},
|
2369 |
491 => function ($stackPos) {
|
2370 |
-
$this->semValue = new Expr\
|
2371 |
},
|
2372 |
492 => function ($stackPos) {
|
2373 |
-
$this->semValue = new Expr\
|
2374 |
},
|
2375 |
493 => function ($stackPos) {
|
2376 |
-
$this->semValue =
|
2377 |
},
|
2378 |
494 => function ($stackPos) {
|
2379 |
-
$this->
|
2380 |
},
|
2381 |
495 => function ($stackPos) {
|
2382 |
-
$this->semValue =
|
2383 |
},
|
2384 |
496 => function ($stackPos) {
|
2385 |
-
$this->semValue =
|
2386 |
},
|
2387 |
497 => function ($stackPos) {
|
2388 |
-
$this->semValue =
|
2389 |
},
|
2390 |
498 => function ($stackPos) {
|
2391 |
-
$this->semValue = new Expr\
|
2392 |
},
|
2393 |
499 => function ($stackPos) {
|
2394 |
-
$this->semValue = new Expr\
|
2395 |
},
|
2396 |
500 => function ($stackPos) {
|
2397 |
-
$this->semValue = new Expr\
|
2398 |
},
|
2399 |
501 => function ($stackPos) {
|
2400 |
-
$this->semValue =
|
2401 |
},
|
2402 |
502 => function ($stackPos) {
|
2403 |
-
|
2404 |
},
|
2405 |
503 => function ($stackPos) {
|
2406 |
-
|
2407 |
},
|
2408 |
504 => function ($stackPos) {
|
2409 |
-
|
2410 |
},
|
2411 |
505 => function ($stackPos) {
|
2412 |
-
|
2413 |
},
|
2414 |
506 => function ($stackPos) {
|
2415 |
-
$this->
|
2416 |
},
|
2417 |
507 => function ($stackPos) {
|
2418 |
-
$this->semValue =
|
2419 |
},
|
2420 |
508 => function ($stackPos) {
|
2421 |
-
$this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(
|
2422 |
},
|
2423 |
509 => function ($stackPos) {
|
2424 |
-
$this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(
|
2425 |
},
|
2426 |
510 => function ($stackPos) {
|
2427 |
$this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-1)], true, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
|
2428 |
},
|
2429 |
511 => function ($stackPos) {
|
2430 |
-
$this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(
|
2431 |
},
|
2432 |
512 => function ($stackPos) {
|
2433 |
$this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
18 |
class Php7 extends \PhpParser\ParserAbstract
|
19 |
{
|
20 |
protected $tokenToSymbolMapSize = 394;
|
21 |
+
protected $actionTableSize = 939;
|
22 |
+
protected $gotoTableSize = 505;
|
23 |
|
24 |
protected $invalidSymbol = 159;
|
25 |
protected $errorSymbol = 1;
|
26 |
protected $defaultAction = -32766;
|
27 |
protected $unexpectedTokenRule = 32767;
|
28 |
|
29 |
+
protected $YY2TBLSTATE = 347;
|
30 |
+
protected $numNonLeafStates = 601;
|
31 |
|
32 |
protected $symbolToName = array(
|
33 |
"EOF",
|
235 |
);
|
236 |
|
237 |
protected $action = array(
|
238 |
+
606, 607, 608, 609, 610, 1085, 611, 612, 613, 649,
|
239 |
+
650,-32766,-32766,-32766,-32767,-32767,-32767,-32767, 94, 95,
|
240 |
+
96, 97, 98, 684,-32766,-32766,-32766, -219, -219, -219,
|
241 |
+
-32766,-32766,-32766, 368,-32766,-32766,-32766,-32766,-32766,-32766,
|
242 |
+
-32767,-32767,-32767,-32767,-32767, 428, 429, 906, 907, 908,
|
243 |
+
905, 904, 903, 614, 742, 790, 370, 371, 845, 906,
|
244 |
+
907, 908, 905, 904, 903, -263, 0, 615, 616, 617,
|
245 |
+
618, 619, 620, 621, 9, 400, 682, 96, 97, 98,
|
246 |
+
769, 28, -219, 622, 623, 624, 625, 626, 627, 628,
|
247 |
+
629, 630, 631, 632, 652, 653, 654, 655, 656, 644,
|
248 |
+
645, 646, 674, 647, 648, 633, 634, 635, 636, 637,
|
249 |
+
638, 639, 676, 677, 678, 679, 680, 681, 640, 641,
|
250 |
+
642, 643, 673, 664, 662, 663, 659, 660, 275, 651,
|
251 |
+
657, 658, 665, 666, 668, 667, 669, 670, 785, 76,
|
252 |
+
77, 78, -178, 661, 672, 671, 767, 44, 45, 419,
|
253 |
+
46, 47, 691, 257, 1047, 75, 48, 49, 1027, 50,
|
254 |
+
30, 257, 79, 80, 81, 82, 83, 84, 85, 86,
|
255 |
+
87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
|
256 |
+
97, 98, 99, 100, 101, 1100, 239,-32766,-32766,-32766,
|
257 |
+
391, 257, 119, 51, 52, 1027, 401, 821, 102, 53,
|
258 |
+
121, 54, 218, 219, 55, 56, 57, 58, 59, 60,
|
259 |
+
61, 62, -263, 24, 238, 63, 366, 420,-32766,-32766,
|
260 |
+
-32766, 1053, 1054, 421, 707, 1082, 708, 756,-32766, 1051,
|
261 |
+
36, 20, 422, 1082, 423, 130, 424, 1082, 425,-32766,
|
262 |
+
225, 426, 581, -177, 249, 38, 39, 367, 375, 369,
|
263 |
+
582, 40, 427, 213, 274, 64, 850, 851, 303, 288,
|
264 |
+
534, 21, 684, 223, 850, 851, 430, 431, 432, 355,
|
265 |
+
384, 1019, 1082, 577, 1082, 583, 433, 434, -239, 1041,
|
266 |
+
1042, 1043, 1044, 1038, 1039, 252, -92,-32766, 588, -178,
|
267 |
+
442, 1045, 1040, 372, 850, 851, 575, 287, 65,-32766,
|
268 |
+
266, 690, 271, 276, 126, 686, 304, 882, 1019,-32766,
|
269 |
+
69, 276,-32766,-32766,-32766, 276,-32766, 822,-32766, 360,
|
270 |
+
-32766, -464, 220,-32766, -299, 307, -299,-32766,-32766,-32766,
|
271 |
+
-32766,-32766,-32766,-32766,-32766, 127, -463,-32766, 686,-32766,
|
272 |
+
-32766, 334,-32766,-32766,-32766, 465, 312, 69,-32766, 359,
|
273 |
+
276,-32766, 276,-32766,-32766,-32766,-32766,-32766,-32766, 586,
|
274 |
+
-465, 858, 769,-32766, 686,-32766,-32766,-32766,-32766, 362,
|
275 |
+
769,-32766,-32766,-32766, 223,-32766, 125,-32766,-32766,-32766,
|
276 |
+
560, 859,-32766, -464, 590,-32766,-32766,-32766,-32766, 257,
|
277 |
+
-177, -467,-32766,-32766, -234, 807,-32766, -464, -463,-32766,
|
278 |
+
334, 507, 363, 1059, -464, 442, -470,-32766, 372, -298,
|
279 |
+
-32766, -298, -463, 500, 549, 550, 686, 269, 364, -463,
|
280 |
+
-32766, -469, -465,-32766,-32766,-32766, 898,-32766, 365,-32766,
|
281 |
+
1128,-32766,-32766, 1129,-32766, 68, -465,-32766,-32766,-32766,
|
282 |
+
-32766, 133, 330, -465,-32766,-32766, 42, 561,-32766, 1104,
|
283 |
+
372,-32766, 334, -467, 884, 1103,-32766,-32766, -276,-32766,
|
284 |
+
380, 381, 686, 488, 134,-32766,-32766, 222, 137,-32766,
|
285 |
+
-32766,-32766, 116,-32766, -467,-32766, 32,-32766, -462, 769,
|
286 |
+
-32766, -501, 117, -501,-32766,-32766,-32766, 125, 122,-32766,
|
287 |
+
-32766,-32766, 850, 851,-32766, 123, 43,-32766, 334, 411,
|
288 |
+
224, 8, 129,-32766, 769,-32766, 136, 212, 255, 686,
|
289 |
+
99, 100, 101,-32766, 239, 138,-32766,-32766,-32766,-32766,
|
290 |
+
-32766, 707,-32766, 708,-32766, 689, 102,-32766, 1119, 118,
|
291 |
+
139,-32766,-32766,-32766, -83,-32766,-32766,-32766,-32766, 250,
|
292 |
+
-462,-32766, 686, 589,-32766, 334,-32766, 592, 124,-32766,
|
293 |
+
-32766,-32766,-32766,-32766, -462,-32766, 766,-32766, 256,-32766,
|
294 |
+
-32766, -462, 527, 528,-32766,-32766,-32766, 850, 851, 132,
|
295 |
+
-32766,-32766, 306, 781,-32766, 883, 598,-32766, 334, 120,
|
296 |
+
258, 259,-32766, 292, 239,-32766, 102, 29, 221, 131,
|
297 |
+
-32766, 557, 686, 1130,-32766, 474, 686, 569, 684, 540,
|
298 |
+
-32766, 687, 689,-32766,-32766,-32766, 525,-32766, 912,-32766,
|
299 |
+
469,-32766, 535, 270,-32766,-32766, 1019, 552,-32766,-32766,
|
300 |
+
-32766, 791, 792, 268,-32766,-32766, -81, 10,-32766, 226,
|
301 |
+
-32766,-32766, 334, 388, 267, 783, 686, 541, 553,-32766,
|
302 |
+
-32766, 337, -428,-32766,-32766,-32766, -237,-32766, 0,-32766,
|
303 |
+
576,-32766, 0, 34,-32766, 0, 0, 0,-32766,-32766,
|
304 |
+
-32766, 24, 273, -495,-32766,-32766, 0, 0,-32766,-32766,
|
305 |
+
0,-32766, 334, 1082, 1058, 0, 1060, 1051, 342,-32766,
|
306 |
+
31, 103, 104, 105, 106, 107, 108, 109, 110, 111,
|
307 |
+
112, 113, 114, 115, -419, 5, 24, -4, 12, 305,
|
308 |
+
343, 346, -235, 0, 384, 471, 0, 1019, 1082,-32766,
|
309 |
+
356, 357, 1051,-32766,-32766,-32766, 35, 596, 597, 747,
|
310 |
+
824, 808, 941, 943, 433, 434, 815, 1041, 1042, 1043,
|
311 |
+
1044, 1038, 1039, -462,-32766, 878,-32766,-32766, 879, 1045,
|
312 |
+
1040, 805, 1019, 578, 816, 745, 67,-32766,-32766,-32766,
|
313 |
+
271, 276, 803, 887, 890, 891, 888, 889, 769, 895,
|
314 |
+
434, 580, 1041, 1042, 1043, 1044, 1038, 1039,-32766, 584,
|
315 |
+
-32766,-32766,-32766,-32766, 1045, 1040, 585, -137, -137, -137,
|
316 |
+
587, 67, 591, 285, 286, 271, 276, 349, 350, 579,
|
317 |
+
-432, 593, -137, 743, -137, -462, -137, 1125, -137, 1127,
|
318 |
+
368, 702, 351, 789, 701, 711, 788, 368, 265, -462,
|
319 |
+
712, 709, 428, 429, 1126, 787, -462, -493, 1007, 428,
|
320 |
+
429, 699, 790, 370, 371, 710, 776, 784, 742, 790,
|
321 |
+
370, 371, -218, -218, -218, 774, 813, 814, 368, 1124,
|
322 |
+
1083, 1074, 290,-32766,-32766,-32766, 1090, 769, 1095, -4,
|
323 |
+
428, 429, 1098, -234, 769, -470, -137, 14, 1052, 742,
|
324 |
+
790, 370, 371, -469,-32766, -468,-32766,-32766,-32766,-32766,
|
325 |
+
-32766,-32766, 23, 25, 26, 33, 37, 41, 66, 70,
|
326 |
+
71, 72, 73, 74, 128, 769, 135, -218, 15, 140,
|
327 |
+
217, 243, 0, 244, 245, 246, 247, 248, 289, 352,
|
328 |
+
354, 0, 16, 17, 19, 327, 402, 404, 407, 409,
|
329 |
+
410, 417, 566, 1031, 980, 1049, 860, 1011, -92, 13,
|
330 |
+
18, 22, 261, 326, 497, 521, 568, 984, 1026, 981,
|
331 |
+
1101, 0, 997, 0, 1048, 1073, 1089, 1122, 531
|
|
|
|
|
|
|
332 |
);
|
333 |
|
334 |
protected $actionCheck = array(
|
335 |
+
2, 3, 4, 5, 6, 1, 8, 9, 10, 11,
|
336 |
+
12, 8, 9, 10, 42, 43, 44, 45, 46, 47,
|
337 |
+
48, 49, 50, 78, 8, 9, 10, 97, 98, 99,
|
338 |
+
8, 9, 29, 103, 31, 32, 33, 34, 35, 36,
|
339 |
+
37, 38, 39, 40, 41, 115, 116, 114, 115, 116,
|
340 |
+
117, 118, 119, 55, 124, 125, 126, 127, 1, 114,
|
341 |
+
115, 116, 117, 118, 119, 7, 0, 69, 70, 71,
|
342 |
+
72, 73, 74, 75, 7, 30, 78, 48, 49, 50,
|
343 |
+
150, 7, 152, 85, 86, 87, 88, 89, 90, 91,
|
344 |
92, 93, 94, 95, 96, 97, 98, 99, 100, 101,
|
345 |
102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
|
346 |
112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
|
347 |
+
122, 123, 124, 125, 126, 127, 128, 129, 68, 131,
|
348 |
+
132, 133, 134, 135, 136, 137, 138, 139, 1, 8,
|
349 |
+
9, 10, 7, 145, 146, 147, 1, 2, 3, 4,
|
350 |
+
5, 6, 1, 29, 1, 151, 11, 12, 1, 14,
|
351 |
+
29, 29, 31, 32, 33, 34, 35, 36, 37, 38,
|
352 |
+
39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
|
353 |
+
49, 50, 51, 52, 53, 1, 55, 8, 9, 10,
|
354 |
+
130, 29, 13, 48, 49, 1, 151, 30, 67, 54,
|
355 |
+
7, 56, 57, 58, 59, 60, 61, 62, 63, 64,
|
356 |
+
65, 66, 154, 68, 69, 70, 71, 72, 8, 9,
|
357 |
+
10, 76, 77, 78, 103, 80, 105, 82, 1, 84,
|
358 |
+
85, 86, 87, 80, 89, 7, 91, 80, 93, 29,
|
359 |
+
7, 96, 30, 7, 7, 100, 101, 102, 103, 104,
|
360 |
+
30, 106, 107, 13, 7, 110, 132, 133, 113, 114,
|
361 |
+
73, 74, 78, 36, 132, 133, 121, 122, 123, 148,
|
362 |
+
148, 114, 80, 151, 80, 30, 131, 132, 154, 134,
|
363 |
+
135, 136, 137, 138, 139, 140, 154, 1, 151, 154,
|
364 |
+
145, 146, 147, 148, 132, 133, 151, 7, 153, 72,
|
365 |
+
155, 150, 157, 158, 151, 78, 7, 1, 114, 82,
|
366 |
+
153, 158, 85, 86, 87, 158, 89, 150, 91, 125,
|
367 |
+
93, 68, 36, 96, 103, 7, 105, 100, 101, 102,
|
368 |
+
8, 9, 10, 106, 107, 151, 68, 110, 78, 1,
|
369 |
+
113, 114, 8, 9, 10, 83, 7, 153, 121, 7,
|
370 |
+
158, 29, 158, 31, 32, 33, 34, 35, 72, 30,
|
371 |
+
68, 1, 150, 29, 78, 31, 32, 33, 82, 7,
|
372 |
+
150, 85, 86, 87, 36, 89, 149, 91, 151, 93,
|
373 |
+
78, 154, 96, 130, 30, 1, 100, 101, 102, 29,
|
374 |
+
154, 68, 106, 107, 154, 150, 110, 144, 130, 113,
|
375 |
+
114, 49, 7, 141, 151, 145, 153, 121, 148, 103,
|
376 |
+
72, 105, 144, 1, 73, 74, 78, 111, 7, 151,
|
377 |
+
82, 153, 130, 85, 86, 87, 120, 89, 7, 91,
|
378 |
+
78, 93, 1, 81, 96, 149, 144, 151, 100, 101,
|
379 |
+
102, 98, 99, 151, 106, 107, 68, 145, 110, 1,
|
380 |
+
148, 113, 114, 130, 152, 7, 72, 8, 152, 121,
|
381 |
+
103, 104, 78, 79, 13, 1, 82, 36, 13, 85,
|
382 |
+
86, 87, 15, 89, 151, 91, 13, 93, 68, 150,
|
383 |
+
96, 154, 15, 156, 100, 101, 102, 149, 15, 151,
|
384 |
+
106, 107, 132, 133, 110, 15, 68, 113, 114, 103,
|
385 |
+
36, 105, 15, 72, 150, 121, 15, 95, 130, 78,
|
386 |
+
51, 52, 53, 82, 55, 15, 85, 86, 87, 1,
|
387 |
+
89, 103, 91, 105, 93, 80, 67, 96, 83, 151,
|
388 |
+
15, 100, 101, 102, 30, 151, 72, 106, 107, 30,
|
389 |
+
130, 110, 78, 30, 113, 114, 82, 30, 30, 85,
|
390 |
+
86, 87, 121, 89, 144, 91, 30, 93, 130, 1,
|
391 |
+
96, 151, 108, 109, 100, 101, 102, 132, 133, 30,
|
392 |
+
106, 107, 144, 36, 110, 150, 151, 113, 114, 151,
|
393 |
+
34, 34, 151, 34, 55, 121, 67, 142, 143, 68,
|
394 |
+
72, 75, 78, 81, 83, 87, 78, 90, 78, 94,
|
395 |
+
82, 78, 80, 85, 86, 87, 111, 89, 80, 91,
|
396 |
+
83, 93, 88, 112, 96, 151, 114, 92, 100, 101,
|
397 |
+
102, 125, 125, 129, 106, 107, 95, 95, 110, 36,
|
398 |
+
72, 113, 114, 95, 128, 149, 78, 97, 97, 121,
|
399 |
+
82, 148, 144, 85, 86, 87, 154, 89, -1, 91,
|
400 |
+
151, 93, -1, 150, 96, -1, -1, -1, 100, 101,
|
401 |
+
102, 68, 128, 153, 106, 107, -1, -1, 110, 151,
|
402 |
+
-1, 113, 114, 80, 141, -1, 141, 84, 148, 121,
|
403 |
+
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
|
404 |
+
25, 26, 27, 28, 144, 144, 68, 0, 144, 144,
|
405 |
+
148, 148, 154, -1, 148, 148, -1, 114, 80, 151,
|
406 |
+
148, 148, 84, 8, 9, 10, 150, 150, 150, 150,
|
407 |
+
150, 150, 57, 58, 131, 132, 150, 134, 135, 136,
|
408 |
+
137, 138, 139, 68, 29, 150, 31, 32, 150, 146,
|
409 |
+
147, 150, 114, 151, 150, 150, 153, 8, 9, 10,
|
410 |
+
157, 158, 150, 150, 150, 150, 150, 150, 150, 150,
|
411 |
+
132, 151, 134, 135, 136, 137, 138, 139, 29, 151,
|
412 |
+
31, 32, 33, 34, 146, 147, 151, 73, 74, 75,
|
413 |
+
151, 153, 151, 151, 151, 157, 158, 151, 151, 151,
|
414 |
+
155, 152, 88, 152, 90, 130, 92, 152, 94, 152,
|
415 |
+
103, 152, 105, 152, 152, 152, 152, 103, 111, 144,
|
416 |
+
152, 152, 115, 116, 152, 152, 151, 153, 152, 115,
|
417 |
+
116, 124, 125, 126, 127, 152, 152, 152, 124, 125,
|
418 |
+
126, 127, 97, 98, 99, 152, 152, 152, 103, 152,
|
419 |
+
152, 152, 145, 8, 9, 10, 152, 150, 152, 152,
|
420 |
+
115, 116, 152, 154, 150, 153, 152, 154, 157, 124,
|
421 |
+
125, 126, 127, 153, 29, 153, 31, 32, 33, 34,
|
422 |
+
35, 36, 153, 153, 153, 153, 153, 153, 153, 153,
|
423 |
+
153, 153, 153, 153, 153, 150, 153, 152, 154, 153,
|
424 |
+
153, 153, -1, 153, 153, 153, 153, 153, 153, 153,
|
425 |
+
153, -1, 154, 154, 154, 154, 154, 154, 154, 154,
|
426 |
+
154, 154, 154, 154, 154, 154, 154, 154, 154, 154,
|
427 |
+
154, 154, 154, 154, 154, 154, 154, 154, 154, 154,
|
428 |
+
154, -1, 155, -1, 156, 156, 156, 156, 156
|
|
|
|
|
|
|
429 |
);
|
430 |
|
431 |
protected $actionBase = array(
|
432 |
+
0, 704, 697, -70, 735, 153, 302, 607, -2, -2,
|
433 |
+
-55, -2, -2, 220, 329, 329, 354, 329, 212, 245,
|
434 |
+
608, 608, 608, 227, 286, 286, 286, 286, 338, 384,
|
435 |
+
518, 431, 464, 558, 558, 558, 558, 558, 558, 558,
|
436 |
+
558, 558, 558, 558, 558, 558, 558, 558, 558, 558,
|
437 |
+
558, 558, 558, 558, 558, 558, 558, 558, 558, 558,
|
438 |
+
558, 558, 558, 558, 558, 558, 558, 558, 558, 558,
|
439 |
+
558, 558, 558, 558, 558, 558, 558, 558, 558, 558,
|
440 |
+
558, 558, 558, 558, 558, 558, 558, 558, 558, 558,
|
441 |
+
558, 558, 558, 558, 558, 558, 558, 558, 558, 558,
|
442 |
+
558, 558, 558, 558, 558, 558, 558, 558, 558, 558,
|
443 |
+
558, 558, 558, 558, 558, 558, 558, 558, 558, 558,
|
444 |
+
558, 558, 558, 558, 558, 558, 558, 558, 558, 558,
|
445 |
+
558, 558, 558, 558, 558, 558, 558, 558, 558, 558,
|
446 |
+
558, 151, 151, 167, 412, 463, 768, 773, 770, 774,
|
447 |
+
766, 765, 769, 775, 687, 688, 539, 689, 694, 696,
|
448 |
+
700, 771, 782, 767, 772, 131, 131, 131, 131, 131,
|
449 |
+
131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
|
450 |
+
131, 131, 449, 179, 22, 16, 16, 16, 16, 16,
|
451 |
+
16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
|
452 |
+
16, 16, 16, 16, 16, 16, 16, 210, 210, 210,
|
453 |
+
705, 334, 593, 593, 739, 665, 322, 628, 628, 628,
|
454 |
+
628, 628, 628, 628, 628, 628, 628, 835, 3, 3,
|
455 |
+
3, 3, 3, -28, -28, -28, -28, 306, 194, 157,
|
456 |
+
221, 29, 29, 124, 124, 124, 124, 124, 124, 132,
|
457 |
+
360, 162, 262, 535, 701, 184, 184, 435, 435, 435,
|
458 |
+
253, 268, 459, 459, 459, 121, 527, 502, 502, 502,
|
459 |
+
502, 445, 445, 502, 502, 352, 4, 327, 292, 410,
|
460 |
+
410, 428, 410, 410, 410, 418, 418, 418, 357, 260,
|
461 |
+
122, 511, 260, 609, 638, 776, 540, 684, 541, 685,
|
462 |
+
323, 378, 562, 192, 563, 192, 192, 192, 454, 187,
|
463 |
+
341, 549, 764, 151, 550, 151, 151, 151, 151, 738,
|
464 |
+
151, 151, 151, 151, 151, 151, 45, 151, 57, 425,
|
465 |
+
167, 137, 137, 137, 357, 529, 60, 632, 236, 529,
|
466 |
+
529, 529, 633, 636, 58, 240, 637, 135, 396, 514,
|
467 |
+
514, 520, 520, 528, 537, 514, 514, 514, 514, 514,
|
468 |
+
719, 719, 520, 522, 520, 528, 724, 520, 537, 537,
|
469 |
+
520, 520, 514, 520, 719, 537, 193, 362, 299, 318,
|
470 |
+
537, 537, 395, 506, 514, 534, 534, 411, 520, 233,
|
471 |
+
228, 520, 74, 494, 719, 719, 494, 237, 537, 247,
|
472 |
+
567, 568, 495, 486, 509, 290, 509, 509, 342, 495,
|
473 |
+
509, 537, 509, 421, 67, 522, 339, 509, 66, 725,
|
474 |
+
726, 504, 727, 722, 728, 746, 729, 499, 496, 497,
|
475 |
+
737, 723, 730, 721, 720, 526, 557, 457, 467, 551,
|
476 |
+
498, 712, 556, 519, 519, 519, 702, 519, 519, 519,
|
477 |
+
519, 519, 519, 519, 519, 457, 778, 555, 508, 740,
|
478 |
+
473, 493, 538, 480, 592, 533, 557, 557, 641, 635,
|
479 |
+
777, 523, 738, 759, 731, 503, 487, 750, 741, 639,
|
480 |
+
530, 552, 742, 743, 751, 760, 610, 761, 645, 521,
|
481 |
+
647, 557, 649, 519, 664, 510, 779, 710, 457, 780,
|
482 |
+
703, 752, 546, 547, 753, 553, 651, 512, 781, 652,
|
483 |
+
762, 618, 625, 566, 734, 492, 754, 653, 755, 756,
|
484 |
+
654, 569, 524, 548, 505, 747, 451, 745, 629, 658,
|
485 |
+
659, 662, 663, 666, 733, 570, 748, 525, 749, 699,
|
486 |
+
571, 576, 491, 673, 455, 585, 500, 515, 588, 736,
|
487 |
+
513, 516, 591, 594, 763, 674, 744, 595, 675, 758,
|
488 |
+
531, 556, 554, 501, 532, 507, 631, 757, 517, 602,
|
489 |
+
603, 604, 605, 683, 606, 0, 0, 0, 0, 0,
|
490 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
491 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
492 |
+
0, 0, 145, 145, 145, 145, -2, -2, -2, 0,
|
493 |
+
0, -2, 0, 0, 145, 145, 145, 145, 145, 145,
|
494 |
+
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
|
495 |
+
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
|
496 |
+
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
|
497 |
+
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
|
498 |
+
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
|
499 |
+
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
|
500 |
+
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
|
501 |
+
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
|
502 |
+
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
|
503 |
+
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
|
504 |
+
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
|
505 |
+
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
|
506 |
+
145, 145, 131, 131, 131, 131, 131, 131, 131, 131,
|
507 |
+
131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
|
508 |
+
131, 131, 131, 131, 131, 131, 0, 0, 0, 0,
|
509 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
510 |
+
0, 0, 0, 131, 131, 131, 131, 131, 131, 131,
|
511 |
+
131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
|
512 |
+
131, 131, 131, 131, 131, 131, 131, 131, 131, 131,
|
513 |
+
131, 131, 131, 260, 260, 131, 0, 131, 260, 260,
|
514 |
+
260, 260, 260, 260, 260, 260, 260, 260, 131, 131,
|
515 |
+
131, 131, 131, 131, 459, 459, 459, 459, -67, 260,
|
516 |
+
260, -67, 459, 459, 260, 260, 260, 260, 260, 260,
|
517 |
+
260, 260, 260, 445, 445, 445, 192, 192, 260, 260,
|
518 |
+
260, 0, 0, 0, 0, 0, 514, 445, 260, 260,
|
519 |
+
260, 260, 0, 0, 260, 260, 522, 192, 448, 0,
|
520 |
+
0, 0, 0, 0, 0, 0, 514, 514, 514, 522,
|
521 |
+
0, 514, 445, 0, 137, 151, 448, 343, 343, 343,
|
522 |
+
343, 0, 0, 514, 0, 514, 0, 0, 0, 0,
|
523 |
+
0, 0, 522, 537, 0, 719, 0, 0, 0, 0,
|
524 |
+
520, 0, 0, 0, 0, 0, 0, 0, 0, 522,
|
525 |
+
0, 0, 0, 0, 0, 0, 519, 0, 523, 0,
|
526 |
+
519, 519, 519, 523, 523, 0, 0, 523
|
|
|
527 |
);
|
528 |
|
529 |
protected $actionDefault = array(
|
530 |
3,32767,32767,32767,32767,32767,32767,32767,32767, 92,
|
531 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
532 |
+
32767,32767,32767,32767, 513, 513, 513, 513, 94,32767,
|
533 |
+
32767,32767,32767, 318, 318, 318,32767,32767, 460, 460,
|
534 |
+
460, 460, 460, 460,32767,32767,32767,32767,32767, 398,
|
|
|
535 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
536 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
537 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
538 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
539 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
540 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
|
|
541 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
542 |
+
32767, 92,32767,32767,32767,32767,32767,32767,32767,32767,
|
543 |
+
94,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
544 |
+
32767,32767,32767,32767,32767, 506,32767,32767,32767,32767,
|
545 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
546 |
+
32767,32767,32767,32767,32767, 381, 382, 384, 385, 317,
|
547 |
+
461, 512, 262, 509, 316, 130, 273, 264, 211, 243,
|
548 |
+
313, 134, 346, 399, 348, 397, 401, 347, 323, 327,
|
549 |
328, 329, 330, 331, 332, 333, 334, 335, 336, 337,
|
550 |
+
338, 339, 321, 322, 400, 402, 403, 378, 377, 376,
|
551 |
+
344, 345,32767,32767, 349, 320, 351,32767,32767,32767,
|
552 |
+
32767,32767,32767,32767,32767, 94,32767, 350, 367, 368,
|
553 |
+
365, 366, 369, 370, 371, 372, 373,32767,32767,32767,
|
554 |
+
296, 358, 359, 253, 253, 253, 253, 253, 253, 253,
|
555 |
+
32767, 253,32767,32767,32767,32767,32767,32767,32767,32767,
|
556 |
+
454, 375, 353, 354, 352,32767, 431,32767,32767,32767,
|
557 |
+
32767,32767, 433,32767, 92,32767,32767,32767, 456, 341,
|
558 |
+
343, 424, 507, 324, 510,32767,32767, 94, 418,32767,
|
|
|
|
|
|
|
559 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
560 |
+
455,32767,32767,32767, 92,32767,32767, 92, 174, 230,
|
561 |
+
232, 476, 179,32767, 436,32767,32767,32767,32767,32767,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
562 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
563 |
+
32767,32767,32767,32767, 418, 363, 520,32767, 462, 355,
|
564 |
+
356, 357,32767,32767, 462, 462,32767, 462,32767,32767,
|
565 |
+
32767,32767,32767,32767, 179,32767,32767,32767,32767, 94,
|
566 |
+
434, 434, 92, 92, 92, 92, 429,32767, 179, 179,
|
567 |
+
32767,32767,32767,32767,32767, 179, 91, 91, 91, 91,
|
568 |
+
179, 179, 91, 194,32767, 192, 192, 91,32767, 93,
|
569 |
+
93,32767, 93, 196,32767, 480, 196, 91, 179, 91,
|
570 |
+
216, 216, 409, 181, 255, 93, 255, 255, 93, 409,
|
571 |
+
255, 179, 255, 91, 91,32767, 91, 255,32767,32767,
|
572 |
+
32767, 85,32767,32767,32767,32767,32767,32767,32767,32767,
|
573 |
+
32767,32767,32767,32767,32767,32767, 420,32767, 449,32767,
|
574 |
+
466, 478,32767, 361, 362, 364, 464, 386, 387, 388,
|
575 |
+
389, 390, 391, 392, 394, 508,32767, 423,32767,32767,
|
576 |
+
32767, 87, 121, 272,32767, 518, 87, 421,32767, 518,
|
577 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
578 |
+
87, 87,32767,32767,32767,32767,32767,32767, 519,32767,
|
579 |
+
462, 422,32767, 360, 445, 485,32767, 463, 511,32767,
|
580 |
+
32767,32767, 245, 247,32767, 87,32767,32767,32767,32767,
|
581 |
+
32767,32767,32767,32767,32767, 449,32767,32767,32767,32767,
|
582 |
+
32767,32767,32767, 462,32767,32767,32767,32767,32767,32767,
|
583 |
+
32767,32767,32767,32767,32767,32767,32767,32767,32767, 462,
|
584 |
+
32767,32767, 242,32767,32767,32767, 312,32767,32767,32767,
|
585 |
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
|
586 |
+
85, 60,32767, 292,32767,32767,32767,32767,32767,32767,
|
587 |
+
32767,32767,32767,32767,32767, 136, 136, 3, 275, 3,
|
588 |
+
275, 136, 136, 136, 275, 275, 136, 136, 136, 136,
|
589 |
+
136, 136, 136, 169, 224, 227, 216, 216, 284, 136,
|
590 |
+
136
|
591 |
);
|
592 |
|
593 |
protected $goto = array(
|
594 |
+
172, 145, 145, 145, 145, 172, 154, 156, 188, 173,
|
595 |
+
169, 169, 169, 169, 169, 170, 170, 170, 170, 170,
|
596 |
+
170, 165, 166, 167, 168, 185, 183, 186, 443, 444,
|
597 |
+
335, 445, 447, 448, 449, 450, 451, 452, 453, 454,
|
598 |
+
927, 142, 146, 147, 148, 171, 149, 150, 151, 144,
|
599 |
+
152, 153, 155, 182, 184, 187, 207, 210, 211, 214,
|
600 |
+
216, 227, 228, 229, 230, 231, 232, 233, 234, 235,
|
601 |
+
236, 241, 242, 262, 263, 264, 339, 340, 341, 493,
|
602 |
+
189, 190, 191, 192, 193, 194, 195, 196, 197, 198,
|
603 |
+
199, 200, 201, 202, 203, 157, 204, 158, 174, 175,
|
604 |
+
176, 208, 177, 159, 160, 161, 178, 174, 162, 209,
|
605 |
+
143, 205, 163, 179, 206, 180, 181, 164, 562, 461,
|
606 |
+
571, 764, 345, 539, 1116, 1116, 697, 338, 279, 280,
|
607 |
+
282, 490, 283, 344, 284, 347, 523, 513, 536, 466,
|
608 |
+
466, 466, 495, 1116, 466, 455, 455, 455, 455, 847,
|
609 |
+
852, 853, 297, 498, 515, 515, 481, 698, 466, 1050,
|
610 |
+
1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1068,
|
611 |
+
1068, 798, 329, 570, 1068, 1068, 1068, 1068, 1068, 1068,
|
612 |
+
1068, 1068, 1068, 1068, 1066, 1066, 1005, 786, 1006, 1066,
|
613 |
+
1066, 1066, 1066, 1066, 1066, 1066, 1066, 1066, 1066, 494,
|
614 |
+
894, 574, 272, 466, 466, 556, 892, 254, 733, 480,
|
615 |
+
505, 466, 466, 466, 331, 332, 685, 759, 544, 760,
|
616 |
+
333, 487, 446, 446, 724, 293, 467, 446, 446, 446,
|
617 |
+
446, 446, 446, 446, 446, 446, 446, 479, 491, 492,
|
618 |
+
806, 509, 595, 522, 524, 1092, 1093, 537, 555, 558,
|
619 |
+
834, 565, 573, 830, 728, 716, 866, 901, 295, 870,
|
620 |
+
902, 724, 1105, 724, 809, 862, 696, 317, 321, 473,
|
621 |
+
496, 499, 1016, 700, 839, 315, 799, 823, 804, 804,
|
622 |
+
802, 804, 594, 390, 458, 832, 827, 538, 1115, 1115,
|
623 |
+
909, 732, 705, 1012, 755, 750, 751, 765, 975, 706,
|
624 |
+
752, 703, 753, 754, 704, 842, 758, 1115, 715, 715,
|
625 |
+
457, 457, 3, 4, 725, 725, 725, 727, 714, 504,
|
626 |
+
516, 518, 519, 567, 319, 459, 1118, 857, 302, 353,
|
627 |
+
529, 472, 1017, 837, 837, 1091, 482, 483, 720, 800,
|
628 |
+
800, 800, 800, 294, 325, 794, 801, 298, 299, 717,
|
629 |
+
1020, 1020, 1018, 1076, 403, 849, 849, 849, 849, 849,
|
630 |
+
849, 849, 849, 849, 1131, 1097, 1097, 11, 867, 849,
|
631 |
+
849, 849, 916, 599, 510, 1088, 1088, 463, 543, 1020,
|
632 |
+
1020, 1020, 1020, 1013, 520, 1020, 1020, 719, 532, 533,
|
633 |
+
713, 1008, 1099, 1099, 729, 811, 871, 396, 512, 911,
|
634 |
+
1078, 772, 412, 0, 773, 0, 0, 0, 0, 0,
|
635 |
+
0, 0, 0, 1084, 0, 0, 0, 542, 0, 0,
|
636 |
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 478,
|
|
|
|
|
|
|
|
|
637 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
638 |
+
869, 0, 1086, 1086, 869, 0, 0, 0, 0, 0,
|
639 |
+
0, 0, 463, 0, 0, 0, 0, 0, 0, 0,
|
640 |
+
0, 460, 476, 0, 0, 0, 0, 0, 0, 0,
|
641 |
+
0, 0, 460, 0, 476, 0, 0, 318, 0, 0,
|
642 |
+
464, 383, 0, 385, 0, 0, 0, 0, 0, 0,
|
643 |
+
0, 0, 0, 0, 0, 0, 0, 0, 723, 0,
|
644 |
+
0, 1123, 0, 0, 1015
|
645 |
);
|
646 |
|
647 |
protected $gotoCheck = array(
|
656 |
33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
|
657 |
33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
|
658 |
33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
|
659 |
+
33, 33, 33, 33, 33, 33, 33, 33, 63, 10,
|
660 |
+
8, 13, 56, 56, 151, 151, 17, 56, 56, 56,
|
661 |
+
56, 56, 56, 56, 56, 56, 56, 46, 46, 10,
|
662 |
+
10, 10, 99, 151, 10, 86, 86, 86, 86, 92,
|
663 |
+
92, 92, 81, 86, 87, 87, 10, 18, 10, 87,
|
664 |
+
87, 87, 87, 87, 87, 87, 87, 87, 87, 138,
|
665 |
+
138, 77, 77, 77, 138, 138, 138, 138, 138, 138,
|
666 |
+
138, 138, 138, 138, 139, 139, 68, 68, 68, 139,
|
667 |
+
139, 139, 139, 139, 139, 139, 139, 139, 139, 7,
|
668 |
+
7, 7, 137, 10, 10, 7, 7, 137, 36, 10,
|
669 |
+
10, 10, 10, 10, 70, 70, 5, 55, 70, 55,
|
670 |
+
70, 140, 141, 141, 26, 70, 10, 141, 141, 141,
|
671 |
+
141, 141, 141, 141, 141, 141, 141, 39, 10, 2,
|
672 |
+
40, 2, 39, 39, 39, 146, 146, 39, 39, 39,
|
673 |
+
39, 39, 39, 39, 14, 14, 14, 113, 147, 14,
|
674 |
+
113, 26, 149, 26, 14, 96, 16, 49, 49, 49,
|
675 |
+
49, 49, 94, 13, 14, 52, 14, 16, 16, 16,
|
676 |
+
16, 16, 16, 118, 16, 16, 16, 54, 150, 150,
|
677 |
+
14, 14, 13, 14, 13, 13, 13, 13, 121, 13,
|
678 |
+
13, 13, 13, 13, 13, 89, 13, 150, 26, 26,
|
679 |
+
76, 76, 37, 37, 26, 26, 26, 26, 26, 69,
|
680 |
+
69, 69, 69, 69, 66, 66, 150, 91, 20, 90,
|
681 |
+
24, 66, 94, 86, 86, 144, 66, 66, 30, 76,
|
682 |
+
76, 76, 76, 11, 19, 76, 76, 81, 81, 28,
|
683 |
+
63, 63, 94, 94, 66, 63, 63, 63, 63, 63,
|
684 |
+
63, 63, 63, 63, 12, 8, 8, 66, 98, 63,
|
685 |
+
63, 63, 15, 83, 15, 99, 99, 12, 23, 63,
|
686 |
+
63, 63, 63, 130, 74, 63, 63, 15, 74, 74,
|
687 |
+
15, 127, 99, 99, 32, 80, 101, 72, 73, 116,
|
688 |
+
12, 63, 125, -1, 63, -1, -1, -1, -1, -1,
|
689 |
+
-1, -1, -1, 99, -1, -1, -1, 12, -1, -1,
|
690 |
+
-1, -1, -1, -1, -1, -1, -1, -1, -1, 8,
|
|
|
|
|
|
|
|
|
691 |
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
692 |
+
99, -1, 99, 99, 99, -1, -1, -1, -1, -1,
|
693 |
+
-1, -1, 12, -1, -1, -1, -1, -1, -1, -1,
|
694 |
+
-1, 8, 8, -1, -1, -1, -1, -1, -1, -1,
|
695 |
+
-1, -1, 8, -1, 8, -1, -1, 8, -1, -1,
|
696 |
+
8, 8, -1, 8, -1, -1, -1, -1, -1, -1,
|
697 |
-1, -1, -1, -1, -1, -1, -1, -1, 8, -1,
|
698 |
+
-1, 8, -1, -1, 12
|
|
|
|
|
699 |
);
|
700 |
|
701 |
protected $gotoBase = array(
|
702 |
+
0, 0, -338, 0, 0, 206, 0, 194, 110, 0,
|
703 |
+
-146, 53, 89, -21, -123, -18, 264, 124, 155, 42,
|
704 |
+
63, 0, 0, 28, 44, 0, -41, 0, 45, 0,
|
705 |
+
51, 0, 32, -23, 0, 0, 199, -287, 0, -339,
|
706 |
+
221, 0, 0, 0, 0, 0, 103, 0, 0, 228,
|
707 |
+
0, 0, 239, 0, 74, 202, -90, 0, 0, 0,
|
708 |
+
0, 0, 0, 112, 0, 0, -44, 0, -145, 75,
|
709 |
+
-192, 0, 11, 2, -196, 0, 72, -97, 0, 0,
|
710 |
+
31, -249, 0, 43, 0, 0, 121, -58, 0, 56,
|
711 |
+
78, 77, -108, 0, -42, 0, 237, 0, 61, 137,
|
712 |
+
0, 33, 0, 0, 0, 0, 0, 0, 0, 0,
|
713 |
+
0, 0, 0, 20, 0, 0, 34, 0, 246, 0,
|
714 |
+
0, 59, 0, 0, 0, -7, 0, 30, 0, 0,
|
715 |
+
29, 0, 0, 0, 0, 0, 0, -64, -43, -28,
|
716 |
+
196, 10, 0, 0, 79, 0, -60, 232, 0, 235,
|
717 |
+
35, -129, 0, 0
|
718 |
);
|
719 |
|
720 |
protected $gotoDefault = array(
|
721 |
+
-32768, 418, 602, 2, 603, 675, 683, 547, 435, 572,
|
722 |
+
436, 462, 336, 757, 915, 777, 739, 740, 741, 322,
|
723 |
+
358, 313, 320, 530, 517, 408, 726, 378, 718, 405,
|
724 |
+
721, 377, 730, 141, 548, 414, 734, 1, 736, 468,
|
725 |
+
768, 309, 744, 310, 551, 746, 475, 748, 749, 316,
|
726 |
+
323, 324, 920, 484, 514, 761, 215, 477, 762, 308,
|
727 |
+
763, 771, 311, 314, 559, 389, 415, 328, 896, 501,
|
728 |
+
526, 373, 393, 511, 506, 486, 1028, 796, 399, 387,
|
729 |
+
810, 296, 818, 600, 826, 829, 437, 438, 397, 841,
|
730 |
+
398, 855, 502, 503, 1036, 392, 861, 379, 868, 1072,
|
731 |
+
382, 872, 237, 875, 251, 545, 348, 880, 881, 6,
|
732 |
+
886, 563, 564, 7, 240, 413, 910, 546, 376, 485,
|
733 |
+
926, 361, 994, 996, 470, 406, 1009, 386, 554, 416,
|
734 |
+
1014, 1075, 374, 439, 394, 281, 440, 253, 300, 278,
|
735 |
+
456, 260, 301, 441, 395, 1080, 1087, 277, 27, 1106,
|
736 |
+
1117, 291, 489, 508
|
737 |
);
|
738 |
|
739 |
protected $ruleToNonTerminal = array(
|
754 |
38, 38, 40, 40, 40, 40, 40, 40, 40, 40,
|
755 |
40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
|
756 |
40, 40, 40, 40, 40, 40, 40, 16, 16, 59,
|
757 |
+
59, 62, 62, 61, 60, 60, 53, 65, 65, 66,
|
758 |
+
66, 67, 67, 68, 68, 17, 18, 18, 18, 71,
|
759 |
+
71, 71, 72, 72, 75, 75, 73, 73, 77, 78,
|
760 |
+
78, 47, 47, 55, 55, 58, 58, 58, 57, 79,
|
761 |
+
79, 80, 48, 48, 48, 48, 81, 81, 82, 82,
|
762 |
+
83, 83, 45, 45, 41, 41, 84, 43, 43, 85,
|
763 |
+
42, 42, 44, 44, 54, 54, 54, 54, 69, 69,
|
764 |
+
88, 88, 89, 89, 89, 91, 91, 91, 92, 92,
|
765 |
+
92, 93, 93, 90, 90, 70, 70, 70, 94, 94,
|
766 |
+
95, 95, 96, 96, 96, 50, 97, 97, 98, 51,
|
767 |
+
100, 100, 101, 101, 102, 102, 74, 103, 103, 103,
|
768 |
+
103, 103, 108, 108, 109, 109, 110, 110, 110, 110,
|
769 |
+
110, 111, 112, 112, 107, 107, 104, 104, 106, 106,
|
770 |
+
114, 114, 113, 113, 113, 113, 113, 113, 105, 115,
|
771 |
+
115, 117, 116, 116, 52, 119, 118, 118, 46, 46,
|
772 |
33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
|
773 |
33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
|
774 |
33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
|
777 |
33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
|
778 |
33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
|
779 |
33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
|
780 |
+
33, 33, 33, 33, 33, 33, 126, 120, 120, 125,
|
781 |
+
125, 128, 129, 129, 130, 131, 131, 131, 76, 76,
|
782 |
+
63, 63, 63, 121, 121, 121, 121, 133, 133, 122,
|
783 |
+
122, 124, 124, 124, 127, 127, 138, 138, 138, 138,
|
784 |
+
138, 138, 138, 138, 138, 139, 139, 87, 141, 141,
|
785 |
+
141, 141, 123, 123, 123, 123, 123, 123, 123, 123,
|
786 |
+
49, 49, 136, 136, 136, 136, 142, 142, 132, 132,
|
787 |
+
132, 143, 143, 143, 143, 143, 64, 64, 56, 56,
|
788 |
+
56, 99, 99, 99, 99, 146, 145, 135, 135, 135,
|
789 |
+
135, 135, 135, 134, 134, 134, 144, 144, 144, 144,
|
790 |
+
86, 140, 148, 148, 147, 147, 149, 149, 149, 149,
|
791 |
+
149, 149, 149, 149, 137, 137, 137, 137, 151, 152,
|
792 |
+
150, 150, 150, 150, 150, 150, 150, 153, 153, 153,
|
793 |
+
153
|
794 |
);
|
795 |
|
796 |
protected $ruleToLength = array(
|
825 |
3, 1, 1, 3, 0, 2, 4, 5, 4, 4,
|
826 |
4, 3, 1, 1, 1, 1, 1, 1, 0, 1,
|
827 |
1, 2, 1, 1, 1, 1, 1, 1, 2, 1,
|
828 |
+
3, 1, 1, 3, 2, 2, 3, 1, 0, 1,
|
829 |
+
1, 3, 3, 3, 4, 1, 2, 3, 3, 3,
|
|
|
|
|
830 |
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
831 |
2, 2, 2, 2, 3, 3, 3, 3, 3, 3,
|
832 |
+
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
833 |
+
3, 2, 2, 2, 2, 3, 3, 3, 3, 3,
|
834 |
+
3, 3, 3, 3, 3, 3, 5, 4, 3, 4,
|
835 |
+
4, 2, 2, 4, 2, 2, 2, 2, 2, 2,
|
836 |
+
2, 2, 2, 2, 2, 1, 3, 2, 1, 2,
|
837 |
+
4, 2, 8, 9, 8, 9, 7, 3, 2, 0,
|
838 |
+
4, 2, 1, 3, 2, 2, 2, 4, 1, 1,
|
839 |
+
1, 2, 3, 1, 1, 3, 1, 1, 1, 0,
|
840 |
+
3, 0, 1, 1, 0, 1, 1, 1, 1, 1,
|
841 |
+
1, 1, 1, 1, 1, 3, 3, 3, 4, 1,
|
842 |
+
1, 3, 1, 1, 1, 1, 1, 3, 2, 3,
|
843 |
+
0, 1, 1, 3, 1, 1, 1, 1, 1, 3,
|
844 |
+
1, 1, 4, 4, 1, 4, 0, 1, 1, 1,
|
845 |
+
3, 1, 4, 2, 2, 1, 3, 1, 4, 4,
|
846 |
+
3, 3, 3, 1, 3, 1, 1, 3, 1, 1,
|
847 |
+
4, 1, 1, 1, 3, 1, 1, 2, 1, 3,
|
848 |
+
4, 3, 2, 0, 2, 2, 1, 2, 1, 1,
|
849 |
1, 4, 3, 3, 3, 6, 3, 1, 1, 2,
|
850 |
1
|
851 |
);
|
865 |
$this->semValue = array();
|
866 |
},
|
867 |
4 => function ($stackPos) {
|
868 |
+
$startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; };
|
869 |
if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)];
|
870 |
},
|
871 |
5 => function ($stackPos) {
|
1271 |
$this->semValue = array();
|
1272 |
},
|
1273 |
137 => function ($stackPos) {
|
1274 |
+
$startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; };
|
1275 |
if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)];
|
1276 |
},
|
1277 |
138 => function ($stackPos) {
|
1699 |
$this->semValue = array();
|
1700 |
},
|
1701 |
276 => function ($stackPos) {
|
1702 |
+
$startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; };
|
1703 |
if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)];
|
1704 |
},
|
1705 |
277 => function ($stackPos) {
|
1819 |
$this->semValue = $this->semStack[$stackPos-(2-1)];
|
1820 |
},
|
1821 |
315 => function ($stackPos) {
|
1822 |
+
$this->semValue = $this->semStack[$stackPos-(2-1)];
|
1823 |
},
|
1824 |
316 => function ($stackPos) {
|
1825 |
+
$this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)];
|
1826 |
},
|
1827 |
317 => function ($stackPos) {
|
1828 |
+
$this->semValue = array($this->semStack[$stackPos-(1-1)]);
|
1829 |
},
|
1830 |
318 => function ($stackPos) {
|
1831 |
+
$this->semValue = array();
|
1832 |
},
|
1833 |
319 => function ($stackPos) {
|
1834 |
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
1835 |
},
|
1836 |
320 => function ($stackPos) {
|
1837 |
+
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
1838 |
},
|
1839 |
321 => function ($stackPos) {
|
1840 |
$this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1843 |
$this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1844 |
},
|
1845 |
323 => function ($stackPos) {
|
1846 |
+
$this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1847 |
},
|
1848 |
324 => function ($stackPos) {
|
1849 |
+
$this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
|
1850 |
},
|
1851 |
325 => function ($stackPos) {
|
1852 |
+
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
1853 |
},
|
1854 |
326 => function ($stackPos) {
|
1855 |
+
$this->semValue = new Expr\Clone_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
1856 |
},
|
1857 |
327 => function ($stackPos) {
|
1858 |
+
$this->semValue = new Expr\AssignOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1859 |
},
|
1860 |
328 => function ($stackPos) {
|
1861 |
+
$this->semValue = new Expr\AssignOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1862 |
},
|
1863 |
329 => function ($stackPos) {
|
1864 |
+
$this->semValue = new Expr\AssignOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1865 |
},
|
1866 |
330 => function ($stackPos) {
|
1867 |
+
$this->semValue = new Expr\AssignOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1868 |
},
|
1869 |
331 => function ($stackPos) {
|
1870 |
+
$this->semValue = new Expr\AssignOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1871 |
},
|
1872 |
332 => function ($stackPos) {
|
1873 |
+
$this->semValue = new Expr\AssignOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1874 |
},
|
1875 |
333 => function ($stackPos) {
|
1876 |
+
$this->semValue = new Expr\AssignOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1877 |
},
|
1878 |
334 => function ($stackPos) {
|
1879 |
+
$this->semValue = new Expr\AssignOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1880 |
},
|
1881 |
335 => function ($stackPos) {
|
1882 |
+
$this->semValue = new Expr\AssignOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1883 |
},
|
1884 |
336 => function ($stackPos) {
|
1885 |
+
$this->semValue = new Expr\AssignOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1886 |
},
|
1887 |
337 => function ($stackPos) {
|
1888 |
+
$this->semValue = new Expr\AssignOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1889 |
},
|
1890 |
338 => function ($stackPos) {
|
1891 |
+
$this->semValue = new Expr\AssignOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1892 |
},
|
1893 |
339 => function ($stackPos) {
|
1894 |
+
$this->semValue = new Expr\AssignOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1895 |
},
|
1896 |
340 => function ($stackPos) {
|
1897 |
+
$this->semValue = new Expr\PostInc($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
1898 |
},
|
1899 |
341 => function ($stackPos) {
|
1900 |
+
$this->semValue = new Expr\PreInc($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
1901 |
},
|
1902 |
342 => function ($stackPos) {
|
1903 |
+
$this->semValue = new Expr\PostDec($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
1904 |
},
|
1905 |
343 => function ($stackPos) {
|
1906 |
+
$this->semValue = new Expr\PreDec($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
1907 |
},
|
1908 |
344 => function ($stackPos) {
|
1909 |
+
$this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1910 |
},
|
1911 |
345 => function ($stackPos) {
|
1912 |
+
$this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1913 |
},
|
1914 |
346 => function ($stackPos) {
|
1915 |
+
$this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1916 |
},
|
1917 |
347 => function ($stackPos) {
|
1918 |
+
$this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1919 |
},
|
1920 |
348 => function ($stackPos) {
|
1921 |
+
$this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1922 |
},
|
1923 |
349 => function ($stackPos) {
|
1924 |
+
$this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1925 |
},
|
1926 |
350 => function ($stackPos) {
|
1927 |
+
$this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1928 |
},
|
1929 |
351 => function ($stackPos) {
|
1930 |
+
$this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1931 |
},
|
1932 |
352 => function ($stackPos) {
|
1933 |
+
$this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1934 |
},
|
1935 |
353 => function ($stackPos) {
|
1936 |
+
$this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1937 |
},
|
1938 |
354 => function ($stackPos) {
|
1939 |
+
$this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1940 |
},
|
1941 |
355 => function ($stackPos) {
|
1942 |
+
$this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1943 |
},
|
1944 |
356 => function ($stackPos) {
|
1945 |
+
$this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1946 |
},
|
1947 |
357 => function ($stackPos) {
|
1948 |
+
$this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1949 |
},
|
1950 |
358 => function ($stackPos) {
|
1951 |
+
$this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1952 |
},
|
1953 |
359 => function ($stackPos) {
|
1954 |
+
$this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1955 |
},
|
1956 |
360 => function ($stackPos) {
|
1957 |
+
$this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1958 |
},
|
1959 |
361 => function ($stackPos) {
|
1960 |
+
$this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
1961 |
},
|
1962 |
362 => function ($stackPos) {
|
1963 |
+
$this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
1964 |
},
|
1965 |
363 => function ($stackPos) {
|
1966 |
+
$this->semValue = new Expr\BooleanNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
1967 |
},
|
1968 |
364 => function ($stackPos) {
|
1969 |
+
$this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
1970 |
},
|
1971 |
365 => function ($stackPos) {
|
1972 |
+
$this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1973 |
},
|
1974 |
366 => function ($stackPos) {
|
1975 |
+
$this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1976 |
},
|
1977 |
367 => function ($stackPos) {
|
1978 |
+
$this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1979 |
},
|
1980 |
368 => function ($stackPos) {
|
1981 |
+
$this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1982 |
},
|
1983 |
369 => function ($stackPos) {
|
1984 |
+
$this->semValue = new Expr\BinaryOp\Spaceship($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1985 |
},
|
1986 |
370 => function ($stackPos) {
|
1987 |
+
$this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1988 |
},
|
1989 |
371 => function ($stackPos) {
|
1990 |
+
$this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1991 |
},
|
1992 |
372 => function ($stackPos) {
|
1993 |
+
$this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1994 |
},
|
1995 |
373 => function ($stackPos) {
|
1996 |
+
$this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
1997 |
},
|
1998 |
374 => function ($stackPos) {
|
1999 |
+
$this->semValue = new Expr\Instanceof_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
2000 |
},
|
2001 |
375 => function ($stackPos) {
|
2002 |
+
$this->semValue = $this->semStack[$stackPos-(3-2)];
|
2003 |
},
|
2004 |
376 => function ($stackPos) {
|
2005 |
+
$this->semValue = new Expr\Ternary($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes);
|
2006 |
},
|
2007 |
377 => function ($stackPos) {
|
2008 |
+
$this->semValue = new Expr\Ternary($this->semStack[$stackPos-(4-1)], null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
|
2009 |
},
|
2010 |
378 => function ($stackPos) {
|
2011 |
+
$this->semValue = new Expr\BinaryOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
2012 |
},
|
2013 |
379 => function ($stackPos) {
|
2014 |
+
$this->semValue = new Expr\Isset_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
|
2015 |
},
|
2016 |
380 => function ($stackPos) {
|
2017 |
+
$this->semValue = new Expr\Empty_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
|
2018 |
},
|
2019 |
381 => function ($stackPos) {
|
2020 |
+
$this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2021 |
},
|
2022 |
382 => function ($stackPos) {
|
2023 |
+
$this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2024 |
},
|
2025 |
383 => function ($stackPos) {
|
2026 |
+
$this->semValue = new Expr\Eval_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
|
2027 |
},
|
2028 |
384 => function ($stackPos) {
|
2029 |
+
$this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2030 |
},
|
2031 |
385 => function ($stackPos) {
|
2032 |
+
$this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2033 |
},
|
2034 |
386 => function ($stackPos) {
|
2035 |
+
$this->semValue = new Expr\Cast\Int_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2036 |
+
},
|
2037 |
+
387 => function ($stackPos) {
|
2038 |
$attrs = $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes;
|
2039 |
$attrs['kind'] = $this->getFloatCastKind($this->semStack[$stackPos-(2-1)]);
|
2040 |
$this->semValue = new Expr\Cast\Double($this->semStack[$stackPos-(2-2)], $attrs);
|
2041 |
},
|
2042 |
+
388 => function ($stackPos) {
|
2043 |
$this->semValue = new Expr\Cast\String_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2044 |
},
|
2045 |
+
389 => function ($stackPos) {
|
2046 |
$this->semValue = new Expr\Cast\Array_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2047 |
},
|
2048 |
+
390 => function ($stackPos) {
|
2049 |
$this->semValue = new Expr\Cast\Object_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2050 |
},
|
2051 |
+
391 => function ($stackPos) {
|
2052 |
$this->semValue = new Expr\Cast\Bool_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2053 |
},
|
2054 |
+
392 => function ($stackPos) {
|
2055 |
$this->semValue = new Expr\Cast\Unset_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2056 |
},
|
2057 |
+
393 => function ($stackPos) {
|
2058 |
$attrs = $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes;
|
2059 |
$attrs['kind'] = strtolower($this->semStack[$stackPos-(2-1)]) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE;
|
2060 |
$this->semValue = new Expr\Exit_($this->semStack[$stackPos-(2-2)], $attrs);
|
2061 |
},
|
2062 |
+
394 => function ($stackPos) {
|
2063 |
$this->semValue = new Expr\ErrorSuppress($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2064 |
},
|
2065 |
+
395 => function ($stackPos) {
|
2066 |
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2067 |
},
|
2068 |
+
396 => function ($stackPos) {
|
2069 |
$this->semValue = new Expr\ShellExec($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
2070 |
},
|
2071 |
+
397 => function ($stackPos) {
|
2072 |
$this->semValue = new Expr\Print_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2073 |
},
|
2074 |
+
398 => function ($stackPos) {
|
2075 |
$this->semValue = new Expr\Yield_(null, null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
|
2076 |
},
|
2077 |
+
399 => function ($stackPos) {
|
2078 |
$this->semValue = new Expr\Yield_($this->semStack[$stackPos-(2-2)], null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2079 |
},
|
2080 |
+
400 => function ($stackPos) {
|
2081 |
$this->semValue = new Expr\Yield_($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
|
2082 |
},
|
2083 |
+
401 => function ($stackPos) {
|
2084 |
$this->semValue = new Expr\YieldFrom($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2085 |
},
|
2086 |
+
402 => function ($stackPos) {
|
2087 |
$this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'returnType' => $this->semStack[$stackPos-(8-6)], 'expr' => $this->semStack[$stackPos-(8-8)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes);
|
2088 |
},
|
2089 |
+
403 => function ($stackPos) {
|
2090 |
$this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes);
|
2091 |
},
|
2092 |
+
404 => function ($stackPos) {
|
2093 |
$this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'uses' => $this->semStack[$stackPos-(8-6)], 'returnType' => $this->semStack[$stackPos-(8-7)], 'stmts' => $this->semStack[$stackPos-(8-8)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes);
|
2094 |
},
|
2095 |
+
405 => function ($stackPos) {
|
2096 |
$this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'uses' => $this->semStack[$stackPos-(9-7)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes);
|
2097 |
},
|
2098 |
+
406 => function ($stackPos) {
|
2099 |
$this->semValue = array(new Stmt\Class_(null, ['type' => 0, 'extends' => $this->semStack[$stackPos-(7-3)], 'implements' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes), $this->semStack[$stackPos-(7-2)]);
|
2100 |
$this->checkClass($this->semValue[0], -1);
|
2101 |
},
|
|
|
|
|
|
|
2102 |
407 => function ($stackPos) {
|
2103 |
+
$this->semValue = new Expr\New_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
2104 |
},
|
2105 |
408 => function ($stackPos) {
|
2106 |
+
list($class, $ctorArgs) = $this->semStack[$stackPos-(2-2)]; $this->semValue = new Expr\New_($class, $ctorArgs, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2107 |
},
|
2108 |
409 => function ($stackPos) {
|
2109 |
+
$this->semValue = array();
|
2110 |
},
|
2111 |
410 => function ($stackPos) {
|
2112 |
+
$this->semValue = $this->semStack[$stackPos-(4-3)];
|
2113 |
},
|
2114 |
411 => function ($stackPos) {
|
2115 |
+
$this->semValue = $this->semStack[$stackPos-(2-1)];
|
2116 |
},
|
2117 |
412 => function ($stackPos) {
|
2118 |
+
$this->semValue = array($this->semStack[$stackPos-(1-1)]);
|
2119 |
},
|
2120 |
413 => function ($stackPos) {
|
2121 |
+
$this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)];
|
2122 |
},
|
2123 |
414 => function ($stackPos) {
|
2124 |
+
$this->semValue = new Expr\ClosureUse($this->semStack[$stackPos-(2-2)], $this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2125 |
},
|
2126 |
415 => function ($stackPos) {
|
2127 |
$this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2128 |
},
|
2129 |
416 => function ($stackPos) {
|
2130 |
+
$this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2131 |
},
|
2132 |
417 => function ($stackPos) {
|
2133 |
+
$this->semValue = new Expr\StaticCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
|
2134 |
},
|
2135 |
418 => function ($stackPos) {
|
2136 |
+
$this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
|
2137 |
},
|
2138 |
419 => function ($stackPos) {
|
2139 |
+
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2140 |
},
|
2141 |
420 => function ($stackPos) {
|
2142 |
+
$this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
|
2143 |
},
|
2144 |
421 => function ($stackPos) {
|
2145 |
+
$this->semValue = new Name\FullyQualified($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2146 |
},
|
2147 |
422 => function ($stackPos) {
|
2148 |
+
$this->semValue = new Name\Relative($this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
2149 |
},
|
2150 |
423 => function ($stackPos) {
|
2151 |
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2152 |
},
|
2153 |
424 => function ($stackPos) {
|
2154 |
+
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2155 |
},
|
2156 |
425 => function ($stackPos) {
|
2157 |
+
$this->semValue = $this->semStack[$stackPos-(3-2)];
|
2158 |
},
|
2159 |
426 => function ($stackPos) {
|
2160 |
+
$this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2;
|
2161 |
},
|
2162 |
427 => function ($stackPos) {
|
2163 |
+
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2164 |
},
|
2165 |
428 => function ($stackPos) {
|
2166 |
+
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2167 |
},
|
2168 |
429 => function ($stackPos) {
|
2169 |
+
$this->semValue = null;
|
2170 |
},
|
2171 |
430 => function ($stackPos) {
|
2172 |
+
$this->semValue = $this->semStack[$stackPos-(3-2)];
|
2173 |
},
|
2174 |
431 => function ($stackPos) {
|
2175 |
+
$this->semValue = array();
|
2176 |
},
|
2177 |
432 => function ($stackPos) {
|
2178 |
+
$this->semValue = array(new Scalar\EncapsedStringPart(Scalar\String_::parseEscapeSequences($this->semStack[$stackPos-(1-1)], '`'), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes));
|
2179 |
},
|
2180 |
433 => function ($stackPos) {
|
2181 |
+
foreach ($this->semStack[$stackPos-(1-1)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', true); } }; $this->semValue = $this->semStack[$stackPos-(1-1)];
|
2182 |
},
|
2183 |
434 => function ($stackPos) {
|
2184 |
+
$this->semValue = array();
|
2185 |
},
|
2186 |
435 => function ($stackPos) {
|
2187 |
+
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2188 |
},
|
2189 |
436 => function ($stackPos) {
|
2190 |
+
$this->semValue = new Expr\ConstFetch($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
|
2191 |
},
|
2192 |
437 => function ($stackPos) {
|
2193 |
+
$this->semValue = new Scalar\MagicConst\Line($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
|
|
|
2194 |
},
|
2195 |
438 => function ($stackPos) {
|
2196 |
+
$this->semValue = new Scalar\MagicConst\File($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
|
|
|
2197 |
},
|
2198 |
439 => function ($stackPos) {
|
2199 |
+
$this->semValue = new Scalar\MagicConst\Dir($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
|
2200 |
},
|
2201 |
440 => function ($stackPos) {
|
2202 |
+
$this->semValue = new Scalar\MagicConst\Class_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
|
|
|
2203 |
},
|
2204 |
441 => function ($stackPos) {
|
2205 |
+
$this->semValue = new Scalar\MagicConst\Trait_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
|
2206 |
},
|
2207 |
442 => function ($stackPos) {
|
2208 |
+
$this->semValue = new Scalar\MagicConst\Method($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
|
2209 |
},
|
2210 |
443 => function ($stackPos) {
|
2211 |
+
$this->semValue = new Scalar\MagicConst\Function_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
|
2212 |
},
|
2213 |
444 => function ($stackPos) {
|
2214 |
+
$this->semValue = new Scalar\MagicConst\Namespace_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
|
2215 |
},
|
2216 |
445 => function ($stackPos) {
|
2217 |
+
$this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
2218 |
},
|
2219 |
446 => function ($stackPos) {
|
2220 |
+
$this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], new Expr\Error($this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)]), $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->errorState = 2;
|
2221 |
},
|
2222 |
447 => function ($stackPos) {
|
2223 |
+
$attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Expr\Array_::KIND_SHORT;
|
2224 |
+
$this->semValue = new Expr\Array_($this->semStack[$stackPos-(3-2)], $attrs);
|
2225 |
},
|
2226 |
448 => function ($stackPos) {
|
2227 |
+
$attrs = $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes; $attrs['kind'] = Expr\Array_::KIND_LONG;
|
2228 |
+
$this->semValue = new Expr\Array_($this->semStack[$stackPos-(4-3)], $attrs);
|
2229 |
},
|
2230 |
449 => function ($stackPos) {
|
2231 |
+
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2232 |
},
|
2233 |
450 => function ($stackPos) {
|
2234 |
+
$attrs = $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes; $attrs['kind'] = ($this->semStack[$stackPos-(1-1)][0] === "'" || ($this->semStack[$stackPos-(1-1)][1] === "'" && ($this->semStack[$stackPos-(1-1)][0] === 'b' || $this->semStack[$stackPos-(1-1)][0] === 'B')) ? Scalar\String_::KIND_SINGLE_QUOTED : Scalar\String_::KIND_DOUBLE_QUOTED);
|
2235 |
+
$this->semValue = new Scalar\String_(Scalar\String_::parse($this->semStack[$stackPos-(1-1)]), $attrs);
|
2236 |
},
|
2237 |
451 => function ($stackPos) {
|
2238 |
+
$attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED;
|
2239 |
+
foreach ($this->semStack[$stackPos-(3-2)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '"', true); } }; $this->semValue = new Scalar\Encapsed($this->semStack[$stackPos-(3-2)], $attrs);
|
2240 |
},
|
2241 |
452 => function ($stackPos) {
|
2242 |
+
$this->semValue = $this->parseLNumber($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
|
2243 |
},
|
2244 |
453 => function ($stackPos) {
|
2245 |
+
$this->semValue = new Scalar\DNumber(Scalar\DNumber::parse($this->semStack[$stackPos-(1-1)]), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
|
2246 |
},
|
2247 |
454 => function ($stackPos) {
|
2248 |
+
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2249 |
},
|
2250 |
455 => function ($stackPos) {
|
2251 |
+
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
|
|
2252 |
},
|
2253 |
456 => function ($stackPos) {
|
2254 |
+
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2255 |
},
|
2256 |
457 => function ($stackPos) {
|
2257 |
+
$this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true);
|
2258 |
},
|
2259 |
458 => function ($stackPos) {
|
2260 |
+
$this->semValue = $this->parseDocString($this->semStack[$stackPos-(2-1)], '', $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(2-2)] + $this->endAttributeStack[$stackPos-(2-2)], true);
|
2261 |
},
|
2262 |
459 => function ($stackPos) {
|
2263 |
+
$this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true);
|
2264 |
},
|
2265 |
460 => function ($stackPos) {
|
2266 |
+
$this->semValue = null;
|
2267 |
},
|
2268 |
461 => function ($stackPos) {
|
2269 |
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2278 |
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2279 |
},
|
2280 |
465 => function ($stackPos) {
|
2281 |
+
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2282 |
},
|
2283 |
466 => function ($stackPos) {
|
2284 |
+
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2285 |
},
|
2286 |
467 => function ($stackPos) {
|
2287 |
+
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2288 |
},
|
2289 |
468 => function ($stackPos) {
|
2290 |
+
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2291 |
},
|
2292 |
469 => function ($stackPos) {
|
2293 |
+
$this->semValue = $this->semStack[$stackPos-(3-2)];
|
2294 |
},
|
2295 |
470 => function ($stackPos) {
|
2296 |
+
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2297 |
},
|
2298 |
471 => function ($stackPos) {
|
2299 |
+
$this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
|
2300 |
},
|
2301 |
472 => function ($stackPos) {
|
2302 |
+
$this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
|
2303 |
},
|
2304 |
473 => function ($stackPos) {
|
2305 |
+
$this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
|
2306 |
},
|
2307 |
474 => function ($stackPos) {
|
2308 |
+
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2309 |
},
|
2310 |
475 => function ($stackPos) {
|
2311 |
+
$this->semValue = new Expr\MethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
|
2312 |
},
|
2313 |
476 => function ($stackPos) {
|
2314 |
+
$this->semValue = null;
|
2315 |
},
|
2316 |
477 => function ($stackPos) {
|
2317 |
+
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2318 |
},
|
2319 |
478 => function ($stackPos) {
|
2320 |
+
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2321 |
},
|
2322 |
479 => function ($stackPos) {
|
2323 |
+
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2324 |
},
|
2325 |
480 => function ($stackPos) {
|
2326 |
+
$this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
2327 |
},
|
2328 |
481 => function ($stackPos) {
|
2329 |
+
$this->semValue = substr($this->semStack[$stackPos-(1-1)], 1);
|
2330 |
},
|
2331 |
482 => function ($stackPos) {
|
2332 |
+
$this->semValue = $this->semStack[$stackPos-(4-3)];
|
2333 |
},
|
2334 |
483 => function ($stackPos) {
|
2335 |
+
$this->semValue = new Expr\Variable($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2336 |
},
|
2337 |
484 => function ($stackPos) {
|
2338 |
+
$this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); $this->errorState = 2;
|
2339 |
},
|
2340 |
485 => function ($stackPos) {
|
2341 |
+
$var = $this->semStack[$stackPos-(1-1)]; $this->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes) : $var;
|
2342 |
},
|
2343 |
486 => function ($stackPos) {
|
2344 |
+
$this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
2345 |
},
|
2346 |
487 => function ($stackPos) {
|
2347 |
+
$this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
|
2348 |
},
|
2349 |
488 => function ($stackPos) {
|
2350 |
+
$this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
|
2351 |
},
|
2352 |
489 => function ($stackPos) {
|
2353 |
+
$this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
|
2354 |
},
|
2355 |
490 => function ($stackPos) {
|
2356 |
+
$this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
2357 |
},
|
2358 |
491 => function ($stackPos) {
|
2359 |
+
$this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
2360 |
},
|
2361 |
492 => function ($stackPos) {
|
2362 |
+
$this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
2363 |
},
|
2364 |
493 => function ($stackPos) {
|
2365 |
+
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2366 |
},
|
2367 |
494 => function ($stackPos) {
|
2368 |
+
$this->semValue = $this->semStack[$stackPos-(3-2)];
|
2369 |
},
|
2370 |
495 => function ($stackPos) {
|
2371 |
+
$this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
|
2372 |
},
|
2373 |
496 => function ($stackPos) {
|
2374 |
+
$this->semValue = $this->semStack[$stackPos-(1-1)];
|
2375 |
},
|
2376 |
497 => function ($stackPos) {
|
2377 |
+
$this->semValue = $this->semStack[$stackPos-(3-2)];
|
2378 |
},
|
2379 |
498 => function ($stackPos) {
|
2380 |
+
$this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
|
2381 |
},
|
2382 |
499 => function ($stackPos) {
|
2383 |
+
$this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2;
|
2384 |
},
|
2385 |
500 => function ($stackPos) {
|
2386 |
+
$this->semValue = new Expr\List_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
|
2387 |
},
|
2388 |
501 => function ($stackPos) {
|
2389 |
+
$this->semValue = $this->semStack[$stackPos-(1-1)]; $end = count($this->semValue)-1; if ($this->semValue[$end] === null) array_pop($this->semValue);
|
2390 |
},
|
2391 |
502 => function ($stackPos) {
|
2392 |
+
$this->semValue = $this->semStack[$stackPos];
|
2393 |
},
|
2394 |
503 => function ($stackPos) {
|
2395 |
+
/* do nothing -- prevent default action of $$=$this->semStack[$1]. See $551. */
|
2396 |
},
|
2397 |
504 => function ($stackPos) {
|
2398 |
+
$this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)];
|
2399 |
},
|
2400 |
505 => function ($stackPos) {
|
2401 |
+
$this->semValue = array($this->semStack[$stackPos-(1-1)]);
|
2402 |
},
|
2403 |
506 => function ($stackPos) {
|
2404 |
+
$this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
|
2405 |
},
|
2406 |
507 => function ($stackPos) {
|
2407 |
+
$this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
2408 |
},
|
2409 |
508 => function ($stackPos) {
|
2410 |
+
$this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
|
2411 |
},
|
2412 |
509 => function ($stackPos) {
|
2413 |
+
$this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
2414 |
},
|
2415 |
510 => function ($stackPos) {
|
2416 |
$this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-1)], true, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
|
2417 |
},
|
2418 |
511 => function ($stackPos) {
|
2419 |
+
$this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
|
2420 |
},
|
2421 |
512 => function ($stackPos) {
|
2422 |
$this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
|
vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php
CHANGED
@@ -648,7 +648,7 @@ abstract class ParserAbstract implements Parser
|
|
648 |
}
|
649 |
|
650 |
protected function handleBuiltinTypes(Name $name) {
|
651 |
-
$
|
652 |
'bool' => true,
|
653 |
'int' => true,
|
654 |
'float' => true,
|
@@ -658,6 +658,7 @@ abstract class ParserAbstract implements Parser
|
|
658 |
'object' => true,
|
659 |
'null' => true,
|
660 |
'false' => true,
|
|
|
661 |
];
|
662 |
|
663 |
if (!$name->isUnqualified()) {
|
@@ -665,7 +666,7 @@ abstract class ParserAbstract implements Parser
|
|
665 |
}
|
666 |
|
667 |
$lowerName = $name->toLowerString();
|
668 |
-
if (!isset($
|
669 |
return $name;
|
670 |
}
|
671 |
|
@@ -842,21 +843,29 @@ abstract class ParserAbstract implements Parser
|
|
842 |
}
|
843 |
|
844 |
/**
|
845 |
-
* Create attributes for a zero-length
|
846 |
*
|
847 |
-
* @param
|
848 |
* @return array
|
849 |
*/
|
850 |
-
protected function
|
851 |
-
$
|
852 |
-
|
853 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
854 |
}
|
855 |
-
if (
|
856 |
-
$attributes['
|
|
|
857 |
}
|
858 |
-
if (
|
859 |
-
$attributes['
|
|
|
860 |
}
|
861 |
return $attributes;
|
862 |
}
|
648 |
}
|
649 |
|
650 |
protected function handleBuiltinTypes(Name $name) {
|
651 |
+
$builtinTypes = [
|
652 |
'bool' => true,
|
653 |
'int' => true,
|
654 |
'float' => true,
|
658 |
'object' => true,
|
659 |
'null' => true,
|
660 |
'false' => true,
|
661 |
+
'mixed' => true,
|
662 |
];
|
663 |
|
664 |
if (!$name->isUnqualified()) {
|
666 |
}
|
667 |
|
668 |
$lowerName = $name->toLowerString();
|
669 |
+
if (!isset($builtinTypes[$lowerName])) {
|
670 |
return $name;
|
671 |
}
|
672 |
|
843 |
}
|
844 |
|
845 |
/**
|
846 |
+
* Create attributes for a zero-length common-capturing nop.
|
847 |
*
|
848 |
+
* @param Comment[] $comments
|
849 |
* @return array
|
850 |
*/
|
851 |
+
protected function createCommentNopAttributes(array $comments) {
|
852 |
+
$comment = $comments[count($comments) - 1];
|
853 |
+
$commentEndLine = $comment->getEndLine();
|
854 |
+
$commentEndFilePos = $comment->getEndFilePos();
|
855 |
+
$commentEndTokenPos = $comment->getEndTokenPos();
|
856 |
+
|
857 |
+
$attributes = ['comments' => $comments];
|
858 |
+
if (-1 !== $commentEndLine) {
|
859 |
+
$attributes['startLine'] = $commentEndLine;
|
860 |
+
$attributes['endLine'] = $commentEndLine;
|
861 |
}
|
862 |
+
if (-1 !== $commentEndFilePos) {
|
863 |
+
$attributes['startFilePos'] = $commentEndFilePos + 1;
|
864 |
+
$attributes['endFilePos'] = $commentEndFilePos;
|
865 |
}
|
866 |
+
if (-1 !== $commentEndTokenPos) {
|
867 |
+
$attributes['startTokenPos'] = $commentEndTokenPos + 1;
|
868 |
+
$attributes['endTokenPos'] = $commentEndTokenPos;
|
869 |
}
|
870 |
return $attributes;
|
871 |
}
|
vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php
CHANGED
@@ -817,8 +817,8 @@ class Standard extends PrettyPrinterAbstract
|
|
817 |
}
|
818 |
|
819 |
protected function pStmt_Catch(Stmt\Catch_ $node) {
|
820 |
-
return 'catch (' . $this->pImplode($node->types, '|')
|
821 |
-
. $this->p($node->var)
|
822 |
. ') {' . $this->pStmts($node->stmts) . $this->nl . '}';
|
823 |
}
|
824 |
|
817 |
}
|
818 |
|
819 |
protected function pStmt_Catch(Stmt\Catch_ $node) {
|
820 |
+
return 'catch (' . $this->pImplode($node->types, '|')
|
821 |
+
. ($node->var !== null ? ' ' . $this->p($node->var) : '')
|
822 |
. ') {' . $this->pStmts($node->stmts) . $this->nl . '}';
|
823 |
}
|
824 |
|
vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php
CHANGED
@@ -756,20 +756,13 @@ abstract class PrettyPrinterAbstract
|
|
756 |
$itemEndPos = $origArrItem->getEndTokenPos();
|
757 |
\assert($itemStartPos >= 0 && $itemEndPos >= 0);
|
758 |
|
759 |
-
if ($itemEndPos < $itemStartPos) {
|
760 |
-
// End can be before start for Nop nodes, because offsets refer to non-whitespace
|
761 |
-
// locations, which for an "empty" node might result in an inverted order.
|
762 |
-
assert($origArrItem instanceof Stmt\Nop);
|
763 |
-
continue;
|
764 |
-
}
|
765 |
-
|
766 |
$origIndentLevel = $this->indentLevel;
|
767 |
$lastElemIndentLevel = $this->origTokens->getIndentationBefore($itemStartPos) + $indentAdjustment;
|
768 |
$this->setIndentLevel($lastElemIndentLevel);
|
769 |
|
770 |
$comments = $arrItem->getComments();
|
771 |
$origComments = $origArrItem->getComments();
|
772 |
-
$commentStartPos = $origComments ? $origComments[0]->
|
773 |
\assert($commentStartPos >= 0);
|
774 |
|
775 |
$commentsChanged = $comments !== $origComments;
|
756 |
$itemEndPos = $origArrItem->getEndTokenPos();
|
757 |
\assert($itemStartPos >= 0 && $itemEndPos >= 0);
|
758 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
759 |
$origIndentLevel = $this->indentLevel;
|
760 |
$lastElemIndentLevel = $this->origTokens->getIndentationBefore($itemStartPos) + $indentAdjustment;
|
761 |
$this->setIndentLevel($lastElemIndentLevel);
|
762 |
|
763 |
$comments = $arrItem->getComments();
|
764 |
$origComments = $origArrItem->getComments();
|
765 |
+
$commentStartPos = $origComments ? $origComments[0]->getStartTokenPos() : $itemStartPos;
|
766 |
\assert($commentStartPos >= 0);
|
767 |
|
768 |
$commentsChanged = $comments !== $origComments;
|