Version Description
- 03.13.2017 =
- NEW: Template mechanism for all display types
- NEW: Review notices
- Changed: Updated branding to Imagely
- Changed: Added the ability to click on a gallery title and have it open direct to Pro Lightbox
- Fixed: Problems with activation after initial installation
- Fixed: Don't display legacy shortcodes after creating new galleries
- Fixed: false positive malware detection notices against 'eval'
- Fixed: Various PHP notices and warnings
- Fixed: Issue with dynamic container height for Imagebrowser display types
Download this release
Release Info
Developer | photocrati |
Plugin | NextGEN Gallery – WordPress Gallery Plugin |
Version | 2.2.1 |
Comparing to | |
See all releases |
Code changes from version 2.1.79 to 2.2.1
- changelog.txt +12 -1
- nggallery.php +11 -5
- non_pope/class.nextgen_settings.php +3 -0
- pope/lib/class.base_module.php +4 -1
- products/photocrati_nextgen/modules/ajax/module.ajax.php +10 -3
- products/photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php +12 -5
- products/photocrati_nextgen/modules/attach_to_post/package.module.attach_to_post.php +1 -1
- products/photocrati_nextgen/modules/cache/module.cache.php +11 -4
- products/photocrati_nextgen/modules/datamapper/module.datamapper.php +19 -12
- products/photocrati_nextgen/modules/datamapper/package.module.datamapper.php +6 -10
- products/photocrati_nextgen/modules/dynamic_stylesheet/module.dynamic_stylesheet.php +11 -4
- products/photocrati_nextgen/modules/dynamic_thumbnails/module.dynamic_thumbnails.php +11 -4
- products/photocrati_nextgen/modules/frame_communication/module.frame_communication.php +11 -4
- products/photocrati_nextgen/modules/fs/module.fs.php +11 -4
- products/photocrati_nextgen/modules/i18n/lang/nggallery-sv_SE.po +3 -3
- products/photocrati_nextgen/modules/i18n/lang/nggallery.po +2 -2
- products/photocrati_nextgen/modules/i18n/module.i18n.php +9 -2
- products/photocrati_nextgen/modules/lightbox/module.lightbox.php +10 -3
- products/photocrati_nextgen/modules/mvc/module.mvc.php +15 -8
- products/photocrati_nextgen/modules/nextgen_addgallery_page/module.nextgen_addgallery_page.php +9 -2
- products/photocrati_nextgen/modules/nextgen_admin/module.nextgen_admin.php +111 -18
- products/photocrati_nextgen/modules/nextgen_admin/package.module.nextgen_admin.php +162 -80
- products/photocrati_nextgen/modules/nextgen_admin/static/admin_notices.js +5 -2
- products/photocrati_nextgen/modules/nextgen_admin/static/admin_notices.min.js +1 -1
- products/photocrati_nextgen/modules/nextgen_admin/templates/admin_notice.php +1 -1
- products/photocrati_nextgen/modules/nextgen_admin/templates/review_notice.php +17 -0
- products/photocrati_nextgen/modules/nextgen_basic_album/module.nextgen_basic_album.php +12 -3
- products/photocrati_nextgen/modules/nextgen_basic_album/package.module.nextgen_basic_album.php +147 -35
- products/photocrati_nextgen/modules/nextgen_basic_album/templates/compact.php +22 -29
- products/photocrati_nextgen/modules/nextgen_basic_album/templates/extended.php +16 -26
- products/photocrati_nextgen/modules/nextgen_basic_gallery/module.nextgen_basic_gallery.php +10 -3
- products/photocrati_nextgen/modules/nextgen_basic_gallery/package.module.nextgen_basic_gallery.php +1 -11
- products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/module.nextgen_basic_imagebrowser.php +13 -6
- products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/static/style.css +142 -0
- products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/static/style.min.css +1 -1
- products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/templates/imagebrowser-simple-template.php +71 -0
- products/photocrati_nextgen/modules/nextgen_basic_singlepic/module.nextgen_basic_singlepic.php +11 -4
- products/photocrati_nextgen/modules/nextgen_basic_tagcloud/module.nextgen_basic_tagcloud.php +11 -4
- products/photocrati_nextgen/modules/nextgen_basic_templates/module.nextgen_basic_templates.php +11 -4
- products/photocrati_nextgen/modules/nextgen_data/module.nextgen_data.php +10 -3
- products/photocrati_nextgen/modules/nextgen_data/package.module.nextgen_data.php +9 -1
- products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php +39 -5
- products/photocrati_nextgen/modules/nextgen_gallery_display/package.module.nextgen_gallery_display.php +149 -0
- products/photocrati_nextgen/modules/nextgen_gallery_display/static/common.js +57 -5
- products/photocrati_nextgen/modules/nextgen_gallery_display/static/common.min.js +3 -1
- products/photocrati_nextgen/modules/{nextgen_admin/templates/field_generator → nextgen_gallery_display/templates}/thumbnail_settings.php +0 -0
- products/photocrati_nextgen/modules/nextgen_other_options/module.nextgen_other_options.php +9 -2
- products/photocrati_nextgen/modules/nextgen_pagination/module.nextgen_pagination.php +9 -2
- products/photocrati_nextgen/modules/nextgen_pro_upgrade/module.nextgen_pro_upgrade.php +9 -2
- products/photocrati_nextgen/modules/nextgen_settings/module.nextgen_settings.php +10 -3
- products/photocrati_nextgen/modules/nextgen_xmlrpc/module.nextgen_xmlrpc.php +9 -2
- products/photocrati_nextgen/modules/ngglegacy/admin/functions.php +6 -8
- products/photocrati_nextgen/modules/ngglegacy/admin/manage.php +2 -0
- products/photocrati_nextgen/modules/ngglegacy/lib/ngg-db.php +7 -7
- products/photocrati_nextgen/modules/ngglegacy/module.ngglegacy.php +18 -10
- products/photocrati_nextgen/modules/ngglegacy/view/album-compact.php +20 -3
- products/photocrati_nextgen/modules/router/module.router.php +9 -2
- products/photocrati_nextgen/modules/router/package.module.router.php +1 -1
- products/photocrati_nextgen/modules/security/module.security.php +9 -2
- products/photocrati_nextgen/modules/simplehtmldom/module.simple_html_dom.php +9 -2
- products/photocrati_nextgen/modules/third_party_compat/module.third_party_compat.php +9 -2
- products/photocrati_nextgen/modules/validation/module.validation.php +9 -2
- products/photocrati_nextgen/modules/widget/module.widget.php +9 -2
- products/photocrati_nextgen/modules/wordpress_routing/module.wordpress_routing.php +9 -2
- products/photocrati_nextgen/modules/wpcli/module.wpcli.php +22 -2
- products/photocrati_nextgen/product.photocrati_nextgen.php +11 -4
- readme.txt +14 -3
changelog.txt
CHANGED
@@ -1,8 +1,19 @@
|
|
1 |
NextGEN Gallery
|
2 |
by Imagely
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
= V2.1.79 - 02.23.2017 =
|
5 |
-
*
|
6 |
|
7 |
= V2.1.77 - 01.31.2017 =
|
8 |
* Changed: Corrected Facebook link
|
1 |
NextGEN Gallery
|
2 |
by Imagely
|
3 |
|
4 |
+
= V2.2.1 - 03.13.2017 =
|
5 |
+
* NEW: Template mechanism for all display types
|
6 |
+
* NEW: Review notices
|
7 |
+
* Changed: Updated branding to Imagely
|
8 |
+
* Changed: Added the ability to click on a gallery title and have it open direct to Pro Lightbox
|
9 |
+
* Fixed: Problems with activation after initial installation
|
10 |
+
* Fixed: Don't display legacy shortcodes after creating new galleries
|
11 |
+
* Fixed: false positive malware detection notices against 'eval'
|
12 |
+
* Fixed: Various PHP notices and warnings
|
13 |
+
* Fixed: Issue with dynamic container height for Imagebrowser display types
|
14 |
+
|
15 |
= V2.1.79 - 02.23.2017 =
|
16 |
+
* Secured: Resolved vulnerability with tag cloud displays
|
17 |
|
18 |
= V2.1.77 - 01.31.2017 =
|
19 |
* Changed: Corrected Facebook link
|
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 16.5 million downloads.
|
7 |
-
* Version: 2.1
|
8 |
* Author: Imagely
|
9 |
* Plugin URI: https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/
|
10 |
* Author URI: https://www.imagely.com
|
@@ -60,7 +60,7 @@ if (!function_exists('nextgen_esc_url')) {
|
|
60 |
}
|
61 |
|
62 |
/**
|
63 |
-
* NextGEN Gallery is built on top of the
|
64 |
* https://bitbucket.org/photocrati/pope-framework
|
65 |
*
|
66 |
* Pope constructs applications by assembling modules.
|
@@ -160,7 +160,7 @@ class C_NextGEN_Bootstrap
|
|
160 |
|
161 |
function is_activating()
|
162 |
{
|
163 |
-
$retval = strpos($_SERVER['REQUEST_URI'], 'plugins.php') !== FALSE && isset($_REQUEST['action']) && in_array($_REQUEST['action'], array('activate
|
164 |
|
165 |
if (!$retval && strpos($_SERVER['REQUEST_URI'], 'update.php') !== FALSE && isset($_REQUEST['action']) && $_REQUEST['action'] == 'install-plugin' && isset($_REQUEST['plugin']) && strpos($_REQUEST['plugin'], 'nextgen-gallery') === 0) {
|
166 |
$retval = TRUE;
|
@@ -209,6 +209,7 @@ class C_NextGEN_Bootstrap
|
|
209 |
// If a plugin wasn't activated/deactivated siliently, we can listen for these things
|
210 |
if (did_action('activate_plugin') || did_action('deactivate_plugin')) return;
|
211 |
else if (strpos($_SERVER['REQUEST_URI'], 'plugins') !== FALSE) return;
|
|
|
212 |
|
213 |
$plugins = get_option('active_plugins');
|
214 |
|
@@ -389,7 +390,7 @@ class C_NextGEN_Bootstrap
|
|
389 |
}
|
390 |
|
391 |
// Update modules
|
392 |
-
add_action('init', array(&$this, 'update'), PHP_INT_MAX-
|
393 |
|
394 |
// Start the plugin!
|
395 |
add_action('init', array(&$this, 'route'), 11);
|
@@ -606,6 +607,11 @@ class C_NextGEN_Bootstrap
|
|
606 |
}
|
607 |
}
|
608 |
|
|
|
|
|
|
|
|
|
|
|
609 |
/**
|
610 |
* Run the uninstaller
|
611 |
*/
|
@@ -631,7 +637,7 @@ class C_NextGEN_Bootstrap
|
|
631 |
define('NGG_PRODUCT_URL', path_join(str_replace("\\", '/', NGG_PLUGIN_URL), 'products'));
|
632 |
define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
|
633 |
define('NGG_PLUGIN_STARTED_AT', microtime());
|
634 |
-
define('NGG_PLUGIN_VERSION', '2.1
|
635 |
|
636 |
if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG)
|
637 |
define('NGG_SCRIPT_VERSION', (string)mt_rand(0, mt_getrandmax()));
|
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 16.5 million downloads.
|
7 |
+
* Version: 2.2.1
|
8 |
* Author: Imagely
|
9 |
* Plugin URI: https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/
|
10 |
* Author URI: https://www.imagely.com
|
60 |
}
|
61 |
|
62 |
/**
|
63 |
+
* NextGEN Gallery is built on top of the Pope Framework:
|
64 |
* https://bitbucket.org/photocrati/pope-framework
|
65 |
*
|
66 |
* Pope constructs applications by assembling modules.
|
160 |
|
161 |
function is_activating()
|
162 |
{
|
163 |
+
$retval = strpos($_SERVER['REQUEST_URI'], 'plugins.php') !== FALSE && isset($_REQUEST['action']) && in_array($_REQUEST['action'], array('activate-selected'));
|
164 |
|
165 |
if (!$retval && strpos($_SERVER['REQUEST_URI'], 'update.php') !== FALSE && isset($_REQUEST['action']) && $_REQUEST['action'] == 'install-plugin' && isset($_REQUEST['plugin']) && strpos($_REQUEST['plugin'], 'nextgen-gallery') === 0) {
|
166 |
$retval = TRUE;
|
209 |
// If a plugin wasn't activated/deactivated siliently, we can listen for these things
|
210 |
if (did_action('activate_plugin') || did_action('deactivate_plugin')) return;
|
211 |
else if (strpos($_SERVER['REQUEST_URI'], 'plugins') !== FALSE) return;
|
212 |
+
else if (!$this->is_page_request()) return;
|
213 |
|
214 |
$plugins = get_option('active_plugins');
|
215 |
|
390 |
}
|
391 |
|
392 |
// Update modules
|
393 |
+
add_action('init', array(&$this, 'update'), PHP_INT_MAX-2);
|
394 |
|
395 |
// Start the plugin!
|
396 |
add_action('init', array(&$this, 'route'), 11);
|
607 |
}
|
608 |
}
|
609 |
|
610 |
+
function is_page_request()
|
611 |
+
{
|
612 |
+
return !(defined('DOING_AJAX') && DOING_AJAX) && !(defined('DOING_CRON') && DOING_CRON) && !(defined('NGG_AJAX_SLUG') && strpos($_SERVER['REQUEST_URI'], NGG_AJAX_SLUG) !== FALSE);
|
613 |
+
}
|
614 |
+
|
615 |
/**
|
616 |
* Run the uninstaller
|
617 |
*/
|
637 |
define('NGG_PRODUCT_URL', path_join(str_replace("\\", '/', NGG_PLUGIN_URL), 'products'));
|
638 |
define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
|
639 |
define('NGG_PLUGIN_STARTED_AT', microtime());
|
640 |
+
define('NGG_PLUGIN_VERSION', '2.2.1');
|
641 |
|
642 |
if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG)
|
643 |
define('NGG_SCRIPT_VERSION', (string)mt_rand(0, mt_getrandmax()));
|
non_pope/class.nextgen_settings.php
CHANGED
@@ -3,6 +3,9 @@
|
|
3 |
|
4 |
if (!class_exists('C_NextGen_Settings')) {
|
5 |
class C_NextGen_Settings {
|
|
|
|
|
|
|
6 |
static function get_instance()
|
7 |
{
|
8 |
return C_Photocrati_Settings_Manager::get_instance();
|
3 |
|
4 |
if (!class_exists('C_NextGen_Settings')) {
|
5 |
class C_NextGen_Settings {
|
6 |
+
/**
|
7 |
+
* @return C_NextGen_Settings
|
8 |
+
*/
|
9 |
static function get_instance()
|
10 |
{
|
11 |
return C_Photocrati_Settings_Manager::get_instance();
|
pope/lib/class.base_module.php
CHANGED
@@ -63,7 +63,10 @@ abstract class C_Base_Module
|
|
63 |
|
64 |
function load()
|
65 |
{
|
66 |
-
|
|
|
|
|
|
|
67 |
|
68 |
$this->_register_utilities();
|
69 |
$this->_register_adapters();
|
63 |
|
64 |
function load()
|
65 |
{
|
66 |
+
// Package files may not exist until releases are built
|
67 |
+
$path = $this->get_package_abspath();
|
68 |
+
if (@file_exists($path))
|
69 |
+
@include_once($path);
|
70 |
|
71 |
$this->_register_utilities();
|
72 |
$this->_register_adapters();
|
products/photocrati_nextgen/modules/ajax/module.ajax.php
CHANGED
@@ -4,15 +4,22 @@ define('NGG_AJAX_SLUG', 'photocrati_ajax');
|
|
4 |
|
5 |
class M_Ajax extends C_Base_Module
|
6 |
{
|
7 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
{
|
9 |
parent::define(
|
10 |
'photocrati-ajax',
|
11 |
'AJAX',
|
12 |
'Provides AJAX functionality',
|
13 |
'0.10',
|
14 |
-
'https://www.imagely.com',
|
15 |
-
'
|
16 |
'https://www.imagely.com'
|
17 |
);
|
18 |
C_NextGen_Settings::get_instance()->add_option_handler('C_Ajax_Option_Handler', array(
|
4 |
|
5 |
class M_Ajax extends C_Base_Module
|
6 |
{
|
7 |
+
function define($id = 'pope-module',
|
8 |
+
$name = 'Pope Module',
|
9 |
+
$description = '',
|
10 |
+
$version = '',
|
11 |
+
$uri = '',
|
12 |
+
$author = '',
|
13 |
+
$author_uri = '',
|
14 |
+
$context = FALSE)
|
15 |
{
|
16 |
parent::define(
|
17 |
'photocrati-ajax',
|
18 |
'AJAX',
|
19 |
'Provides AJAX functionality',
|
20 |
'0.10',
|
21 |
+
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
22 |
+
'Imagely',
|
23 |
'https://www.imagely.com'
|
24 |
);
|
25 |
C_NextGen_Settings::get_instance()->add_option_handler('C_Ajax_Option_Handler', array(
|
products/photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php
CHANGED
@@ -12,16 +12,23 @@ class M_Attach_To_Post extends C_Base_Module
|
|
12 |
* Defines the module
|
13 |
* @param string|bool $context
|
14 |
*/
|
15 |
-
function define($
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
{
|
17 |
parent::define(
|
18 |
'photocrati-attach_to_post',
|
19 |
'Attach To Post',
|
20 |
'Provides the "Attach to Post" interface for displaying galleries and albums',
|
21 |
'0.18',
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
$context
|
26 |
);
|
27 |
|
@@ -95,7 +102,7 @@ class M_Attach_To_Post extends C_Base_Module
|
|
95 |
|
96 |
function does_request_require_frame_communication()
|
97 |
{
|
98 |
-
return (strpos($_SERVER['REQUEST_URI'], 'attach_to_post') !== FALSE OR strpos($_SERVER['HTTP_REFERER'], 'attach_to_post') !== FALSE OR array_key_exists('attach_to_post', $_REQUEST));
|
99 |
}
|
100 |
|
101 |
|
12 |
* Defines the module
|
13 |
* @param string|bool $context
|
14 |
*/
|
15 |
+
function define($id = 'pope-module',
|
16 |
+
$name = 'Pope Module',
|
17 |
+
$description = '',
|
18 |
+
$version = '',
|
19 |
+
$uri = '',
|
20 |
+
$author = '',
|
21 |
+
$author_uri = '',
|
22 |
+
$context = FALSE)
|
23 |
{
|
24 |
parent::define(
|
25 |
'photocrati-attach_to_post',
|
26 |
'Attach To Post',
|
27 |
'Provides the "Attach to Post" interface for displaying galleries and albums',
|
28 |
'0.18',
|
29 |
+
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
30 |
+
'Imagely',
|
31 |
+
'https://www.imagely.com',
|
32 |
$context
|
33 |
);
|
34 |
|
102 |
|
103 |
function does_request_require_frame_communication()
|
104 |
{
|
105 |
+
return (strpos($_SERVER['REQUEST_URI'], 'attach_to_post') !== FALSE OR (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], 'attach_to_post') !== FALSE) OR array_key_exists('attach_to_post', $_REQUEST));
|
106 |
}
|
107 |
|
108 |
|
products/photocrati_nextgen/modules/attach_to_post/package.module.attach_to_post.php
CHANGED
@@ -356,7 +356,7 @@ class Mixin_Attach_To_Post extends Mixin
|
|
356 |
usort($display_types, array($this->object, '_display_type_list_sort'));
|
357 |
wp_enqueue_script('ngg_display_tab', $this->get_static_url('photocrati-attach_to_post#display_tab.js'), array('jquery', 'backbone', 'underscore.string', 'photocrati_ajax'));
|
358 |
$this->object->mark_script('ngg_display_tab');
|
359 |
-
wp_localize_script('ngg_display_tab', 'igw_data', array('displayed_gallery_preview_url' => $settings->gallery_preview_url, 'displayed_gallery' => $this->object->_displayed_gallery->get_entity(), 'sources' => $sources->get_all(), 'gallery_primary_key' => $gallery_mapper->get_primary_key_column(), 'galleries' => $gallery_mapper->find_all(), 'albums' => $album_mapper->find_all(), 'tags' => $tags, 'display_types' => $display_types, 'sec_token' => $security->get_request_token('nextgen_edit_displayed_gallery')->get_json(), 'image_primary_key' => $image_mapper->get_primary_key_column(), 'display_type_priority_base' => NGG_DISPLAY_PRIORITY_BASE, 'display_type_priority_step' => NGG_DISPLAY_PRIORITY_STEP, 'shortcode_ref' => isset($_REQUEST['ref']) ?
|
360 |
}
|
361 |
function enqueue_backend_resources()
|
362 |
{
|
356 |
usort($display_types, array($this->object, '_display_type_list_sort'));
|
357 |
wp_enqueue_script('ngg_display_tab', $this->get_static_url('photocrati-attach_to_post#display_tab.js'), array('jquery', 'backbone', 'underscore.string', 'photocrati_ajax'));
|
358 |
$this->object->mark_script('ngg_display_tab');
|
359 |
+
wp_localize_script('ngg_display_tab', 'igw_data', array('displayed_gallery_preview_url' => $settings->gallery_preview_url, 'displayed_gallery' => $this->object->_displayed_gallery->get_entity(), 'sources' => $sources->get_all(), 'gallery_primary_key' => $gallery_mapper->get_primary_key_column(), 'galleries' => $gallery_mapper->find_all(), 'albums' => $album_mapper->find_all(), 'tags' => $tags, 'display_types' => $display_types, 'sec_token' => $security->get_request_token('nextgen_edit_displayed_gallery')->get_json(), 'image_primary_key' => $image_mapper->get_primary_key_column(), 'display_type_priority_base' => NGG_DISPLAY_PRIORITY_BASE, 'display_type_priority_step' => NGG_DISPLAY_PRIORITY_STEP, 'shortcode_ref' => isset($_REQUEST['ref']) ? floatval($_REQUEST['ref']) : null, 'i18n' => array('sources' => __('Sources', 'nggallery'), 'optional' => __('(optional)', 'nggallery'), 'slug_tooltip' => __('Sets an SEO-friendly name to this gallery for URLs. Currently only in use by the Pro Lightbox', 'nggallery'), 'slug_label' => __('Slug', 'nggallery'), 'no_entities' => __('No entities to display for this source', 'nggallery'), 'exclude_question' => __('Exlude?', 'nggallery'), 'select_gallery' => __('Select a gallery', 'nggallery'), 'galleries' => __('Galleries', 'nggallery'), 'albums' => __('Albums', 'nggallery'))));
|
360 |
}
|
361 |
function enqueue_backend_resources()
|
362 |
{
|
products/photocrati_nextgen/modules/cache/module.cache.php
CHANGED
@@ -4,16 +4,23 @@ class M_Cache extends C_Base_Module
|
|
4 |
/**
|
5 |
* Defines the module name & version
|
6 |
*/
|
7 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
{
|
9 |
parent::define(
|
10 |
'photocrati-cache',
|
11 |
'Cache',
|
12 |
'Handles clearing of NextGen caches',
|
13 |
'0.2',
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
);
|
18 |
}
|
19 |
|
4 |
/**
|
5 |
* Defines the module name & version
|
6 |
*/
|
7 |
+
function define($id = 'pope-module',
|
8 |
+
$name = 'Pope Module',
|
9 |
+
$description = '',
|
10 |
+
$version = '',
|
11 |
+
$uri = '',
|
12 |
+
$author = '',
|
13 |
+
$author_uri = '',
|
14 |
+
$context = FALSE)
|
15 |
{
|
16 |
parent::define(
|
17 |
'photocrati-cache',
|
18 |
'Cache',
|
19 |
'Handles clearing of NextGen caches',
|
20 |
'0.2',
|
21 |
+
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
22 |
+
'Imagely',
|
23 |
+
'https://www.imagely.com'
|
24 |
);
|
25 |
}
|
26 |
|
products/photocrati_nextgen/modules/datamapper/module.datamapper.php
CHANGED
@@ -1,16 +1,23 @@
|
|
1 |
<?php
|
2 |
class M_DataMapper extends C_Base_Module
|
3 |
{
|
4 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
{
|
6 |
parent::define(
|
7 |
'photocrati-datamapper',
|
8 |
'DataMapper',
|
9 |
'Provides a database abstraction layer following the DataMapper pattern',
|
10 |
'0.10',
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
);
|
15 |
|
16 |
C_Photocrati_Installer::add_handler($this->module_id, 'C_Datamapper_Installer');
|
@@ -24,10 +31,10 @@ class M_DataMapper extends C_Base_Module
|
|
24 |
|
25 |
function _register_hooks()
|
26 |
{
|
27 |
-
add_filter('posts_request', array(
|
28 |
-
add_filter('posts_fields', array(
|
29 |
-
add_filter('posts_where', array(
|
30 |
-
add_filter('posts_groupby', array(
|
31 |
}
|
32 |
|
33 |
|
@@ -38,7 +45,7 @@ class M_DataMapper extends C_Base_Module
|
|
38 |
* @param WP_Query $wp_query
|
39 |
* @return string
|
40 |
*/
|
41 |
-
function set_custom_wp_query($sql,
|
42 |
{
|
43 |
if ($wp_query->get('datamapper')) {
|
44 |
|
@@ -64,7 +71,7 @@ class M_DataMapper extends C_Base_Module
|
|
64 |
* @param WP_Query $wp_query
|
65 |
* @return string
|
66 |
*/
|
67 |
-
function set_custom_wp_query_fields($fields,
|
68 |
{
|
69 |
if ($wp_query->get('datamapper')) {
|
70 |
if (($custom_fields = $wp_query->get('fields')) && $custom_fields != 'ids') {
|
@@ -82,7 +89,7 @@ class M_DataMapper extends C_Base_Module
|
|
82 |
* @param WP_Query $wp_query
|
83 |
* @return string
|
84 |
*/
|
85 |
-
function set_custom_wp_query_where($where,
|
86 |
{
|
87 |
if ($wp_query->get('datamapper')) {
|
88 |
$this->add_post_title_where_clauses($where, $wp_query);
|
@@ -99,7 +106,7 @@ class M_DataMapper extends C_Base_Module
|
|
99 |
* @param WP_Query $wp_query
|
100 |
* @return string
|
101 |
*/
|
102 |
-
function set_custom_wp_query_groupby($groupby,
|
103 |
{
|
104 |
$retval = $groupby;
|
105 |
$group_by_columns = $wp_query->get('group_by_columns');
|
1 |
<?php
|
2 |
class M_DataMapper extends C_Base_Module
|
3 |
{
|
4 |
+
function define($id = 'pope-module',
|
5 |
+
$name = 'Pope Module',
|
6 |
+
$description = '',
|
7 |
+
$version = '',
|
8 |
+
$uri = '',
|
9 |
+
$author = '',
|
10 |
+
$author_uri = '',
|
11 |
+
$context = FALSE)
|
12 |
{
|
13 |
parent::define(
|
14 |
'photocrati-datamapper',
|
15 |
'DataMapper',
|
16 |
'Provides a database abstraction layer following the DataMapper pattern',
|
17 |
'0.10',
|
18 |
+
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
19 |
+
'Imagely',
|
20 |
+
'https://www.imagely.com'
|
21 |
);
|
22 |
|
23 |
C_Photocrati_Installer::add_handler($this->module_id, 'C_Datamapper_Installer');
|
31 |
|
32 |
function _register_hooks()
|
33 |
{
|
34 |
+
add_filter('posts_request', array($this, 'set_custom_wp_query'), 50, 2);
|
35 |
+
add_filter('posts_fields', array($this, 'set_custom_wp_query_fields'), 50, 2);
|
36 |
+
add_filter('posts_where', array($this, 'set_custom_wp_query_where'), 50, 2);
|
37 |
+
add_filter('posts_groupby', array($this, 'set_custom_wp_query_groupby'), 50, 2);
|
38 |
}
|
39 |
|
40 |
|
45 |
* @param WP_Query $wp_query
|
46 |
* @return string
|
47 |
*/
|
48 |
+
function set_custom_wp_query($sql, $wp_query)
|
49 |
{
|
50 |
if ($wp_query->get('datamapper')) {
|
51 |
|
71 |
* @param WP_Query $wp_query
|
72 |
* @return string
|
73 |
*/
|
74 |
+
function set_custom_wp_query_fields($fields, $wp_query)
|
75 |
{
|
76 |
if ($wp_query->get('datamapper')) {
|
77 |
if (($custom_fields = $wp_query->get('fields')) && $custom_fields != 'ids') {
|
89 |
* @param WP_Query $wp_query
|
90 |
* @return string
|
91 |
*/
|
92 |
+
function set_custom_wp_query_where($where, $wp_query)
|
93 |
{
|
94 |
if ($wp_query->get('datamapper')) {
|
95 |
$this->add_post_title_where_clauses($where, $wp_query);
|
106 |
* @param WP_Query $wp_query
|
107 |
* @return string
|
108 |
*/
|
109 |
+
function set_custom_wp_query_groupby($groupby, $wp_query)
|
110 |
{
|
111 |
$retval = $groupby;
|
112 |
$group_by_columns = $wp_query->get('group_by_columns');
|
products/photocrati_nextgen/modules/datamapper/package.module.datamapper.php
CHANGED
@@ -1655,18 +1655,14 @@ class Mixin_DataMapper_Driver_Base extends Mixin
|
|
1655 |
$entity->{$key} = strval($value);
|
1656 |
}
|
1657 |
} else {
|
1658 |
-
if (preg_match("/decimal|numeric|double/i", $column_type)) {
|
1659 |
-
$entity->{$key} =
|
1660 |
} else {
|
1661 |
-
if (preg_match("/
|
1662 |
-
$entity->{$key} =
|
1663 |
} else {
|
1664 |
-
if (preg_match("/
|
1665 |
-
$entity->{$key} =
|
1666 |
-
} else {
|
1667 |
-
if (preg_match("/bool/i", $column_type)) {
|
1668 |
-
$entity->{$key} = $value ? TRUE : FALSE;
|
1669 |
-
}
|
1670 |
}
|
1671 |
}
|
1672 |
}
|
1655 |
$entity->{$key} = strval($value);
|
1656 |
}
|
1657 |
} else {
|
1658 |
+
if (preg_match("/decimal|numeric|double|float/i", $column_type)) {
|
1659 |
+
$entity->{$key} = floatval($value);
|
1660 |
} else {
|
1661 |
+
if (preg_match("/int/i", $column_type)) {
|
1662 |
+
$entity->{$key} = intval($value);
|
1663 |
} else {
|
1664 |
+
if (preg_match("/bool/i", $column_type)) {
|
1665 |
+
$entity->{$key} = $value ? TRUE : FALSE;
|
|
|
|
|
|
|
|
|
1666 |
}
|
1667 |
}
|
1668 |
}
|
products/photocrati_nextgen/modules/dynamic_stylesheet/module.dynamic_stylesheet.php
CHANGED
@@ -11,16 +11,23 @@ if (!defined('NGG_INLINE_DYNAMIC_CSS')) define('NGG_INLINE_DYNAMIC_CSS', TRUE);
|
|
11 |
|
12 |
class M_Dynamic_Stylesheet extends C_Base_Module
|
13 |
{
|
14 |
-
function define($
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
{
|
16 |
parent::define(
|
17 |
'photocrati-dynamic_stylesheet',
|
18 |
'Dynamic Stylesheet',
|
19 |
'Provides the ability to generate and enqueue a dynamic stylesheet',
|
20 |
'0.4',
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
$context
|
25 |
);
|
26 |
|
11 |
|
12 |
class M_Dynamic_Stylesheet extends C_Base_Module
|
13 |
{
|
14 |
+
function define($id = 'pope-module',
|
15 |
+
$name = 'Pope Module',
|
16 |
+
$description = '',
|
17 |
+
$version = '',
|
18 |
+
$uri = '',
|
19 |
+
$author = '',
|
20 |
+
$author_uri = '',
|
21 |
+
$context = FALSE)
|
22 |
{
|
23 |
parent::define(
|
24 |
'photocrati-dynamic_stylesheet',
|
25 |
'Dynamic Stylesheet',
|
26 |
'Provides the ability to generate and enqueue a dynamic stylesheet',
|
27 |
'0.4',
|
28 |
+
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
29 |
+
'Imagely',
|
30 |
+
'https://www.imagely.com',
|
31 |
$context
|
32 |
);
|
33 |
|
products/photocrati_nextgen/modules/dynamic_thumbnails/module.dynamic_thumbnails.php
CHANGED
@@ -7,16 +7,23 @@
|
|
7 |
***/
|
8 |
class M_Dynamic_Thumbnails extends C_Base_Module
|
9 |
{
|
10 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
{
|
12 |
parent::define(
|
13 |
'photocrati-dynamic_thumbnails',
|
14 |
'Dynamic Thumbnails',
|
15 |
'Adds support for dynamic thumbnails',
|
16 |
'0.7',
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
);
|
21 |
|
22 |
C_Photocrati_Installer::add_handler($this->module_id, 'C_Dynamic_Thumbnails_Installer');
|
7 |
***/
|
8 |
class M_Dynamic_Thumbnails extends C_Base_Module
|
9 |
{
|
10 |
+
function define($id = 'pope-module',
|
11 |
+
$name = 'Pope Module',
|
12 |
+
$description = '',
|
13 |
+
$version = '',
|
14 |
+
$uri = '',
|
15 |
+
$author = '',
|
16 |
+
$author_uri = '',
|
17 |
+
$context = FALSE)
|
18 |
{
|
19 |
parent::define(
|
20 |
'photocrati-dynamic_thumbnails',
|
21 |
'Dynamic Thumbnails',
|
22 |
'Adds support for dynamic thumbnails',
|
23 |
'0.7',
|
24 |
+
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
25 |
+
'Imagely',
|
26 |
+
'https://www.imagely.com'
|
27 |
);
|
28 |
|
29 |
C_Photocrati_Installer::add_handler($this->module_id, 'C_Dynamic_Thumbnails_Installer');
|
products/photocrati_nextgen/modules/frame_communication/module.frame_communication.php
CHANGED
@@ -9,16 +9,23 @@
|
|
9 |
|
10 |
class M_Frame_Communication extends C_Base_Module
|
11 |
{
|
12 |
-
function define($
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
{
|
14 |
parent::define(
|
15 |
'photocrati-frame_communication',
|
16 |
'Frame/iFrame Inter-Communication',
|
17 |
'Provides a means for HTML frames to share server-side events with each other',
|
18 |
'0.5',
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
$context
|
23 |
);
|
24 |
|
9 |
|
10 |
class M_Frame_Communication extends C_Base_Module
|
11 |
{
|
12 |
+
function define($id = 'pope-module',
|
13 |
+
$name = 'Pope Module',
|
14 |
+
$description = '',
|
15 |
+
$version = '',
|
16 |
+
$uri = '',
|
17 |
+
$author = '',
|
18 |
+
$author_uri = '',
|
19 |
+
$context = FALSE)
|
20 |
{
|
21 |
parent::define(
|
22 |
'photocrati-frame_communication',
|
23 |
'Frame/iFrame Inter-Communication',
|
24 |
'Provides a means for HTML frames to share server-side events with each other',
|
25 |
'0.5',
|
26 |
+
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
27 |
+
'Imagely',
|
28 |
+
'https://www.imagely.com',
|
29 |
$context
|
30 |
);
|
31 |
|
products/photocrati_nextgen/modules/fs/module.fs.php
CHANGED
@@ -6,16 +6,23 @@
|
|
6 |
*/
|
7 |
class M_Fs extends C_Base_Module
|
8 |
{
|
9 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
{
|
11 |
parent::define(
|
12 |
'photocrati-fs',
|
13 |
'Filesystem',
|
14 |
'Provides a filesystem abstraction layer for Pope modules',
|
15 |
'0.6',
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
);
|
20 |
}
|
21 |
|
6 |
*/
|
7 |
class M_Fs extends C_Base_Module
|
8 |
{
|
9 |
+
function define($id = 'pope-module',
|
10 |
+
$name = 'Pope Module',
|
11 |
+
$description = '',
|
12 |
+
$version = '',
|
13 |
+
$uri = '',
|
14 |
+
$author = '',
|
15 |
+
$author_uri = '',
|
16 |
+
$context = FALSE)
|
17 |
{
|
18 |
parent::define(
|
19 |
'photocrati-fs',
|
20 |
'Filesystem',
|
21 |
'Provides a filesystem abstraction layer for Pope modules',
|
22 |
'0.6',
|
23 |
+
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
24 |
+
'Imagely',
|
25 |
+
'https://www.imagely.com'
|
26 |
);
|
27 |
}
|
28 |
|
products/photocrati_nextgen/modules/i18n/lang/nggallery-sv_SE.po
CHANGED
@@ -1832,10 +1832,10 @@ msgstr "och katalogen med miniatyrer"
|
|
1832 |
msgid "with permission 777 manually !"
|
1833 |
msgstr "med rättigheterna 777 manuellt!"
|
1834 |
|
1835 |
-
#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:
|
1836 |
#, php-format
|
1837 |
-
msgid "Gallery
|
1838 |
-
msgstr "
|
1839 |
|
1840 |
#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:122
|
1841 |
#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:692
|
1832 |
msgid "with permission 777 manually !"
|
1833 |
msgstr "med rättigheterna 777 manuellt!"
|
1834 |
|
1835 |
+
#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:121
|
1836 |
#, php-format
|
1837 |
+
msgid "Gallery successfully created. <a href=\"%s\" target=\"_blank\">Manage gallery</a>"
|
1838 |
+
msgstr ""
|
1839 |
|
1840 |
#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:122
|
1841 |
#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:692
|
products/photocrati_nextgen/modules/i18n/lang/nggallery.po
CHANGED
@@ -1849,9 +1849,9 @@ msgstr ""
|
|
1849 |
msgid "with permission 777 manually !"
|
1850 |
msgstr ""
|
1851 |
|
1852 |
-
#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:
|
1853 |
#, php-format
|
1854 |
-
msgid "Gallery
|
1855 |
msgstr ""
|
1856 |
|
1857 |
#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:122
|
1849 |
msgid "with permission 777 manually !"
|
1850 |
msgstr ""
|
1851 |
|
1852 |
+
#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:121
|
1853 |
#, php-format
|
1854 |
+
msgid "Gallery successfully created. <a href=\"%s\" target=\"_blank\">Manage gallery</a>"
|
1855 |
msgstr ""
|
1856 |
|
1857 |
#: products/photocrati_nextgen/modules/ngglegacy/admin/functions.php:122
|
products/photocrati_nextgen/modules/i18n/module.i18n.php
CHANGED
@@ -7,7 +7,14 @@
|
|
7 |
***/
|
8 |
class M_I18N extends C_Base_Module
|
9 |
{
|
10 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
{
|
12 |
parent::define(
|
13 |
'photocrati-i18n',
|
@@ -15,7 +22,7 @@ class M_I18N extends C_Base_Module
|
|
15 |
"Adds I18N resources and methods",
|
16 |
'0.3',
|
17 |
'https://www.imagely.com/languages/',
|
18 |
-
'
|
19 |
'https://www.imagely.com'
|
20 |
);
|
21 |
}
|
7 |
***/
|
8 |
class M_I18N extends C_Base_Module
|
9 |
{
|
10 |
+
function define($id = 'pope-module',
|
11 |
+
$name = 'Pope Module',
|
12 |
+
$description = '',
|
13 |
+
$version = '',
|
14 |
+
$uri = '',
|
15 |
+
$author = '',
|
16 |
+
$author_uri = '',
|
17 |
+
$context = FALSE)
|
18 |
{
|
19 |
parent::define(
|
20 |
'photocrati-i18n',
|
22 |
"Adds I18N resources and methods",
|
23 |
'0.3',
|
24 |
'https://www.imagely.com/languages/',
|
25 |
+
'Imagely',
|
26 |
'https://www.imagely.com'
|
27 |
);
|
28 |
}
|
products/photocrati_nextgen/modules/lightbox/module.lightbox.php
CHANGED
@@ -10,15 +10,22 @@ define('NGG_LIGHTBOX_OPTIONS_SLUG', 'ngg_lightbox_options');
|
|
10 |
|
11 |
class M_Lightbox extends C_Base_Module
|
12 |
{
|
13 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
{
|
15 |
parent::define(
|
16 |
'photocrati-lightbox',
|
17 |
'Lightbox',
|
18 |
"Provides integration with several JavaScript lightbox effect libraries",
|
19 |
'0.17',
|
20 |
-
'
|
21 |
-
'
|
22 |
'https://www.imagely.com'
|
23 |
);
|
24 |
}
|
10 |
|
11 |
class M_Lightbox 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-lightbox',
|
24 |
'Lightbox',
|
25 |
"Provides integration with several JavaScript lightbox effect libraries",
|
26 |
'0.17',
|
27 |
+
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
28 |
+
'Imagely',
|
29 |
'https://www.imagely.com'
|
30 |
);
|
31 |
}
|
products/photocrati_nextgen/modules/mvc/module.mvc.php
CHANGED
@@ -14,16 +14,23 @@
|
|
14 |
|
15 |
class M_MVC extends C_Base_Module
|
16 |
{
|
17 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
{
|
19 |
parent::define(
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
);
|
28 |
|
29 |
C_NextGen_Settings::get_instance()->add_option_handler('C_Mvc_Option_Handler', array(
|
14 |
|
15 |
class M_MVC extends C_Base_Module
|
16 |
{
|
17 |
+
function define($id = 'pope-module',
|
18 |
+
$name = 'Pope Module',
|
19 |
+
$description = '',
|
20 |
+
$version = '',
|
21 |
+
$uri = '',
|
22 |
+
$author = '',
|
23 |
+
$author_uri = '',
|
24 |
+
$context = FALSE)
|
25 |
{
|
26 |
parent::define(
|
27 |
+
'photocrati-mvc',
|
28 |
+
'MVC Framework',
|
29 |
+
'Provides an MVC architecture for the plugin to use',
|
30 |
+
'0.8',
|
31 |
+
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery',
|
32 |
+
'Imagely',
|
33 |
+
'https://www.imagely.com'
|
34 |
);
|
35 |
|
36 |
C_NextGen_Settings::get_instance()->add_option_handler('C_Mvc_Option_Handler', array(
|
products/photocrati_nextgen/modules/nextgen_addgallery_page/module.nextgen_addgallery_page.php
CHANGED
@@ -9,7 +9,14 @@ define('NGG_ADD_GALLERY_SLUG', 'ngg_addgallery');
|
|
9 |
|
10 |
class M_NextGen_AddGallery_Page extends C_Base_Module
|
11 |
{
|
12 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
{
|
14 |
parent::define(
|
15 |
'photocrati-nextgen_addgallery_page',
|
@@ -17,7 +24,7 @@ class M_NextGen_AddGallery_Page extends C_Base_Module
|
|
17 |
'Provides admin page for adding a gallery and uploading images',
|
18 |
'0.9',
|
19 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
20 |
-
'
|
21 |
'https://www.imagely.com'
|
22 |
);
|
23 |
}
|
9 |
|
10 |
class M_NextGen_AddGallery_Page extends C_Base_Module
|
11 |
{
|
12 |
+
function define($id = 'pope-module',
|
13 |
+
$name = 'Pope Module',
|
14 |
+
$description = '',
|
15 |
+
$version = '',
|
16 |
+
$uri = '',
|
17 |
+
$author = '',
|
18 |
+
$author_uri = '',
|
19 |
+
$context = FALSE)
|
20 |
{
|
21 |
parent::define(
|
22 |
'photocrati-nextgen_addgallery_page',
|
24 |
'Provides admin page for adding a gallery and uploading images',
|
25 |
'0.9',
|
26 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
27 |
+
'Imagely',
|
28 |
'https://www.imagely.com'
|
29 |
);
|
30 |
}
|
products/photocrati_nextgen/modules/nextgen_admin/module.nextgen_admin.php
CHANGED
@@ -13,16 +13,23 @@ class M_NextGen_Admin extends C_Base_Module
|
|
13 |
/**
|
14 |
* Defines the module
|
15 |
*/
|
16 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
{
|
18 |
parent::define(
|
19 |
'photocrati-nextgen_admin',
|
20 |
'NextGEN Administration',
|
21 |
'Provides a framework for adding Administration pages',
|
22 |
'0.16',
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
);
|
27 |
|
28 |
C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Admin_Installer');
|
@@ -105,24 +112,110 @@ class M_NextGen_Admin extends C_Base_Module
|
|
105 |
$notices = C_Admin_Notification_Manager::get_instance();
|
106 |
add_action('init', array($notices, 'serve_ajax_request'));
|
107 |
add_action('admin_footer', array($notices, 'enqueue_scripts'));
|
108 |
-
add_action('
|
109 |
-
|
110 |
-
|
|
|
|
|
|
|
|
|
111 |
|
112 |
-
|
113 |
-
$php_id = PHP_VERSION_ID;
|
114 |
-
}
|
115 |
-
else {
|
116 |
-
$version = explode('.', PHP_VERSION);
|
117 |
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
}
|
125 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
function define_routes($router)
|
127 |
{
|
128 |
// TODO: Why is this in the nextgen-admin module? Shouldn't it be in the other options module?
|
13 |
/**
|
14 |
* Defines the module
|
15 |
*/
|
16 |
+
function define($id = 'pope-module',
|
17 |
+
$name = 'Pope Module',
|
18 |
+
$description = '',
|
19 |
+
$version = '',
|
20 |
+
$uri = '',
|
21 |
+
$author = '',
|
22 |
+
$author_uri = '',
|
23 |
+
$context = FALSE)
|
24 |
{
|
25 |
parent::define(
|
26 |
'photocrati-nextgen_admin',
|
27 |
'NextGEN Administration',
|
28 |
'Provides a framework for adding Administration pages',
|
29 |
'0.16',
|
30 |
+
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
31 |
+
'Imagely',
|
32 |
+
'https://www.imagely.com'
|
33 |
);
|
34 |
|
35 |
C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Admin_Installer');
|
112 |
$notices = C_Admin_Notification_Manager::get_instance();
|
113 |
add_action('init', array($notices, 'serve_ajax_request'));
|
114 |
add_action('admin_footer', array($notices, 'enqueue_scripts'));
|
115 |
+
add_action('do_ngg_notices', array($notices, 'render'));
|
116 |
+
add_action('ngg_created_new_gallery', array($this, 'set_review_notice_flag'));
|
117 |
+
add_action('ngg_created_new_gallery', get_class().'::update_gallery_count_setting');
|
118 |
+
add_action('ngg_delete_gallery', get_class().'::update_gallery_count_setting');
|
119 |
+
if (!self::is_ngg_legacy_page()) {
|
120 |
+
add_action('all_admin_notices', get_class().'::emit_do_notices_action');
|
121 |
+
}
|
122 |
|
123 |
+
$notices = C_Admin_Notification_Manager::get_instance();
|
|
|
|
|
|
|
|
|
124 |
|
125 |
+
$php_id = 0;
|
126 |
+
|
127 |
+
if (defined('PHP_VERSION_ID')) {
|
128 |
+
$php_id = PHP_VERSION_ID;
|
129 |
+
}
|
130 |
+
else {
|
131 |
+
$version = explode('.', PHP_VERSION);
|
132 |
+
|
133 |
+
$php_id = ($version[0] * 10000 + $version[1] * 100 + $version[2]);
|
134 |
+
}
|
135 |
+
|
136 |
+
if ($php_id < 50300) {
|
137 |
+
$notices->add("ngg_php52_deprecation", array("message" => __('PHP 5.2 will be deprecated in a future version of NextGEN. Please upgrade your PHP installation to 5.3 or above.', 'nggallery')));
|
138 |
+
}
|
139 |
+
|
140 |
+
// Add review notices
|
141 |
+
$review_notice_1 = new C_Review_Notice(array(
|
142 |
+
'name' => 'review_level_1',
|
143 |
+
'range' => array('min' => 3, 'max' => 8),
|
144 |
+
'follows' => '')
|
145 |
+
);
|
146 |
+
$review_notice_2 = new C_Review_Notice(array(
|
147 |
+
'name' => 'review_level_2',
|
148 |
+
'range' => array('min' => 10, 'max' => 18),
|
149 |
+
'follows' => &$review_notice_1)
|
150 |
+
);
|
151 |
+
$review_notice_3 = new C_Review_Notice(array(
|
152 |
+
'name' => 'review_level_3',
|
153 |
+
'range' => array('min' => 20, 'max' => PHP_INT_MAX),
|
154 |
+
'follows' => &$review_notice_2)
|
155 |
+
);
|
156 |
+
$notices->add($review_notice_1->get_name(), $review_notice_1);
|
157 |
+
$notices->add($review_notice_2->get_name(), $review_notice_2);
|
158 |
+
$notices->add($review_notice_3->get_name(), $review_notice_3);
|
159 |
}
|
160 |
|
161 |
+
/**
|
162 |
+
* Used to determine if the current request is for a NGG legacy page
|
163 |
+
* @return bool
|
164 |
+
*/
|
165 |
+
static function is_ngg_legacy_page()
|
166 |
+
{
|
167 |
+
return (
|
168 |
+
is_admin() &&
|
169 |
+
isset($_REQUEST['page']) &&
|
170 |
+
in_array($_REQUEST['page'], array(
|
171 |
+
'nggallery-manage-gallery',
|
172 |
+
'nggallery-manage-album',
|
173 |
+
'nggallery-tags',
|
174 |
+
'manage-galleries'
|
175 |
+
))
|
176 |
+
);
|
177 |
+
}
|
178 |
+
|
179 |
+
/**
|
180 |
+
* Emits the 'do_ngg_notices' action
|
181 |
+
* Used by the notification manager to render all notices
|
182 |
+
*/
|
183 |
+
static function emit_do_notices_action()
|
184 |
+
{
|
185 |
+
if (!did_action('do_ngg_notices')) {
|
186 |
+
do_action('do_ngg_notices');
|
187 |
+
}
|
188 |
+
}
|
189 |
+
|
190 |
+
/**
|
191 |
+
* We do not want to suddenly ask users for a review when they have upgraded. Instead we will wait for a new
|
192 |
+
* gallery to be created and then will we also consider displaying reviews if the gallery count is within range.
|
193 |
+
*/
|
194 |
+
function set_review_notice_flag()
|
195 |
+
{
|
196 |
+
$settings = C_NextGen_Settings::get_instance();
|
197 |
+
if (!$settings->get('gallery_created_after_reviews_introduced'))
|
198 |
+
$settings->set('gallery_created_after_reviews_introduced', TRUE);
|
199 |
+
$settings->save();
|
200 |
+
}
|
201 |
+
|
202 |
+
/**
|
203 |
+
* Review notifications are pegged to run only when the current gallery count is within a certain range. This
|
204 |
+
* updates the 'gallery_count' setting when galleries have been created or deleted.
|
205 |
+
*/
|
206 |
+
static function update_gallery_count_setting()
|
207 |
+
{
|
208 |
+
$settings = C_NextGen_Settings::get_instance();
|
209 |
+
$mapper = C_Gallery_Mapper::get_instance();
|
210 |
+
$original_cache_setting = $mapper->__use_cache;
|
211 |
+
$mapper->_use_cache = FALSE;
|
212 |
+
$gallery_count = C_Gallery_Mapper::get_instance()->count();
|
213 |
+
$mapper->_use_cache = $original_cache_setting;
|
214 |
+
$settings->set('gallery_count', $gallery_count);
|
215 |
+
$settings->save();
|
216 |
+
return $gallery_count;
|
217 |
+
}
|
218 |
+
|
219 |
function define_routes($router)
|
220 |
{
|
221 |
// TODO: Why is this in the nextgen-admin module? Shouldn't it be in the other options module?
|
products/photocrati_nextgen/modules/nextgen_admin/package.module.nextgen_admin.php
CHANGED
@@ -74,10 +74,109 @@ class A_NextGen_Admin_Default_Pages extends Mixin
|
|
74 |
return $this->call_parent('setup');
|
75 |
}
|
76 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
class C_Admin_Notification_Wrapper
|
78 |
{
|
79 |
-
|
80 |
-
|
81 |
function __construct($name, $data)
|
82 |
{
|
83 |
$this->_name = $name;
|
@@ -98,9 +197,12 @@ class C_Admin_Notification_Wrapper
|
|
98 |
}
|
99 |
class C_Admin_Notification_Manager
|
100 |
{
|
101 |
-
|
102 |
-
|
103 |
-
|
|
|
|
|
|
|
104 |
static $_instance = NULL;
|
105 |
static function get_instance()
|
106 |
{
|
@@ -154,25 +256,55 @@ class C_Admin_Notification_Manager
|
|
154 |
}
|
155 |
return $retval;
|
156 |
}
|
157 |
-
function dismiss($name)
|
158 |
{
|
159 |
-
$
|
160 |
if ($handler = $this->get_handler_instance($name)) {
|
161 |
$has_method = method_exists($handler, 'is_dismissable');
|
162 |
if ($has_method && $handler->is_dismissable() || !$has_method) {
|
163 |
-
$
|
164 |
-
|
165 |
-
|
166 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
}
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
$
|
172 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
}
|
|
|
|
|
174 |
}
|
175 |
-
return $
|
176 |
}
|
177 |
function get_handler_instance($name)
|
178 |
{
|
@@ -201,14 +333,19 @@ class C_Admin_Notification_Manager
|
|
201 |
{
|
202 |
$retval = array('failure' => TRUE);
|
203 |
if (isset($_REQUEST['ngg_dismiss_notice'])) {
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
|
|
|
|
|
|
|
|
|
|
208 |
} else {
|
209 |
$retval['msg'] = __('Not a valid notice name', 'nggallery');
|
210 |
}
|
211 |
-
|
212 |
echo json_encode($retval);
|
213 |
throw new E_Clean_Exit();
|
214 |
}
|
@@ -220,7 +357,8 @@ class C_Admin_Notification_Manager
|
|
220 |
// Does the handler want to render?
|
221 |
$has_method = method_exists($handler, 'is_renderable');
|
222 |
if ($has_method && $handler->is_renderable() || !$has_method) {
|
223 |
-
$
|
|
|
224 |
$retval = $view->render(TRUE);
|
225 |
$this->_displayed_notice = TRUE;
|
226 |
}
|
@@ -351,62 +489,6 @@ class Mixin_Form_Field_Generators extends Mixin
|
|
351 |
{
|
352 |
return $this->object->render_partial('photocrati-nextgen_admin#field_generator/nextgen_settings_field_color', array('display_type_name' => $display_type->name, 'name' => $name, 'label' => $label, 'value' => $value, 'text' => $text, 'hidden' => $hidden), True);
|
353 |
}
|
354 |
-
function _render_ajax_pagination_field($display_type)
|
355 |
-
{
|
356 |
-
return $this->object->_render_radio_field($display_type, 'ajax_pagination', __('Enable AJAX pagination', 'nggallery'), isset($display_type->settings['ajax_pagination']) ? $display_type->settings['ajax_pagination'] : FALSE);
|
357 |
-
}
|
358 |
-
function _render_thumbnail_override_settings_field($display_type)
|
359 |
-
{
|
360 |
-
$hidden = !(isset($display_type->settings['override_thumbnail_settings']) ? $display_type->settings['override_thumbnail_settings'] : FALSE);
|
361 |
-
$override_field = $this->_render_radio_field($display_type, 'override_thumbnail_settings', __('Override thumbnail settings', 'nggallery'), isset($display_type->settings['override_thumbnail_settings']) ? $display_type->settings['override_thumbnail_settings'] : FALSE, __("This does not affect existing thumbnails; overriding the thumbnail settings will create an additional set of thumbnails. To change the size of existing thumbnails please visit 'Manage Galleries' and choose 'Create new thumbnails' for all images in the gallery.", 'nggallery'));
|
362 |
-
$dimensions_field = $this->object->render_partial('photocrati-nextgen_admin#field_generator/thumbnail_settings', array('display_type_name' => $display_type->name, 'name' => 'thumbnail_dimensions', 'label' => __('Thumbnail dimensions', 'nggallery'), 'thumbnail_width' => isset($display_type->settings['thumbnail_width']) ? intval($display_type->settings['thumbnail_width']) : 0, 'thumbnail_height' => isset($display_type->settings['thumbnail_height']) ? intval($display_type->settings['thumbnail_height']) : 0, 'hidden' => $hidden ? 'hidden' : '', 'text' => ''), TRUE);
|
363 |
-
/*
|
364 |
-
$qualities = array();
|
365 |
-
for ($i = 100; $i > 40; $i -= 5) { $qualities[$i] = "{$i}%"; }
|
366 |
-
$quality_field = $this->_render_select_field(
|
367 |
-
$display_type,
|
368 |
-
'thumbnail_quality',
|
369 |
-
__('Thumbnail quality', 'nggallery'),
|
370 |
-
$qualities,
|
371 |
-
isset($display_type->settings['thumbnail_quality']) ? $display_type->settings['thumbnail_quality'] : 100,
|
372 |
-
'',
|
373 |
-
$hidden
|
374 |
-
);
|
375 |
-
*/
|
376 |
-
$crop_field = $this->_render_radio_field($display_type, 'thumbnail_crop', __('Thumbnail crop', 'nggallery'), isset($display_type->settings['thumbnail_crop']) ? $display_type->settings['thumbnail_crop'] : FALSE, '', $hidden);
|
377 |
-
/*
|
378 |
-
$watermark_field = $this->_render_radio_field(
|
379 |
-
$display_type,
|
380 |
-
'thumbnail_watermark',
|
381 |
-
__('Thumbnail watermark', 'nggallery'),
|
382 |
-
isset($display_type->settings['thumbnail_watermark']) ? $display_type->settings['thumbnail_watermark'] : FALSE,
|
383 |
-
'',
|
384 |
-
$hidden
|
385 |
-
);
|
386 |
-
*/
|
387 |
-
$everything = $override_field . $dimensions_field . $crop_field;
|
388 |
-
return $everything;
|
389 |
-
}
|
390 |
-
/**
|
391 |
-
* Renders the thumbnail override settings field(s)
|
392 |
-
*
|
393 |
-
* @param C_Display_Type $display_type
|
394 |
-
* @return string
|
395 |
-
*/
|
396 |
-
function _render_image_override_settings_field($display_type)
|
397 |
-
{
|
398 |
-
$hidden = !(isset($display_type->settings['override_image_settings']) ? $display_type->settings['override_image_settings'] : FALSE);
|
399 |
-
$override_field = $this->_render_radio_field($display_type, 'override_image_settings', __('Override image settings', 'nggallery'), isset($display_type->settings['override_image_settings']) ? $display_type->settings['override_image_settings'] : 0, __('Overriding the image settings will create an additional set of images', 'nggallery'));
|
400 |
-
$qualities = array();
|
401 |
-
for ($i = 100; $i > 40; $i -= 5) {
|
402 |
-
$qualities[$i] = "{$i}%";
|
403 |
-
}
|
404 |
-
$quality_field = $this->_render_select_field($display_type, 'image_quality', __('Image quality', 'nggallery'), $qualities, $display_type->settings['image_quality'], '', $hidden);
|
405 |
-
$crop_field = $this->_render_radio_field($display_type, 'image_crop', __('Image crop', 'nggallery'), $display_type->settings['image_crop'], '', $hidden);
|
406 |
-
$watermark_field = $this->_render_radio_field($display_type, 'image_watermark', __('Image watermark', 'nggallery'), $display_type->settings['image_watermark'], '', $hidden);
|
407 |
-
$everything = $override_field . $quality_field . $crop_field . $watermark_field;
|
408 |
-
return $everything;
|
409 |
-
}
|
410 |
/**
|
411 |
* Renders a pair of fields for width and width-units (px, em, etc)
|
412 |
*
|
@@ -621,7 +703,7 @@ if (!class_exists('C_NextGen_Admin_Installer')) {
|
|
621 |
class C_NextGen_Admin_Page_Controller extends C_MVC_Controller
|
622 |
{
|
623 |
static $_instances = array();
|
624 |
-
static function
|
625 |
{
|
626 |
if (!isset(self::$_instances[$context])) {
|
627 |
$klass = get_class();
|
74 |
return $this->call_parent('setup');
|
75 |
}
|
76 |
}
|
77 |
+
class C_Review_Notice
|
78 |
+
{
|
79 |
+
function __construct($params = array())
|
80 |
+
{
|
81 |
+
$this->_data['name'] = $params['name'];
|
82 |
+
$this->_data['range'] = $params['range'];
|
83 |
+
$this->_data['follows'] = $params['follows'];
|
84 |
+
}
|
85 |
+
function get_name()
|
86 |
+
{
|
87 |
+
return $this->_data['name'];
|
88 |
+
}
|
89 |
+
function get_gallery_count()
|
90 |
+
{
|
91 |
+
// Get the total # of galleries if we don't have them
|
92 |
+
$settings = C_NextGen_Settings::get_instance();
|
93 |
+
$count = $settings->get('gallery_count', FALSE);
|
94 |
+
if (!$count) {
|
95 |
+
$count = M_NextGen_Admin::update_gallery_count_setting();
|
96 |
+
}
|
97 |
+
return $count;
|
98 |
+
}
|
99 |
+
function get_range()
|
100 |
+
{
|
101 |
+
return $this->_data['range'];
|
102 |
+
}
|
103 |
+
function is_renderable()
|
104 |
+
{
|
105 |
+
return ($this->is_on_dashboard() || $this->is_on_ngg_admin_page()) && $this->is_at_gallery_count() && $this->is_previous_notice_dismissed() && $this->gallery_created_flag_check();
|
106 |
+
}
|
107 |
+
function gallery_created_flag_check()
|
108 |
+
{
|
109 |
+
$settings = C_NextGen_Settings::get_instance();
|
110 |
+
return $settings->get('gallery_created_after_reviews_introduced');
|
111 |
+
}
|
112 |
+
function is_at_gallery_count()
|
113 |
+
{
|
114 |
+
$retval = FALSE;
|
115 |
+
$range = $this->_data['range'];
|
116 |
+
$count = $this->get_gallery_count();
|
117 |
+
$manager = C_Admin_Notification_Manager::get_instance();
|
118 |
+
// Determine if we match the current range
|
119 |
+
if ($count >= $range['min'] && $count <= $range['max']) {
|
120 |
+
$retval = TRUE;
|
121 |
+
}
|
122 |
+
// If the current number of galleries exceeds the parent notice's maximum we should dismiss the parent
|
123 |
+
if (!empty($this->_data['follows'])) {
|
124 |
+
$follows = $this->_data['follows'];
|
125 |
+
$parent_range = $follows->get_range();
|
126 |
+
if ($count > $parent_range['max'] && !$manager->is_dismissed($follows->get_name())) {
|
127 |
+
$manager->dismiss($follows->get_name(), 2);
|
128 |
+
}
|
129 |
+
}
|
130 |
+
return $retval;
|
131 |
+
}
|
132 |
+
function is_previous_notice_dismissed($level = FALSE)
|
133 |
+
{
|
134 |
+
$retval = FALSE;
|
135 |
+
$manager = C_Admin_Notification_Manager::get_instance();
|
136 |
+
if (empty($level)) {
|
137 |
+
$level = $this;
|
138 |
+
}
|
139 |
+
if (!empty($level->_data['follows'])) {
|
140 |
+
$parent = $level->_data['follows'];
|
141 |
+
$retval = $manager->is_dismissed($parent->get_name());
|
142 |
+
if (!$retval && !empty($parent->_data['follows'])) {
|
143 |
+
$retval = $this->is_previous_notice_dismissed($parent);
|
144 |
+
}
|
145 |
+
} else {
|
146 |
+
$retval = TRUE;
|
147 |
+
}
|
148 |
+
return $retval;
|
149 |
+
}
|
150 |
+
function is_on_dashboard()
|
151 |
+
{
|
152 |
+
return preg_match('#/wp-admin/?(index\\.php)?$#', $_SERVER['REQUEST_URI']) == TRUE;
|
153 |
+
}
|
154 |
+
function is_on_ngg_admin_page()
|
155 |
+
{
|
156 |
+
// Do not show this notification inside of the ATP popup
|
157 |
+
return (preg_match("/wp-admin.*(ngg|nextgen).*/", $_SERVER['REQUEST_URI']) || isset($_REQUEST['page']) && preg_match("/ngg|nextgen/", $_REQUEST['page'])) && strpos(strtolower($_SERVER['REQUEST_URI']), '&attach_to_post') == false;
|
158 |
+
}
|
159 |
+
function render()
|
160 |
+
{
|
161 |
+
$view = new C_MVC_View('photocrati-nextgen_admin#review_notice', array('number' => $this->get_gallery_count()));
|
162 |
+
return $view->render(TRUE);
|
163 |
+
}
|
164 |
+
function dismiss($code)
|
165 |
+
{
|
166 |
+
$retval = array('dismiss' => TRUE, 'persist' => TRUE, 'success' => TRUE, 'code' => $code, 'dismiss_code' => $code);
|
167 |
+
$manager = C_Admin_Notification_Manager::get_instance();
|
168 |
+
if ($code == 1 || $code == 3) {
|
169 |
+
$retval['review_level_1'] = $manager->dismiss('review_level_1', 2);
|
170 |
+
$retval['review_level_2'] = $manager->dismiss('review_level_2', 2);
|
171 |
+
$retval['review_level_3'] = $manager->dismiss('review_level_3', 2);
|
172 |
+
}
|
173 |
+
return $retval;
|
174 |
+
}
|
175 |
+
}
|
176 |
class C_Admin_Notification_Wrapper
|
177 |
{
|
178 |
+
public $_name;
|
179 |
+
public $_data;
|
180 |
function __construct($name, $data)
|
181 |
{
|
182 |
$this->_name = $name;
|
197 |
}
|
198 |
class C_Admin_Notification_Manager
|
199 |
{
|
200 |
+
public $_notifications = array();
|
201 |
+
public $_displayed_notice = FALSE;
|
202 |
+
public $_dismiss_url = NULL;
|
203 |
+
/**
|
204 |
+
* @var C_Admin_Notification_Manager
|
205 |
+
*/
|
206 |
static $_instance = NULL;
|
207 |
static function get_instance()
|
208 |
{
|
256 |
}
|
257 |
return $retval;
|
258 |
}
|
259 |
+
function dismiss($name, $dismiss_code = 1)
|
260 |
{
|
261 |
+
$response = array();
|
262 |
if ($handler = $this->get_handler_instance($name)) {
|
263 |
$has_method = method_exists($handler, 'is_dismissable');
|
264 |
if ($has_method && $handler->is_dismissable() || !$has_method) {
|
265 |
+
if (method_exists($handler, 'dismiss')) {
|
266 |
+
$response = $handler->dismiss($dismiss_code);
|
267 |
+
$response['handled'] = TRUE;
|
268 |
+
}
|
269 |
+
if (is_bool($response)) {
|
270 |
+
$response = array('dismiss' => $response);
|
271 |
+
}
|
272 |
+
// Set default key/values
|
273 |
+
if (!isset($response['handled'])) {
|
274 |
+
$response['handled'] = FALSE;
|
275 |
+
}
|
276 |
+
if (!isset($response['dismiss'])) {
|
277 |
+
$response['dismiss'] = TRUE;
|
278 |
+
}
|
279 |
+
if (!isset($response['persist'])) {
|
280 |
+
$response['persist'] = $response['dismiss'];
|
281 |
}
|
282 |
+
if (!isset($response['success'])) {
|
283 |
+
$response['success'] = $response['dismiss'];
|
284 |
+
}
|
285 |
+
if (!isset($response['code'])) {
|
286 |
+
$response['code'] = $dismiss_code;
|
287 |
+
}
|
288 |
+
if ($response['dismiss']) {
|
289 |
+
$settings = C_NextGen_Settings::get_instance();
|
290 |
+
$dismissed = $settings->get('dismissed_notifications', array());
|
291 |
+
if (!isset($dismissed[$name])) {
|
292 |
+
$dismissed[$name] = array();
|
293 |
+
}
|
294 |
+
$user_id = get_current_user_id();
|
295 |
+
$dismissed[$name][] = $user_id ? $user_id : 'unknown';
|
296 |
+
$settings->set('dismissed_notifications', $dismissed);
|
297 |
+
if ($response['persist']) {
|
298 |
+
$settings->save();
|
299 |
+
}
|
300 |
+
}
|
301 |
+
} else {
|
302 |
+
$response['error'] = __("Notice is not dismissible", 'nggallery');
|
303 |
}
|
304 |
+
} else {
|
305 |
+
$response['error'] = __("No handler defined for this notice", 'nggallery');
|
306 |
}
|
307 |
+
return $response;
|
308 |
}
|
309 |
function get_handler_instance($name)
|
310 |
{
|
333 |
{
|
334 |
$retval = array('failure' => TRUE);
|
335 |
if (isset($_REQUEST['ngg_dismiss_notice'])) {
|
336 |
+
if (!headers_sent()) {
|
337 |
+
header('Content-Type: application/json');
|
338 |
+
}
|
339 |
+
ob_start();
|
340 |
+
if (!isset($_REQUEST['code'])) {
|
341 |
+
$_REQUEST['code'] = 1;
|
342 |
+
}
|
343 |
+
if (isset($_REQUEST['name'])) {
|
344 |
+
$retval = $this->dismiss($_REQUEST['name'], intval($_REQUEST['code']));
|
345 |
} else {
|
346 |
$retval['msg'] = __('Not a valid notice name', 'nggallery');
|
347 |
}
|
348 |
+
ob_end_clean();
|
349 |
echo json_encode($retval);
|
350 |
throw new E_Clean_Exit();
|
351 |
}
|
357 |
// Does the handler want to render?
|
358 |
$has_method = method_exists($handler, 'is_renderable');
|
359 |
if ($has_method && $handler->is_renderable() || !$has_method) {
|
360 |
+
$show_dismiss_button = method_exists($handler, 'show_dismiss_button') ? $handler->show_dismiss_button() : method_exists($handler, 'is_dismissable') ? $handler->is_dismissable() : FALSE;
|
361 |
+
$view = new C_MVC_View('photocrati-nextgen_admin#admin_notice', array('css_class' => method_exists($handler, 'get_css_class') ? $handler->get_css_class() : 'updated', 'is_dismissable' => method_exists($handler, 'is_dismissable') ? $handler->is_dismissable() : FALSE, 'html' => method_exists($handler, 'render') ? $handler->render() : '', 'show_dismiss_button' => $show_dismiss_button, 'notice_name' => $name));
|
362 |
$retval = $view->render(TRUE);
|
363 |
$this->_displayed_notice = TRUE;
|
364 |
}
|
489 |
{
|
490 |
return $this->object->render_partial('photocrati-nextgen_admin#field_generator/nextgen_settings_field_color', array('display_type_name' => $display_type->name, 'name' => $name, 'label' => $label, 'value' => $value, 'text' => $text, 'hidden' => $hidden), True);
|
491 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
492 |
/**
|
493 |
* Renders a pair of fields for width and width-units (px, em, etc)
|
494 |
*
|
703 |
class C_NextGen_Admin_Page_Controller extends C_MVC_Controller
|
704 |
{
|
705 |
static $_instances = array();
|
706 |
+
static function get_instance($context = FALSE)
|
707 |
{
|
708 |
if (!isset(self::$_instances[$context])) {
|
709 |
$klass = get_class();
|
products/photocrati_nextgen/modules/nextgen_admin/static/admin_notices.js
CHANGED
@@ -1,11 +1,14 @@
|
|
1 |
jQuery(function($){
|
2 |
$('.ngg_admin_notice .dismiss').click(function(e){
|
3 |
-
|
|
|
|
|
|
|
4 |
|
5 |
var $notice = $(this).parents('.ngg_admin_notice');
|
6 |
var $notice_name = $notice.attr('data-notification-name');
|
7 |
if ($notice_name.length > 0) {
|
8 |
-
var url = ngg_dismiss_url+'&name='+$notice_name;
|
9 |
$.post(url, function(response){
|
10 |
if (typeof(response) != 'object') response = JSON.parse(response);
|
11 |
if (response.success) {
|
1 |
jQuery(function($){
|
2 |
$('.ngg_admin_notice .dismiss').click(function(e){
|
3 |
+
var $button = $(this);
|
4 |
+
var code = $button.data('dismiss-code');
|
5 |
+
if (!code) code = 1;
|
6 |
+
if ($button.attr('href') == '#') e.preventDefault();
|
7 |
|
8 |
var $notice = $(this).parents('.ngg_admin_notice');
|
9 |
var $notice_name = $notice.attr('data-notification-name');
|
10 |
if ($notice_name.length > 0) {
|
11 |
+
var url = ngg_dismiss_url+'&name='+$notice_name+'&code='+code;
|
12 |
$.post(url, function(response){
|
13 |
if (typeof(response) != 'object') response = JSON.parse(response);
|
14 |
if (response.success) {
|
products/photocrati_nextgen/modules/nextgen_admin/static/admin_notices.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(function(
|
1 |
+
jQuery(function(t){t(".ngg_admin_notice .dismiss").click(function(i){var n=t(this),a=n.data("dismiss-code");a||(a=1),"#"==n.attr("href")&&i.preventDefault();var e=t(this).parents(".ngg_admin_notice"),s=e.attr("data-notification-name");if(s.length>0){var c=ngg_dismiss_url+"&name="+s+"&code="+a;t.post(c,function(t){"object"!=typeof t&&(t=JSON.parse(t)),t.success?e.fadeOut():alert(t.msg)})}})});
|
products/photocrati_nextgen/modules/nextgen_admin/templates/admin_notice.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<div data-notification-name="<?php echo esc_attr($notice_name)?>" class="ngg_admin_notice <?php echo esc_attr($css_class)?>">
|
2 |
<p><?php echo $html ?></p>
|
3 |
-
<?php if ($
|
4 |
<p><a class='dismiss' href="#"><?php esc_html_e(__('Dismiss', 'nggallery')) ?></a></p>
|
5 |
<?php endif ?>
|
6 |
</div>
|
1 |
<div data-notification-name="<?php echo esc_attr($notice_name)?>" class="ngg_admin_notice <?php echo esc_attr($css_class)?>">
|
2 |
<p><?php echo $html ?></p>
|
3 |
+
<?php if ($show_dismiss_button): ?>
|
4 |
<p><a class='dismiss' href="#"><?php esc_html_e(__('Dismiss', 'nggallery')) ?></a></p>
|
5 |
<?php endif ?>
|
6 |
</div>
|
products/photocrati_nextgen/modules/nextgen_admin/templates/review_notice.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<p>
|
2 |
+
<?php
|
3 |
+
$review_1_anchor = 'href="https://wordpress.org/support/plugin/nextgen-gallery/reviews/?rate=5#new-post" target="_blank"';
|
4 |
+
$user = get_userdata(get_current_user_id());
|
5 |
+
echo sprintf(__("Hey <strong>%s</strong>, you've created %d NextGEN galleries! Awesome! Could I ask you to give us a 5-star rating really quickly on <a %s>WordPress.org</a>? It helps other WordPress users and motivates us to keep improving. You can also just send us feedback <a %s>here</a>. Thanks! ~ Erick Danzer (founder of Imagely/NextGEN Gallery", 'nggallery'),
|
6 |
+
$user->display_name,
|
7 |
+
$number,
|
8 |
+
$review_1_anchor,
|
9 |
+
'href="https://www.imagely.com/feedback/" target="_blank"'
|
10 |
+
);
|
11 |
+
?>
|
12 |
+
</p>
|
13 |
+
<p>
|
14 |
+
<a class='dismiss' data-dismiss-code="2" <?php echo $review_1_anchor; ?>><?php esc_html_e(__('Ok, you deserve it', 'nggallery')); ?></a>
|
15 |
+
| <a class='dismiss' data-dismiss-code="2" href="#"><?php esc_html_e(__('Nope, maybe later', 'nggallery')); ?></a>
|
16 |
+
| <a class='dismiss' data-dismiss-code="3" href="#"><?php esc_html_e(__('I already did', 'nggallery')); ?></a>
|
17 |
+
</p>
|
products/photocrati_nextgen/modules/nextgen_basic_album/module.nextgen_basic_album.php
CHANGED
@@ -12,7 +12,14 @@ define('NGG_BASIC_EXTENDED_ALBUM', 'photocrati-nextgen_basic_extended_album');
|
|
12 |
|
13 |
class M_NextGen_Basic_Album extends C_Base_Module
|
14 |
{
|
15 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
{
|
17 |
parent::define(
|
18 |
'photocrati-nextgen_basic_album',
|
@@ -20,7 +27,7 @@ class M_NextGen_Basic_Album extends C_Base_Module
|
|
20 |
"Provides support for NextGEN's Basic Album",
|
21 |
'0.17',
|
22 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
23 |
-
'
|
24 |
'https://www.imagely.com'
|
25 |
);
|
26 |
|
@@ -74,6 +81,7 @@ class M_NextGen_Basic_Album extends C_Base_Module
|
|
74 |
|
75 |
$this->get_registry()->add_adapter('I_MVC_View', 'A_NextGen_Album_Breadcrumbs');
|
76 |
$this->get_registry()->add_adapter('I_MVC_View', 'A_NextGen_Album_Descriptions');
|
|
|
77 |
}
|
78 |
|
79 |
|
@@ -168,6 +176,7 @@ class M_NextGen_Basic_Album extends C_Base_Module
|
|
168 |
return array(
|
169 |
'A_NextGen_Album_Breadcrumbs' => 'adapter.nextgen_album_breadcrumbs.php',
|
170 |
'A_NextGen_Album_Descriptions' => 'adapter.nextgen_album_descriptions.php',
|
|
|
171 |
'A_Nextgen_Basic_Album' => 'adapter.nextgen_basic_album.php',
|
172 |
'A_Nextgen_Basic_Album_Controller' => 'adapter.nextgen_basic_album_controller.php',
|
173 |
'A_Nextgen_Basic_Album_Mapper' => 'adapter.nextgen_basic_album_mapper.php',
|
@@ -182,7 +191,7 @@ class M_NextGen_Basic_Album extends C_Base_Module
|
|
182 |
|
183 |
class C_NextGen_Basic_Album_Installer extends C_Gallery_Display_Installer
|
184 |
{
|
185 |
-
function install()
|
186 |
{
|
187 |
$this->install_display_type(
|
188 |
NGG_BASIC_COMPACT_ALBUM, array(
|
12 |
|
13 |
class M_NextGen_Basic_Album extends C_Base_Module
|
14 |
{
|
15 |
+
function define($id = 'pope-module',
|
16 |
+
$name = 'Pope Module',
|
17 |
+
$description = '',
|
18 |
+
$version = '',
|
19 |
+
$uri = '',
|
20 |
+
$author = '',
|
21 |
+
$author_uri = '',
|
22 |
+
$context = FALSE)
|
23 |
{
|
24 |
parent::define(
|
25 |
'photocrati-nextgen_basic_album',
|
27 |
"Provides support for NextGEN's Basic Album",
|
28 |
'0.17',
|
29 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
30 |
+
'Imagely',
|
31 |
'https://www.imagely.com'
|
32 |
);
|
33 |
|
81 |
|
82 |
$this->get_registry()->add_adapter('I_MVC_View', 'A_NextGen_Album_Breadcrumbs');
|
83 |
$this->get_registry()->add_adapter('I_MVC_View', 'A_NextGen_Album_Descriptions');
|
84 |
+
$this->get_registry()->add_adapter('I_MVC_View', 'A_NextGen_Album_Child_Entities');
|
85 |
}
|
86 |
|
87 |
|
176 |
return array(
|
177 |
'A_NextGen_Album_Breadcrumbs' => 'adapter.nextgen_album_breadcrumbs.php',
|
178 |
'A_NextGen_Album_Descriptions' => 'adapter.nextgen_album_descriptions.php',
|
179 |
+
'A_NextGen_Album_Child_Entities' => 'adapter.nextgen_album_child_entities.php',
|
180 |
'A_Nextgen_Basic_Album' => 'adapter.nextgen_basic_album.php',
|
181 |
'A_Nextgen_Basic_Album_Controller' => 'adapter.nextgen_basic_album_controller.php',
|
182 |
'A_Nextgen_Basic_Album_Mapper' => 'adapter.nextgen_basic_album_mapper.php',
|
191 |
|
192 |
class C_NextGen_Basic_Album_Installer extends C_Gallery_Display_Installer
|
193 |
{
|
194 |
+
function install($reset = FALSE)
|
195 |
{
|
196 |
$this->install_display_type(
|
197 |
NGG_BASIC_COMPACT_ALBUM, array(
|
products/photocrati_nextgen/modules/nextgen_basic_album/package.module.nextgen_basic_album.php
CHANGED
@@ -189,6 +189,111 @@ class A_NextGen_Album_Breadcrumbs extends Mixin
|
|
189 |
return $view->render(TRUE);
|
190 |
}
|
191 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
/**
|
193 |
* Class A_NextGen_Album_Descriptions
|
194 |
* @mixin C_MVC_View
|
@@ -310,10 +415,6 @@ class A_NextGen_Basic_Album_Controller extends Mixin_NextGen_Basic_Pagination
|
|
310 |
*/
|
311 |
function index_action($displayed_gallery, $return = FALSE)
|
312 |
{
|
313 |
-
// Ensure that the open_gallery_in_lightbox setting is present
|
314 |
-
if (!array_key_exists('open_gallery_in_lightbox', $displayed_gallery->display_settings)) {
|
315 |
-
$displayed_gallery->display_settings['open_gallery_in_lightbox'] = 0;
|
316 |
-
}
|
317 |
$display_settings = $displayed_gallery->display_settings;
|
318 |
// We need to fetch the album containers selected in the Attach
|
319 |
// to Post interface. We need to do this, because once we fetch the
|
@@ -376,22 +477,26 @@ class A_NextGen_Basic_Album_Controller extends Mixin_NextGen_Basic_Pagination
|
|
376 |
// If there are entities to be displayed
|
377 |
if ($entities) {
|
378 |
$pagination_result = $this->object->create_pagination($current_page, $displayed_gallery->get_entity_count(), $display_settings['galleries_per_page'], urldecode($this->object->param('ajax_pagination_referrer')));
|
|
|
|
|
|
|
|
|
379 |
if (!empty($display_settings['template']) && $display_settings['template'] != 'default') {
|
380 |
// Add additional parameters
|
381 |
$this->object->remove_param('ajax_pagination_referrer');
|
382 |
$display_settings['current_page'] = $current_page;
|
383 |
-
$display_settings['entities'] =& $entities;
|
384 |
$display_settings['pagination_prev'] = $pagination_result['prev'];
|
385 |
$display_settings['pagination_next'] = $pagination_result['next'];
|
386 |
-
$display_settings['pagination'] = $pagination_result['output'];
|
387 |
// Legacy templates lack a good way of injecting content at the right time
|
|
|
388 |
$this->object->add_mixin('A_NextGen_Album_Breadcrumbs');
|
389 |
$this->object->add_mixin('A_NextGen_Album_Descriptions');
|
390 |
$breadcrumbs = $this->object->render_legacy_template_breadcrumbs($displayed_gallery, $entities);
|
391 |
$description = $this->object->render_legacy_template_description($displayed_gallery);
|
392 |
-
//
|
393 |
-
$
|
394 |
-
|
|
|
395 |
$retval = $this->object->legacy_render($display_settings['template'], $display_settings, $return, 'album');
|
396 |
if (!empty($description)) {
|
397 |
$retval = $description . $retval;
|
@@ -399,35 +504,12 @@ class A_NextGen_Basic_Album_Controller extends Mixin_NextGen_Basic_Pagination
|
|
399 |
if (!empty($breadcrumbs)) {
|
400 |
$retval = $breadcrumbs . $retval;
|
401 |
}
|
|
|
|
|
|
|
402 |
return $retval;
|
403 |
} else {
|
404 |
$params = $display_settings;
|
405 |
-
$albums = $this->prepare_legacy_album_params($displayed_gallery->get_entity(), array('entities' => $entities));
|
406 |
-
$params['pagination'] = $pagination_result['output'];
|
407 |
-
$params['image_gen_params'] = $albums['image_gen_params'];
|
408 |
-
$params['galleries'] = $albums['galleries'];
|
409 |
-
foreach ($params['galleries'] as &$gallery) {
|
410 |
-
$gallery->entity_type = isset($gallery->is_gallery) && intval($gallery->is_gallery) ? 'gallery' : 'album';
|
411 |
-
// If we're to open a gallery in a lightbox, we need to expose it to the lightbox
|
412 |
-
// as a displayed gallery
|
413 |
-
if (isset($params['open_gallery_in_lightbox']) && $gallery->entity_type == 'gallery') {
|
414 |
-
$gallery->displayed_gallery = new C_Displayed_Gallery();
|
415 |
-
$gallery->displayed_gallery->container_ids = array($gallery->{$gallery->id_field});
|
416 |
-
$gallery->displayed_gallery->display_settings = $displayed_gallery->display_settings;
|
417 |
-
$gallery->displayed_gallery->returns = 'included';
|
418 |
-
$gallery->displayed_gallery->source = 'galleries';
|
419 |
-
$gallery->displayed_gallery->images_list_count = $gallery->displayed_gallery->get_entity_count();
|
420 |
-
$gallery->displayed_gallery->is_album_gallery = TRUE;
|
421 |
-
$gallery->displayed_gallery->to_transient();
|
422 |
-
if ($this->does_lightbox_support_displayed_gallery($displayed_gallery)) {
|
423 |
-
$gallery->displayed_gallery->effect_code = $this->object->get_effect_code($gallery->displayed_gallery);
|
424 |
-
}
|
425 |
-
// Add "galleries.gallery_1 = {};"
|
426 |
-
$this->object->_add_script_data('ngg_common', 'galleries.gallery_' . $gallery->displayed_gallery->id(), (array) $gallery->displayed_gallery->get_entity(), FALSE);
|
427 |
-
$this->object->_add_script_data('ngg_common', 'galleries.gallery_' . $gallery->displayed_gallery->id() . '.wordpress_page_root', get_permalink(), FALSE);
|
428 |
-
}
|
429 |
-
}
|
430 |
-
$params['displayed_gallery'] = $displayed_gallery;
|
431 |
$params = $this->object->prepare_display_parameters($displayed_gallery, $params);
|
432 |
switch ($displayed_gallery->display_type) {
|
433 |
case NGG_BASIC_COMPACT_ALBUM:
|
@@ -443,6 +525,26 @@ class A_NextGen_Basic_Album_Controller extends Mixin_NextGen_Basic_Pagination
|
|
443 |
return $this->object->render_partial('photocrati-nextgen_gallery_display#no_images_found', array(), $return);
|
444 |
}
|
445 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
446 |
function add_breadcrumbs_to_legacy_templates($html, $displayed_gallery)
|
447 |
{
|
448 |
$this->object->add_mixin('A_NextGen_Album_Breadcrumbs');
|
@@ -548,9 +650,19 @@ class A_NextGen_Basic_Album_Controller extends Mixin_NextGen_Basic_Pagination
|
|
548 |
$gallery->pagelink = $this->object->set_param_for($pagelink, 'gallery', $gallery->slug);
|
549 |
}
|
550 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
551 |
// Let plugins modify the gallery
|
552 |
$gallery = apply_filters('ngg_album_galleryobject', $gallery);
|
553 |
}
|
|
|
554 |
$params['album'] = reset($this->albums);
|
555 |
$params['albums'] = $this->albums;
|
556 |
// Clean up
|
189 |
return $view->render(TRUE);
|
190 |
}
|
191 |
}
|
192 |
+
/**
|
193 |
+
* Because enqueueing an albums child entities (for use in lightboxes) is slow to do inside of cache_action() and
|
194 |
+
* we can't guarantee index_action() will run on every hit (thanks to page caching) we inline those entities into
|
195 |
+
* our basic albums templates under a window.load listener.
|
196 |
+
*
|
197 |
+
* @mixin C_MVC_View
|
198 |
+
* @adapts I_MVC_View
|
199 |
+
*/
|
200 |
+
class A_NextGen_Album_Child_Entities extends Mixin
|
201 |
+
{
|
202 |
+
protected static $_runonce = FALSE;
|
203 |
+
public static $_entities = array();
|
204 |
+
/**
|
205 |
+
* The album controller will invoke this filter when its _render_album() method is called
|
206 |
+
*/
|
207 |
+
function __construct()
|
208 |
+
{
|
209 |
+
if (!self::$_runonce) {
|
210 |
+
add_filter('ngg_album_prepared_child_entity', array($this, 'register_child_gallery'), 10, 2);
|
211 |
+
} else {
|
212 |
+
self::$_runonce = TRUE;
|
213 |
+
}
|
214 |
+
}
|
215 |
+
/**
|
216 |
+
* Register each gallery belonging to the album that has just been rendered, so that when the MVC controller
|
217 |
+
* system 'catches up' and runs $this->render_object() that method knows what galleries to inline as JS.
|
218 |
+
*
|
219 |
+
* @param array $gallery
|
220 |
+
* @param $displayed_gallery
|
221 |
+
* @return array mixed
|
222 |
+
*/
|
223 |
+
function register_child_gallery($galleries, $displayed_gallery)
|
224 |
+
{
|
225 |
+
if (!$this->is_basic_album($displayed_gallery)) {
|
226 |
+
return $galleries;
|
227 |
+
}
|
228 |
+
$id = $displayed_gallery->ID();
|
229 |
+
foreach ($galleries as $gallery) {
|
230 |
+
if ($gallery->is_album) {
|
231 |
+
continue;
|
232 |
+
}
|
233 |
+
self::$_entities[$id][] = $gallery;
|
234 |
+
}
|
235 |
+
return $galleries;
|
236 |
+
}
|
237 |
+
function is_basic_album($displayed_gallery)
|
238 |
+
{
|
239 |
+
return in_array($displayed_gallery->display_type, array(NGG_BASIC_COMPACT_ALBUM, NGG_BASIC_EXTENDED_ALBUM));
|
240 |
+
}
|
241 |
+
/**
|
242 |
+
* Determine if we need to append the JS to the current template. This method static for the basic album controller to access.
|
243 |
+
*
|
244 |
+
* @param $display_settings
|
245 |
+
* @return bool
|
246 |
+
*/
|
247 |
+
static function are_child_entities_enabled($display_settings)
|
248 |
+
{
|
249 |
+
$retval = FALSE;
|
250 |
+
if (empty($display_settings['open_gallery_in_lightbox'])) {
|
251 |
+
$display_settings['open_gallery_in_lightbox'] = 0;
|
252 |
+
}
|
253 |
+
if ($display_settings['open_gallery_in_lightbox'] == 1) {
|
254 |
+
$retval = TRUE;
|
255 |
+
}
|
256 |
+
return $retval;
|
257 |
+
}
|
258 |
+
/**
|
259 |
+
* Search inside the template for the inside of the container and append our inline JS
|
260 |
+
*/
|
261 |
+
function render_object()
|
262 |
+
{
|
263 |
+
$root_element = $this->call_parent('render_object');
|
264 |
+
if ($displayed_gallery = $this->object->get_param('displayed_gallery')) {
|
265 |
+
if (!$this->is_basic_album($displayed_gallery)) {
|
266 |
+
return $root_element;
|
267 |
+
}
|
268 |
+
$ds = $displayed_gallery->display_settings;
|
269 |
+
if (self::are_child_entities_enabled($ds)) {
|
270 |
+
$id = $displayed_gallery->ID();
|
271 |
+
foreach ($root_element->find('nextgen_gallery.gallery_container', TRUE) as $container) {
|
272 |
+
$container->append(self::generate_script(self::$_entities[$id]));
|
273 |
+
}
|
274 |
+
}
|
275 |
+
}
|
276 |
+
return $root_element;
|
277 |
+
}
|
278 |
+
/**
|
279 |
+
* Generate the JS that will be inserted into the template. This method static for the basic album controller to access.
|
280 |
+
*
|
281 |
+
* @param array $galleries
|
282 |
+
* @return string
|
283 |
+
*/
|
284 |
+
static function generate_script($galleries)
|
285 |
+
{
|
286 |
+
$retval = '<script type="text/javascript">window.addEventListener("load", function() {';
|
287 |
+
foreach ($galleries as $gallery) {
|
288 |
+
$dg = $gallery->displayed_gallery;
|
289 |
+
$id = $dg->id();
|
290 |
+
$retval .= 'galleries.gallery_' . $id . ' = ' . json_encode($dg->get_entity()) . ';';
|
291 |
+
$retval .= 'galleries.gallery_' . $id . '.wordpress_page_root = "' . get_permalink() . '";';
|
292 |
+
}
|
293 |
+
$retval .= '}, false);</script>';
|
294 |
+
return $retval;
|
295 |
+
}
|
296 |
+
}
|
297 |
/**
|
298 |
* Class A_NextGen_Album_Descriptions
|
299 |
* @mixin C_MVC_View
|
415 |
*/
|
416 |
function index_action($displayed_gallery, $return = FALSE)
|
417 |
{
|
|
|
|
|
|
|
|
|
418 |
$display_settings = $displayed_gallery->display_settings;
|
419 |
// We need to fetch the album containers selected in the Attach
|
420 |
// to Post interface. We need to do this, because once we fetch the
|
477 |
// If there are entities to be displayed
|
478 |
if ($entities) {
|
479 |
$pagination_result = $this->object->create_pagination($current_page, $displayed_gallery->get_entity_count(), $display_settings['galleries_per_page'], urldecode($this->object->param('ajax_pagination_referrer')));
|
480 |
+
$display_settings['entities'] = $entities;
|
481 |
+
$display_settings['pagination'] = $pagination_result['output'];
|
482 |
+
$display_settings['displayed_gallery'] = $displayed_gallery;
|
483 |
+
$display_settings = $this->prepare_legacy_album_params($displayed_gallery->get_entity(), $display_settings);
|
484 |
if (!empty($display_settings['template']) && $display_settings['template'] != 'default') {
|
485 |
// Add additional parameters
|
486 |
$this->object->remove_param('ajax_pagination_referrer');
|
487 |
$display_settings['current_page'] = $current_page;
|
|
|
488 |
$display_settings['pagination_prev'] = $pagination_result['prev'];
|
489 |
$display_settings['pagination_next'] = $pagination_result['next'];
|
|
|
490 |
// Legacy templates lack a good way of injecting content at the right time
|
491 |
+
$this->object->add_mixin('Mixin_NextGen_Basic_Templates');
|
492 |
$this->object->add_mixin('A_NextGen_Album_Breadcrumbs');
|
493 |
$this->object->add_mixin('A_NextGen_Album_Descriptions');
|
494 |
$breadcrumbs = $this->object->render_legacy_template_breadcrumbs($displayed_gallery, $entities);
|
495 |
$description = $this->object->render_legacy_template_description($displayed_gallery);
|
496 |
+
// If enabled enqueue the child entities as JSON for lightboxes to read
|
497 |
+
if (A_NextGen_Album_Child_Entities::are_child_entities_enabled($display_settings)) {
|
498 |
+
$script = A_NextGen_Album_Child_Entities::generate_script($entities);
|
499 |
+
}
|
500 |
$retval = $this->object->legacy_render($display_settings['template'], $display_settings, $return, 'album');
|
501 |
if (!empty($description)) {
|
502 |
$retval = $description . $retval;
|
504 |
if (!empty($breadcrumbs)) {
|
505 |
$retval = $breadcrumbs . $retval;
|
506 |
}
|
507 |
+
if (!empty($script)) {
|
508 |
+
$retval = $retval . $script;
|
509 |
+
}
|
510 |
return $retval;
|
511 |
} else {
|
512 |
$params = $display_settings;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
513 |
$params = $this->object->prepare_display_parameters($displayed_gallery, $params);
|
514 |
switch ($displayed_gallery->display_type) {
|
515 |
case NGG_BASIC_COMPACT_ALBUM:
|
525 |
return $this->object->render_partial('photocrati-nextgen_gallery_display#no_images_found', array(), $return);
|
526 |
}
|
527 |
}
|
528 |
+
/**
|
529 |
+
* Creates a displayed gallery of a gallery belonging to an album. Shared by index_action() and cache_action() to
|
530 |
+
* allow lightboxes to open album children directly.
|
531 |
+
*
|
532 |
+
* @param $gallery
|
533 |
+
* @param $display_settings
|
534 |
+
* @return $gallery
|
535 |
+
*/
|
536 |
+
function make_child_displayed_gallery($gallery, $display_settings)
|
537 |
+
{
|
538 |
+
$gallery->displayed_gallery = new C_Displayed_Gallery();
|
539 |
+
$gallery->displayed_gallery->container_ids = array($gallery->{$gallery->id_field});
|
540 |
+
$gallery->displayed_gallery->display_settings = $display_settings;
|
541 |
+
$gallery->displayed_gallery->returns = 'included';
|
542 |
+
$gallery->displayed_gallery->source = 'galleries';
|
543 |
+
$gallery->displayed_gallery->images_list_count = $gallery->displayed_gallery->get_entity_count();
|
544 |
+
$gallery->displayed_gallery->is_album_gallery = TRUE;
|
545 |
+
$gallery->displayed_gallery->to_transient();
|
546 |
+
return $gallery;
|
547 |
+
}
|
548 |
function add_breadcrumbs_to_legacy_templates($html, $displayed_gallery)
|
549 |
{
|
550 |
$this->object->add_mixin('A_NextGen_Album_Breadcrumbs');
|
650 |
$gallery->pagelink = $this->object->set_param_for($pagelink, 'gallery', $gallery->slug);
|
651 |
}
|
652 |
}
|
653 |
+
// Mark the child type
|
654 |
+
$gallery->entity_type = isset($gallery->is_gallery) && intval($gallery->is_gallery) ? 'gallery' : 'album';
|
655 |
+
// If this setting is on we need to inject an effect code
|
656 |
+
if (!empty($displayed_gallery->display_settings['open_gallery_in_lightbox']) && $gallery->entity_type == 'gallery') {
|
657 |
+
$gallery = $this->object->make_child_displayed_gallery($gallery, $displayed_gallery->display_settings);
|
658 |
+
if ($this->does_lightbox_support_displayed_gallery($displayed_gallery)) {
|
659 |
+
$gallery->displayed_gallery->effect_code = $this->object->get_effect_code($gallery->displayed_gallery);
|
660 |
+
}
|
661 |
+
}
|
662 |
// Let plugins modify the gallery
|
663 |
$gallery = apply_filters('ngg_album_galleryobject', $gallery);
|
664 |
}
|
665 |
+
$params['galleries'] = apply_filters('ngg_album_prepared_child_entity', $params['galleries'], $params['displayed_gallery']);
|
666 |
$params['album'] = reset($this->albums);
|
667 |
$params['albums'] = $this->albums;
|
668 |
// Clean up
|
products/photocrati_nextgen/modules/nextgen_basic_album/templates/compact.php
CHANGED
@@ -1,32 +1,30 @@
|
|
1 |
<?php $this->start_element('nextgen_gallery.gallery_container', 'container', $displayed_gallery); ?>
|
2 |
<div class="ngg-albumoverview">
|
3 |
-
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
<div class="ngg-album-compact">
|
5 |
<div class="ngg-album-compactbox">
|
6 |
<div class="ngg-album-link">
|
7 |
<?php $this->start_element('nextgen_gallery.album_gallery', 'item', $gallery); ?>
|
8 |
-
<?php
|
9 |
-
<
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
data-src="<?php echo esc_attr($gallery->previewpic_fullsized_url) ?>"
|
14 |
-
data-thumbnail="<?php echo esc_attr($gallery->previewurl)?>"
|
15 |
-
data-title="<?php echo esc_attr($gallery->previewpic_image->alttext)?>"
|
16 |
-
data-description="<?php echo esc_attr(stripslashes($gallery->previewpic_image->description))?>"
|
17 |
-
data-image-id="<?php echo esc_attr($gallery->previewpic)?>"
|
18 |
-
>
|
19 |
-
<img class="Thumb"
|
20 |
-
alt="<?php echo esc_attr($gallery->title); ?>"
|
21 |
-
src="<?php echo nextgen_esc_url($gallery->previewurl); ?>"/>
|
22 |
-
</a>
|
23 |
-
<?php else: ?>
|
24 |
-
<a class="Link gallery_link" href="<?php echo nextgen_esc_url($gallery->pagelink); ?>">
|
25 |
-
<img class="Thumb"
|
26 |
-
alt="<?php echo esc_attr($gallery->title); ?>"
|
27 |
-
src="<?php echo nextgen_esc_url($gallery->previewurl); ?>"/>
|
28 |
-
</a>
|
29 |
-
<?php endif ?>
|
30 |
<?php $this->end_element(); ?>
|
31 |
</div>
|
32 |
</div>
|
@@ -36,12 +34,7 @@
|
|
36 |
$max_width = '';
|
37 |
} ?>
|
38 |
<h4>
|
39 |
-
<a class=
|
40 |
-
title="<?php echo esc_attr($gallery->title); ?>"
|
41 |
-
href="<?php echo nextgen_esc_url($gallery->pagelink); ?>"
|
42 |
-
<?php echo $max_width; ?>>
|
43 |
-
<?php echo_safe_html($gallery->title); ?>
|
44 |
-
</a>
|
45 |
</h4>
|
46 |
<p class="ngg-album-gallery-image-counter">
|
47 |
<?php if (isset($gallery->counter) && $gallery->counter > 0) { ?>
|
1 |
<?php $this->start_element('nextgen_gallery.gallery_container', 'container', $displayed_gallery); ?>
|
2 |
<div class="ngg-albumoverview">
|
3 |
+
<?php
|
4 |
+
foreach ($galleries as $gallery) {
|
5 |
+
if ($open_gallery_in_lightbox && $gallery->entity_type == 'gallery') {
|
6 |
+
$anchor = $gallery->displayed_gallery->effect_code . "
|
7 |
+
href='" . nextgen_esc_url($gallery->pagelink) . "'
|
8 |
+
data-src='" . esc_attr($gallery->previewpic_fullsized_url) . "'
|
9 |
+
data-fullsize='" . esc_attr($gallery->previewpic_fullsized_url) . "'
|
10 |
+
data-thumbnail='" . esc_attr($gallery->previewurl) . "'
|
11 |
+
data-title='" . esc_attr($gallery->previewpic_image->alttext) . "'
|
12 |
+
data-description='" . esc_attr(stripslashes($gallery->previewpic_image->description)) . "'
|
13 |
+
data-image-id='" . esc_attr($gallery->previewpic) . "'";
|
14 |
+
} else {
|
15 |
+
$anchor = "title='" . esc_attr($gallery->title) . "'
|
16 |
+
href='" . nextgen_esc_url($gallery->pagelink) . "'";
|
17 |
+
}
|
18 |
+
?>
|
19 |
<div class="ngg-album-compact">
|
20 |
<div class="ngg-album-compactbox">
|
21 |
<div class="ngg-album-link">
|
22 |
<?php $this->start_element('nextgen_gallery.album_gallery', 'item', $gallery); ?>
|
23 |
+
<a <?php echo $anchor; ?>>
|
24 |
+
<img class="Thumb"
|
25 |
+
alt="<?php echo esc_attr($gallery->title); ?>"
|
26 |
+
src="<?php echo nextgen_esc_url($gallery->previewurl); ?>"/>
|
27 |
+
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
<?php $this->end_element(); ?>
|
29 |
</div>
|
30 |
</div>
|
34 |
$max_width = '';
|
35 |
} ?>
|
36 |
<h4>
|
37 |
+
<a class='ngg-album-desc' <?php echo $anchor; echo $max_width; ?>><?php echo_safe_html($gallery->title); ?></a>
|
|
|
|
|
|
|
|
|
|
|
38 |
</h4>
|
39 |
<p class="ngg-album-gallery-image-counter">
|
40 |
<?php if (isset($gallery->counter) && $gallery->counter > 0) { ?>
|
products/photocrati_nextgen/modules/nextgen_basic_album/templates/extended.php
CHANGED
@@ -1,39 +1,29 @@
|
|
1 |
<?php $this->start_element('nextgen_gallery.gallery_container', 'container', $displayed_gallery); ?>
|
2 |
<div class="ngg-albumoverview">
|
3 |
-
<?php foreach ($galleries as $gallery) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
<div class="ngg-album">
|
5 |
<div class="ngg-albumtitle">
|
6 |
-
<a
|
7 |
</div>
|
8 |
<div class="ngg-albumcontent">
|
9 |
<div class="ngg-thumbnail">
|
10 |
-
|
11 |
-
<a
|
12 |
-
<?php echo $gallery->displayed_gallery->effect_code ?>
|
13 |
-
href="<?php echo esc_attr($gallery->previewpic_fullsized_url)?>"
|
14 |
-
data-fullsize="<?php echo esc_attr($gallery->previewpic_fullsized_url) ?>"
|
15 |
-
data-src="http://sandbox.dev/wp-content/gallery/wood-cutting/DSC_0236.JPG"
|
16 |
-
data-thumbnail="<?php echo esc_attr($gallery->previewurl)?>"
|
17 |
-
data-title="<?php echo esc_attr($gallery->previewpic_image->alttext)?>"
|
18 |
-
data-description="<?php echo esc_attr(stripslashes($gallery->previewpic_image->description))?>"
|
19 |
-
data-image-id="<?php echo esc_attr($gallery->previewpic)?>"
|
20 |
-
>
|
21 |
<img class="Thumb"
|
22 |
alt="<?php echo esc_attr($gallery->title); ?>"
|
23 |
src="<?php echo nextgen_esc_url($gallery->previewurl); ?>"/>
|
24 |
</a>
|
25 |
-
<?php else: ?>
|
26 |
-
<a
|
27 |
-
class="gallery_link"
|
28 |
-
href="<?php echo nextgen_esc_url($gallery->pagelink); ?>"
|
29 |
-
>
|
30 |
-
<img
|
31 |
-
class="Thumb"
|
32 |
-
alt="<?php echo esc_attr($gallery->title); ?>"
|
33 |
-
src="<?php echo nextgen_esc_url($gallery->previewurl); ?>"
|
34 |
-
/>
|
35 |
-
</a>
|
36 |
-
<?php endif ?>
|
37 |
</div>
|
38 |
<div class="ngg-description">
|
39 |
<p><?php echo_safe_html($gallery->galdesc); ?></p>
|
@@ -44,6 +34,6 @@
|
|
44 |
</div>
|
45 |
</div>
|
46 |
<?php } ?>
|
47 |
-
<?php echo $pagination ?>
|
48 |
</div>
|
49 |
<?php $this->end_element(); ?>
|
1 |
<?php $this->start_element('nextgen_gallery.gallery_container', 'container', $displayed_gallery); ?>
|
2 |
<div class="ngg-albumoverview">
|
3 |
+
<?php foreach ($galleries as $gallery) {
|
4 |
+
if ($open_gallery_in_lightbox && $gallery->entity_type == 'gallery') {
|
5 |
+
$anchor = $gallery->displayed_gallery->effect_code . "
|
6 |
+
href='" . nextgen_esc_url($gallery->pagelink) . "'
|
7 |
+
data-src='" . esc_attr($gallery->previewpic_fullsized_url) . "'
|
8 |
+
data-fullsize='" . esc_attr($gallery->previewpic_fullsized_url) . "'
|
9 |
+
data-thumbnail='" . esc_attr($gallery->previewurl) . "'
|
10 |
+
data-title='" . esc_attr($gallery->previewpic_image->alttext) . "'
|
11 |
+
data-description='" . esc_attr(stripslashes($gallery->previewpic_image->description)) . "'
|
12 |
+
data-image-id='" . esc_attr($gallery->previewpic) . "'";
|
13 |
+
} else {
|
14 |
+
$anchor = "class='gallery_link' href='" . nextgen_esc_url($gallery->pagelink) . "'";
|
15 |
+
} ?>
|
16 |
<div class="ngg-album">
|
17 |
<div class="ngg-albumtitle">
|
18 |
+
<a <?php echo $anchor; ?>><?php echo_safe_html($gallery->title); ?></a>
|
19 |
</div>
|
20 |
<div class="ngg-albumcontent">
|
21 |
<div class="ngg-thumbnail">
|
22 |
+
<a <?php echo $anchor; ?>>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
<img class="Thumb"
|
24 |
alt="<?php echo esc_attr($gallery->title); ?>"
|
25 |
src="<?php echo nextgen_esc_url($gallery->previewurl); ?>"/>
|
26 |
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
</div>
|
28 |
<div class="ngg-description">
|
29 |
<p><?php echo_safe_html($gallery->galdesc); ?></p>
|
34 |
</div>
|
35 |
</div>
|
36 |
<?php } ?>
|
37 |
+
<?php echo $pagination; ?>
|
38 |
</div>
|
39 |
<?php $this->end_element(); ?>
|
products/photocrati_nextgen/modules/nextgen_basic_gallery/module.nextgen_basic_gallery.php
CHANGED
@@ -19,7 +19,14 @@ define(
|
|
19 |
|
20 |
class M_NextGen_Basic_Gallery extends C_Base_Module
|
21 |
{
|
22 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
{
|
24 |
parent::define(
|
25 |
'photocrati-nextgen_basic_gallery',
|
@@ -27,7 +34,7 @@ class M_NextGen_Basic_Gallery extends C_Base_Module
|
|
27 |
"Provides NextGEN Gallery's basic thumbnail/slideshow integrated gallery",
|
28 |
'0.16',
|
29 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
30 |
-
'
|
31 |
'https://www.imagely.com'
|
32 |
);
|
33 |
|
@@ -334,7 +341,7 @@ function nggShowSlideshow($galleryID, $width, $height)
|
|
334 |
|
335 |
class C_NextGen_Basic_Gallery_Installer extends C_Gallery_Display_Installer
|
336 |
{
|
337 |
-
function install()
|
338 |
{
|
339 |
$this->install_display_type(NGG_BASIC_THUMBNAILS,
|
340 |
array(
|
19 |
|
20 |
class M_NextGen_Basic_Gallery extends C_Base_Module
|
21 |
{
|
22 |
+
function define($id = 'pope-module',
|
23 |
+
$name = 'Pope Module',
|
24 |
+
$description = '',
|
25 |
+
$version = '',
|
26 |
+
$uri = '',
|
27 |
+
$author = '',
|
28 |
+
$author_uri = '',
|
29 |
+
$context = FALSE)
|
30 |
{
|
31 |
parent::define(
|
32 |
'photocrati-nextgen_basic_gallery',
|
34 |
"Provides NextGEN Gallery's basic thumbnail/slideshow integrated gallery",
|
35 |
'0.16',
|
36 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
37 |
+
'Imagely',
|
38 |
'https://www.imagely.com'
|
39 |
);
|
40 |
|
341 |
|
342 |
class C_NextGen_Basic_Gallery_Installer extends C_Gallery_Display_Installer
|
343 |
{
|
344 |
+
function install($reset = FALSE)
|
345 |
{
|
346 |
$this->install_display_type(NGG_BASIC_THUMBNAILS,
|
347 |
array(
|
products/photocrati_nextgen/modules/nextgen_basic_gallery/package.module.nextgen_basic_gallery.php
CHANGED
@@ -370,7 +370,7 @@ class A_NextGen_Basic_Thumbnail_Form extends Mixin_Display_Type_Form
|
|
370 |
*/
|
371 |
function _get_field_names()
|
372 |
{
|
373 |
-
return array('thumbnail_override_settings', 'nextgen_basic_thumbnails_images_per_page', 'nextgen_basic_thumbnails_number_of_columns', '
|
374 |
}
|
375 |
/**
|
376 |
* Renders the images_per_page settings field
|
@@ -406,16 +406,6 @@ class A_NextGen_Basic_Thumbnail_Form extends Mixin_Display_Type_Form
|
|
406 |
{
|
407 |
return $this->_render_radio_field($display_type, 'use_imagebrowser_effect', __('Use imagebrowser effect', 'nggallery'), $display_type->settings['use_imagebrowser_effect'], __('When active each image in the gallery will link to an imagebrowser display and lightbox effects will not be applied.', 'nggallery'));
|
408 |
}
|
409 |
-
/**
|
410 |
-
* Renders the AJAX pagination settings field
|
411 |
-
*
|
412 |
-
* @param C_Display_Type $display_type
|
413 |
-
* @return string
|
414 |
-
*/
|
415 |
-
function _render_nextgen_basic_thumbnails_ajax_pagination_field($display_type)
|
416 |
-
{
|
417 |
-
return $this->_render_radio_field($display_type, 'ajax_pagination', __('Enable AJAX pagination', 'nggallery'), $display_type->settings['ajax_pagination'], __('Browse images without reloading the page.', 'nggallery'));
|
418 |
-
}
|
419 |
/**
|
420 |
* Renders the show_slideshow_link settings field
|
421 |
*
|
370 |
*/
|
371 |
function _get_field_names()
|
372 |
{
|
373 |
+
return array('thumbnail_override_settings', 'nextgen_basic_thumbnails_images_per_page', 'nextgen_basic_thumbnails_number_of_columns', 'ajax_pagination', 'nextgen_basic_thumbnails_hidden', 'nextgen_basic_thumbnails_imagebrowser_effect', 'nextgen_basic_thumbnails_show_slideshow_link', 'nextgen_basic_thumbnails_slideshow_link_text', 'nextgen_basic_templates_template');
|
374 |
}
|
375 |
/**
|
376 |
* Renders the images_per_page settings field
|
406 |
{
|
407 |
return $this->_render_radio_field($display_type, 'use_imagebrowser_effect', __('Use imagebrowser effect', 'nggallery'), $display_type->settings['use_imagebrowser_effect'], __('When active each image in the gallery will link to an imagebrowser display and lightbox effects will not be applied.', 'nggallery'));
|
408 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
409 |
/**
|
410 |
* Renders the show_slideshow_link settings field
|
411 |
*
|
products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/module.nextgen_basic_imagebrowser.php
CHANGED
@@ -13,16 +13,23 @@ define(
|
|
13 |
|
14 |
class M_NextGen_Basic_ImageBrowser extends C_Base_Module
|
15 |
{
|
16 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
{
|
18 |
parent::define(
|
19 |
'photocrati-nextgen_basic_imagebrowser',
|
20 |
'NextGEN Basic ImageBrowser',
|
21 |
'Provides the NextGEN Basic ImageBrowser Display Type',
|
22 |
-
'0.
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
);
|
27 |
|
28 |
C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Basic_ImageBrowser_Installer');
|
@@ -171,7 +178,7 @@ function nggCreateImageBrowser($picturelist, $template = '')
|
|
171 |
|
172 |
class C_NextGen_Basic_ImageBrowser_Installer extends C_Gallery_Display_Installer
|
173 |
{
|
174 |
-
function install()
|
175 |
{
|
176 |
$this->install_display_type(
|
177 |
NGG_BASIC_IMAGEBROWSER, array(
|
13 |
|
14 |
class M_NextGen_Basic_ImageBrowser extends C_Base_Module
|
15 |
{
|
16 |
+
function define($id = 'pope-module',
|
17 |
+
$name = 'Pope Module',
|
18 |
+
$description = '',
|
19 |
+
$version = '',
|
20 |
+
$uri = '',
|
21 |
+
$author = '',
|
22 |
+
$author_uri = '',
|
23 |
+
$context = FALSE)
|
24 |
{
|
25 |
parent::define(
|
26 |
'photocrati-nextgen_basic_imagebrowser',
|
27 |
'NextGEN Basic ImageBrowser',
|
28 |
'Provides the NextGEN Basic ImageBrowser Display Type',
|
29 |
+
'0.14',
|
30 |
+
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
31 |
+
'Imagely',
|
32 |
+
'https://www.imagely.com'
|
33 |
);
|
34 |
|
35 |
C_Photocrati_Installer::add_handler($this->module_id, 'C_NextGen_Basic_ImageBrowser_Installer');
|
178 |
|
179 |
class C_NextGen_Basic_ImageBrowser_Installer extends C_Gallery_Display_Installer
|
180 |
{
|
181 |
+
function install($reset = FALSE)
|
182 |
{
|
183 |
$this->install_display_type(
|
184 |
NGG_BASIC_IMAGEBROWSER, array(
|
products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/static/style.css
CHANGED
@@ -56,3 +56,145 @@
|
|
56 |
margin-left: auto !important;
|
57 |
margin-right: auto !important;
|
58 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
margin-left: auto !important;
|
57 |
margin-right: auto !important;
|
58 |
}
|
59 |
+
|
60 |
+
|
61 |
+
/* TEMPLATES: Imagebrowser Simple and Dark */
|
62 |
+
|
63 |
+
.ngg-imagebrowser.ngg-imagebrowser-simple,
|
64 |
+
.ngg-imagebrowser.ngg-imagebrowser-dark {
|
65 |
+
padding: 0;
|
66 |
+
margin: 40px 0 !important;
|
67 |
+
text-align: center;
|
68 |
+
max-width: 1200px;
|
69 |
+
margin: 0 auto;
|
70 |
+
box-sizing: border-box;
|
71 |
+
}
|
72 |
+
|
73 |
+
.ngg-imagebrowser.ngg-imagebrowser-dark {
|
74 |
+
background: #000;
|
75 |
+
padding: 0 20px;
|
76 |
+
box-shadow: 0 0 2px 1px rgba(150,150,150,.1);
|
77 |
+
}
|
78 |
+
|
79 |
+
.ngg-imagebrowser.ngg-imagebrowser-simple h3,
|
80 |
+
.ngg-imagebrowser.ngg-imagebrowser-dark h3 {
|
81 |
+
font-size: 18px !important;
|
82 |
+
margin: 0 !important;
|
83 |
+
padding: 20px !important;
|
84 |
+
text-align: center;
|
85 |
+
font-weight: bold;
|
86 |
+
}
|
87 |
+
|
88 |
+
.ngg-imagebrowser.ngg-imagebrowser-dark h3 {
|
89 |
+
color: #fff;
|
90 |
+
}
|
91 |
+
|
92 |
+
.ngg-imagebrowser.ngg-imagebrowser-simple img,
|
93 |
+
.ngg-imagebrowser.ngg-imagebrowser-dark img {
|
94 |
+
max-height: 500px;
|
95 |
+
}
|
96 |
+
|
97 |
+
.ngg-imagebrowser.ngg-imagebrowser-simple .pic,
|
98 |
+
.ngg-imagebrowser.ngg-imagebrowser-simple .pic a,
|
99 |
+
.ngg-imagebrowser.ngg-imagebrowser-dark .pic,
|
100 |
+
.ngg-imagebrowser.ngg-imagebrowser-dark .pic a {
|
101 |
+
margin: 0;
|
102 |
+
border: none;
|
103 |
+
}
|
104 |
+
|
105 |
+
.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-nav,
|
106 |
+
.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-nav {
|
107 |
+
text-align: center;
|
108 |
+
padding: 20px 20px 5px;
|
109 |
+
}
|
110 |
+
|
111 |
+
.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-nav .back,
|
112 |
+
.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-nav .next,
|
113 |
+
.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-nav .back,
|
114 |
+
.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-nav .next {
|
115 |
+
float: none;
|
116 |
+
display: inline-block;
|
117 |
+
border: none;
|
118 |
+
background-color: rgba(0,0,0,.5);
|
119 |
+
border-radius: 15px;
|
120 |
+
width: 30px;
|
121 |
+
height: 30px;
|
122 |
+
padding: 0;
|
123 |
+
}
|
124 |
+
|
125 |
+
.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-nav .fa,
|
126 |
+
.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-nav .fa {
|
127 |
+
font-size: 16px;
|
128 |
+
color: #fff;
|
129 |
+
padding: 0 !important;
|
130 |
+
line-height: 30px;
|
131 |
+
}
|
132 |
+
|
133 |
+
.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-nav .fa-chevron-right,
|
134 |
+
.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-nav .fa-chevron-right {
|
135 |
+
margin-left: 2px;
|
136 |
+
}
|
137 |
+
|
138 |
+
.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-nav .fa-chevron-left,
|
139 |
+
.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-nav .fa-chevron-left {
|
140 |
+
margin-right: 2px;
|
141 |
+
}
|
142 |
+
|
143 |
+
.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-nav a,
|
144 |
+
.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-nav a:hover,
|
145 |
+
.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-nav a:focus,
|
146 |
+
.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-nav a,
|
147 |
+
.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-nav a:hover,
|
148 |
+
.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-nav a:focus {
|
149 |
+
box-shadow: none;
|
150 |
+
text-decoration: none;
|
151 |
+
padding: 0;
|
152 |
+
}
|
153 |
+
|
154 |
+
.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-nav .counter,
|
155 |
+
.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-nav .counter {
|
156 |
+
margin: 20px 0 22px;
|
157 |
+
font-size: 12px !important;
|
158 |
+
color: rgba(150,150,150,.7);
|
159 |
+
}
|
160 |
+
|
161 |
+
.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-nav .counter {
|
162 |
+
color: #666;
|
163 |
+
}
|
164 |
+
|
165 |
+
.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-desc,
|
166 |
+
.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-desc {
|
167 |
+
text-align: center;
|
168 |
+
padding: 0 50px;
|
169 |
+
font-size: 14px;
|
170 |
+
}
|
171 |
+
|
172 |
+
.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-desc {
|
173 |
+
color: #999;
|
174 |
+
padding-bottom: 20px;
|
175 |
+
}
|
176 |
+
|
177 |
+
.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-desc p:first-of-type,
|
178 |
+
.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-desc p:first-of-type {
|
179 |
+
margin-top: 0;
|
180 |
+
padding-top: 0;
|
181 |
+
}
|
182 |
+
|
183 |
+
@media (max-width: 800px) {
|
184 |
+
|
185 |
+
.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-nav,
|
186 |
+
.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-nav {
|
187 |
+
text-align: center;
|
188 |
+
padding: 20px 10px 5px;
|
189 |
+
}
|
190 |
+
|
191 |
+
.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-desc,
|
192 |
+
.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-desc {
|
193 |
+
padding: 0;
|
194 |
+
font-size: 12px;
|
195 |
+
}
|
196 |
+
|
197 |
+
.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-desc {
|
198 |
+
padding-bottom: 20px;
|
199 |
+
}
|
200 |
+
}
|
products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/static/style.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.ngg-imagebrowser h3{text-align:center}.ngg-imagebrowser-desc{clear:both}.ngg-imagebrowser .pic{max-width:100%;margin-top:10px;margin-bottom:10px;border:1px solid #A9A9A9}.ngg-imagebrowser .pic a{display:block!important;font-size:0;margin:5px;text-align:center}.ngg-imagebrowser img{max-width:100%;margin:0 auto;padding:0;border:none}.ngg-imagebrowser-nav{padding:5px}.ngg-imagebrowser-nav .back{float:left;border:1px solid #DDD;padding:3px 7px}.ngg-imagebrowser-nav .next{float:right;border:1px solid #DDD;padding:3px 7px}.ngg-imagebrowser-nav .counter{text-align:center;font-size:.9em!important}.exif-data{margin-left:auto!important;margin-right:auto!important}
|
1 |
+
.ngg-imagebrowser h3{text-align:center}.ngg-imagebrowser-desc{clear:both}.ngg-imagebrowser .pic{max-width:100%;margin-top:10px;margin-bottom:10px;border:1px solid #A9A9A9}.ngg-imagebrowser .pic a{display:block!important;font-size:0;margin:5px;text-align:center}.ngg-imagebrowser img{max-width:100%;margin:0 auto;padding:0;border:none}.ngg-imagebrowser-nav{padding:5px}.ngg-imagebrowser-nav .back{float:left;border:1px solid #DDD;padding:3px 7px}.ngg-imagebrowser-nav .next{float:right;border:1px solid #DDD;padding:3px 7px}.ngg-imagebrowser-nav .counter{text-align:center;font-size:.9em!important}.exif-data{margin-left:auto!important;margin-right:auto!important}.ngg-imagebrowser.ngg-imagebrowser-dark,.ngg-imagebrowser.ngg-imagebrowser-simple{padding:0;margin:40px 0!important;text-align:center;max-width:1200px;box-sizing:border-box}.ngg-imagebrowser.ngg-imagebrowser-dark{background:#000;padding:0 20px;box-shadow:0 0 2px 1px rgba(150,150,150,.1)}.ngg-imagebrowser.ngg-imagebrowser-dark h3,.ngg-imagebrowser.ngg-imagebrowser-simple h3{font-size:18px!important;margin:0!important;padding:20px!important;text-align:center;font-weight:700}.ngg-imagebrowser.ngg-imagebrowser-dark h3{color:#fff}.ngg-imagebrowser.ngg-imagebrowser-dark img,.ngg-imagebrowser.ngg-imagebrowser-simple img{max-height:500px}.ngg-imagebrowser.ngg-imagebrowser-dark .pic,.ngg-imagebrowser.ngg-imagebrowser-dark .pic a,.ngg-imagebrowser.ngg-imagebrowser-simple .pic,.ngg-imagebrowser.ngg-imagebrowser-simple .pic a{margin:0;border:none}.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-nav,.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-nav{text-align:center;padding:20px 20px 5px}.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-nav .back,.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-nav .next,.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-nav .back,.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-nav .next{float:none;display:inline-block;border:none;background-color:rgba(0,0,0,.5);border-radius:15px;width:30px;height:30px;padding:0}.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-nav .fa,.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-nav .fa{font-size:16px;color:#fff;padding:0!important;line-height:30px}.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-nav .fa-chevron-right,.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-nav .fa-chevron-right{margin-left:2px}.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-nav .fa-chevron-left,.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-nav .fa-chevron-left{margin-right:2px}.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-nav a,.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-nav a:focus,.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-nav a:hover,.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-nav a,.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-nav a:focus,.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-nav a:hover{box-shadow:none;text-decoration:none;padding:0}.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-nav .counter,.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-nav .counter{margin:20px 0 22px;font-size:12px!important;color:rgba(150,150,150,.7)}.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-nav .counter{color:#666}.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-desc,.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-desc{text-align:center;padding:0 50px;font-size:14px}.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-desc{color:#999;padding-bottom:20px}.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-desc p:first-of-type,.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-desc p:first-of-type{margin-top:0;padding-top:0}@media (max-width:800px){.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-nav,.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-nav{text-align:center;padding:20px 10px 5px}.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-desc,.ngg-imagebrowser.ngg-imagebrowser-simple .ngg-imagebrowser-desc{padding:0;font-size:12px}.ngg-imagebrowser.ngg-imagebrowser-dark .ngg-imagebrowser-desc{padding-bottom:20px}}
|
products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/templates/imagebrowser-simple-template.php
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php $this->start_element('nextgen_gallery.gallery_container', 'container', $displayed_gallery); ?>
|
2 |
+
<div class='ngg-imagebrowser ngg-imagebrowser-simple' id='<?php echo $anchor; ?>' data-nextgen-gallery-id="<?php echo $displayed_gallery->id(); ?>">
|
3 |
+
|
4 |
+
<h3><?php echo esc_attr($image->alttext); ?></h3>
|
5 |
+
|
6 |
+
<?php
|
7 |
+
|
8 |
+
$template_params = array(
|
9 |
+
'index' => 0,
|
10 |
+
'class' => 'pic',
|
11 |
+
'image' => $image,
|
12 |
+
);
|
13 |
+
|
14 |
+
$this->include_template('photocrati-nextgen_gallery_display#image/before', $template_params);
|
15 |
+
|
16 |
+
?>
|
17 |
+
<a href='<?php echo esc_attr($storage->get_image_url($image, 'full', TRUE)); ?>'
|
18 |
+
title='<?php echo esc_attr($image->description); ?>'
|
19 |
+
data-src="<?php echo esc_attr($storage->get_image_url($image)); ?>"
|
20 |
+
data-thumbnail="<?php echo esc_attr($storage->get_image_url($image, 'thumb')); ?>"
|
21 |
+
data-image-id="<?php echo esc_attr($image->{$image->id_field}); ?>"
|
22 |
+
data-title="<?php echo esc_attr($image->alttext); ?>"
|
23 |
+
data-description="<?php echo esc_attr(stripslashes($image->description)); ?>"
|
24 |
+
<?php echo $effect_code ?>>
|
25 |
+
<img title='<?php echo esc_attr($image->alttext); ?>'
|
26 |
+
alt='<?php echo esc_attr($image->alttext); ?>'
|
27 |
+
src='<?php echo esc_attr($storage->get_image_url($image, 'full', TRUE)); ?>'/>
|
28 |
+
</a>
|
29 |
+
<?php
|
30 |
+
|
31 |
+
$this->include_template('photocrati-nextgen_gallery_display#image/after', $template_params);
|
32 |
+
|
33 |
+
?>
|
34 |
+
|
35 |
+
<div class='ngg-imagebrowser-nav'>
|
36 |
+
|
37 |
+
<div class='back'>
|
38 |
+
<a class='ngg-browser-prev'
|
39 |
+
id='ngg-prev-<?php echo $previous_pid; ?>'
|
40 |
+
href='<?php echo $previous_image_link; ?>'>
|
41 |
+
<i class="fa fa-chevron-left" aria-hidden="true"></i>
|
42 |
+
</a>
|
43 |
+
</div>
|
44 |
+
|
45 |
+
<div class='next'>
|
46 |
+
<a class='ngg-browser-next'
|
47 |
+
id='ngg-next-<?php echo $next_pid; ?>'
|
48 |
+
href='<?php echo $next_image_link; ?>'>
|
49 |
+
<i class="fa fa-chevron-right" aria-hidden="true"></i>
|
50 |
+
</a>
|
51 |
+
</div>
|
52 |
+
|
53 |
+
<div class='counter'>
|
54 |
+
<?php _e('Image', 'nggallery'); ?> <?php echo $number; ?> <?php _e('of', 'nggallery'); ?> <?php echo $total; ?>
|
55 |
+
</div>
|
56 |
+
|
57 |
+
<div class='ngg-imagebrowser-desc'>
|
58 |
+
<p>
|
59 |
+
<?php echo $image->description; ?>
|
60 |
+
</p>
|
61 |
+
</div>
|
62 |
+
|
63 |
+
</div>
|
64 |
+
|
65 |
+
</div>
|
66 |
+
<?php $this->end_element(); ?>
|
67 |
+
<script type='text/javascript'>
|
68 |
+
jQuery(function($) {
|
69 |
+
new NggPaginatedGallery('<?php echo $displayed_gallery->id() ?>', '.ngg-imagebrowser');
|
70 |
+
});
|
71 |
+
</script>
|
products/photocrati_nextgen/modules/nextgen_basic_singlepic/module.nextgen_basic_singlepic.php
CHANGED
@@ -11,15 +11,22 @@ define('NGG_BASIC_SINGLEPIC', 'photocrati-nextgen_basic_singlepic');
|
|
11 |
|
12 |
class M_NextGen_Basic_Singlepic extends C_Base_Module
|
13 |
{
|
14 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
{
|
16 |
parent::define(
|
17 |
NGG_BASIC_SINGLEPIC,
|
18 |
'NextGen Basic Singlepic',
|
19 |
'Provides a singlepic gallery for NextGEN Gallery',
|
20 |
'0.14',
|
21 |
-
'https://www.imagely.com',
|
22 |
-
'
|
23 |
'https://www.imagely.com'
|
24 |
);
|
25 |
|
@@ -138,7 +145,7 @@ class M_NextGen_Basic_Singlepic extends C_Base_Module
|
|
138 |
|
139 |
class C_NextGen_Basic_SinglePic_Installer extends C_Gallery_Display_Installer
|
140 |
{
|
141 |
-
function install()
|
142 |
{
|
143 |
$this->install_display_type(
|
144 |
NGG_BASIC_SINGLEPIC, array(
|
11 |
|
12 |
class M_NextGen_Basic_Singlepic extends C_Base_Module
|
13 |
{
|
14 |
+
function define($id = 'pope-module',
|
15 |
+
$name = 'Pope Module',
|
16 |
+
$description = '',
|
17 |
+
$version = '',
|
18 |
+
$uri = '',
|
19 |
+
$author = '',
|
20 |
+
$author_uri = '',
|
21 |
+
$context = FALSE)
|
22 |
{
|
23 |
parent::define(
|
24 |
NGG_BASIC_SINGLEPIC,
|
25 |
'NextGen Basic Singlepic',
|
26 |
'Provides a singlepic gallery for NextGEN Gallery',
|
27 |
'0.14',
|
28 |
+
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
29 |
+
'Imagely',
|
30 |
'https://www.imagely.com'
|
31 |
);
|
32 |
|
145 |
|
146 |
class C_NextGen_Basic_SinglePic_Installer extends C_Gallery_Display_Installer
|
147 |
{
|
148 |
+
function install($reset = FALSE)
|
149 |
{
|
150 |
$this->install_display_type(
|
151 |
NGG_BASIC_SINGLEPIC, array(
|
products/photocrati_nextgen/modules/nextgen_basic_tagcloud/module.nextgen_basic_tagcloud.php
CHANGED
@@ -11,15 +11,22 @@ define('NGG_BASIC_TAGCLOUD', 'photocrati-nextgen_basic_tagcloud');
|
|
11 |
|
12 |
class M_NextGen_Basic_Tagcloud extends C_Base_Module
|
13 |
{
|
14 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
{
|
16 |
parent::define(
|
17 |
NGG_BASIC_TAGCLOUD,
|
18 |
'NextGen Basic Tagcloud',
|
19 |
'Provides a tagcloud for NextGEN Gallery',
|
20 |
'0.15',
|
21 |
-
'https://www.imagely.com',
|
22 |
-
'
|
23 |
'https://www.imagely.com'
|
24 |
);
|
25 |
|
@@ -160,7 +167,7 @@ class C_NextGen_Basic_Tagcloud_Installer extends C_Gallery_Display_Installer
|
|
160 |
/**
|
161 |
* Installs the display type for NextGEN Basic Tagcloud
|
162 |
*/
|
163 |
-
function install()
|
164 |
{
|
165 |
$this->install_display_type(
|
166 |
NGG_BASIC_TAGCLOUD, array(
|
11 |
|
12 |
class M_NextGen_Basic_Tagcloud extends C_Base_Module
|
13 |
{
|
14 |
+
function define($id = 'pope-module',
|
15 |
+
$name = 'Pope Module',
|
16 |
+
$description = '',
|
17 |
+
$version = '',
|
18 |
+
$uri = '',
|
19 |
+
$author = '',
|
20 |
+
$author_uri = '',
|
21 |
+
$context = FALSE)
|
22 |
{
|
23 |
parent::define(
|
24 |
NGG_BASIC_TAGCLOUD,
|
25 |
'NextGen Basic Tagcloud',
|
26 |
'Provides a tagcloud for NextGEN Gallery',
|
27 |
'0.15',
|
28 |
+
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
29 |
+
'Imagely',
|
30 |
'https://www.imagely.com'
|
31 |
);
|
32 |
|
167 |
/**
|
168 |
* Installs the display type for NextGEN Basic Tagcloud
|
169 |
*/
|
170 |
+
function install($reset = FALSE)
|
171 |
{
|
172 |
$this->install_display_type(
|
173 |
NGG_BASIC_TAGCLOUD, array(
|
products/photocrati_nextgen/modules/nextgen_basic_templates/module.nextgen_basic_templates.php
CHANGED
@@ -9,16 +9,23 @@
|
|
9 |
|
10 |
class M_NextGen_Basic_Templates extends C_Base_Module
|
11 |
{
|
12 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
{
|
14 |
parent::define(
|
15 |
'photocrati-nextgen_basic_templates',
|
16 |
'NextGen Basic Templates',
|
17 |
'Provides a NextGen-Legacy compatible thumbnail gallery for NextGEN Gallery',
|
18 |
'0.7',
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
);
|
23 |
}
|
24 |
|
9 |
|
10 |
class M_NextGen_Basic_Templates extends C_Base_Module
|
11 |
{
|
12 |
+
function define($id = 'pope-module',
|
13 |
+
$name = 'Pope Module',
|
14 |
+
$description = '',
|
15 |
+
$version = '',
|
16 |
+
$uri = '',
|
17 |
+
$author = '',
|
18 |
+
$author_uri = '',
|
19 |
+
$context = FALSE)
|
20 |
{
|
21 |
parent::define(
|
22 |
'photocrati-nextgen_basic_templates',
|
23 |
'NextGen Basic Templates',
|
24 |
'Provides a NextGen-Legacy compatible thumbnail gallery for NextGEN Gallery',
|
25 |
'0.7',
|
26 |
+
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
27 |
+
'Imagely',
|
28 |
+
'https://www.imagely.com'
|
29 |
);
|
30 |
}
|
31 |
|
products/photocrati_nextgen/modules/nextgen_data/module.nextgen_data.php
CHANGED
@@ -9,15 +9,22 @@
|
|
9 |
|
10 |
class M_NextGen_Data extends C_Base_Module
|
11 |
{
|
12 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
{
|
14 |
parent::define(
|
15 |
'photocrati-nextgen-data',
|
16 |
'NextGEN Data Tier',
|
17 |
"Provides a data tier for NextGEN gallery based on the DataMapper module",
|
18 |
'0.14',
|
19 |
-
'https://www.imagely.com',
|
20 |
-
'
|
21 |
'https://www.imagely.com'
|
22 |
);
|
23 |
|
9 |
|
10 |
class M_NextGen_Data extends C_Base_Module
|
11 |
{
|
12 |
+
function define($id = 'pope-module',
|
13 |
+
$name = 'Pope Module',
|
14 |
+
$description = '',
|
15 |
+
$version = '',
|
16 |
+
$uri = '',
|
17 |
+
$author = '',
|
18 |
+
$author_uri = '',
|
19 |
+
$context = FALSE)
|
20 |
{
|
21 |
parent::define(
|
22 |
'photocrati-nextgen-data',
|
23 |
'NextGEN Data Tier',
|
24 |
"Provides a data tier for NextGEN gallery based on the DataMapper module",
|
25 |
'0.14',
|
26 |
+
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
27 |
+
'Imagely',
|
28 |
'https://www.imagely.com'
|
29 |
);
|
30 |
|
products/photocrati_nextgen/modules/nextgen_data/package.module.nextgen_data.php
CHANGED
@@ -867,6 +867,14 @@ class Mixin_GalleryStorage_Driver_Base extends Mixin
|
|
867 |
{
|
868 |
return $this->object->get_image_url($image, 'full', $check_existance);
|
869 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
870 |
/**
|
871 |
* Gets the dimensions for a particular-sized image
|
872 |
*
|
@@ -1213,7 +1221,7 @@ class Mixin_GalleryStorage_Driver_Base extends Mixin
|
|
1213 |
}
|
1214 |
// Ensure that fullsize dimensions are added to metadata array
|
1215 |
$dimensions = getimagesize($abs_filename);
|
1216 |
-
$full_meta = array('width' => $dimensions[0], 'height' => $dimensions[1]);
|
1217 |
if (!isset($image->meta_data) or is_string($image->meta_data) && strlen($image->meta_data) == 0) {
|
1218 |
$image->meta_data = array();
|
1219 |
}
|
867 |
{
|
868 |
return $this->object->get_image_url($image, 'full', $check_existance);
|
869 |
}
|
870 |
+
function get_image_checksum($image, $size = 'full')
|
871 |
+
{
|
872 |
+
$retval = NULL;
|
873 |
+
if ($image_abspath = $this->get_image_abspath($image, $size, TRUE)) {
|
874 |
+
$retval = md5_file($image_abspath);
|
875 |
+
}
|
876 |
+
return $retval;
|
877 |
+
}
|
878 |
/**
|
879 |
* Gets the dimensions for a particular-sized image
|
880 |
*
|
1221 |
}
|
1222 |
// Ensure that fullsize dimensions are added to metadata array
|
1223 |
$dimensions = getimagesize($abs_filename);
|
1224 |
+
$full_meta = array('width' => $dimensions[0], 'height' => $dimensions[1], 'md5' => $this->object->get_image_checksum($image, 'full'));
|
1225 |
if (!isset($image->meta_data) or is_string($image->meta_data) && strlen($image->meta_data) == 0) {
|
1226 |
$image->meta_data = array();
|
1227 |
}
|
products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php
CHANGED
@@ -10,16 +10,23 @@ if (!defined('NGG_SHOW_DISPLAYED_GALLERY_ERRORS')) define('NGG_SHOW_DISPLAYED_GA
|
|
10 |
|
11 |
class M_Gallery_Display extends C_Base_Module
|
12 |
{
|
13 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
{
|
15 |
parent::define(
|
16 |
'photocrati-nextgen_gallery_display',
|
17 |
'Gallery Display',
|
18 |
'Provides the ability to display gallery of images',
|
19 |
-
'0.
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
);
|
24 |
|
25 |
C_Photocrati_Installer::add_handler($this->module_id, 'C_Display_Type_Installer');
|
@@ -492,6 +499,33 @@ class M_Gallery_Display extends C_Base_Module
|
|
492 |
'Mixin_Display_Type_Form' => 'mixin.display_type_form.php'
|
493 |
);
|
494 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
495 |
}
|
496 |
|
497 |
class C_Display_Type_Installer
|
10 |
|
11 |
class M_Gallery_Display 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-nextgen_gallery_display',
|
24 |
'Gallery Display',
|
25 |
'Provides the ability to display gallery of images',
|
26 |
+
'0.17',
|
27 |
+
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
28 |
+
'Imagely',
|
29 |
+
'https://www.imagely.com'
|
30 |
);
|
31 |
|
32 |
C_Photocrati_Installer::add_handler($this->module_id, 'C_Display_Type_Installer');
|
499 |
'Mixin_Display_Type_Form' => 'mixin.display_type_form.php'
|
500 |
);
|
501 |
}
|
502 |
+
|
503 |
+
/**
|
504 |
+
* Gets a list of directories in which display type template might be stored
|
505 |
+
*
|
506 |
+
* @param C_Display_Type $display_type
|
507 |
+
* @return array
|
508 |
+
*/
|
509 |
+
static function get_display_type_view_dirs($display_type)
|
510 |
+
{
|
511 |
+
if (!is_object($display_type)) $display_type = C_Display_Type_Mapper::get_instance()->find_by_name($display_type);
|
512 |
+
|
513 |
+
/* Create array of directories to scan */
|
514 |
+
$dirs = array(
|
515 |
+
'default' => C_Component_Registry::get_instance()->get_module_dir($display_type->name) . DIRECTORY_SEPARATOR . 'templates',
|
516 |
+
'custom' => WP_CONTENT_DIR . DIRECTORY_SEPARATOR . 'ngg' . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . $display_type->name . DIRECTORY_SEPARATOR . 'templates',
|
517 |
+
);
|
518 |
+
|
519 |
+
/* Apply filters so third party devs can add directories for their templates */
|
520 |
+
$dirs = apply_filters('ngg_display_type_template_dirs', $dirs, $display_type);
|
521 |
+
$dirs = apply_filters('ngg_' . $display_type->name . '_template_dirs', $dirs, $display_type);
|
522 |
+
foreach ($display_type->aliases as $alias) {
|
523 |
+
$dirs = apply_filters("ngg_{$alias}_template_dirs", $dirs, $display_type);
|
524 |
+
}
|
525 |
+
|
526 |
+
return $dirs;
|
527 |
+
}
|
528 |
+
|
529 |
}
|
530 |
|
531 |
class C_Display_Type_Installer
|
products/photocrati_nextgen/modules/nextgen_gallery_display/package.module.nextgen_gallery_display.php
CHANGED
@@ -491,6 +491,49 @@ class Mixin_Display_Type_Controller extends Mixin
|
|
491 |
}
|
492 |
return array('entities' => $entities, 'longest' => $longest, 'widest' => $widest);
|
493 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
494 |
}
|
495 |
/**
|
496 |
* Provides a datamapper to perform CRUD operations for Display Types
|
@@ -2286,4 +2329,110 @@ class Mixin_Display_Type_Form extends Mixin
|
|
2286 |
{
|
2287 |
return $this->object->get_model()->save(array('settings' => $attributes));
|
2288 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2289 |
}
|
491 |
}
|
492 |
return array('entities' => $entities, 'longest' => $longest, 'widest' => $widest);
|
493 |
}
|
494 |
+
/**
|
495 |
+
* Renders a view after checking for templates
|
496 |
+
*/
|
497 |
+
function create_view($template, $params = array(), $context = NULL)
|
498 |
+
{
|
499 |
+
if (isset($params['displayed_gallery'])) {
|
500 |
+
if (isset($params['displayed_gallery']->display_settings)) {
|
501 |
+
if (isset($params['displayed_gallery']->display_settings['display_type_view'])) {
|
502 |
+
if ('default' !== $params['displayed_gallery']->display_settings['display_type_view']) {
|
503 |
+
$template = $this->get_display_type_view_abspath($template, $params);
|
504 |
+
}
|
505 |
+
}
|
506 |
+
}
|
507 |
+
}
|
508 |
+
return $this->call_parent('create_view', $template, $params, $context);
|
509 |
+
}
|
510 |
+
/**
|
511 |
+
* Finds the abs path of template given file name and list of posssible directories
|
512 |
+
* @param string $template
|
513 |
+
* @param array $params
|
514 |
+
* @return string $template
|
515 |
+
*/
|
516 |
+
function get_display_type_view_abspath($template, $params)
|
517 |
+
{
|
518 |
+
/* Identify display type and display_type_view */
|
519 |
+
$display_type_name = $params['displayed_gallery']->display_type;
|
520 |
+
$display_type_view = $params['displayed_gallery']->display_settings['display_type_view'];
|
521 |
+
/* Fetch array of template directories */
|
522 |
+
$dirs = M_Gallery_Display::get_display_type_view_dirs($display_type_name);
|
523 |
+
/* Set abspath for template based on directory placeholder in display_type_view */
|
524 |
+
$path = pathinfo($display_type_view);
|
525 |
+
if ($path['dirname'] == ".") {
|
526 |
+
$template = $dirs['default'] . DIRECTORY_SEPARATOR . $path['basename'];
|
527 |
+
} else {
|
528 |
+
foreach ($dirs as $dir_name => $dir) {
|
529 |
+
if ($path['dirname'] == $dir_name) {
|
530 |
+
$template = $dir . DIRECTORY_SEPARATOR . $path['basename'];
|
531 |
+
}
|
532 |
+
}
|
533 |
+
}
|
534 |
+
/* Return template. If no match is found, returns the original template */
|
535 |
+
return $template;
|
536 |
+
}
|
537 |
}
|
538 |
/**
|
539 |
* Provides a datamapper to perform CRUD operations for Display Types
|
2329 |
{
|
2330 |
return $this->object->get_model()->save(array('settings' => $attributes));
|
2331 |
}
|
2332 |
+
/**
|
2333 |
+
* Renders the AJAX pagination settings field
|
2334 |
+
*
|
2335 |
+
* @param C_Display_Type $display_type
|
2336 |
+
* @return string
|
2337 |
+
*/
|
2338 |
+
function _render_ajax_pagination_field($display_type)
|
2339 |
+
{
|
2340 |
+
return $this->object->_render_radio_field($display_type, 'ajax_pagination', __('Enable AJAX pagination', 'nggallery'), isset($display_type->settings['ajax_pagination']) ? $display_type->settings['ajax_pagination'] : FALSE, __('Browse images without reloading the page.', 'nggallery'));
|
2341 |
+
}
|
2342 |
+
function _render_thumbnail_override_settings_field($display_type)
|
2343 |
+
{
|
2344 |
+
$hidden = !(isset($display_type->settings['override_thumbnail_settings']) ? $display_type->settings['override_thumbnail_settings'] : FALSE);
|
2345 |
+
$override_field = $this->_render_radio_field($display_type, 'override_thumbnail_settings', __('Override thumbnail settings', 'nggallery'), isset($display_type->settings['override_thumbnail_settings']) ? $display_type->settings['override_thumbnail_settings'] : FALSE, __("This does not affect existing thumbnails; overriding the thumbnail settings will create an additional set of thumbnails. To change the size of existing thumbnails please visit 'Manage Galleries' and choose 'Create new thumbnails' for all images in the gallery.", 'nggallery'));
|
2346 |
+
$dimensions_field = $this->object->render_partial('photocrati-nextgen_gallery_display#thumbnail_settings', array('display_type_name' => $display_type->name, 'name' => 'thumbnail_dimensions', 'label' => __('Thumbnail dimensions', 'nggallery'), 'thumbnail_width' => isset($display_type->settings['thumbnail_width']) ? intval($display_type->settings['thumbnail_width']) : 0, 'thumbnail_height' => isset($display_type->settings['thumbnail_height']) ? intval($display_type->settings['thumbnail_height']) : 0, 'hidden' => $hidden ? 'hidden' : '', 'text' => ''), TRUE);
|
2347 |
+
/*
|
2348 |
+
$qualities = array();
|
2349 |
+
for ($i = 100; $i > 40; $i -= 5) { $qualities[$i] = "{$i}%"; }
|
2350 |
+
$quality_field = $this->_render_select_field(
|
2351 |
+
$display_type,
|
2352 |
+
'thumbnail_quality',
|
2353 |
+
__('Thumbnail quality', 'nggallery'),
|
2354 |
+
$qualities,
|
2355 |
+
isset($display_type->settings['thumbnail_quality']) ? $display_type->settings['thumbnail_quality'] : 100,
|
2356 |
+
'',
|
2357 |
+
$hidden
|
2358 |
+
);
|
2359 |
+
*/
|
2360 |
+
$crop_field = $this->_render_radio_field($display_type, 'thumbnail_crop', __('Thumbnail crop', 'nggallery'), isset($display_type->settings['thumbnail_crop']) ? $display_type->settings['thumbnail_crop'] : FALSE, '', $hidden);
|
2361 |
+
/*
|
2362 |
+
$watermark_field = $this->_render_radio_field(
|
2363 |
+
$display_type,
|
2364 |
+
'thumbnail_watermark',
|
2365 |
+
__('Thumbnail watermark', 'nggallery'),
|
2366 |
+
isset($display_type->settings['thumbnail_watermark']) ? $display_type->settings['thumbnail_watermark'] : FALSE,
|
2367 |
+
'',
|
2368 |
+
$hidden
|
2369 |
+
);
|
2370 |
+
*/
|
2371 |
+
$everything = $override_field . $dimensions_field . $crop_field;
|
2372 |
+
return $everything;
|
2373 |
+
}
|
2374 |
+
/**
|
2375 |
+
* Renders the thumbnail override settings field(s)
|
2376 |
+
*
|
2377 |
+
* @param C_Display_Type $display_type
|
2378 |
+
* @return string
|
2379 |
+
*/
|
2380 |
+
function _render_image_override_settings_field($display_type)
|
2381 |
+
{
|
2382 |
+
$hidden = !(isset($display_type->settings['override_image_settings']) ? $display_type->settings['override_image_settings'] : FALSE);
|
2383 |
+
$override_field = $this->_render_radio_field($display_type, 'override_image_settings', __('Override image settings', 'nggallery'), isset($display_type->settings['override_image_settings']) ? $display_type->settings['override_image_settings'] : 0, __('Overriding the image settings will create an additional set of images', 'nggallery'));
|
2384 |
+
$qualities = array();
|
2385 |
+
for ($i = 100; $i > 40; $i -= 5) {
|
2386 |
+
$qualities[$i] = "{$i}%";
|
2387 |
+
}
|
2388 |
+
$quality_field = $this->_render_select_field($display_type, 'image_quality', __('Image quality', 'nggallery'), $qualities, $display_type->settings['image_quality'], '', $hidden);
|
2389 |
+
$crop_field = $this->_render_radio_field($display_type, 'image_crop', __('Image crop', 'nggallery'), $display_type->settings['image_crop'], '', $hidden);
|
2390 |
+
$watermark_field = $this->_render_radio_field($display_type, 'image_watermark', __('Image watermark', 'nggallery'), $display_type->settings['image_watermark'], '', $hidden);
|
2391 |
+
$everything = $override_field . $quality_field . $crop_field . $watermark_field;
|
2392 |
+
return $everything;
|
2393 |
+
}
|
2394 |
+
/**
|
2395 |
+
* Renders a field for selecting a template
|
2396 |
+
*
|
2397 |
+
* @param C_Display_Type $display_type
|
2398 |
+
* @return string
|
2399 |
+
*/
|
2400 |
+
function _render_display_type_view_field($display_type)
|
2401 |
+
{
|
2402 |
+
$display_type_views = $this->get_available_display_type_views($display_type);
|
2403 |
+
return $this->object->_render_select_field($display_type, 'display_type_view', __('Select Template', 'nggallery'), $display_type_views, $display_type->settings['display_type_view'], '', FALSE);
|
2404 |
+
}
|
2405 |
+
/**
|
2406 |
+
* Gets available templates
|
2407 |
+
*
|
2408 |
+
* @param C_Display_Type $display_type
|
2409 |
+
* @return array
|
2410 |
+
*/
|
2411 |
+
function get_available_display_type_views($display_type)
|
2412 |
+
{
|
2413 |
+
/* Set up templates array */
|
2414 |
+
$views = array('default' => __('Default Template', 'nggallery'));
|
2415 |
+
/* Fetch array of directories to scan */
|
2416 |
+
$dirs = M_Gallery_Display::get_display_type_view_dirs($display_type);
|
2417 |
+
/* Populate the views array by scanning each directory for relevant templates */
|
2418 |
+
foreach ($dirs as $dir_name => $dir) {
|
2419 |
+
/* Confirm directory exists */
|
2420 |
+
if (!file_exists($dir) || !is_dir($dir)) {
|
2421 |
+
continue;
|
2422 |
+
}
|
2423 |
+
/* Scan for template files and create array */
|
2424 |
+
$files = scandir($dir);
|
2425 |
+
$template_files = preg_grep('/^.+\\-template.php$/i', $files);
|
2426 |
+
$template_files = array_combine($template_files, $template_files);
|
2427 |
+
/* For custom templates only, append directory name placeholder */
|
2428 |
+
foreach ($template_files as $key => $value) {
|
2429 |
+
if ($dir_name !== 'default') {
|
2430 |
+
$template_files[$dir_name . DIRECTORY_SEPARATOR . $key] = $dir_name . DIRECTORY_SEPARATOR . $value;
|
2431 |
+
unset($template_files[$key]);
|
2432 |
+
}
|
2433 |
+
}
|
2434 |
+
$views = array_merge($views, $template_files);
|
2435 |
+
}
|
2436 |
+
return $views;
|
2437 |
+
}
|
2438 |
}
|
products/photocrati_nextgen/modules/nextgen_gallery_display/static/common.js
CHANGED
@@ -1,3 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
(function($) {
|
2 |
window.NggPaginatedGallery = function(displayed_gallery_id, container) {
|
3 |
this.displayed_gallery_id = displayed_gallery_id;
|
@@ -58,15 +90,35 @@
|
|
58 |
});
|
59 |
if (replacement) {
|
60 |
self.container.each(function () {
|
61 |
-
|
|
|
|
|
62 |
return true;
|
63 |
}
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
return true;
|
66 |
});
|
67 |
-
|
68 |
-
// Let the user know that we've refreshed the content
|
69 |
-
$(document).trigger('refreshed');
|
70 |
}
|
71 |
}
|
72 |
});
|
1 |
+
/* @preserve
|
2 |
+
* The MIT License (MIT)
|
3 |
+
*
|
4 |
+
* Copyright (c) 2013-2015 Petka Antonov
|
5 |
+
*
|
6 |
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
7 |
+
* of this software and associated documentation files (the "Software"), to deal
|
8 |
+
* in the Software without restriction, including without limitation the rights
|
9 |
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10 |
+
* copies of the Software, and to permit persons to whom the Software is
|
11 |
+
* furnished to do so, subject to the following conditions:
|
12 |
+
*
|
13 |
+
* The above copyright notice and this permission notice shall be included in
|
14 |
+
* all copies or substantial portions of the Software.
|
15 |
+
*
|
16 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19 |
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21 |
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22 |
+
* THE SOFTWARE.
|
23 |
+
*
|
24 |
+
*/
|
25 |
+
/**
|
26 |
+
* bluebird build version 3.4.7
|
27 |
+
* Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each
|
28 |
+
*/
|
29 |
+
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Promise=t()}}(function(){var t,e,n;return function r(t,e,n){function i(s,a){if(!e[s]){if(!t[s]){var c="function"==typeof _dereq_&&_dereq_;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=e[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return i(n?n:e)},u,u.exports,r,t,e,n)}return e[s].exports}for(var o="function"==typeof _dereq_&&_dereq_,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(t,e,n){"use strict";e.exports=function(t){function e(t){var e=new n(t),r=e.promise();return e.setHowMany(1),e.setUnwrap(),e.init(),r}var n=t._SomePromiseArray;t.any=function(t){return e(t)},t.prototype.any=function(){return e(this)}}},{}],2:[function(t,e,n){"use strict";function r(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new u(16),this._normalQueue=new u(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var t=this;this.drainQueues=function(){t._drainQueues()},this._schedule=l}function i(t,e,n){this._lateQueue.push(t,e,n),this._queueTick()}function o(t,e,n){this._normalQueue.push(t,e,n),this._queueTick()}function s(t){this._normalQueue._pushOne(t),this._queueTick()}var a;try{throw new Error}catch(c){a=c}var l=t("./schedule"),u=t("./queue"),p=t("./util");r.prototype.setScheduler=function(t){var e=this._schedule;return this._schedule=t,this._customScheduler=!0,e},r.prototype.hasCustomScheduler=function(){return this._customScheduler},r.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},r.prototype.disableTrampolineIfNecessary=function(){p.hasDevTools&&(this._trampolineEnabled=!1)},r.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},r.prototype.fatalError=function(t,e){e?(process.stderr.write("Fatal "+(t instanceof Error?t.stack:t)+"\n"),process.exit(2)):this.throwLater(t)},r.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(n){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},p.hasDevTools?(r.prototype.invokeLater=function(t,e,n){this._trampolineEnabled?i.call(this,t,e,n):this._schedule(function(){setTimeout(function(){t.call(e,n)},100)})},r.prototype.invoke=function(t,e,n){this._trampolineEnabled?o.call(this,t,e,n):this._schedule(function(){t.call(e,n)})},r.prototype.settlePromises=function(t){this._trampolineEnabled?s.call(this,t):this._schedule(function(){t._settlePromises()})}):(r.prototype.invokeLater=i,r.prototype.invoke=o,r.prototype.settlePromises=s),r.prototype._drainQueue=function(t){for(;t.length()>0;){var e=t.shift();if("function"==typeof e){var n=t.shift(),r=t.shift();e.call(n,r)}else e._settlePromises()}},r.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},e.exports=r,e.exports.firstLineError=a},{"./queue":26,"./schedule":29,"./util":36}],3:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){var i=!1,o=function(t,e){this._reject(e)},s=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},a=function(t,e){0===(50397184&this._bitField)&&this._resolveCallback(e.target)},c=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=r.propagateFromFunction(),t.prototype._boundValue=r.boundValueFunction());var l=n(o),u=new t(e);u._propagateFrom(this,1);var p=this._target();if(u._setBoundTo(l),l instanceof t){var h={promiseRejectionQueued:!1,promise:u,target:p,bindingPromise:l};p._then(e,s,void 0,u,h),l._then(a,c,void 0,u,h),u._setOnCancel(l)}else u._resolveCallback(p);return u},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152===(2097152&this._bitField)},t.bind=function(e,n){return t.resolve(n).bind(e)}}},{}],4:[function(t,e,n){"use strict";function r(){try{Promise===o&&(Promise=i)}catch(t){}return o}var i;"undefined"!=typeof Promise&&(i=Promise);var o=t("./promise")();o.noConflict=r,e.exports=o},{"./promise":22}],5:[function(t,e,n){"use strict";var r=Object.create;if(r){var i=r(null),o=r(null);i[" size"]=o[" size"]=0}e.exports=function(e){function n(t,n){var r;if(null!=t&&(r=t[n]),"function"!=typeof r){var i="Object "+a.classString(t)+" has no method '"+a.toString(n)+"'";throw new e.TypeError(i)}return r}function r(t){var e=this.pop(),r=n(t,e);return r.apply(t,this)}function i(t){return t[this]}function o(t){var e=+this;return 0>e&&(e=Math.max(0,e+t.length)),t[e]}var s,a=t("./util"),c=a.canEvaluate;a.isIdentifier;e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(r,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e,n="number"==typeof t;if(n)e=o;else if(c){var r=s(t);e=null!==r?r:i}else e=i;return this._then(e,void 0,void 0,t,void 0)}}},{"./util":36}],6:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){var o=t("./util"),s=o.tryCatch,a=o.errorObj,c=e._async;e.prototype["break"]=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var n=t._cancellationParent;if(null==n||!n._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=n}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),this._enoughBranchesHaveCancelled()?(this._invokeOnCancel(),!0):!1)},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var n=0;n<t.length;++n)this._doInvokeOnCancel(t[n],e);else if(void 0!==t)if("function"==typeof t){if(!e){var r=s(t).call(this._boundValue());r===a&&(this._attachExtraTrace(r.e),c.throwLater(r.e))}}else t._resultCancelled(this)},e.prototype._invokeOnCancel=function(){var t=this._onCancel();this._unsetOnCancel(),c.invoke(this._doInvokeOnCancel,this,t)},e.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},e.prototype._resultCancelled=function(){this.cancel()}}},{"./util":36}],7:[function(t,e,n){"use strict";e.exports=function(e){function n(t,n,a){return function(c){var l=a._boundValue();t:for(var u=0;u<t.length;++u){var p=t[u];if(p===Error||null!=p&&p.prototype instanceof Error){if(c instanceof p)return o(n).call(l,c)}else if("function"==typeof p){var h=o(p).call(l,c);if(h===s)return h;if(h)return o(n).call(l,c)}else if(r.isObject(c)){for(var f=i(p),_=0;_<f.length;++_){var d=f[_];if(p[d]!=c[d])continue t}return o(n).call(l,c)}}return e}}var r=t("./util"),i=t("./es5").keys,o=r.tryCatch,s=r.errorObj;return n}},{"./es5":13,"./util":36}],8:[function(t,e,n){"use strict";e.exports=function(t){function e(){this._trace=new e.CapturedTrace(r())}function n(){return i?new e:void 0}function r(){var t=o.length-1;return t>=0?o[t]:void 0}var i=!1,o=[];return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},e.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,o.push(this._trace))},e.prototype._popContext=function(){if(void 0!==this._trace){var t=o.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},e.CapturedTrace=null,e.create=n,e.deactivateLongStackTraces=function(){},e.activateLongStackTraces=function(){var n=t.prototype._pushContext,o=t.prototype._popContext,s=t._peekContext,a=t.prototype._peekContext,c=t.prototype._promiseCreated;e.deactivateLongStackTraces=function(){t.prototype._pushContext=n,t.prototype._popContext=o,t._peekContext=s,t.prototype._peekContext=a,t.prototype._promiseCreated=c,i=!1},i=!0,t.prototype._pushContext=e.prototype._pushContext,t.prototype._popContext=e.prototype._popContext,t._peekContext=t.prototype._peekContext=r,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},e}},{}],9:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t,e){return{promise:e}}function i(){return!1}function o(t,e,n){var r=this;try{t(e,n,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+H.toString(t));r._attachCancellationCallback(t)})}catch(i){return i}}function s(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?H.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function a(){return this._onCancelField}function c(t){this._onCancelField=t}function l(){this._cancellationParent=void 0,this._onCancelField=void 0}function u(t,e){if(0!==(1&e)){this._cancellationParent=t;var n=t._branchesRemainingToCancel;void 0===n&&(n=0),t._branchesRemainingToCancel=n+1}0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function p(t,e){0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function h(){var t=this._boundTo;return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t}function f(){this._trace=new S(this._peekContext())}function _(t,e){if(N(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var r=j(t);H.notEnumerableProp(t,"stack",r.message+"\n"+r.stack.join("\n")),H.notEnumerableProp(t,"__stackCleaned__",!0)}}}function d(t,e,n,r,i){if(void 0===t&&null!==e&&W){if(void 0!==i&&i._returnedNonUndefined())return;if(0===(65535&r._bitField))return;n&&(n+=" ");var o="",s="";if(e._trace){for(var a=e._trace.stack.split("\n"),c=w(a),l=c.length-1;l>=0;--l){var u=c[l];if(!U.test(u)){var p=u.match(M);p&&(o="at "+p[1]+":"+p[2]+":"+p[3]+" ");break}}if(c.length>0)for(var h=c[0],l=0;l<a.length;++l)if(a[l]===h){l>0&&(s="\n"+a[l-1]);break}}var f="a promise was created in a "+n+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+s;r._warn(f,!0,e)}}function v(t,e){var n=t+" is deprecated and will be removed in a future version.";return e&&(n+=" Use "+e+" instead."),y(n)}function y(t,n,r){if(ot.warnings){var i,o=new L(t);if(n)r._attachExtraTrace(o);else if(ot.longStackTraces&&(i=e._peekContext()))i.attachExtraTrace(o);else{var s=j(o);o.stack=s.message+"\n"+s.stack.join("\n")}tt("warning",o)||E(o,"",!0)}}function m(t,e){for(var n=0;n<e.length-1;++n)e[n].push("From previous event:"),e[n]=e[n].join("\n");return n<e.length&&(e[n]=e[n].join("\n")),t+"\n"+e.join("\n")}function g(t){for(var e=0;e<t.length;++e)(0===t[e].length||e+1<t.length&&t[e][0]===t[e+1][0])&&(t.splice(e,1),e--)}function b(t){for(var e=t[0],n=1;n<t.length;++n){for(var r=t[n],i=e.length-1,o=e[i],s=-1,a=r.length-1;a>=0;--a)if(r[a]===o){s=a;break}for(var a=s;a>=0;--a){var c=r[a];if(e[i]!==c)break;e.pop(),i--}e=r}}function w(t){for(var e=[],n=0;n<t.length;++n){var r=t[n],i=" (No stack trace)"===r||q.test(r),o=i&&nt(r);i&&!o&&($&&" "!==r.charAt(0)&&(r=" "+r),e.push(r))}return e}function C(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),n=0;n<e.length;++n){var r=e[n];if(" (No stack trace)"===r||q.test(r))break}return n>0&&"SyntaxError"!=t.name&&(e=e.slice(n)),e}function j(t){var e=t.stack,n=t.toString();return e="string"==typeof e&&e.length>0?C(t):[" (No stack trace)"],{message:n,stack:"SyntaxError"==t.name?e:w(e)}}function E(t,e,n){if("undefined"!=typeof console){var r;if(H.isObject(t)){var i=t.stack;r=e+Q(i,t)}else r=e+String(t);"function"==typeof D?D(r,n):("function"==typeof console.log||"object"==typeof console.log)&&console.log(r)}}function k(t,e,n,r){var i=!1;try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(r):e(n,r))}catch(o){I.throwLater(o)}"unhandledRejection"===t?tt(t,n,r)||i||E(n,"Unhandled rejection "):tt(t,r)}function F(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():H.toString(t);var n=/\[object [a-zA-Z0-9$_]+\]/;if(n.test(e))try{var r=JSON.stringify(t);e=r}catch(i){}0===e.length&&(e="(empty array)")}return"(<"+x(e)+">, no stack trace)"}function x(t){var e=41;return t.length<e?t:t.substr(0,e-3)+"..."}function T(){return"function"==typeof it}function P(t){var e=t.match(rt);return e?{fileName:e[1],line:parseInt(e[2],10)}:void 0}function R(t,e){if(T()){for(var n,r,i=t.stack.split("\n"),o=e.stack.split("\n"),s=-1,a=-1,c=0;c<i.length;++c){var l=P(i[c]);if(l){n=l.fileName,s=l.line;break}}for(var c=0;c<o.length;++c){var l=P(o[c]);if(l){r=l.fileName,a=l.line;break}}0>s||0>a||!n||!r||n!==r||s>=a||(nt=function(t){if(B.test(t))return!0;var e=P(t);return e&&e.fileName===n&&s<=e.line&&e.line<=a?!0:!1})}}function S(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);it(this,S),e>32&&this.uncycle()}var O,A,D,V=e._getDomain,I=e._async,L=t("./errors").Warning,H=t("./util"),N=H.canAttachTrace,B=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,U=/\((?:timers\.js):\d+:\d+\)/,M=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,q=null,Q=null,$=!1,G=!(0==H.env("BLUEBIRD_DEBUG")||!H.env("BLUEBIRD_DEBUG")&&"development"!==H.env("NODE_ENV")),z=!(0==H.env("BLUEBIRD_WARNINGS")||!G&&!H.env("BLUEBIRD_WARNINGS")),X=!(0==H.env("BLUEBIRD_LONG_STACK_TRACES")||!G&&!H.env("BLUEBIRD_LONG_STACK_TRACES")),W=0!=H.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(z||!!H.env("BLUEBIRD_W_FORGOTTEN_RETURN"));e.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288},e.prototype._ensurePossibleRejectionHandled=function(){0===(524288&this._bitField)&&(this._setRejectionIsUnhandled(),I.invokeLater(this._notifyUnhandledRejection,this,void 0))},e.prototype._notifyUnhandledRejectionIsHandled=function(){k("rejectionHandled",O,void 0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},e.prototype._returnedNonUndefined=function(){return 0!==(268435456&this._bitField)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),k("unhandledRejection",A,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},e.prototype._warn=function(t,e,n){return y(t,e,n||this)},e.onPossiblyUnhandledRejection=function(t){var e=V();A="function"==typeof t?null===e?t:H.domainBind(e,t):void 0},e.onUnhandledRejectionHandled=function(t){var e=V();O="function"==typeof t?null===e?t:H.domainBind(e,t):void 0};var K=function(){};e.longStackTraces=function(){if(I.haveItemsQueued()&&!ot.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!ot.longStackTraces&&T()){var t=e.prototype._captureStackTrace,r=e.prototype._attachExtraTrace;ot.longStackTraces=!0,K=function(){if(I.haveItemsQueued()&&!ot.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");e.prototype._captureStackTrace=t,e.prototype._attachExtraTrace=r,n.deactivateLongStackTraces(),I.enableTrampoline(),ot.longStackTraces=!1},e.prototype._captureStackTrace=f,e.prototype._attachExtraTrace=_,n.activateLongStackTraces(),I.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){return ot.longStackTraces&&T()};var J=function(){try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return H.global.dispatchEvent(t),function(t,e){var n=new CustomEvent(t.toLowerCase(),{detail:e,cancelable:!0});return!H.global.dispatchEvent(n)}}if("function"==typeof Event){var t=new Event("CustomEvent");return H.global.dispatchEvent(t),function(t,e){var n=new Event(t.toLowerCase(),{cancelable:!0});return n.detail=e,!H.global.dispatchEvent(n)}}var t=document.createEvent("CustomEvent");return t.initCustomEvent("testingtheevent",!1,!0,{}),H.global.dispatchEvent(t),function(t,e){var n=document.createEvent("CustomEvent");return n.initCustomEvent(t.toLowerCase(),!1,!0,e),!H.global.dispatchEvent(n)}}catch(e){}return function(){return!1}}(),Y=function(){return H.isNode?function(){return process.emit.apply(process,arguments)}:H.global?function(t){var e="on"+t.toLowerCase(),n=H.global[e];return n?(n.apply(H.global,[].slice.call(arguments,1)),!0):!1}:function(){return!1}}(),Z={promiseCreated:r,promiseFulfilled:r,promiseRejected:r,promiseResolved:r,promiseCancelled:r,promiseChained:function(t,e,n){return{promise:e,child:n}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,n){return{reason:e,promise:n}},rejectionHandled:r},tt=function(t){var e=!1;try{e=Y.apply(null,arguments)}catch(n){I.throwLater(n),e=!0}var r=!1;try{r=J(t,Z[t].apply(null,arguments))}catch(n){I.throwLater(n),r=!0}return r||e};e.config=function(t){if(t=Object(t),"longStackTraces"in t&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&K()),"warnings"in t){var n=t.warnings;ot.warnings=!!n,W=ot.warnings,H.isObject(n)&&"wForgottenReturn"in n&&(W=!!n.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!ot.cancellation){if(I.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=l,e.prototype._propagateFrom=u,e.prototype._onCancel=a,e.prototype._setOnCancel=c,e.prototype._attachCancellationCallback=s,e.prototype._execute=o,et=u,ot.cancellation=!0}return"monitoring"in t&&(t.monitoring&&!ot.monitoring?(ot.monitoring=!0,e.prototype._fireEvent=tt):!t.monitoring&&ot.monitoring&&(ot.monitoring=!1,e.prototype._fireEvent=i)),e},e.prototype._fireEvent=i,e.prototype._execute=function(t,e,n){try{t(e,n)}catch(r){return r}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(t){},e.prototype._attachCancellationCallback=function(t){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(t,e){};var et=p,nt=function(){return!1},rt=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;H.inherits(S,Error),n.CapturedTrace=S,S.prototype.uncycle=function(){var t=this._length;if(!(2>t)){for(var e=[],n={},r=0,i=this;void 0!==i;++r)e.push(i),i=i._parent;t=this._length=r;for(var r=t-1;r>=0;--r){var o=e[r].stack;void 0===n[o]&&(n[o]=r)}for(var r=0;t>r;++r){var s=e[r].stack,a=n[s];if(void 0!==a&&a!==r){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[r]._parent=void 0,e[r]._length=1;var c=r>0?e[r-1]:this;t-1>a?(c._parent=e[a+1],c._parent.uncycle(),c._length=c._parent._length+1):(c._parent=void 0,c._length=1);for(var l=c._length+1,u=r-2;u>=0;--u)e[u]._length=l,l++;return}}}},S.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=j(t),n=e.message,r=[e.stack],i=this;void 0!==i;)r.push(w(i.stack.split("\n"))),i=i._parent;b(r),g(r),H.notEnumerableProp(t,"stack",m(n,r)),H.notEnumerableProp(t,"__stackCleaned__",!0)}};var it=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():F(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,q=t,Q=e;var n=Error.captureStackTrace;return nt=function(t){return B.test(t)},function(t,e){Error.stackTraceLimit+=6,n(t,e),Error.stackTraceLimit-=6}}var r=new Error;if("string"==typeof r.stack&&r.stack.split("\n")[0].indexOf("stackDetection@")>=0)return q=/@/,Q=e,$=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(o){i="stack"in o}return"stack"in r||!i||"number"!=typeof Error.stackTraceLimit?(Q=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?F(e):e.toString()},null):(q=t,Q=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}([]);"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(D=function(t){console.warn(t)},H.isNode&&process.stderr.isTTY?D=function(t,e){var n=e?"[33m":"[31m";console.warn(n+t+"[0m\n")}:H.isNode||"string"!=typeof(new Error).stack||(D=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var ot={warnings:z,longStackTraces:!1,cancellation:!1,monitoring:!1};return X&&e.longStackTraces(),{longStackTraces:function(){return ot.longStackTraces},warnings:function(){return ot.warnings},cancellation:function(){return ot.cancellation},monitoring:function(){return ot.monitoring},propagateFromFunction:function(){return et},boundValueFunction:function(){return h},checkForgottenReturns:d,setBounds:R,warn:y,deprecated:v,CapturedTrace:S,fireDomEvent:J,fireGlobalEvent:Y}}},{"./errors":12,"./util":36}],10:[function(t,e,n){"use strict";e.exports=function(t){function e(){return this.value}function n(){throw this.reason}t.prototype["return"]=t.prototype.thenReturn=function(n){return n instanceof t&&n.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:n},void 0)},t.prototype["throw"]=t.prototype.thenThrow=function(t){return this._then(n,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:t},void 0);var e=arguments[1],r=function(){throw e};return this.caught(t,r)},t.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof t&&n.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:n},void 0);var r=arguments[1];r instanceof t&&r.suppressUnhandledRejections();var i=function(){return r};return this.caught(n,i)}}},{}],11:[function(t,e,n){"use strict";e.exports=function(t,e){function n(){return o(this)}function r(t,n){return i(t,n,e,e)}var i=t.reduce,o=t.all;t.prototype.each=function(t){return i(this,t,e,0)._then(n,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return i(this,t,e,e)},t.each=function(t,r){return i(t,r,e,0)._then(n,void 0,void 0,t,void 0)},t.mapSeries=r}},{}],12:[function(t,e,n){"use strict";function r(t,e){function n(r){return this instanceof n?(p(this,"message","string"==typeof r?r:e),p(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new n(r)}return u(n,Error),n}function i(t){return this instanceof i?(p(this,"name","OperationalError"),p(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(p(this,"message",t.message),p(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new i(t)}var o,s,a=t("./es5"),c=a.freeze,l=t("./util"),u=l.inherits,p=l.notEnumerableProp,h=r("Warning","warning"),f=r("CancellationError","cancellation error"),_=r("TimeoutError","timeout error"),d=r("AggregateError","aggregate error");try{o=TypeError,s=RangeError}catch(v){o=r("TypeError","type error"),s=r("RangeError","range error")}for(var y="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),m=0;m<y.length;++m)"function"==typeof Array.prototype[y[m]]&&(d.prototype[y[m]]=Array.prototype[y[m]]);a.defineProperty(d.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),d.prototype.isOperational=!0;var g=0;d.prototype.toString=function(){var t=Array(4*g+1).join(" "),e="\n"+t+"AggregateError of:\n";g++,t=Array(4*g+1).join(" ");for(var n=0;n<this.length;++n){for(var r=this[n]===this?"[Circular AggregateError]":this[n]+"",i=r.split("\n"),o=0;o<i.length;++o)i[o]=t+i[o];r=i.join("\n"),e+=r+"\n"}return g--,e},u(i,Error);var b=Error.__BluebirdErrorTypes__;b||(b=c({CancellationError:f,TimeoutError:_,OperationalError:i,RejectionError:i,AggregateError:d}),a.defineProperty(Error,"__BluebirdErrorTypes__",{value:b,writable:!1,enumerable:!1,configurable:!1})),e.exports={Error:Error,TypeError:o,RangeError:s,CancellationError:b.CancellationError,OperationalError:b.OperationalError,TimeoutError:b.TimeoutError,AggregateError:b.AggregateError,Warning:h}},{"./es5":13,"./util":36}],13:[function(t,e,n){var r=function(){"use strict";return void 0===this}();if(r)e.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:r,propertyIsWritable:function(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!(n&&!n.writable&&!n.set)}};else{var i={}.hasOwnProperty,o={}.toString,s={}.constructor.prototype,a=function(t){var e=[];for(var n in t)i.call(t,n)&&e.push(n);return e},c=function(t,e){return{value:t[e]}},l=function(t,e,n){return t[e]=n.value,t},u=function(t){return t},p=function(t){try{return Object(t).constructor.prototype}catch(e){return s}},h=function(t){try{return"[object Array]"===o.call(t)}catch(e){return!1}};e.exports={isArray:h,keys:a,names:a,defineProperty:l,getDescriptor:c,freeze:u,getPrototypeOf:p,isES5:r,propertyIsWritable:function(){return!0}}}},{}],14:[function(t,e,n){"use strict";e.exports=function(t,e){var n=t.map;t.prototype.filter=function(t,r){return n(this,t,r,e)},t.filter=function(t,r,i){return n(t,r,i,e)}}},{}],15:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t,e,n){this.promise=t,this.type=e,this.handler=n,this.called=!1,this.cancelPromise=null}function i(t){this.finallyHandler=t}function o(t,e){return null!=t.cancelPromise?(arguments.length>1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0):!1}function s(){return c.call(this,this.promise._target()._settledValue())}function a(t){return o(this,t)?void 0:(p.e=t,p)}function c(t){var r=this.promise,c=this.handler;if(!this.called){this.called=!0;var l=this.isFinallyHandler()?c.call(r._boundValue()):c.call(r._boundValue(),t);if(void 0!==l){r._setReturnedNonUndefined();var h=n(l,r);if(h instanceof e){if(null!=this.cancelPromise){if(h._isCancelled()){var f=new u("late cancellation observer");return r._attachExtraTrace(f),p.e=f,p}h.isPending()&&h._attachCancellationCallback(new i(this))}return h._then(s,a,void 0,this,void 0)}}}return r.isRejected()?(o(this),p.e=t,p):(o(this),t)}var l=t("./util"),u=e.CancellationError,p=l.errorObj;return r.prototype.isFinallyHandler=function(){return 0===this.type},i.prototype._resultCancelled=function(){o(this.finallyHandler)},e.prototype._passThrough=function(t,e,n,i){return"function"!=typeof t?this.then():this._then(n,i,void 0,new r(this,e,t),void 0)},e.prototype.lastly=e.prototype["finally"]=function(t){return this._passThrough(t,0,c,c)},e.prototype.tap=function(t){return this._passThrough(t,1,c)},r}},{"./util":36}],16:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,n,r){for(var o=0;o<n.length;++o){r._pushContext();var s=f(n[o])(t);if(r._popContext(),s===h){r._pushContext();var a=e.reject(h.e);return r._popContext(),a}var c=i(s,r);if(c instanceof e)return c}return null}function c(t,n,i,o){if(s.cancellation()){var a=new e(r),c=this._finallyPromise=new e(r);this._promise=a.lastly(function(){return c}),a._captureStackTrace(),a._setOnCancel(this)}else{var l=this._promise=new e(r);l._captureStackTrace()}this._stack=o,this._generatorFunction=t,this._receiver=n,this._generator=void 0,this._yieldHandlers="function"==typeof i?[i].concat(_):_,this._yieldedPromise=null,this._cancellationPhase=!1}var l=t("./errors"),u=l.TypeError,p=t("./util"),h=p.errorObj,f=p.tryCatch,_=[];p.inherits(c,o),c.prototype._isResolved=function(){return null===this._promise},c.prototype._cleanup=function(){this._promise=this._generator=null,s.cancellation()&&null!==this._finallyPromise&&(this._finallyPromise._fulfill(),this._finallyPromise=null)},c.prototype._promiseCancelled=function(){if(!this._isResolved()){var t,n="undefined"!=typeof this._generator["return"];if(n)this._promise._pushContext(),t=f(this._generator["return"]).call(this._generator,void 0),this._promise._popContext();else{var r=new e.CancellationError("generator .return() sentinel");e.coroutine.returnSentinel=r,this._promise._attachExtraTrace(r),this._promise._pushContext(),t=f(this._generator["throw"]).call(this._generator,r),this._promise._popContext()}this._cancellationPhase=!0,this._yieldedPromise=null,this._continue(t)}},c.prototype._promiseFulfilled=function(t){this._yieldedPromise=null,this._promise._pushContext();var e=f(this._generator.next).call(this._generator,t);this._promise._popContext(),this._continue(e)},c.prototype._promiseRejected=function(t){this._yieldedPromise=null,this._promise._attachExtraTrace(t),this._promise._pushContext();var e=f(this._generator["throw"]).call(this._generator,t);this._promise._popContext(),this._continue(e)},c.prototype._resultCancelled=function(){if(this._yieldedPromise instanceof e){var t=this._yieldedPromise;this._yieldedPromise=null,t.cancel()}},c.prototype.promise=function(){return this._promise},c.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._promiseFulfilled(void 0)},c.prototype._continue=function(t){var n=this._promise;if(t===h)return this._cleanup(),this._cancellationPhase?n.cancel():n._rejectCallback(t.e,!1);var r=t.value;if(t.done===!0)return this._cleanup(),this._cancellationPhase?n.cancel():n._resolveCallback(r);var o=i(r,this._promise);if(!(o instanceof e)&&(o=a(o,this._yieldHandlers,this._promise),null===o))return void this._promiseRejected(new u("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/MqrFmX\n\n".replace("%s",r)+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")));o=o._target();var s=o._bitField;0===(50397184&s)?(this._yieldedPromise=o,o._proxy(this,null)):0!==(33554432&s)?e._async.invoke(this._promiseFulfilled,this,o._value()):0!==(16777216&s)?e._async.invoke(this._promiseRejected,this,o._reason()):this._promiseCancelled()},e.coroutine=function(t,e){if("function"!=typeof t)throw new u("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var n=Object(e).yieldHandler,r=c,i=(new Error).stack;return function(){var e=t.apply(this,arguments),o=new r(void 0,void 0,n,i),s=o.promise();return o._generator=e,o._promiseFulfilled(void 0),
|
30 |
+
s}},e.coroutine.addYieldHandler=function(t){if("function"!=typeof t)throw new u("expecting a function but got "+p.classString(t));_.push(t)},e.spawn=function(t){if(s.deprecated("Promise.spawn()","Promise.coroutine()"),"function"!=typeof t)return n("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var r=new c(t,this),i=r.promise();return r._run(e.spawn),i}}},{"./errors":12,"./util":36}],17:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){var a=t("./util");a.canEvaluate,a.tryCatch,a.errorObj;e.join=function(){var t,e=arguments.length-1;if(e>0&&"function"==typeof arguments[e]){t=arguments[e];var r}var i=[].slice.call(arguments);t&&i.pop();var r=new n(i).promise();return void 0!==t?r.spread(t):r}}},{"./util":36}],18:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,e,n,r){this.constructor$(t),this._promise._captureStackTrace();var i=l();this._callback=null===i?e:u.domainBind(i,e),this._preservedValues=r===o?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=[],f.invoke(this._asyncInit,this,void 0)}function c(t,n,i,o){if("function"!=typeof n)return r("expecting a function but got "+u.classString(n));var s=0;if(void 0!==i){if("object"!=typeof i||null===i)return e.reject(new TypeError("options argument must be an object but it is "+u.classString(i)));if("number"!=typeof i.concurrency)return e.reject(new TypeError("'concurrency' must be a number but it is "+u.classString(i.concurrency)));s=i.concurrency}return s="number"==typeof s&&isFinite(s)&&s>=1?s:0,new a(t,n,s,o).promise()}var l=e._getDomain,u=t("./util"),p=u.tryCatch,h=u.errorObj,f=e._async;u.inherits(a,n),a.prototype._asyncInit=function(){this._init$(void 0,-2)},a.prototype._init=function(){},a.prototype._promiseFulfilled=function(t,n){var r=this._values,o=this.length(),a=this._preservedValues,c=this._limit;if(0>n){if(n=-1*n-1,r[n]=t,c>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(c>=1&&this._inFlight>=c)return r[n]=t,this._queue.push(n),!1;null!==a&&(a[n]=t);var l=this._promise,u=this._callback,f=l._boundValue();l._pushContext();var _=p(u).call(f,t,n,o),d=l._popContext();if(s.checkForgottenReturns(_,d,null!==a?"Promise.filter":"Promise.map",l),_===h)return this._reject(_.e),!0;var v=i(_,this._promise);if(v instanceof e){v=v._target();var y=v._bitField;if(0===(50397184&y))return c>=1&&this._inFlight++,r[n]=v,v._proxy(this,-1*(n+1)),!1;if(0===(33554432&y))return 0!==(16777216&y)?(this._reject(v._reason()),!0):(this._cancel(),!0);_=v._value()}r[n]=_}var m=++this._totalResolved;return m>=o?(null!==a?this._filter(r,a):this._resolve(r),!0):!1},a.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,n=this._values;t.length>0&&this._inFlight<e;){if(this._isResolved())return;var r=t.pop();this._promiseFulfilled(n[r],r)}},a.prototype._filter=function(t,e){for(var n=e.length,r=new Array(n),i=0,o=0;n>o;++o)t[o]&&(r[i++]=e[o]);r.length=i,this._resolve(r)},a.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(t,e){return c(this,t,e,null)},e.map=function(t,e,n,r){return c(t,e,n,r)}}},{"./util":36}],19:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){var s=t("./util"),a=s.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("expecting a function but got "+s.classString(t));return function(){var r=new e(n);r._captureStackTrace(),r._pushContext();var i=a(t).apply(this,arguments),s=r._popContext();return o.checkForgottenReturns(i,s,"Promise.method",r),r._resolveFromSyncValue(i),r}},e.attempt=e["try"]=function(t){if("function"!=typeof t)return i("expecting a function but got "+s.classString(t));var r=new e(n);r._captureStackTrace(),r._pushContext();var c;if(arguments.length>1){o.deprecated("calling Promise.try with more than 1 argument");var l=arguments[1],u=arguments[2];c=s.isArray(l)?a(t).apply(u,l):a(t).call(u,l)}else c=a(t)();var p=r._popContext();return o.checkForgottenReturns(c,p,"Promise.try",r),r._resolveFromSyncValue(c),r},e.prototype._resolveFromSyncValue=function(t){t===s.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":36}],20:[function(t,e,n){"use strict";function r(t){return t instanceof Error&&u.getPrototypeOf(t)===Error.prototype}function i(t){var e;if(r(t)){e=new l(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=u.keys(t),i=0;i<n.length;++i){var o=n[i];p.test(o)||(e[o]=t[o])}return e}return s.markAsOriginatingFromRejection(t),t}function o(t,e){return function(n,r){if(null!==t){if(n){var o=i(a(n));t._attachExtraTrace(o),t._reject(o)}else if(e){var s=[].slice.call(arguments,1);t._fulfill(s)}else t._fulfill(r);t=null}}}var s=t("./util"),a=s.maybeWrapAsError,c=t("./errors"),l=c.OperationalError,u=t("./es5"),p=/^(?:name|message|stack|cause)$/;e.exports=o},{"./errors":12,"./es5":13,"./util":36}],21:[function(t,e,n){"use strict";e.exports=function(e){function n(t,e){var n=this;if(!o.isArray(t))return r.call(n,t,e);var i=a(e).apply(n._boundValue(),[null].concat(t));i===c&&s.throwLater(i.e)}function r(t,e){var n=this,r=n._boundValue(),i=void 0===t?a(e).call(r,null):a(e).call(r,null,t);i===c&&s.throwLater(i.e)}function i(t,e){var n=this;if(!t){var r=new Error(t+"");r.cause=t,t=r}var i=a(e).call(n._boundValue(),t);i===c&&s.throwLater(i.e)}var o=t("./util"),s=e._async,a=o.tryCatch,c=o.errorObj;e.prototype.asCallback=e.prototype.nodeify=function(t,e){if("function"==typeof t){var o=r;void 0!==e&&Object(e).spread&&(o=n),this._then(o,i,void 0,this,t)}return this}}},{"./util":36}],22:[function(t,e,n){"use strict";e.exports=function(){function n(){}function r(t,e){if("function"!=typeof e)throw new m("expecting a function but got "+f.classString(e));if(t.constructor!==i)throw new m("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n")}function i(t){this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,t!==b&&(r(this,t),this._resolveFromExecutor(t)),this._promiseCreated(),this._fireEvent("promiseCreated",this)}function o(t){this.promise._resolveCallback(t)}function s(t){this.promise._rejectCallback(t,!1)}function a(t){var e=new i(b);e._fulfillmentHandler0=t,e._rejectionHandler0=t,e._promise0=t,e._receiver0=t}var c,l=function(){return new m("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n")},u=function(){return new i.PromiseInspection(this._target())},p=function(t){return i.reject(new m(t))},h={},f=t("./util");c=f.isNode?function(){var t=process.domain;return void 0===t&&(t=null),t}:function(){return null},f.notEnumerableProp(i,"_getDomain",c);var _=t("./es5"),d=t("./async"),v=new d;_.defineProperty(i,"_async",{value:v});var y=t("./errors"),m=i.TypeError=y.TypeError;i.RangeError=y.RangeError;var g=i.CancellationError=y.CancellationError;i.TimeoutError=y.TimeoutError,i.OperationalError=y.OperationalError,i.RejectionError=y.OperationalError,i.AggregateError=y.AggregateError;var b=function(){},w={},C={},j=t("./thenables")(i,b),E=t("./promise_array")(i,b,j,p,n),k=t("./context")(i),F=k.create,x=t("./debuggability")(i,k),T=(x.CapturedTrace,t("./finally")(i,j)),P=t("./catch_filter")(C),R=t("./nodeback"),S=f.errorObj,O=f.tryCatch;return i.prototype.toString=function(){return"[object Promise]"},i.prototype.caught=i.prototype["catch"]=function(t){var e=arguments.length;if(e>1){var n,r=new Array(e-1),i=0;for(n=0;e-1>n;++n){var o=arguments[n];if(!f.isObject(o))return p("expecting an object but got A catch statement predicate "+f.classString(o));r[i++]=o}return r.length=i,t=arguments[n],this.then(void 0,P(r,t,this))}return this.then(void 0,t)},i.prototype.reflect=function(){return this._then(u,u,void 0,this,void 0)},i.prototype.then=function(t,e){if(x.warnings()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+f.classString(t);arguments.length>1&&(n+=", "+f.classString(e)),this._warn(n)}return this._then(t,e,void 0,void 0,void 0)},i.prototype.done=function(t,e){var n=this._then(t,e,void 0,void 0,void 0);n._setIsFinal()},i.prototype.spread=function(t){return"function"!=typeof t?p("expecting a function but got "+f.classString(t)):this.all()._then(t,void 0,void 0,w,void 0)},i.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},i.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new E(this).promise()},i.prototype.error=function(t){return this.caught(f.originatesFromRejection,t)},i.getNewLibraryCopy=e.exports,i.is=function(t){return t instanceof i},i.fromNode=i.fromCallback=function(t){var e=new i(b);e._captureStackTrace();var n=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,r=O(t)(R(e,n));return r===S&&e._rejectCallback(r.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},i.all=function(t){return new E(t).promise()},i.cast=function(t){var e=j(t);return e instanceof i||(e=new i(b),e._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},i.resolve=i.fulfilled=i.cast,i.reject=i.rejected=function(t){var e=new i(b);return e._captureStackTrace(),e._rejectCallback(t,!0),e},i.setScheduler=function(t){if("function"!=typeof t)throw new m("expecting a function but got "+f.classString(t));return v.setScheduler(t)},i.prototype._then=function(t,e,n,r,o){var s=void 0!==o,a=s?o:new i(b),l=this._target(),u=l._bitField;s||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===r&&0!==(2097152&this._bitField)&&(r=0!==(50397184&u)?this._boundValue():l===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var p=c();if(0!==(50397184&u)){var h,_,d=l._settlePromiseCtx;0!==(33554432&u)?(_=l._rejectionHandler0,h=t):0!==(16777216&u)?(_=l._fulfillmentHandler0,h=e,l._unsetRejectionIsUnhandled()):(d=l._settlePromiseLateCancellationObserver,_=new g("late cancellation observer"),l._attachExtraTrace(_),h=e),v.invoke(d,l,{handler:null===p?h:"function"==typeof h&&f.domainBind(p,h),promise:a,receiver:r,value:_})}else l._addCallbacks(t,e,a,r,p);return a},i.prototype._length=function(){return 65535&this._bitField},i.prototype._isFateSealed=function(){return 0!==(117506048&this._bitField)},i.prototype._isFollowing=function(){return 67108864===(67108864&this._bitField)},i.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},i.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},i.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},i.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},i.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},i.prototype._isFinal=function(){return(4194304&this._bitField)>0},i.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},i.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},i.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},i.prototype._setAsyncGuaranteed=function(){v.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},i.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];return e===h?void 0:void 0===e&&this._isBound()?this._boundValue():e},i.prototype._promiseAt=function(t){return this[4*t-4+2]},i.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},i.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},i.prototype._boundValue=function(){},i.prototype._migrateCallback0=function(t){var e=(t._bitField,t._fulfillmentHandler0),n=t._rejectionHandler0,r=t._promise0,i=t._receiverAt(0);void 0===i&&(i=h),this._addCallbacks(e,n,r,i,null)},i.prototype._migrateCallbackAt=function(t,e){var n=t._fulfillmentHandlerAt(e),r=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=h),this._addCallbacks(n,r,i,o,null)},i.prototype._addCallbacks=function(t,e,n,r,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=r,"function"==typeof t&&(this._fulfillmentHandler0=null===i?t:f.domainBind(i,t)),"function"==typeof e&&(this._rejectionHandler0=null===i?e:f.domainBind(i,e));else{var s=4*o-4;this[s+2]=n,this[s+3]=r,"function"==typeof t&&(this[s+0]=null===i?t:f.domainBind(i,t)),"function"==typeof e&&(this[s+1]=null===i?e:f.domainBind(i,e))}return this._setLength(o+1),o},i.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},i.prototype._resolveCallback=function(t,e){if(0===(117506048&this._bitField)){if(t===this)return this._rejectCallback(l(),!1);var n=j(t,this);if(!(n instanceof i))return this._fulfill(t);e&&this._propagateFrom(n,2);var r=n._target();if(r===this)return void this._reject(l());var o=r._bitField;if(0===(50397184&o)){var s=this._length();s>0&&r._migrateCallback0(this);for(var a=1;s>a;++a)r._migrateCallbackAt(this,a);this._setFollowing(),this._setLength(0),this._setFollowee(r)}else if(0!==(33554432&o))this._fulfill(r._value());else if(0!==(16777216&o))this._reject(r._reason());else{var c=new g("late cancellation observer");r._attachExtraTrace(c),this._reject(c)}}},i.prototype._rejectCallback=function(t,e,n){var r=f.ensureErrorObject(t),i=r===t;if(!i&&!n&&x.warnings()){var o="a promise was rejected with a non-error: "+f.classString(t);this._warn(o,!0)}this._attachExtraTrace(r,e?i:!1),this._reject(t)},i.prototype._resolveFromExecutor=function(t){var e=this;this._captureStackTrace(),this._pushContext();var n=!0,r=this._execute(t,function(t){e._resolveCallback(t)},function(t){e._rejectCallback(t,n)});n=!1,this._popContext(),void 0!==r&&e._rejectCallback(r,!0)},i.prototype._settlePromiseFromHandler=function(t,e,n,r){var i=r._bitField;if(0===(65536&i)){r._pushContext();var o;e===w?n&&"number"==typeof n.length?o=O(t).apply(this._boundValue(),n):(o=S,o.e=new m("cannot .spread() a non-array: "+f.classString(n))):o=O(t).call(e,n);var s=r._popContext();i=r._bitField,0===(65536&i)&&(o===C?r._reject(n):o===S?r._rejectCallback(o.e,!1):(x.checkForgottenReturns(o,s,"",r,this),r._resolveCallback(o)))}},i.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},i.prototype._followee=function(){return this._rejectionHandler0},i.prototype._setFollowee=function(t){this._rejectionHandler0=t},i.prototype._settlePromise=function(t,e,r,o){var s=t instanceof i,a=this._bitField,c=0!==(134217728&a);0!==(65536&a)?(s&&t._invokeInternalOnCancel(),r instanceof T&&r.isFinallyHandler()?(r.cancelPromise=t,O(e).call(r,o)===S&&t._reject(S.e)):e===u?t._fulfill(u.call(r)):r instanceof n?r._promiseCancelled(t):s||t instanceof E?t._cancel():r.cancel()):"function"==typeof e?s?(c&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(e,r,o,t)):e.call(r,o,t):r instanceof n?r._isResolved()||(0!==(33554432&a)?r._promiseFulfilled(o,t):r._promiseRejected(o,t)):s&&(c&&t._setAsyncGuaranteed(),0!==(33554432&a)?t._fulfill(o):t._reject(o))},i.prototype._settlePromiseLateCancellationObserver=function(t){var e=t.handler,n=t.promise,r=t.receiver,o=t.value;"function"==typeof e?n instanceof i?this._settlePromiseFromHandler(e,r,o,n):e.call(r,o,n):n instanceof i&&n._reject(o)},i.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)},i.prototype._settlePromise0=function(t,e,n){var r=this._promise0,i=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(r,t,i,e)},i.prototype._clearCallbackDataAtIndex=function(t){var e=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void 0},i.prototype._fulfill=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(t===this){var n=l();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!==(134217728&e)?this._settlePromises():v.settlePromises(this))}},i.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16))return this._setRejected(),this._fulfillmentHandler0=t,this._isFinal()?v.fatalError(t,f.isNode):void((65535&e)>0?v.settlePromises(this):this._ensurePossibleRejectionHandled())},i.prototype._fulfillPromises=function(t,e){for(var n=1;t>n;n++){var r=this._fulfillmentHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},i.prototype._rejectPromises=function(t,e){for(var n=1;t>n;n++){var r=this._rejectionHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},i.prototype._settlePromises=function(){var t=this._bitField,e=65535&t;if(e>0){if(0!==(16842752&t)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,t),this._rejectPromises(e,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,t),this._fulfillPromises(e,r)}this._setLength(0)}this._clearCancellationData()},i.prototype._settledValue=function(){var t=this._bitField;return 0!==(33554432&t)?this._rejectionHandler0:0!==(16777216&t)?this._fulfillmentHandler0:void 0},i.defer=i.pending=function(){x.deprecated("Promise.defer","new Promise");var t=new i(b);return{promise:t,resolve:o,reject:s}},f.notEnumerableProp(i,"_makeSelfResolutionError",l),t("./method")(i,b,j,p,x),t("./bind")(i,b,j,x),t("./cancel")(i,E,p,x),t("./direct_resolve")(i),t("./synchronous_inspection")(i),t("./join")(i,E,j,b,v,c),i.Promise=i,i.version="3.4.7",t("./map.js")(i,E,p,j,b,x),t("./call_get.js")(i),t("./using.js")(i,p,j,F,b,x),t("./timers.js")(i,b,x),t("./generators.js")(i,p,b,j,n,x),t("./nodeify.js")(i),t("./promisify.js")(i,b),t("./props.js")(i,E,j,p),t("./race.js")(i,b,j,p),t("./reduce.js")(i,E,p,j,b,x),t("./settle.js")(i,E,x),t("./some.js")(i,E,p),t("./filter.js")(i,b),t("./each.js")(i,b),t("./any.js")(i),f.toFastProperties(i),f.toFastProperties(i.prototype),a({a:1}),a({b:2}),a({c:3}),a(1),a(function(){}),a(void 0),a(!1),a(new i(b)),x.setBounds(d.firstLineError,f.lastLineError),i}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){function s(t){switch(t){case-2:return[];case-3:return{}}}function a(t){var r=this._promise=new e(n);t instanceof e&&r._propagateFrom(t,3),r._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var c=t("./util");c.isArray;return c.inherits(a,o),a.prototype.length=function(){return this._length},a.prototype.promise=function(){return this._promise},a.prototype._init=function l(t,n){var o=r(this._values,this._promise);if(o instanceof e){o=o._target();var a=o._bitField;if(this._values=o,0===(50397184&a))return this._promise._setAsyncGuaranteed(),o._then(l,this._reject,void 0,this,n);if(0===(33554432&a))return 0!==(16777216&a)?this._reject(o._reason()):this._cancel();o=o._value()}if(o=c.asArray(o),null===o){var u=i("expecting an array or an iterable object but got "+c.classString(o)).reason();return void this._promise._rejectCallback(u,!1)}return 0===o.length?void(-5===n?this._resolveEmptyArray():this._resolve(s(n))):void this._iterate(o)},a.prototype._iterate=function(t){var n=this.getActualLength(t.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var i=this._promise,o=!1,s=null,a=0;n>a;++a){var c=r(t[a],i);c instanceof e?(c=c._target(),s=c._bitField):s=null,o?null!==s&&c.suppressUnhandledRejections():null!==s?0===(50397184&s)?(c._proxy(this,a),this._values[a]=c):o=0!==(33554432&s)?this._promiseFulfilled(c._value(),a):0!==(16777216&s)?this._promiseRejected(c._reason(),a):this._promiseCancelled(a):o=this._promiseFulfilled(c,a)}o||i._setAsyncGuaranteed()},a.prototype._isResolved=function(){return null===this._values},a.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},a.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},a.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1)},a.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;return n>=this._length?(this._resolve(this._values),!0):!1},a.prototype._promiseCancelled=function(){return this._cancel(),!0},a.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},a.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var n=0;n<t.length;++n)t[n]instanceof e&&t[n].cancel()}},a.prototype.shouldCopyValues=function(){return!0},a.prototype.getActualLength=function(t){return t},a}},{"./util":36}],24:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t){return!C.test(t)}function i(t){try{return t.__isPromisified__===!0}catch(e){return!1}}function o(t,e,n){var r=f.getDataPropertyOrDefault(t,e+n,b);return r?i(r):!1}function s(t,e,n){for(var r=0;r<t.length;r+=2){var i=t[r];if(n.test(i))for(var o=i.replace(n,""),s=0;s<t.length;s+=2)if(t[s]===o)throw new m("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/MqrFmX\n".replace("%s",e))}}function a(t,e,n,r){for(var a=f.inheritedDataKeys(t),c=[],l=0;l<a.length;++l){var u=a[l],p=t[u],h=r===j?!0:j(u,p,t);"function"!=typeof p||i(p)||o(t,u,e)||!r(u,p,t,h)||c.push(u,p)}return s(c,e,n),c}function c(t,r,i,o,s,a){function c(){var i=r;r===h&&(i=this);var o=new e(n);o._captureStackTrace();var s="string"==typeof u&&this!==l?this[u]:t,c=_(o,a);try{s.apply(i,d(arguments,c))}catch(p){o._rejectCallback(v(p),!0,!0)}return o._isFateSealed()||o._setAsyncGuaranteed(),o}var l=function(){return this}(),u=t;return"string"==typeof u&&(t=o),f.notEnumerableProp(c,"__isPromisified__",!0),c}function l(t,e,n,r,i){for(var o=new RegExp(E(e)+"$"),s=a(t,e,o,n),c=0,l=s.length;l>c;c+=2){var u=s[c],p=s[c+1],_=u+e;if(r===k)t[_]=k(u,h,u,p,e,i);else{var d=r(p,function(){return k(u,h,u,p,e,i)});f.notEnumerableProp(d,"__isPromisified__",!0),t[_]=d}}return f.toFastProperties(t),t}function u(t,e,n){return k(t,e,void 0,t,null,n)}var p,h={},f=t("./util"),_=t("./nodeback"),d=f.withAppended,v=f.maybeWrapAsError,y=f.canEvaluate,m=t("./errors").TypeError,g="Async",b={__isPromisified__:!0},w=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],C=new RegExp("^(?:"+w.join("|")+")$"),j=function(t){return f.isIdentifier(t)&&"_"!==t.charAt(0)&&"constructor"!==t},E=function(t){return t.replace(/([$])/,"\\$")},k=y?p:c;e.promisify=function(t,e){if("function"!=typeof t)throw new m("expecting a function but got "+f.classString(t));if(i(t))return t;e=Object(e);var n=void 0===e.context?h:e.context,o=!!e.multiArgs,s=u(t,n,o);return f.copyDescriptors(t,s,r),s},e.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new m("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n");e=Object(e);var n=!!e.multiArgs,r=e.suffix;"string"!=typeof r&&(r=g);var i=e.filter;"function"!=typeof i&&(i=j);var o=e.promisifier;if("function"!=typeof o&&(o=k),!f.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n");for(var s=f.inheritedDataKeys(t),a=0;a<s.length;++a){var c=t[s[a]];"constructor"!==s[a]&&f.isClass(c)&&(l(c.prototype,r,i,o,n),l(c,r,i,o,n))}return l(t,r,i,o,n)}}},{"./errors":12,"./nodeback":20,"./util":36}],25:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){function o(t){var e,n=!1;if(void 0!==a&&t instanceof a)e=p(t),n=!0;else{var r=u.keys(t),i=r.length;e=new Array(2*i);for(var o=0;i>o;++o){var s=r[o];e[o]=t[s],e[o+i]=s}}this.constructor$(e),this._isMap=n,this._init$(void 0,-3)}function s(t){var n,s=r(t);return l(s)?(n=s instanceof e?s._then(e.props,void 0,void 0,void 0,void 0):new o(s).promise(),s instanceof e&&n._propagateFrom(s,2),n):i("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")}var a,c=t("./util"),l=c.isObject,u=t("./es5");"function"==typeof Map&&(a=Map);var p=function(){function t(t,r){this[e]=t,this[e+n]=r,e++}var e=0,n=0;return function(r){n=r.size,e=0;var i=new Array(2*r.size);return r.forEach(t,i),i}}(),h=function(t){for(var e=new a,n=t.length/2|0,r=0;n>r;++r){var i=t[n+r],o=t[r];e.set(i,o)}return e};c.inherits(o,n),o.prototype._init=function(){},o.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;if(n>=this._length){var r;if(this._isMap)r=h(this._values);else{r={};for(var i=this.length(),o=0,s=this.length();s>o;++o)r[this._values[o+i]]=this._values[o]}return this._resolve(r),!0}return!1},o.prototype.shouldCopyValues=function(){return!1},o.prototype.getActualLength=function(t){return t>>1},e.prototype.props=function(){return s(this)},e.props=function(t){return s(t)}}},{"./es5":13,"./util":36}],26:[function(t,e,n){"use strict";function r(t,e,n,r,i){for(var o=0;i>o;++o)n[o+r]=t[o+e],t[o+e]=void 0}function i(t){this._capacity=t,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(t){return this._capacity<t},i.prototype._pushOne=function(t){var e=this.length();this._checkCapacity(e+1);var n=this._front+e&this._capacity-1;this[n]=t,this._length=e+1},i.prototype.push=function(t,e,n){var r=this.length()+3;if(this._willBeOverCapacity(r))return this._pushOne(t),this._pushOne(e),void this._pushOne(n);var i=this._front+r-3;this._checkCapacity(r);var o=this._capacity-1;this[i+0&o]=t,this[i+1&o]=e,this[i+2&o]=n,this._length=r},i.prototype.shift=function(){var t=this._front,e=this[t];return this[t]=void 0,this._front=t+1&this._capacity-1,this._length--,e},i.prototype.length=function(){return this._length},i.prototype._checkCapacity=function(t){this._capacity<t&&this._resizeTo(this._capacity<<1)},i.prototype._resizeTo=function(t){var e=this._capacity;this._capacity=t;var n=this._front,i=this._length,o=n+i&e-1;r(this,0,this,e,o)},e.exports=i},{}],27:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){function o(t,o){var c=r(t);if(c instanceof e)return a(c);if(t=s.asArray(t),null===t)return i("expecting an array or an iterable object but got "+s.classString(t));var l=new e(n);void 0!==o&&l._propagateFrom(o,3);for(var u=l._fulfill,p=l._reject,h=0,f=t.length;f>h;++h){var _=t[h];(void 0!==_||h in t)&&e.cast(_)._then(u,p,void 0,l,null)}return l}var s=t("./util"),a=function(t){return t.then(function(e){return o(e,t)})};e.race=function(t){return o(t,void 0)},e.prototype.race=function(){return o(this,void 0)}}},{"./util":36}],28:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,n,r,i){this.constructor$(t);var s=h();this._fn=null===s?n:f.domainBind(s,n),void 0!==r&&(r=e.resolve(r),r._attachCancellationCallback(this)),this._initialValue=r,this._currentCancellable=null,i===o?this._eachValues=Array(this._length):0===i?this._eachValues=null:this._eachValues=void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function c(t,e){this.isFulfilled()?e._resolve(t):e._reject(t)}function l(t,e,n,i){if("function"!=typeof e)return r("expecting a function but got "+f.classString(e));var o=new a(t,e,n,i);return o.promise()}function u(t){this.accum=t,this.array._gotAccum(t);var n=i(this.value,this.array._promise);return n instanceof e?(this.array._currentCancellable=n,n._then(p,void 0,void 0,this,void 0)):p.call(this,n)}function p(t){var n=this.array,r=n._promise,i=_(n._fn);r._pushContext();var o;o=void 0!==n._eachValues?i.call(r._boundValue(),t,this.index,this.length):i.call(r._boundValue(),this.accum,t,this.index,this.length),o instanceof e&&(n._currentCancellable=o);var a=r._popContext();return s.checkForgottenReturns(o,a,void 0!==n._eachValues?"Promise.each":"Promise.reduce",r),o}var h=e._getDomain,f=t("./util"),_=f.tryCatch;f.inherits(a,n),a.prototype._gotAccum=function(t){void 0!==this._eachValues&&null!==this._eachValues&&t!==o&&this._eachValues.push(t)},a.prototype._eachComplete=function(t){return null!==this._eachValues&&this._eachValues.push(t),this._eachValues},a.prototype._init=function(){},a.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},a.prototype.shouldCopyValues=function(){return!1},a.prototype._resolve=function(t){this._promise._resolveCallback(t),this._values=null},a.prototype._resultCancelled=function(t){return t===this._initialValue?this._cancel():void(this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof e&&this._currentCancellable.cancel(),this._initialValue instanceof e&&this._initialValue.cancel()))},a.prototype._iterate=function(t){this._values=t;var n,r,i=t.length;if(void 0!==this._initialValue?(n=this._initialValue,r=0):(n=e.resolve(t[0]),r=1),this._currentCancellable=n,!n.isRejected())for(;i>r;++r){var o={accum:null,value:t[r],index:r,length:i,array:this};n=n._then(u,void 0,void 0,o,void 0)}void 0!==this._eachValues&&(n=n._then(this._eachComplete,void 0,void 0,this,void 0)),n._then(c,c,void 0,n,this)},e.prototype.reduce=function(t,e){return l(this,t,e,null)},e.reduce=function(t,e,n,r){return l(t,e,n,r)}}},{"./util":36}],29:[function(t,e,n){"use strict";var r,i=t("./util"),o=function(){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")},s=i.getNativePromise();if(i.isNode&&"undefined"==typeof MutationObserver){var a=global.setImmediate,c=process.nextTick;r=i.isRecentNode?function(t){a.call(global,t)}:function(t){c.call(process,t)}}else if("function"==typeof s&&"function"==typeof s.resolve){var l=s.resolve();r=function(t){l.then(t)}}else r="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&(window.navigator.standalone||window.cordova)?"undefined"!=typeof setImmediate?function(t){setImmediate(t)}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:o:function(){var t=document.createElement("div"),e={attributes:!0},n=!1,r=document.createElement("div"),i=new MutationObserver(function(){t.classList.toggle("foo"),n=!1});i.observe(r,e);var o=function(){n||(n=!0,r.classList.toggle("foo"))};return function(n){var r=new MutationObserver(function(){r.disconnect(),n()});r.observe(t,e),o()}}();e.exports=r},{"./util":36}],30:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.constructor$(t)}var o=e.PromiseInspection,s=t("./util");s.inherits(i,n),i.prototype._promiseResolved=function(t,e){this._values[t]=e;var n=++this._totalResolved;return n>=this._length?(this._resolve(this._values),!0):!1},i.prototype._promiseFulfilled=function(t,e){var n=new o;return n._bitField=33554432,n._settledValueField=t,this._promiseResolved(e,n)},i.prototype._promiseRejected=function(t,e){var n=new o;return n._bitField=16777216,n._settledValueField=t,this._promiseResolved(e,n)},e.settle=function(t){return r.deprecated(".settle()",".reflect()"),new i(t).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||0>e)return r("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var n=new i(t),o=n.promise();return n.setHowMany(e),n.init(),o}var s=t("./util"),a=t("./errors").RangeError,c=t("./errors").AggregateError,l=s.isArray,u={};s.inherits(i,n),i.prototype._init=function(){
|
31 |
+
if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=l(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()?(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0):!1},i.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},i.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(u),this._checkOutcome())},i.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new c,e=this.length();e<this._values.length;++e)this._values[e]!==u&&t.push(this._values[e]);return t.length>0?this._reject(t):this._cancel(),!0}return!1},i.prototype._fulfilled=function(){return this._totalResolved},i.prototype._rejected=function(){return this._values.length-this.length()},i.prototype._addRejected=function(t){this._values.push(t)},i.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},i.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},i.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new a(e)},i.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return o(t,e)},e.prototype.some=function(t){return o(this,t)},e._SomePromiseArray=i}},{"./errors":12,"./util":36}],32:[function(t,e,n){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var n=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},r=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=e.prototype.isFulfilled=function(){return 0!==(33554432&this._bitField)},o=e.prototype.isRejected=function(){return 0!==(16777216&this._bitField)},s=e.prototype.isPending=function(){return 0===(50397184&this._bitField)},a=e.prototype.isResolved=function(){return 0!==(50331648&this._bitField)};e.prototype.isCancelled=function(){return 0!==(8454144&this._bitField)},t.prototype.__isCancelled=function(){return 65536===(65536&this._bitField)},t.prototype._isCancelled=function(){return this._target().__isCancelled()},t.prototype.isCancelled=function(){return 0!==(8454144&this._target()._bitField)},t.prototype.isPending=function(){return s.call(this._target())},t.prototype.isRejected=function(){return o.call(this._target())},t.prototype.isFulfilled=function(){return i.call(this._target())},t.prototype.isResolved=function(){return a.call(this._target())},t.prototype.value=function(){return n.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),r.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t,r){if(u(t)){if(t instanceof e)return t;var i=o(t);if(i===l){r&&r._pushContext();var c=e.reject(i.e);return r&&r._popContext(),c}if("function"==typeof i){if(s(t)){var c=new e(n);return t._then(c._fulfill,c._reject,void 0,c,null),c}return a(t,i,r)}}return t}function i(t){return t.then}function o(t){try{return i(t)}catch(e){return l.e=e,l}}function s(t){try{return p.call(t,"_promise0")}catch(e){return!1}}function a(t,r,i){function o(t){a&&(a._resolveCallback(t),a=null)}function s(t){a&&(a._rejectCallback(t,p,!0),a=null)}var a=new e(n),u=a;i&&i._pushContext(),a._captureStackTrace(),i&&i._popContext();var p=!0,h=c.tryCatch(r).call(t,o,s);return p=!1,a&&h===l&&(a._rejectCallback(h.e,!0,!0),a=null),u}var c=t("./util"),l=c.errorObj,u=c.isObject,p={}.hasOwnProperty;return r}},{"./util":36}],34:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.handle=t}function o(t){return clearTimeout(this.handle),t}function s(t){throw clearTimeout(this.handle),t}var a=t("./util"),c=e.TimeoutError;i.prototype._resultCancelled=function(){clearTimeout(this.handle)};var l=function(t){return u(+this).thenReturn(t)},u=e.delay=function(t,o){var s,a;return void 0!==o?(s=e.resolve(o)._then(l,null,null,t,void 0),r.cancellation()&&o instanceof e&&s._setOnCancel(o)):(s=new e(n),a=setTimeout(function(){s._fulfill()},+t),r.cancellation()&&s._setOnCancel(new i(a)),s._captureStackTrace()),s._setAsyncGuaranteed(),s};e.prototype.delay=function(t){return u(t,this)};var p=function(t,e,n){var r;r="string"!=typeof e?e instanceof Error?e:new c("operation timed out"):new c(e),a.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._reject(r),null!=n&&n.cancel()};e.prototype.timeout=function(t,e){t=+t;var n,a,c=new i(setTimeout(function(){n.isPending()&&p(n,e,a)},t));return r.cancellation()?(a=this.then(),n=a._then(o,s,void 0,c,void 0),n._setOnCancel(c)):n=this._then(o,s,void 0,c,void 0),n}}},{"./util":36}],35:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t){setTimeout(function(){throw t},0)}function c(t){var e=r(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function l(t,n){function i(){if(s>=l)return u._fulfill();var o=c(t[s++]);if(o instanceof e&&o._isDisposable()){try{o=r(o._getDisposer().tryDispose(n),t.promise)}catch(p){return a(p)}if(o instanceof e)return o._then(i,a,null,null,null)}i()}var s=0,l=t.length,u=new e(o);return i(),u}function u(t,e,n){this._data=t,this._promise=e,this._context=n}function p(t,e,n){this.constructor$(t,e,n)}function h(t){return u.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function f(t){this.length=t,this.promise=null,this[t-1]=null}var _=t("./util"),d=t("./errors").TypeError,v=t("./util").inherits,y=_.errorObj,m=_.tryCatch,g={};u.prototype.data=function(){return this._data},u.prototype.promise=function(){return this._promise},u.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():g},u.prototype.tryDispose=function(t){var e=this.resource(),n=this._context;void 0!==n&&n._pushContext();var r=e!==g?this.doDispose(e,t):null;return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,r},u.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},v(p,u),p.prototype.doDispose=function(t,e){var n=this.data();return n.call(t,t,e)},f.prototype._resultCancelled=function(){for(var t=this.length,n=0;t>n;++n){var r=this[n];r instanceof e&&r.cancel()}},e.using=function(){var t=arguments.length;if(2>t)return n("you must pass at least 2 arguments to Promise.using");var i=arguments[t-1];if("function"!=typeof i)return n("expecting a function but got "+_.classString(i));var o,a=!0;2===t&&Array.isArray(arguments[0])?(o=arguments[0],t=o.length,a=!1):(o=arguments,t--);for(var c=new f(t),p=0;t>p;++p){var d=o[p];if(u.isDisposer(d)){var v=d;d=d.promise(),d._setDisposable(v)}else{var g=r(d);g instanceof e&&(d=g._then(h,null,null,{resources:c,index:p},void 0))}c[p]=d}for(var b=new Array(c.length),p=0;p<b.length;++p)b[p]=e.resolve(c[p]).reflect();var w=e.all(b).then(function(t){for(var e=0;e<t.length;++e){var n=t[e];if(n.isRejected())return y.e=n.error(),y;if(!n.isFulfilled())return void w.cancel();t[e]=n.value()}C._pushContext(),i=m(i);var r=a?i.apply(void 0,t):i(t),o=C._popContext();return s.checkForgottenReturns(r,o,"Promise.using",C),r}),C=w.lastly(function(){var t=new e.PromiseInspection(w);return l(c,t)});return c.promise=C,C._setOnCancel(c),C},e.prototype._setDisposable=function(t){this._bitField=131072|this._bitField,this._disposer=t},e.prototype._isDisposable=function(){return(131072&this._bitField)>0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new p(t,this,i());throw new d}}},{"./errors":12,"./util":36}],36:[function(t,e,n){"use strict";function r(){try{var t=P;return P=null,t.apply(this,arguments)}catch(e){return T.e=e,T}}function i(t){return P=t,r}function o(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function s(t){return"function"==typeof t||"object"==typeof t&&null!==t}function a(t){return o(t)?new Error(v(t)):t}function c(t,e){var n,r=t.length,i=new Array(r+1);for(n=0;r>n;++n)i[n]=t[n];return i[n]=e,i}function l(t,e,n){if(!F.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var r=Object.getOwnPropertyDescriptor(t,e);return null!=r?null==r.get&&null==r.set?r.value:n:void 0}function u(t,e,n){if(o(t))return t;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return F.defineProperty(t,e,r),t}function p(t){throw t}function h(t){try{if("function"==typeof t){var e=F.names(t.prototype),n=F.isES5&&e.length>1,r=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=A.test(t+"")&&F.names(t).length>0;if(n||r||i)return!0}return!1}catch(o){return!1}}function f(t){function e(){}e.prototype=t;for(var n=8;n--;)new e;return t}function _(t){return D.test(t)}function d(t,e,n){for(var r=new Array(t),i=0;t>i;++i)r[i]=e+i+n;return r}function v(t){try{return t+""}catch(e){return"[no string representation]"}}function y(t){return null!==t&&"object"==typeof t&&"string"==typeof t.message&&"string"==typeof t.name}function m(t){try{u(t,"isOperational",!0)}catch(e){}}function g(t){return null==t?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}function b(t){return y(t)&&F.propertyIsWritable(t,"stack")}function w(t){return{}.toString.call(t)}function C(t,e,n){for(var r=F.names(t),i=0;i<r.length;++i){var o=r[i];if(n(o))try{F.defineProperty(e,o,F.getDescriptor(t,o))}catch(s){}}}function j(t){return N?process.env[t]:void 0}function E(){if("function"==typeof Promise)try{var t=new Promise(function(){});if("[object Promise]"==={}.toString.call(t))return Promise}catch(e){}}function k(t,e){return t.bind(e)}var F=t("./es5"),x="undefined"==typeof navigator,T={e:{}},P,R="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0!==this?this:null,S=function(t,e){function n(){this.constructor=t,this.constructor$=e;for(var n in e.prototype)r.call(e.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=e.prototype[n])}var r={}.hasOwnProperty;return n.prototype=e.prototype,t.prototype=new n,t.prototype},O=function(){var t=[Array.prototype,Object.prototype,Function.prototype],e=function(e){for(var n=0;n<t.length;++n)if(t[n]===e)return!0;return!1};if(F.isES5){var n=Object.getOwnPropertyNames;return function(t){for(var r=[],i=Object.create(null);null!=t&&!e(t);){var o;try{o=n(t)}catch(s){return r}for(var a=0;a<o.length;++a){var c=o[a];if(!i[c]){i[c]=!0;var l=Object.getOwnPropertyDescriptor(t,c);null!=l&&null==l.get&&null==l.set&&r.push(c)}}t=F.getPrototypeOf(t)}return r}}var r={}.hasOwnProperty;return function(n){if(e(n))return[];var i=[];t:for(var o in n)if(r.call(n,o))i.push(o);else{for(var s=0;s<t.length;++s)if(r.call(t[s],o))continue t;i.push(o)}return i}}(),A=/this\s*\.\s*\S+\s*=/,D=/^[a-z$_][a-z$_0-9]*$/i,V=function(){return"stack"in new Error?function(t){return b(t)?t:new Error(v(t))}:function(t){if(b(t))return t;try{throw new Error(v(t))}catch(e){return e}}}(),I=function(t){return F.isArray(t)?t:null};if("undefined"!=typeof Symbol&&Symbol.iterator){var L="function"==typeof Array.from?function(t){return Array.from(t)}:function(t){for(var e,n=[],r=t[Symbol.iterator]();!(e=r.next()).done;)n.push(e.value);return n};I=function(t){return F.isArray(t)?t:null!=t&&"function"==typeof t[Symbol.iterator]?L(t):null}}var H="undefined"!=typeof process&&"[object process]"===w(process).toLowerCase(),N="undefined"!=typeof process&&"undefined"!=typeof process.env,B={isClass:h,isIdentifier:_,inheritedDataKeys:O,getDataPropertyOrDefault:l,thrower:p,isArray:F.isArray,asArray:I,notEnumerableProp:u,isPrimitive:o,isObject:s,isError:y,canEvaluate:x,errorObj:T,tryCatch:i,inherits:S,withAppended:c,maybeWrapAsError:a,toFastProperties:f,filledRange:d,toString:v,canAttachTrace:b,ensureErrorObject:V,originatesFromRejection:g,markAsOriginatingFromRejection:m,classString:w,copyDescriptors:C,hasDevTools:"undefined"!=typeof chrome&&chrome&&"function"==typeof chrome.loadTimes,isNode:H,hasEnvVariables:N,env:j,global:R,getNativePromise:E,domainBind:k};B.isRecentNode=B.isNode&&function(){var t=process.versions.node.split(".").map(Number);return 0===t[0]&&t[1]>10||t[0]>0}(),B.isNode&&B.toFastProperties(process);try{throw new Error}catch(U){B.lastLineError=U}e.exports=B},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise);
|
32 |
+
|
33 |
(function($) {
|
34 |
window.NggPaginatedGallery = function(displayed_gallery_id, container) {
|
35 |
this.displayed_gallery_id = displayed_gallery_id;
|
90 |
});
|
91 |
if (replacement) {
|
92 |
self.container.each(function () {
|
93 |
+
var $this = $(this);
|
94 |
+
|
95 |
+
if ($this.data('nextgen-gallery-id') != self.displayed_gallery_id) {
|
96 |
return true;
|
97 |
}
|
98 |
+
|
99 |
+
// If the image gallery makes up the bulk of the post/page content the .html() call
|
100 |
+
// below will empty the contents causing the browser's scroll position to be reset to
|
101 |
+
// zero as the browser believes it has been pushed back to the top of the page. Here
|
102 |
+
// we give the parent container a min-height equal to the gallery's height to prevent
|
103 |
+
// this flicker and resetting of the scroll position.
|
104 |
+
var $new_element = $(replacement.html());
|
105 |
+
var promises = $new_element.find('img').toArray().map(function(img){
|
106 |
+
return new Promise(function(resolve, reject){
|
107 |
+
var i = new Image();
|
108 |
+
i.src = img.src;
|
109 |
+
$(i).on('load', resolve);
|
110 |
+
});
|
111 |
+
});
|
112 |
+
|
113 |
+
Promise.all(promises).then(function(){
|
114 |
+
$this.html($new_element);
|
115 |
+
|
116 |
+
// Let the user know that we've refreshed the content
|
117 |
+
$(document).trigger('refreshed');
|
118 |
+
});
|
119 |
+
|
120 |
return true;
|
121 |
});
|
|
|
|
|
|
|
122 |
}
|
123 |
}
|
124 |
});
|
products/photocrati_nextgen/modules/nextgen_gallery_display/static/common.min.js
CHANGED
@@ -1 +1,3 @@
|
|
1 |
-
!function(n){window.NggPaginatedGallery=function(a,e){this.displayed_gallery_id=a,this.container=n(e),this.container_name=e,this.get_displayed_gallery_obj=function(){var n="gallery_"+this.displayed_gallery_id;return"undefined"!=typeof window.galleries[n]&&window.galleries[n]},this.enable_ajax_pagination=function(){var a=this;n("body").on("click","a.ngg-browser-prev, a.ngg-browser-next",function(i){var t=!0;n(this).parents(e).each(function(){return n(this).data("nextgen-gallery-id")!=a.displayed_gallery_id||void(t=!1)}),t||(i.preventDefault(),window.ngg_ajax_operaton_count++,n("body, a").css("cursor","wait"),n.get(n(this).attr("href"),function(e){if(window.ngg_ajax_operaton_count--,window.ngg_ajax_operaton_count<=0&&(window.ngg_ajax_operaton_count=0,n("body, a").css("cursor","auto")),e){var i=n(e),t=!1;i.find(a.container_name).each(function(){return!!t||(n(this).data("nextgen-gallery-id")!=a.displayed_gallery_id||void(t=n(this)))}),t&&(a.container.each(function(){return n(this).data("nextgen-gallery-id")!=a.displayed_gallery_id||(n(this).html(t.html()),!0)}),n(document).trigger("refreshed"))}}))})};var i=this.get_displayed_gallery_obj();i&&"undefined"!=typeof i.display_settings.ajax_pagination&&parseInt(i.display_settings.ajax_pagination)&&this.enable_ajax_pagination(),"undefined"==typeof window.ngg_ajax_operation_count&&(window.ngg_ajax_operaton_count=0)}}(jQuery);
|
|
|
|
1 |
+
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Promise=t()}}(function(){return function t(e,n,r){function i(s,a){if(!n[s]){if(!e[s]){var c="function"==typeof _dereq_&&_dereq_;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[s]={exports:{}};e[s][0].call(u.exports,function(t){var n=e[s][1][t];return i(n?n:t)},u,u.exports,t,e,n,r)}return n[s].exports}for(var o="function"==typeof _dereq_&&_dereq_,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(t,e,n){"use strict";e.exports=function(t){function e(t){var e=new n(t),r=e.promise();return e.setHowMany(1),e.setUnwrap(),e.init(),r}var n=t._SomePromiseArray;t.any=function(t){return e(t)},t.prototype.any=function(){return e(this)}}},{}],2:[function(t,e,n){"use strict";function r(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new l(16),this._normalQueue=new l(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var t=this;this.drainQueues=function(){t._drainQueues()},this._schedule=c}function i(t,e,n){this._lateQueue.push(t,e,n),this._queueTick()}function o(t,e,n){this._normalQueue.push(t,e,n),this._queueTick()}function s(t){this._normalQueue._pushOne(t),this._queueTick()}var a;try{throw new Error}catch(t){a=t}var c=t("./schedule"),l=t("./queue"),u=t("./util");r.prototype.setScheduler=function(t){var e=this._schedule;return this._schedule=t,this._customScheduler=!0,e},r.prototype.hasCustomScheduler=function(){return this._customScheduler},r.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},r.prototype.disableTrampolineIfNecessary=function(){u.hasDevTools&&(this._trampolineEnabled=!1)},r.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},r.prototype.fatalError=function(t,e){e?(process.stderr.write("Fatal "+(t instanceof Error?t.stack:t)+"\n"),process.exit(2)):this.throwLater(t)},r.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(t){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},u.hasDevTools?(r.prototype.invokeLater=function(t,e,n){this._trampolineEnabled?i.call(this,t,e,n):this._schedule(function(){setTimeout(function(){t.call(e,n)},100)})},r.prototype.invoke=function(t,e,n){this._trampolineEnabled?o.call(this,t,e,n):this._schedule(function(){t.call(e,n)})},r.prototype.settlePromises=function(t){this._trampolineEnabled?s.call(this,t):this._schedule(function(){t._settlePromises()})}):(r.prototype.invokeLater=i,r.prototype.invoke=o,r.prototype.settlePromises=s),r.prototype._drainQueue=function(t){for(;t.length()>0;){var e=t.shift();if("function"==typeof e){var n=t.shift(),r=t.shift();e.call(n,r)}else e._settlePromises()}},r.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},e.exports=r,e.exports.firstLineError=a},{"./queue":26,"./schedule":29,"./util":36}],3:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){var i=!1,o=function(t,e){this._reject(e)},s=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},a=function(t,e){0===(50397184&this._bitField)&&this._resolveCallback(e.target)},c=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=r.propagateFromFunction(),t.prototype._boundValue=r.boundValueFunction());var l=n(o),u=new t(e);u._propagateFrom(this,1);var p=this._target();if(u._setBoundTo(l),l instanceof t){var h={promiseRejectionQueued:!1,promise:u,target:p,bindingPromise:l};p._then(e,s,void 0,u,h),l._then(a,c,void 0,u,h),u._setOnCancel(l)}else u._resolveCallback(p);return u},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152===(2097152&this._bitField)},t.bind=function(e,n){return t.resolve(n).bind(e)}}},{}],4:[function(t,e,n){"use strict";function r(){try{Promise===o&&(Promise=i)}catch(t){}return o}var i;"undefined"!=typeof Promise&&(i=Promise);var o=t("./promise")();o.noConflict=r,e.exports=o},{"./promise":22}],5:[function(t,e,n){"use strict";var r=Object.create;if(r){var i=r(null),o=r(null);i[" size"]=o[" size"]=0}e.exports=function(e){function n(t,n){var r;if(null!=t&&(r=t[n]),"function"!=typeof r){var i="Object "+a.classString(t)+" has no method '"+a.toString(n)+"'";throw new e.TypeError(i)}return r}function r(t){var e=this.pop(),r=n(t,e);return r.apply(t,this)}function i(t){return t[this]}function o(t){var e=+this;return 0>e&&(e=Math.max(0,e+t.length)),t[e]}var s,a=t("./util"),c=a.canEvaluate;a.isIdentifier,e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(r,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e,n="number"==typeof t;if(n)e=o;else if(c){var r=s(t);e=null!==r?r:i}else e=i;return this._then(e,void 0,void 0,t,void 0)}}},{"./util":36}],6:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){var o=t("./util"),s=o.tryCatch,a=o.errorObj,c=e._async;e.prototype.break=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var n=t._cancellationParent;if(null==n||!n._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=n}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var n=0;n<t.length;++n)this._doInvokeOnCancel(t[n],e);else if(void 0!==t)if("function"==typeof t){if(!e){var r=s(t).call(this._boundValue());r===a&&(this._attachExtraTrace(r.e),c.throwLater(r.e))}}else t._resultCancelled(this)},e.prototype._invokeOnCancel=function(){var t=this._onCancel();this._unsetOnCancel(),c.invoke(this._doInvokeOnCancel,this,t)},e.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},e.prototype._resultCancelled=function(){this.cancel()}}},{"./util":36}],7:[function(t,e,n){"use strict";e.exports=function(e){function n(t,n,a){return function(c){var l=a._boundValue();t:for(var u=0;u<t.length;++u){var p=t[u];if(p===Error||null!=p&&p.prototype instanceof Error){if(c instanceof p)return o(n).call(l,c)}else if("function"==typeof p){var h=o(p).call(l,c);if(h===s)return h;if(h)return o(n).call(l,c)}else if(r.isObject(c)){for(var f=i(p),_=0;_<f.length;++_){var d=f[_];if(p[d]!=c[d])continue t}return o(n).call(l,c)}}return e}}var r=t("./util"),i=t("./es5").keys,o=r.tryCatch,s=r.errorObj;return n}},{"./es5":13,"./util":36}],8:[function(t,e,n){"use strict";e.exports=function(t){function e(){this._trace=new e.CapturedTrace(r())}function n(){return i?new e:void 0}function r(){var t=o.length-1;return t>=0?o[t]:void 0}var i=!1,o=[];return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},e.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,o.push(this._trace))},e.prototype._popContext=function(){if(void 0!==this._trace){var t=o.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},e.CapturedTrace=null,e.create=n,e.deactivateLongStackTraces=function(){},e.activateLongStackTraces=function(){var n=t.prototype._pushContext,o=t.prototype._popContext,s=t._peekContext,a=t.prototype._peekContext,c=t.prototype._promiseCreated;e.deactivateLongStackTraces=function(){t.prototype._pushContext=n,t.prototype._popContext=o,t._peekContext=s,t.prototype._peekContext=a,t.prototype._promiseCreated=c,i=!1},i=!0,t.prototype._pushContext=e.prototype._pushContext,t.prototype._popContext=e.prototype._popContext,t._peekContext=t.prototype._peekContext=r,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},e}},{}],9:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t,e){return{promise:e}}function i(){return!1}function o(t,e,n){var r=this;try{t(e,n,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+N.toString(t));r._attachCancellationCallback(t)})}catch(t){return t}}function s(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?N.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function a(){return this._onCancelField}function c(t){this._onCancelField=t}function l(){this._cancellationParent=void 0,this._onCancelField=void 0}function u(t,e){if(0!==(1&e)){this._cancellationParent=t;var n=t._branchesRemainingToCancel;void 0===n&&(n=0),t._branchesRemainingToCancel=n+1}0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function p(t,e){0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function h(){var t=this._boundTo;return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t}function f(){this._trace=new S(this._peekContext())}function _(t,e){if(H(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var r=j(t);N.notEnumerableProp(t,"stack",r.message+"\n"+r.stack.join("\n")),N.notEnumerableProp(t,"__stackCleaned__",!0)}}}function d(t,e,n,r,i){if(void 0===t&&null!==e&&W){if(void 0!==i&&i._returnedNonUndefined())return;if(0===(65535&r._bitField))return;n&&(n+=" ");var o="",s="";if(e._trace){for(var a=e._trace.stack.split("\n"),c=w(a),l=c.length-1;l>=0;--l){var u=c[l];if(!U.test(u)){var p=u.match(M);p&&(o="at "+p[1]+":"+p[2]+":"+p[3]+" ");break}}if(c.length>0)for(var h=c[0],l=0;l<a.length;++l)if(a[l]===h){l>0&&(s="\n"+a[l-1]);break}}var f="a promise was created in a "+n+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+s;r._warn(f,!0,e)}}function v(t,e){var n=t+" is deprecated and will be removed in a future version.";return e&&(n+=" Use "+e+" instead."),y(n)}function y(t,n,r){if(ot.warnings){var i,o=new L(t);if(n)r._attachExtraTrace(o);else if(ot.longStackTraces&&(i=e._peekContext()))i.attachExtraTrace(o);else{var s=j(o);o.stack=s.message+"\n"+s.stack.join("\n")}tt("warning",o)||E(o,"",!0)}}function g(t,e){for(var n=0;n<e.length-1;++n)e[n].push("From previous event:"),e[n]=e[n].join("\n");return n<e.length&&(e[n]=e[n].join("\n")),t+"\n"+e.join("\n")}function m(t){for(var e=0;e<t.length;++e)(0===t[e].length||e+1<t.length&&t[e][0]===t[e+1][0])&&(t.splice(e,1),e--)}function b(t){for(var e=t[0],n=1;n<t.length;++n){for(var r=t[n],i=e.length-1,o=e[i],s=-1,a=r.length-1;a>=0;--a)if(r[a]===o){s=a;break}for(var a=s;a>=0;--a){var c=r[a];if(e[i]!==c)break;e.pop(),i--}e=r}}function w(t){for(var e=[],n=0;n<t.length;++n){var r=t[n],i=" (No stack trace)"===r||q.test(r),o=i&&nt(r);i&&!o&&($&&" "!==r.charAt(0)&&(r=" "+r),e.push(r))}return e}function C(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),n=0;n<e.length;++n){var r=e[n];if(" (No stack trace)"===r||q.test(r))break}return n>0&&"SyntaxError"!=t.name&&(e=e.slice(n)),e}function j(t){var e=t.stack,n=t.toString();return e="string"==typeof e&&e.length>0?C(t):[" (No stack trace)"],{message:n,stack:"SyntaxError"==t.name?e:w(e)}}function E(t,e,n){if("undefined"!=typeof console){var r;if(N.isObject(t)){var i=t.stack;r=e+Q(i,t)}else r=e+String(t);"function"==typeof D?D(r,n):("function"==typeof console.log||"object"==typeof console.log)&&console.log(r)}}function k(t,e,n,r){var i=!1;try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(r):e(n,r))}catch(t){I.throwLater(t)}"unhandledRejection"===t?tt(t,n,r)||i||E(n,"Unhandled rejection "):tt(t,r)}function F(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():N.toString(t);var n=/\[object [a-zA-Z0-9$_]+\]/;if(n.test(e))try{var r=JSON.stringify(t);e=r}catch(t){}0===e.length&&(e="(empty array)")}return"(<"+x(e)+">, no stack trace)"}function x(t){var e=41;return t.length<e?t:t.substr(0,e-3)+"..."}function T(){return"function"==typeof it}function P(t){var e=t.match(rt);return e?{fileName:e[1],line:parseInt(e[2],10)}:void 0}function R(t,e){if(T()){for(var n,r,i=t.stack.split("\n"),o=e.stack.split("\n"),s=-1,a=-1,c=0;c<i.length;++c){var l=P(i[c]);if(l){n=l.fileName,s=l.line;break}}for(var c=0;c<o.length;++c){var l=P(o[c]);if(l){r=l.fileName,a=l.line;break}}0>s||0>a||!n||!r||n!==r||s>=a||(nt=function(t){if(B.test(t))return!0;var e=P(t);return!!(e&&e.fileName===n&&s<=e.line&&e.line<=a)})}}function S(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);it(this,S),e>32&&this.uncycle()}var O,A,D,V=e._getDomain,I=e._async,L=t("./errors").Warning,N=t("./util"),H=N.canAttachTrace,B=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,U=/\((?:timers\.js):\d+:\d+\)/,M=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,q=null,Q=null,$=!1,G=!(0==N.env("BLUEBIRD_DEBUG")||!N.env("BLUEBIRD_DEBUG")&&"development"!==N.env("NODE_ENV")),z=!(0==N.env("BLUEBIRD_WARNINGS")||!G&&!N.env("BLUEBIRD_WARNINGS")),X=!(0==N.env("BLUEBIRD_LONG_STACK_TRACES")||!G&&!N.env("BLUEBIRD_LONG_STACK_TRACES")),W=0!=N.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(z||!!N.env("BLUEBIRD_W_FORGOTTEN_RETURN"));e.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288},e.prototype._ensurePossibleRejectionHandled=function(){0===(524288&this._bitField)&&(this._setRejectionIsUnhandled(),I.invokeLater(this._notifyUnhandledRejection,this,void 0))},e.prototype._notifyUnhandledRejectionIsHandled=function(){k("rejectionHandled",O,void 0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},e.prototype._returnedNonUndefined=function(){return 0!==(268435456&this._bitField)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),k("unhandledRejection",A,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},e.prototype._warn=function(t,e,n){return y(t,e,n||this)},e.onPossiblyUnhandledRejection=function(t){var e=V();A="function"==typeof t?null===e?t:N.domainBind(e,t):void 0},e.onUnhandledRejectionHandled=function(t){var e=V();O="function"==typeof t?null===e?t:N.domainBind(e,t):void 0};var K=function(){};e.longStackTraces=function(){if(I.haveItemsQueued()&&!ot.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!ot.longStackTraces&&T()){var t=e.prototype._captureStackTrace,r=e.prototype._attachExtraTrace;ot.longStackTraces=!0,K=function(){if(I.haveItemsQueued()&&!ot.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");e.prototype._captureStackTrace=t,e.prototype._attachExtraTrace=r,n.deactivateLongStackTraces(),I.enableTrampoline(),ot.longStackTraces=!1},e.prototype._captureStackTrace=f,e.prototype._attachExtraTrace=_,n.activateLongStackTraces(),I.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){return ot.longStackTraces&&T()};var J=function(){try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return N.global.dispatchEvent(t),function(t,e){var n=new CustomEvent(t.toLowerCase(),{detail:e,cancelable:!0});return!N.global.dispatchEvent(n)}}if("function"==typeof Event){var t=new Event("CustomEvent");return N.global.dispatchEvent(t),function(t,e){var n=new Event(t.toLowerCase(),{cancelable:!0});return n.detail=e,!N.global.dispatchEvent(n)}}var t=document.createEvent("CustomEvent");return t.initCustomEvent("testingtheevent",!1,!0,{}),N.global.dispatchEvent(t),function(t,e){var n=document.createEvent("CustomEvent");return n.initCustomEvent(t.toLowerCase(),!1,!0,e),!N.global.dispatchEvent(n)}}catch(t){}return function(){return!1}}(),Y=function(){return N.isNode?function(){return process.emit.apply(process,arguments)}:N.global?function(t){var e="on"+t.toLowerCase(),n=N.global[e];return!!n&&(n.apply(N.global,[].slice.call(arguments,1)),!0)}:function(){return!1}}(),Z={promiseCreated:r,promiseFulfilled:r,promiseRejected:r,promiseResolved:r,promiseCancelled:r,promiseChained:function(t,e,n){return{promise:e,child:n}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,n){return{reason:e,promise:n}},rejectionHandled:r},tt=function(t){var e=!1;try{e=Y.apply(null,arguments)}catch(t){I.throwLater(t),e=!0}var n=!1;try{n=J(t,Z[t].apply(null,arguments))}catch(t){I.throwLater(t),n=!0}return n||e};e.config=function(t){if(t=Object(t),"longStackTraces"in t&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&K()),"warnings"in t){var n=t.warnings;ot.warnings=!!n,W=ot.warnings,N.isObject(n)&&"wForgottenReturn"in n&&(W=!!n.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!ot.cancellation){if(I.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=l,e.prototype._propagateFrom=u,e.prototype._onCancel=a,e.prototype._setOnCancel=c,e.prototype._attachCancellationCallback=s,e.prototype._execute=o,et=u,ot.cancellation=!0}return"monitoring"in t&&(t.monitoring&&!ot.monitoring?(ot.monitoring=!0,e.prototype._fireEvent=tt):!t.monitoring&&ot.monitoring&&(ot.monitoring=!1,e.prototype._fireEvent=i)),e},e.prototype._fireEvent=i,e.prototype._execute=function(t,e,n){try{t(e,n)}catch(t){return t}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(t){},e.prototype._attachCancellationCallback=function(t){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(t,e){};var et=p,nt=function(){return!1},rt=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;N.inherits(S,Error),n.CapturedTrace=S,S.prototype.uncycle=function(){var t=this._length;if(!(2>t)){for(var e=[],n={},r=0,i=this;void 0!==i;++r)e.push(i),i=i._parent;t=this._length=r;for(var r=t-1;r>=0;--r){var o=e[r].stack;void 0===n[o]&&(n[o]=r)}for(var r=0;t>r;++r){var s=e[r].stack,a=n[s];if(void 0!==a&&a!==r){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[r]._parent=void 0,e[r]._length=1;var c=r>0?e[r-1]:this;t-1>a?(c._parent=e[a+1],c._parent.uncycle(),c._length=c._parent._length+1):(c._parent=void 0,c._length=1);for(var l=c._length+1,u=r-2;u>=0;--u)e[u]._length=l,l++;return}}}},S.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=j(t),n=e.message,r=[e.stack],i=this;void 0!==i;)r.push(w(i.stack.split("\n"))),i=i._parent;b(r),m(r),N.notEnumerableProp(t,"stack",g(n,r)),N.notEnumerableProp(t,"__stackCleaned__",!0)}};var it=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():F(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,q=t,Q=e;var n=Error.captureStackTrace;return nt=function(t){return B.test(t)},function(t,e){Error.stackTraceLimit+=6,n(t,e),Error.stackTraceLimit-=6}}var r=new Error;if("string"==typeof r.stack&&r.stack.split("\n")[0].indexOf("stackDetection@")>=0)return q=/@/,Q=e,$=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(t){i="stack"in t}return"stack"in r||!i||"number"!=typeof Error.stackTraceLimit?(Q=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?F(e):e.toString()},null):(q=t,Q=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}([]);"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(D=function(t){console.warn(t)},N.isNode&&process.stderr.isTTY?D=function(t,e){var n=e?"[33m":"[31m";console.warn(n+t+"[0m\n")}:N.isNode||"string"!=typeof(new Error).stack||(D=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var ot={warnings:z,longStackTraces:!1,cancellation:!1,monitoring:!1};return X&&e.longStackTraces(),{longStackTraces:function(){return ot.longStackTraces},warnings:function(){return ot.warnings},cancellation:function(){return ot.cancellation},monitoring:function(){return ot.monitoring},propagateFromFunction:function(){return et},boundValueFunction:function(){return h},checkForgottenReturns:d,setBounds:R,warn:y,deprecated:v,CapturedTrace:S,fireDomEvent:J,fireGlobalEvent:Y}}},{"./errors":12,"./util":36}],10:[function(t,e,n){"use strict";e.exports=function(t){function e(){return this.value}function n(){throw this.reason}t.prototype.return=t.prototype.thenReturn=function(n){return n instanceof t&&n.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:n},void 0)},t.prototype.throw=t.prototype.thenThrow=function(t){return this._then(n,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:t},void 0);var e=arguments[1],r=function(){throw e};return this.caught(t,r)},t.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof t&&n.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:n},void 0);var r=arguments[1];r instanceof t&&r.suppressUnhandledRejections();var i=function(){return r};return this.caught(n,i)}}},{}],11:[function(t,e,n){"use strict";e.exports=function(t,e){function n(){return o(this)}function r(t,n){return i(t,n,e,e)}var i=t.reduce,o=t.all;t.prototype.each=function(t){return i(this,t,e,0)._then(n,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return i(this,t,e,e)},t.each=function(t,r){return i(t,r,e,0)._then(n,void 0,void 0,t,void 0)},t.mapSeries=r}},{}],12:[function(t,e,n){"use strict";function r(t,e){function n(r){return this instanceof n?(p(this,"message","string"==typeof r?r:e),p(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new n(r)}return u(n,Error),n}function i(t){return this instanceof i?(p(this,"name","OperationalError"),p(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(p(this,"message",t.message),p(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new i(t)}var o,s,a=t("./es5"),c=a.freeze,l=t("./util"),u=l.inherits,p=l.notEnumerableProp,h=r("Warning","warning"),f=r("CancellationError","cancellation error"),_=r("TimeoutError","timeout error"),d=r("AggregateError","aggregate error");try{o=TypeError,s=RangeError}catch(t){o=r("TypeError","type error"),s=r("RangeError","range error")}for(var v="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),y=0;y<v.length;++y)"function"==typeof Array.prototype[v[y]]&&(d.prototype[v[y]]=Array.prototype[v[y]]);a.defineProperty(d.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),d.prototype.isOperational=!0;var g=0;d.prototype.toString=function(){var t=Array(4*g+1).join(" "),e="\n"+t+"AggregateError of:\n";g++,t=Array(4*g+1).join(" ");for(var n=0;n<this.length;++n){for(var r=this[n]===this?"[Circular AggregateError]":this[n]+"",i=r.split("\n"),o=0;o<i.length;++o)i[o]=t+i[o];r=i.join("\n"),e+=r+"\n"}return g--,e},u(i,Error);var m=Error.__BluebirdErrorTypes__;m||(m=c({CancellationError:f,TimeoutError:_,OperationalError:i,RejectionError:i,AggregateError:d}),a.defineProperty(Error,"__BluebirdErrorTypes__",{value:m,writable:!1,enumerable:!1,configurable:!1})),e.exports={Error:Error,TypeError:o,RangeError:s,CancellationError:m.CancellationError,OperationalError:m.OperationalError,TimeoutError:m.TimeoutError,AggregateError:m.AggregateError,Warning:h}},{"./es5":13,"./util":36}],13:[function(t,e,n){var r=function(){"use strict";return void 0===this}();if(r)e.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:r,propertyIsWritable:function(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!(n&&!n.writable&&!n.set)}};else{var i={}.hasOwnProperty,o={}.toString,s={}.constructor.prototype,a=function(t){var e=[];for(var n in t)i.call(t,n)&&e.push(n);return e},c=function(t,e){return{value:t[e]}},l=function(t,e,n){return t[e]=n.value,t},u=function(t){return t},p=function(t){try{return Object(t).constructor.prototype}catch(t){return s}},h=function(t){try{return"[object Array]"===o.call(t)}catch(t){return!1}};e.exports={isArray:h,keys:a,names:a,defineProperty:l,getDescriptor:c,freeze:u,getPrototypeOf:p,isES5:r,propertyIsWritable:function(){return!0}}}},{}],14:[function(t,e,n){"use strict";e.exports=function(t,e){var n=t.map;t.prototype.filter=function(t,r){return n(this,t,r,e)},t.filter=function(t,r,i){return n(t,r,i,e)}}},{}],15:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t,e,n){this.promise=t,this.type=e,this.handler=n,this.called=!1,this.cancelPromise=null}function i(t){this.finallyHandler=t}function o(t,e){return null!=t.cancelPromise&&(arguments.length>1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0)}function s(){return c.call(this,this.promise._target()._settledValue())}function a(t){return o(this,t)?void 0:(p.e=t,p)}function c(t){var r=this.promise,c=this.handler;if(!this.called){this.called=!0;var l=this.isFinallyHandler()?c.call(r._boundValue()):c.call(r._boundValue(),t);if(void 0!==l){r._setReturnedNonUndefined();var h=n(l,r);if(h instanceof e){if(null!=this.cancelPromise){if(h._isCancelled()){var f=new u("late cancellation observer");return r._attachExtraTrace(f),p.e=f,p}h.isPending()&&h._attachCancellationCallback(new i(this))}return h._then(s,a,void 0,this,void 0)}}}return r.isRejected()?(o(this),p.e=t,p):(o(this),t)}var l=t("./util"),u=e.CancellationError,p=l.errorObj;return r.prototype.isFinallyHandler=function(){return 0===this.type},i.prototype._resultCancelled=function(){o(this.finallyHandler)},e.prototype._passThrough=function(t,e,n,i){return"function"!=typeof t?this.then():this._then(n,i,void 0,new r(this,e,t),void 0)},e.prototype.lastly=e.prototype.finally=function(t){return this._passThrough(t,0,c,c)},e.prototype.tap=function(t){return this._passThrough(t,1,c)},r}},{"./util":36}],16:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,n,r){for(var o=0;o<n.length;++o){r._pushContext();var s=f(n[o])(t);if(r._popContext(),s===h){r._pushContext();var a=e.reject(h.e);return r._popContext(),a}var c=i(s,r);if(c instanceof e)return c}return null}function c(t,n,i,o){if(s.cancellation()){var a=new e(r),c=this._finallyPromise=new e(r);this._promise=a.lastly(function(){return c}),a._captureStackTrace(),a._setOnCancel(this)}else{var l=this._promise=new e(r);l._captureStackTrace()}this._stack=o,this._generatorFunction=t,this._receiver=n,this._generator=void 0,this._yieldHandlers="function"==typeof i?[i].concat(_):_,this._yieldedPromise=null,this._cancellationPhase=!1}var l=t("./errors"),u=l.TypeError,p=t("./util"),h=p.errorObj,f=p.tryCatch,_=[];p.inherits(c,o),c.prototype._isResolved=function(){return null===this._promise},c.prototype._cleanup=function(){this._promise=this._generator=null,s.cancellation()&&null!==this._finallyPromise&&(this._finallyPromise._fulfill(),this._finallyPromise=null)},c.prototype._promiseCancelled=function(){if(!this._isResolved()){var t,n="undefined"!=typeof this._generator.return;if(n)this._promise._pushContext(),t=f(this._generator.return).call(this._generator,void 0),this._promise._popContext();else{var r=new e.CancellationError("generator .return() sentinel");e.coroutine.returnSentinel=r,this._promise._attachExtraTrace(r),this._promise._pushContext(),t=f(this._generator.throw).call(this._generator,r),this._promise._popContext()}this._cancellationPhase=!0,this._yieldedPromise=null,this._continue(t)}},c.prototype._promiseFulfilled=function(t){this._yieldedPromise=null,this._promise._pushContext();var e=f(this._generator.next).call(this._generator,t);this._promise._popContext(),this._continue(e)},c.prototype._promiseRejected=function(t){this._yieldedPromise=null,this._promise._attachExtraTrace(t),this._promise._pushContext();var e=f(this._generator.throw).call(this._generator,t);this._promise._popContext(),this._continue(e)},c.prototype._resultCancelled=function(){if(this._yieldedPromise instanceof e){var t=this._yieldedPromise;this._yieldedPromise=null,t.cancel()}},c.prototype.promise=function(){return this._promise},c.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._promiseFulfilled(void 0)},c.prototype._continue=function(t){var n=this._promise;if(t===h)return this._cleanup(),this._cancellationPhase?n.cancel():n._rejectCallback(t.e,!1);var r=t.value;if(t.done===!0)return this._cleanup(),this._cancellationPhase?n.cancel():n._resolveCallback(r);var o=i(r,this._promise);if(!(o instanceof e)&&(o=a(o,this._yieldHandlers,this._promise),null===o))return void this._promiseRejected(new u("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/MqrFmX\n\n".replace("%s",r)+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")));o=o._target();var s=o._bitField;0===(50397184&s)?(this._yieldedPromise=o,o._proxy(this,null)):0!==(33554432&s)?e._async.invoke(this._promiseFulfilled,this,o._value()):0!==(16777216&s)?e._async.invoke(this._promiseRejected,this,o._reason()):this._promiseCancelled()},e.coroutine=function(t,e){if("function"!=typeof t)throw new u("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var n=Object(e).yieldHandler,r=c,i=(new Error).stack;return function(){var e=t.apply(this,arguments),o=new r((void 0),(void 0),n,i),s=o.promise();return o._generator=e,o._promiseFulfilled(void 0),s}},e.coroutine.addYieldHandler=function(t){
|
2 |
+
if("function"!=typeof t)throw new u("expecting a function but got "+p.classString(t));_.push(t)},e.spawn=function(t){if(s.deprecated("Promise.spawn()","Promise.coroutine()"),"function"!=typeof t)return n("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var r=new c(t,this),i=r.promise();return r._run(e.spawn),i}}},{"./errors":12,"./util":36}],17:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){var a=t("./util");a.canEvaluate,a.tryCatch,a.errorObj,e.join=function(){var t,e=arguments.length-1;if(e>0&&"function"==typeof arguments[e]){t=arguments[e];var r}var i=[].slice.call(arguments);t&&i.pop();var r=new n(i).promise();return void 0!==t?r.spread(t):r}}},{"./util":36}],18:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,e,n,r){this.constructor$(t),this._promise._captureStackTrace();var i=l();this._callback=null===i?e:u.domainBind(i,e),this._preservedValues=r===o?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=[],f.invoke(this._asyncInit,this,void 0)}function c(t,n,i,o){if("function"!=typeof n)return r("expecting a function but got "+u.classString(n));var s=0;if(void 0!==i){if("object"!=typeof i||null===i)return e.reject(new TypeError("options argument must be an object but it is "+u.classString(i)));if("number"!=typeof i.concurrency)return e.reject(new TypeError("'concurrency' must be a number but it is "+u.classString(i.concurrency)));s=i.concurrency}return s="number"==typeof s&&isFinite(s)&&s>=1?s:0,new a(t,n,s,o).promise()}var l=e._getDomain,u=t("./util"),p=u.tryCatch,h=u.errorObj,f=e._async;u.inherits(a,n),a.prototype._asyncInit=function(){this._init$(void 0,-2)},a.prototype._init=function(){},a.prototype._promiseFulfilled=function(t,n){var r=this._values,o=this.length(),a=this._preservedValues,c=this._limit;if(0>n){if(n=-1*n-1,r[n]=t,c>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(c>=1&&this._inFlight>=c)return r[n]=t,this._queue.push(n),!1;null!==a&&(a[n]=t);var l=this._promise,u=this._callback,f=l._boundValue();l._pushContext();var _=p(u).call(f,t,n,o),d=l._popContext();if(s.checkForgottenReturns(_,d,null!==a?"Promise.filter":"Promise.map",l),_===h)return this._reject(_.e),!0;var v=i(_,this._promise);if(v instanceof e){v=v._target();var y=v._bitField;if(0===(50397184&y))return c>=1&&this._inFlight++,r[n]=v,v._proxy(this,-1*(n+1)),!1;if(0===(33554432&y))return 0!==(16777216&y)?(this._reject(v._reason()),!0):(this._cancel(),!0);_=v._value()}r[n]=_}var g=++this._totalResolved;return g>=o&&(null!==a?this._filter(r,a):this._resolve(r),!0)},a.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,n=this._values;t.length>0&&this._inFlight<e;){if(this._isResolved())return;var r=t.pop();this._promiseFulfilled(n[r],r)}},a.prototype._filter=function(t,e){for(var n=e.length,r=new Array(n),i=0,o=0;n>o;++o)t[o]&&(r[i++]=e[o]);r.length=i,this._resolve(r)},a.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(t,e){return c(this,t,e,null)},e.map=function(t,e,n,r){return c(t,e,n,r)}}},{"./util":36}],19:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){var s=t("./util"),a=s.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("expecting a function but got "+s.classString(t));return function(){var r=new e(n);r._captureStackTrace(),r._pushContext();var i=a(t).apply(this,arguments),s=r._popContext();return o.checkForgottenReturns(i,s,"Promise.method",r),r._resolveFromSyncValue(i),r}},e.attempt=e.try=function(t){if("function"!=typeof t)return i("expecting a function but got "+s.classString(t));var r=new e(n);r._captureStackTrace(),r._pushContext();var c;if(arguments.length>1){o.deprecated("calling Promise.try with more than 1 argument");var l=arguments[1],u=arguments[2];c=s.isArray(l)?a(t).apply(u,l):a(t).call(u,l)}else c=a(t)();var p=r._popContext();return o.checkForgottenReturns(c,p,"Promise.try",r),r._resolveFromSyncValue(c),r},e.prototype._resolveFromSyncValue=function(t){t===s.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":36}],20:[function(t,e,n){"use strict";function r(t){return t instanceof Error&&u.getPrototypeOf(t)===Error.prototype}function i(t){var e;if(r(t)){e=new l(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=u.keys(t),i=0;i<n.length;++i){var o=n[i];p.test(o)||(e[o]=t[o])}return e}return s.markAsOriginatingFromRejection(t),t}function o(t,e){return function(n,r){if(null!==t){if(n){var o=i(a(n));t._attachExtraTrace(o),t._reject(o)}else if(e){var s=[].slice.call(arguments,1);t._fulfill(s)}else t._fulfill(r);t=null}}}var s=t("./util"),a=s.maybeWrapAsError,c=t("./errors"),l=c.OperationalError,u=t("./es5"),p=/^(?:name|message|stack|cause)$/;e.exports=o},{"./errors":12,"./es5":13,"./util":36}],21:[function(t,e,n){"use strict";e.exports=function(e){function n(t,e){var n=this;if(!o.isArray(t))return r.call(n,t,e);var i=a(e).apply(n._boundValue(),[null].concat(t));i===c&&s.throwLater(i.e)}function r(t,e){var n=this,r=n._boundValue(),i=void 0===t?a(e).call(r,null):a(e).call(r,null,t);i===c&&s.throwLater(i.e)}function i(t,e){var n=this;if(!t){var r=new Error(t+"");r.cause=t,t=r}var i=a(e).call(n._boundValue(),t);i===c&&s.throwLater(i.e)}var o=t("./util"),s=e._async,a=o.tryCatch,c=o.errorObj;e.prototype.asCallback=e.prototype.nodeify=function(t,e){if("function"==typeof t){var o=r;void 0!==e&&Object(e).spread&&(o=n),this._then(o,i,void 0,this,t)}return this}}},{"./util":36}],22:[function(t,e,n){"use strict";e.exports=function(){function n(){}function r(t,e){if("function"!=typeof e)throw new g("expecting a function but got "+f.classString(e));if(t.constructor!==i)throw new g("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n")}function i(t){this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,t!==b&&(r(this,t),this._resolveFromExecutor(t)),this._promiseCreated(),this._fireEvent("promiseCreated",this)}function o(t){this.promise._resolveCallback(t)}function s(t){this.promise._rejectCallback(t,!1)}function a(t){var e=new i(b);e._fulfillmentHandler0=t,e._rejectionHandler0=t,e._promise0=t,e._receiver0=t}var c,l=function(){return new g("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n")},u=function(){return new i.PromiseInspection(this._target())},p=function(t){return i.reject(new g(t))},h={},f=t("./util");c=f.isNode?function(){var t=process.domain;return void 0===t&&(t=null),t}:function(){return null},f.notEnumerableProp(i,"_getDomain",c);var _=t("./es5"),d=t("./async"),v=new d;_.defineProperty(i,"_async",{value:v});var y=t("./errors"),g=i.TypeError=y.TypeError;i.RangeError=y.RangeError;var m=i.CancellationError=y.CancellationError;i.TimeoutError=y.TimeoutError,i.OperationalError=y.OperationalError,i.RejectionError=y.OperationalError,i.AggregateError=y.AggregateError;var b=function(){},w={},C={},j=t("./thenables")(i,b),E=t("./promise_array")(i,b,j,p,n),k=t("./context")(i),F=k.create,x=t("./debuggability")(i,k),T=(x.CapturedTrace,t("./finally")(i,j)),P=t("./catch_filter")(C),R=t("./nodeback"),S=f.errorObj,O=f.tryCatch;return i.prototype.toString=function(){return"[object Promise]"},i.prototype.caught=i.prototype.catch=function(t){var e=arguments.length;if(e>1){var n,r=new Array(e-1),i=0;for(n=0;e-1>n;++n){var o=arguments[n];if(!f.isObject(o))return p("expecting an object but got A catch statement predicate "+f.classString(o));r[i++]=o}return r.length=i,t=arguments[n],this.then(void 0,P(r,t,this))}return this.then(void 0,t)},i.prototype.reflect=function(){return this._then(u,u,void 0,this,void 0)},i.prototype.then=function(t,e){if(x.warnings()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+f.classString(t);arguments.length>1&&(n+=", "+f.classString(e)),this._warn(n)}return this._then(t,e,void 0,void 0,void 0)},i.prototype.done=function(t,e){var n=this._then(t,e,void 0,void 0,void 0);n._setIsFinal()},i.prototype.spread=function(t){return"function"!=typeof t?p("expecting a function but got "+f.classString(t)):this.all()._then(t,void 0,void 0,w,void 0)},i.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},i.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new E(this).promise()},i.prototype.error=function(t){return this.caught(f.originatesFromRejection,t)},i.getNewLibraryCopy=e.exports,i.is=function(t){return t instanceof i},i.fromNode=i.fromCallback=function(t){var e=new i(b);e._captureStackTrace();var n=arguments.length>1&&!!Object(arguments[1]).multiArgs,r=O(t)(R(e,n));return r===S&&e._rejectCallback(r.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},i.all=function(t){return new E(t).promise()},i.cast=function(t){var e=j(t);return e instanceof i||(e=new i(b),e._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},i.resolve=i.fulfilled=i.cast,i.reject=i.rejected=function(t){var e=new i(b);return e._captureStackTrace(),e._rejectCallback(t,!0),e},i.setScheduler=function(t){if("function"!=typeof t)throw new g("expecting a function but got "+f.classString(t));return v.setScheduler(t)},i.prototype._then=function(t,e,n,r,o){var s=void 0!==o,a=s?o:new i(b),l=this._target(),u=l._bitField;s||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===r&&0!==(2097152&this._bitField)&&(r=0!==(50397184&u)?this._boundValue():l===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var p=c();if(0!==(50397184&u)){var h,_,d=l._settlePromiseCtx;0!==(33554432&u)?(_=l._rejectionHandler0,h=t):0!==(16777216&u)?(_=l._fulfillmentHandler0,h=e,l._unsetRejectionIsUnhandled()):(d=l._settlePromiseLateCancellationObserver,_=new m("late cancellation observer"),l._attachExtraTrace(_),h=e),v.invoke(d,l,{handler:null===p?h:"function"==typeof h&&f.domainBind(p,h),promise:a,receiver:r,value:_})}else l._addCallbacks(t,e,a,r,p);return a},i.prototype._length=function(){return 65535&this._bitField},i.prototype._isFateSealed=function(){return 0!==(117506048&this._bitField)},i.prototype._isFollowing=function(){return 67108864===(67108864&this._bitField)},i.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},i.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},i.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},i.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},i.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},i.prototype._isFinal=function(){return(4194304&this._bitField)>0},i.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},i.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},i.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},i.prototype._setAsyncGuaranteed=function(){v.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},i.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];return e===h?void 0:void 0===e&&this._isBound()?this._boundValue():e},i.prototype._promiseAt=function(t){return this[4*t-4+2]},i.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},i.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},i.prototype._boundValue=function(){},i.prototype._migrateCallback0=function(t){var e=(t._bitField,t._fulfillmentHandler0),n=t._rejectionHandler0,r=t._promise0,i=t._receiverAt(0);void 0===i&&(i=h),this._addCallbacks(e,n,r,i,null)},i.prototype._migrateCallbackAt=function(t,e){var n=t._fulfillmentHandlerAt(e),r=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=h),this._addCallbacks(n,r,i,o,null)},i.prototype._addCallbacks=function(t,e,n,r,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=r,"function"==typeof t&&(this._fulfillmentHandler0=null===i?t:f.domainBind(i,t)),"function"==typeof e&&(this._rejectionHandler0=null===i?e:f.domainBind(i,e));else{var s=4*o-4;this[s+2]=n,this[s+3]=r,"function"==typeof t&&(this[s+0]=null===i?t:f.domainBind(i,t)),"function"==typeof e&&(this[s+1]=null===i?e:f.domainBind(i,e))}return this._setLength(o+1),o},i.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},i.prototype._resolveCallback=function(t,e){if(0===(117506048&this._bitField)){if(t===this)return this._rejectCallback(l(),!1);var n=j(t,this);if(!(n instanceof i))return this._fulfill(t);e&&this._propagateFrom(n,2);var r=n._target();if(r===this)return void this._reject(l());var o=r._bitField;if(0===(50397184&o)){var s=this._length();s>0&&r._migrateCallback0(this);for(var a=1;s>a;++a)r._migrateCallbackAt(this,a);this._setFollowing(),this._setLength(0),this._setFollowee(r)}else if(0!==(33554432&o))this._fulfill(r._value());else if(0!==(16777216&o))this._reject(r._reason());else{var c=new m("late cancellation observer");r._attachExtraTrace(c),this._reject(c)}}},i.prototype._rejectCallback=function(t,e,n){var r=f.ensureErrorObject(t),i=r===t;if(!i&&!n&&x.warnings()){var o="a promise was rejected with a non-error: "+f.classString(t);this._warn(o,!0)}this._attachExtraTrace(r,!!e&&i),this._reject(t)},i.prototype._resolveFromExecutor=function(t){var e=this;this._captureStackTrace(),this._pushContext();var n=!0,r=this._execute(t,function(t){e._resolveCallback(t)},function(t){e._rejectCallback(t,n)});n=!1,this._popContext(),void 0!==r&&e._rejectCallback(r,!0)},i.prototype._settlePromiseFromHandler=function(t,e,n,r){var i=r._bitField;if(0===(65536&i)){r._pushContext();var o;e===w?n&&"number"==typeof n.length?o=O(t).apply(this._boundValue(),n):(o=S,o.e=new g("cannot .spread() a non-array: "+f.classString(n))):o=O(t).call(e,n);var s=r._popContext();i=r._bitField,0===(65536&i)&&(o===C?r._reject(n):o===S?r._rejectCallback(o.e,!1):(x.checkForgottenReturns(o,s,"",r,this),r._resolveCallback(o)))}},i.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},i.prototype._followee=function(){return this._rejectionHandler0},i.prototype._setFollowee=function(t){this._rejectionHandler0=t},i.prototype._settlePromise=function(t,e,r,o){var s=t instanceof i,a=this._bitField,c=0!==(134217728&a);0!==(65536&a)?(s&&t._invokeInternalOnCancel(),r instanceof T&&r.isFinallyHandler()?(r.cancelPromise=t,O(e).call(r,o)===S&&t._reject(S.e)):e===u?t._fulfill(u.call(r)):r instanceof n?r._promiseCancelled(t):s||t instanceof E?t._cancel():r.cancel()):"function"==typeof e?s?(c&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(e,r,o,t)):e.call(r,o,t):r instanceof n?r._isResolved()||(0!==(33554432&a)?r._promiseFulfilled(o,t):r._promiseRejected(o,t)):s&&(c&&t._setAsyncGuaranteed(),0!==(33554432&a)?t._fulfill(o):t._reject(o))},i.prototype._settlePromiseLateCancellationObserver=function(t){var e=t.handler,n=t.promise,r=t.receiver,o=t.value;"function"==typeof e?n instanceof i?this._settlePromiseFromHandler(e,r,o,n):e.call(r,o,n):n instanceof i&&n._reject(o)},i.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)},i.prototype._settlePromise0=function(t,e,n){var r=this._promise0,i=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(r,t,i,e)},i.prototype._clearCallbackDataAtIndex=function(t){var e=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void 0},i.prototype._fulfill=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(t===this){var n=l();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!==(134217728&e)?this._settlePromises():v.settlePromises(this))}},i.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16))return this._setRejected(),this._fulfillmentHandler0=t,this._isFinal()?v.fatalError(t,f.isNode):void((65535&e)>0?v.settlePromises(this):this._ensurePossibleRejectionHandled())},i.prototype._fulfillPromises=function(t,e){for(var n=1;t>n;n++){var r=this._fulfillmentHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},i.prototype._rejectPromises=function(t,e){for(var n=1;t>n;n++){var r=this._rejectionHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},i.prototype._settlePromises=function(){var t=this._bitField,e=65535&t;if(e>0){if(0!==(16842752&t)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,t),this._rejectPromises(e,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,t),this._fulfillPromises(e,r)}this._setLength(0)}this._clearCancellationData()},i.prototype._settledValue=function(){var t=this._bitField;return 0!==(33554432&t)?this._rejectionHandler0:0!==(16777216&t)?this._fulfillmentHandler0:void 0},i.defer=i.pending=function(){x.deprecated("Promise.defer","new Promise");var t=new i(b);return{promise:t,resolve:o,reject:s}},f.notEnumerableProp(i,"_makeSelfResolutionError",l),t("./method")(i,b,j,p,x),t("./bind")(i,b,j,x),t("./cancel")(i,E,p,x),t("./direct_resolve")(i),t("./synchronous_inspection")(i),t("./join")(i,E,j,b,v,c),i.Promise=i,i.version="3.4.7",t("./map.js")(i,E,p,j,b,x),t("./call_get.js")(i),t("./using.js")(i,p,j,F,b,x),t("./timers.js")(i,b,x),t("./generators.js")(i,p,b,j,n,x),t("./nodeify.js")(i),t("./promisify.js")(i,b),t("./props.js")(i,E,j,p),t("./race.js")(i,b,j,p),t("./reduce.js")(i,E,p,j,b,x),t("./settle.js")(i,E,x),t("./some.js")(i,E,p),t("./filter.js")(i,b),t("./each.js")(i,b),t("./any.js")(i),f.toFastProperties(i),f.toFastProperties(i.prototype),a({a:1}),a({b:2}),a({c:3}),a(1),a(function(){}),a(void 0),a(!1),a(new i(b)),x.setBounds(d.firstLineError,f.lastLineError),i}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){function s(t){switch(t){case-2:return[];case-3:return{}}}function a(t){var r=this._promise=new e(n);t instanceof e&&r._propagateFrom(t,3),r._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var c=t("./util");return c.isArray,c.inherits(a,o),a.prototype.length=function(){return this._length},a.prototype.promise=function(){return this._promise},a.prototype._init=function t(n,o){var a=r(this._values,this._promise);if(a instanceof e){a=a._target();var l=a._bitField;if(this._values=a,0===(50397184&l))return this._promise._setAsyncGuaranteed(),a._then(t,this._reject,void 0,this,o);if(0===(33554432&l))return 0!==(16777216&l)?this._reject(a._reason()):this._cancel();a=a._value()}if(a=c.asArray(a),null===a){var u=i("expecting an array or an iterable object but got "+c.classString(a)).reason();return void this._promise._rejectCallback(u,!1)}return 0===a.length?void(-5===o?this._resolveEmptyArray():this._resolve(s(o))):void this._iterate(a)},a.prototype._iterate=function(t){var n=this.getActualLength(t.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var i=this._promise,o=!1,s=null,a=0;n>a;++a){var c=r(t[a],i);c instanceof e?(c=c._target(),s=c._bitField):s=null,o?null!==s&&c.suppressUnhandledRejections():null!==s?0===(50397184&s)?(c._proxy(this,a),this._values[a]=c):o=0!==(33554432&s)?this._promiseFulfilled(c._value(),a):0!==(16777216&s)?this._promiseRejected(c._reason(),a):this._promiseCancelled(a):o=this._promiseFulfilled(c,a)}o||i._setAsyncGuaranteed()},a.prototype._isResolved=function(){return null===this._values},a.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},a.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},a.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1)},a.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;return n>=this._length&&(this._resolve(this._values),!0)},a.prototype._promiseCancelled=function(){return this._cancel(),!0},a.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},a.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var n=0;n<t.length;++n)t[n]instanceof e&&t[n].cancel()}},a.prototype.shouldCopyValues=function(){return!0},a.prototype.getActualLength=function(t){return t},a}},{"./util":36}],24:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t){return!C.test(t)}function i(t){try{return t.__isPromisified__===!0}catch(t){return!1}}function o(t,e,n){var r=f.getDataPropertyOrDefault(t,e+n,b);return!!r&&i(r)}function s(t,e,n){for(var r=0;r<t.length;r+=2){var i=t[r];if(n.test(i))for(var o=i.replace(n,""),s=0;s<t.length;s+=2)if(t[s]===o)throw new g("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/MqrFmX\n".replace("%s",e))}}function a(t,e,n,r){for(var a=f.inheritedDataKeys(t),c=[],l=0;l<a.length;++l){var u=a[l],p=t[u],h=r===j||j(u,p,t);"function"!=typeof p||i(p)||o(t,u,e)||!r(u,p,t,h)||c.push(u,p)}return s(c,e,n),c}function c(t,r,i,o,s,a){function c(){var i=r;r===h&&(i=this);var o=new e(n);o._captureStackTrace();var s="string"==typeof u&&this!==l?this[u]:t,c=_(o,a);try{s.apply(i,d(arguments,c))}catch(t){o._rejectCallback(v(t),!0,!0)}return o._isFateSealed()||o._setAsyncGuaranteed(),o}var l=function(){return this}(),u=t;return"string"==typeof u&&(t=o),f.notEnumerableProp(c,"__isPromisified__",!0),c}function l(t,e,n,r,i){for(var o=new RegExp(E(e)+"$"),s=a(t,e,o,n),c=0,l=s.length;l>c;c+=2){var u=s[c],p=s[c+1],_=u+e;if(r===k)t[_]=k(u,h,u,p,e,i);else{var d=r(p,function(){return k(u,h,u,p,e,i)});f.notEnumerableProp(d,"__isPromisified__",!0),t[_]=d}}return f.toFastProperties(t),t}function u(t,e,n){return k(t,e,void 0,t,null,n)}var p,h={},f=t("./util"),_=t("./nodeback"),d=f.withAppended,v=f.maybeWrapAsError,y=f.canEvaluate,g=t("./errors").TypeError,m="Async",b={__isPromisified__:!0},w=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],C=new RegExp("^(?:"+w.join("|")+")$"),j=function(t){return f.isIdentifier(t)&&"_"!==t.charAt(0)&&"constructor"!==t},E=function(t){return t.replace(/([$])/,"\\$")},k=y?p:c;e.promisify=function(t,e){if("function"!=typeof t)throw new g("expecting a function but got "+f.classString(t));if(i(t))return t;e=Object(e);var n=void 0===e.context?h:e.context,o=!!e.multiArgs,s=u(t,n,o);return f.copyDescriptors(t,s,r),s},e.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new g("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n");e=Object(e);var n=!!e.multiArgs,r=e.suffix;"string"!=typeof r&&(r=m);var i=e.filter;"function"!=typeof i&&(i=j);var o=e.promisifier;if("function"!=typeof o&&(o=k),!f.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n");for(var s=f.inheritedDataKeys(t),a=0;a<s.length;++a){var c=t[s[a]];"constructor"!==s[a]&&f.isClass(c)&&(l(c.prototype,r,i,o,n),l(c,r,i,o,n))}return l(t,r,i,o,n)}}},{"./errors":12,"./nodeback":20,"./util":36}],25:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){function o(t){var e,n=!1;if(void 0!==a&&t instanceof a)e=p(t),n=!0;else{var r=u.keys(t),i=r.length;e=new Array(2*i);for(var o=0;i>o;++o){var s=r[o];e[o]=t[s],e[o+i]=s}}this.constructor$(e),this._isMap=n,this._init$(void 0,-3)}function s(t){var n,s=r(t);return l(s)?(n=s instanceof e?s._then(e.props,void 0,void 0,void 0,void 0):new o(s).promise(),s instanceof e&&n._propagateFrom(s,2),n):i("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")}var a,c=t("./util"),l=c.isObject,u=t("./es5");"function"==typeof Map&&(a=Map);var p=function(){function t(t,r){this[e]=t,this[e+n]=r,e++}var e=0,n=0;return function(r){n=r.size,e=0;var i=new Array(2*r.size);return r.forEach(t,i),i}}(),h=function(t){for(var e=new a,n=t.length/2|0,r=0;n>r;++r){var i=t[n+r],o=t[r];e.set(i,o)}return e};c.inherits(o,n),o.prototype._init=function(){},o.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;if(n>=this._length){var r;if(this._isMap)r=h(this._values);else{r={};for(var i=this.length(),o=0,s=this.length();s>o;++o)r[this._values[o+i]]=this._values[o]}return this._resolve(r),!0}return!1},o.prototype.shouldCopyValues=function(){return!1},o.prototype.getActualLength=function(t){return t>>1},e.prototype.props=function(){return s(this)},e.props=function(t){return s(t)}}},{"./es5":13,"./util":36}],26:[function(t,e,n){"use strict";function r(t,e,n,r,i){for(var o=0;i>o;++o)n[o+r]=t[o+e],t[o+e]=void 0}function i(t){this._capacity=t,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(t){return this._capacity<t},i.prototype._pushOne=function(t){var e=this.length();this._checkCapacity(e+1);var n=this._front+e&this._capacity-1;this[n]=t,this._length=e+1},i.prototype.push=function(t,e,n){var r=this.length()+3;if(this._willBeOverCapacity(r))return this._pushOne(t),this._pushOne(e),void this._pushOne(n);var i=this._front+r-3;this._checkCapacity(r);var o=this._capacity-1;this[i+0&o]=t,this[i+1&o]=e,this[i+2&o]=n,this._length=r},i.prototype.shift=function(){var t=this._front,e=this[t];return this[t]=void 0,this._front=t+1&this._capacity-1,this._length--,e},i.prototype.length=function(){return this._length},i.prototype._checkCapacity=function(t){this._capacity<t&&this._resizeTo(this._capacity<<1)},i.prototype._resizeTo=function(t){var e=this._capacity;this._capacity=t;var n=this._front,i=this._length,o=n+i&e-1;r(this,0,this,e,o)},e.exports=i},{}],27:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){function o(t,o){var c=r(t);if(c instanceof e)return a(c);if(t=s.asArray(t),null===t)return i("expecting an array or an iterable object but got "+s.classString(t));var l=new e(n);void 0!==o&&l._propagateFrom(o,3);for(var u=l._fulfill,p=l._reject,h=0,f=t.length;f>h;++h){var _=t[h];(void 0!==_||h in t)&&e.cast(_)._then(u,p,void 0,l,null)}return l}var s=t("./util"),a=function(t){return t.then(function(e){return o(e,t)})};e.race=function(t){return o(t,void 0)},e.prototype.race=function(){return o(this,void 0)}}},{"./util":36}],28:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,n,r,i){this.constructor$(t);var s=h();this._fn=null===s?n:f.domainBind(s,n),void 0!==r&&(r=e.resolve(r),r._attachCancellationCallback(this)),this._initialValue=r,this._currentCancellable=null,i===o?this._eachValues=Array(this._length):0===i?this._eachValues=null:this._eachValues=void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function c(t,e){this.isFulfilled()?e._resolve(t):e._reject(t)}function l(t,e,n,i){if("function"!=typeof e)return r("expecting a function but got "+f.classString(e));var o=new a(t,e,n,i);return o.promise()}function u(t){this.accum=t,this.array._gotAccum(t);var n=i(this.value,this.array._promise);return n instanceof e?(this.array._currentCancellable=n,n._then(p,void 0,void 0,this,void 0)):p.call(this,n)}function p(t){var n=this.array,r=n._promise,i=_(n._fn);r._pushContext();var o;o=void 0!==n._eachValues?i.call(r._boundValue(),t,this.index,this.length):i.call(r._boundValue(),this.accum,t,this.index,this.length),o instanceof e&&(n._currentCancellable=o);var a=r._popContext();return s.checkForgottenReturns(o,a,void 0!==n._eachValues?"Promise.each":"Promise.reduce",r),o}var h=e._getDomain,f=t("./util"),_=f.tryCatch;f.inherits(a,n),a.prototype._gotAccum=function(t){void 0!==this._eachValues&&null!==this._eachValues&&t!==o&&this._eachValues.push(t)},a.prototype._eachComplete=function(t){return null!==this._eachValues&&this._eachValues.push(t),this._eachValues},a.prototype._init=function(){},a.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},a.prototype.shouldCopyValues=function(){return!1},a.prototype._resolve=function(t){this._promise._resolveCallback(t),this._values=null},a.prototype._resultCancelled=function(t){return t===this._initialValue?this._cancel():void(this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof e&&this._currentCancellable.cancel(),this._initialValue instanceof e&&this._initialValue.cancel()))},a.prototype._iterate=function(t){this._values=t;var n,r,i=t.length;if(void 0!==this._initialValue?(n=this._initialValue,r=0):(n=e.resolve(t[0]),r=1),this._currentCancellable=n,!n.isRejected())for(;i>r;++r){var o={accum:null,value:t[r],index:r,length:i,array:this};n=n._then(u,void 0,void 0,o,void 0)}void 0!==this._eachValues&&(n=n._then(this._eachComplete,void 0,void 0,this,void 0)),n._then(c,c,void 0,n,this)},e.prototype.reduce=function(t,e){return l(this,t,e,null)},e.reduce=function(t,e,n,r){return l(t,e,n,r)}}},{"./util":36}],29:[function(t,e,n){"use strict";var r,i=t("./util"),o=function(){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")},s=i.getNativePromise();if(i.isNode&&"undefined"==typeof MutationObserver){var a=global.setImmediate,c=process.nextTick;r=i.isRecentNode?function(t){a.call(global,t)}:function(t){c.call(process,t)}}else if("function"==typeof s&&"function"==typeof s.resolve){var l=s.resolve();r=function(t){l.then(t)}}else r="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&(window.navigator.standalone||window.cordova)?"undefined"!=typeof setImmediate?function(t){setImmediate(t)}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:o:function(){var t=document.createElement("div"),e={attributes:!0},n=!1,r=document.createElement("div"),i=new MutationObserver(function(){t.classList.toggle("foo"),n=!1});i.observe(r,e);var o=function(){n||(n=!0,r.classList.toggle("foo"))};return function(n){var r=new MutationObserver(function(){r.disconnect(),n()});r.observe(t,e),o()}}();e.exports=r},{"./util":36}],30:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.constructor$(t)}var o=e.PromiseInspection,s=t("./util");s.inherits(i,n),i.prototype._promiseResolved=function(t,e){this._values[t]=e;var n=++this._totalResolved;return n>=this._length&&(this._resolve(this._values),!0)},i.prototype._promiseFulfilled=function(t,e){var n=new o;return n._bitField=33554432,n._settledValueField=t,this._promiseResolved(e,n)},i.prototype._promiseRejected=function(t,e){var n=new o;return n._bitField=16777216,n._settledValueField=t,this._promiseResolved(e,n)},e.settle=function(t){return r.deprecated(".settle()",".reflect()"),new i(t).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||0>e)return r("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var n=new i(t),o=n.promise();return n.setHowMany(e),n.init(),o}var s=t("./util"),a=t("./errors").RangeError,c=t("./errors").AggregateError,l=s.isArray,u={};s.inherits(i,n),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);
|
3 |
+
this._init$(void 0,-5);var t=l(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},i.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},i.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(u),this._checkOutcome())},i.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new c,e=this.length();e<this._values.length;++e)this._values[e]!==u&&t.push(this._values[e]);return t.length>0?this._reject(t):this._cancel(),!0}return!1},i.prototype._fulfilled=function(){return this._totalResolved},i.prototype._rejected=function(){return this._values.length-this.length()},i.prototype._addRejected=function(t){this._values.push(t)},i.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},i.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},i.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new a(e)},i.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return o(t,e)},e.prototype.some=function(t){return o(this,t)},e._SomePromiseArray=i}},{"./errors":12,"./util":36}],32:[function(t,e,n){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var n=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},r=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=e.prototype.isFulfilled=function(){return 0!==(33554432&this._bitField)},o=e.prototype.isRejected=function(){return 0!==(16777216&this._bitField)},s=e.prototype.isPending=function(){return 0===(50397184&this._bitField)},a=e.prototype.isResolved=function(){return 0!==(50331648&this._bitField)};e.prototype.isCancelled=function(){return 0!==(8454144&this._bitField)},t.prototype.__isCancelled=function(){return 65536===(65536&this._bitField)},t.prototype._isCancelled=function(){return this._target().__isCancelled()},t.prototype.isCancelled=function(){return 0!==(8454144&this._target()._bitField)},t.prototype.isPending=function(){return s.call(this._target())},t.prototype.isRejected=function(){return o.call(this._target())},t.prototype.isFulfilled=function(){return i.call(this._target())},t.prototype.isResolved=function(){return a.call(this._target())},t.prototype.value=function(){return n.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),r.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t,r){if(u(t)){if(t instanceof e)return t;var i=o(t);if(i===l){r&&r._pushContext();var c=e.reject(i.e);return r&&r._popContext(),c}if("function"==typeof i){if(s(t)){var c=new e(n);return t._then(c._fulfill,c._reject,void 0,c,null),c}return a(t,i,r)}}return t}function i(t){return t.then}function o(t){try{return i(t)}catch(t){return l.e=t,l}}function s(t){try{return p.call(t,"_promise0")}catch(t){return!1}}function a(t,r,i){function o(t){a&&(a._resolveCallback(t),a=null)}function s(t){a&&(a._rejectCallback(t,p,!0),a=null)}var a=new e(n),u=a;i&&i._pushContext(),a._captureStackTrace(),i&&i._popContext();var p=!0,h=c.tryCatch(r).call(t,o,s);return p=!1,a&&h===l&&(a._rejectCallback(h.e,!0,!0),a=null),u}var c=t("./util"),l=c.errorObj,u=c.isObject,p={}.hasOwnProperty;return r}},{"./util":36}],34:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.handle=t}function o(t){return clearTimeout(this.handle),t}function s(t){throw clearTimeout(this.handle),t}var a=t("./util"),c=e.TimeoutError;i.prototype._resultCancelled=function(){clearTimeout(this.handle)};var l=function(t){return u(+this).thenReturn(t)},u=e.delay=function(t,o){var s,a;return void 0!==o?(s=e.resolve(o)._then(l,null,null,t,void 0),r.cancellation()&&o instanceof e&&s._setOnCancel(o)):(s=new e(n),a=setTimeout(function(){s._fulfill()},+t),r.cancellation()&&s._setOnCancel(new i(a)),s._captureStackTrace()),s._setAsyncGuaranteed(),s};e.prototype.delay=function(t){return u(t,this)};var p=function(t,e,n){var r;r="string"!=typeof e?e instanceof Error?e:new c("operation timed out"):new c(e),a.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._reject(r),null!=n&&n.cancel()};e.prototype.timeout=function(t,e){t=+t;var n,a,c=new i(setTimeout(function(){n.isPending()&&p(n,e,a)},t));return r.cancellation()?(a=this.then(),n=a._then(o,s,void 0,c,void 0),n._setOnCancel(c)):n=this._then(o,s,void 0,c,void 0),n}}},{"./util":36}],35:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t){setTimeout(function(){throw t},0)}function c(t){var e=r(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function l(t,n){function i(){if(s>=l)return u._fulfill();var o=c(t[s++]);if(o instanceof e&&o._isDisposable()){try{o=r(o._getDisposer().tryDispose(n),t.promise)}catch(t){return a(t)}if(o instanceof e)return o._then(i,a,null,null,null)}i()}var s=0,l=t.length,u=new e(o);return i(),u}function u(t,e,n){this._data=t,this._promise=e,this._context=n}function p(t,e,n){this.constructor$(t,e,n)}function h(t){return u.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function f(t){this.length=t,this.promise=null,this[t-1]=null}var _=t("./util"),d=t("./errors").TypeError,v=t("./util").inherits,y=_.errorObj,g=_.tryCatch,m={};u.prototype.data=function(){return this._data},u.prototype.promise=function(){return this._promise},u.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():m},u.prototype.tryDispose=function(t){var e=this.resource(),n=this._context;void 0!==n&&n._pushContext();var r=e!==m?this.doDispose(e,t):null;return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,r},u.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},v(p,u),p.prototype.doDispose=function(t,e){var n=this.data();return n.call(t,t,e)},f.prototype._resultCancelled=function(){for(var t=this.length,n=0;t>n;++n){var r=this[n];r instanceof e&&r.cancel()}},e.using=function(){var t=arguments.length;if(2>t)return n("you must pass at least 2 arguments to Promise.using");var i=arguments[t-1];if("function"!=typeof i)return n("expecting a function but got "+_.classString(i));var o,a=!0;2===t&&Array.isArray(arguments[0])?(o=arguments[0],t=o.length,a=!1):(o=arguments,t--);for(var c=new f(t),p=0;t>p;++p){var d=o[p];if(u.isDisposer(d)){var v=d;d=d.promise(),d._setDisposable(v)}else{var m=r(d);m instanceof e&&(d=m._then(h,null,null,{resources:c,index:p},void 0))}c[p]=d}for(var b=new Array(c.length),p=0;p<b.length;++p)b[p]=e.resolve(c[p]).reflect();var w=e.all(b).then(function(t){for(var e=0;e<t.length;++e){var n=t[e];if(n.isRejected())return y.e=n.error(),y;if(!n.isFulfilled())return void w.cancel();t[e]=n.value()}C._pushContext(),i=g(i);var r=a?i.apply(void 0,t):i(t),o=C._popContext();return s.checkForgottenReturns(r,o,"Promise.using",C),r}),C=w.lastly(function(){var t=new e.PromiseInspection(w);return l(c,t)});return c.promise=C,C._setOnCancel(c),C},e.prototype._setDisposable=function(t){this._bitField=131072|this._bitField,this._disposer=t},e.prototype._isDisposable=function(){return(131072&this._bitField)>0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new p(t,this,i());throw new d}}},{"./errors":12,"./util":36}],36:[function(t,e,n){"use strict";function r(){try{var t=F;return F=null,t.apply(this,arguments)}catch(t){return P.e=t,P}}function i(t){return F=t,r}function o(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function s(t){return"function"==typeof t||"object"==typeof t&&null!==t}function a(t){return o(t)?new Error(v(t)):t}function c(t,e){var n,r=t.length,i=new Array(r+1);for(n=0;r>n;++n)i[n]=t[n];return i[n]=e,i}function l(t,e,n){if(!x.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var r=Object.getOwnPropertyDescriptor(t,e);return null!=r?null==r.get&&null==r.set?r.value:n:void 0}function u(t,e,n){if(o(t))return t;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return x.defineProperty(t,e,r),t}function p(t){throw t}function h(t){try{if("function"==typeof t){var e=x.names(t.prototype),n=x.isES5&&e.length>1,r=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=A.test(t+"")&&x.names(t).length>0;if(n||r||i)return!0}return!1}catch(t){return!1}}function f(t){function e(){}e.prototype=t;for(var n=8;n--;)new e;return t}function _(t){return D.test(t)}function d(t,e,n){for(var r=new Array(t),i=0;t>i;++i)r[i]=e+i+n;return r}function v(t){try{return t+""}catch(t){return"[no string representation]"}}function y(t){return null!==t&&"object"==typeof t&&"string"==typeof t.message&&"string"==typeof t.name}function g(t){try{u(t,"isOperational",!0)}catch(t){}}function m(t){return null!=t&&(t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0)}function b(t){return y(t)&&x.propertyIsWritable(t,"stack")}function w(t){return{}.toString.call(t)}function C(t,e,n){for(var r=x.names(t),i=0;i<r.length;++i){var o=r[i];if(n(o))try{x.defineProperty(e,o,x.getDescriptor(t,o))}catch(t){}}}function j(t){return H?process.env[t]:void 0}function E(){if("function"==typeof Promise)try{var t=new Promise(function(){});if("[object Promise]"==={}.toString.call(t))return Promise}catch(t){}}function k(t,e){return t.bind(e)}var F,x=t("./es5"),T="undefined"==typeof navigator,P={e:{}},R="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0!==this?this:null,S=function(t,e){function n(){this.constructor=t,this.constructor$=e;for(var n in e.prototype)r.call(e.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=e.prototype[n])}var r={}.hasOwnProperty;return n.prototype=e.prototype,t.prototype=new n,t.prototype},O=function(){var t=[Array.prototype,Object.prototype,Function.prototype],e=function(e){for(var n=0;n<t.length;++n)if(t[n]===e)return!0;return!1};if(x.isES5){var n=Object.getOwnPropertyNames;return function(t){for(var r=[],i=Object.create(null);null!=t&&!e(t);){var o;try{o=n(t)}catch(t){return r}for(var s=0;s<o.length;++s){var a=o[s];if(!i[a]){i[a]=!0;var c=Object.getOwnPropertyDescriptor(t,a);null!=c&&null==c.get&&null==c.set&&r.push(a)}}t=x.getPrototypeOf(t)}return r}}var r={}.hasOwnProperty;return function(n){if(e(n))return[];var i=[];t:for(var o in n)if(r.call(n,o))i.push(o);else{for(var s=0;s<t.length;++s)if(r.call(t[s],o))continue t;i.push(o)}return i}}(),A=/this\s*\.\s*\S+\s*=/,D=/^[a-z$_][a-z$_0-9]*$/i,V=function(){return"stack"in new Error?function(t){return b(t)?t:new Error(v(t))}:function(t){if(b(t))return t;try{throw new Error(v(t))}catch(t){return t}}}(),I=function(t){return x.isArray(t)?t:null};if("undefined"!=typeof Symbol&&Symbol.iterator){var L="function"==typeof Array.from?function(t){return Array.from(t)}:function(t){for(var e,n=[],r=t[Symbol.iterator]();!(e=r.next()).done;)n.push(e.value);return n};I=function(t){return x.isArray(t)?t:null!=t&&"function"==typeof t[Symbol.iterator]?L(t):null}}var N="undefined"!=typeof process&&"[object process]"===w(process).toLowerCase(),H="undefined"!=typeof process&&"undefined"!=typeof process.env,B={isClass:h,isIdentifier:_,inheritedDataKeys:O,getDataPropertyOrDefault:l,thrower:p,isArray:x.isArray,asArray:I,notEnumerableProp:u,isPrimitive:o,isObject:s,isError:y,canEvaluate:T,errorObj:P,tryCatch:i,inherits:S,withAppended:c,maybeWrapAsError:a,toFastProperties:f,filledRange:d,toString:v,canAttachTrace:b,ensureErrorObject:V,originatesFromRejection:m,markAsOriginatingFromRejection:g,classString:w,copyDescriptors:C,hasDevTools:"undefined"!=typeof chrome&&chrome&&"function"==typeof chrome.loadTimes,isNode:N,hasEnvVariables:H,env:j,global:R,getNativePromise:E,domainBind:k};B.isRecentNode=B.isNode&&function(){var t=process.versions.node.split(".").map(Number);return 0===t[0]&&t[1]>10||t[0]>0}(),B.isNode&&B.toFastProperties(process);try{throw new Error}catch(t){B.lastLineError=t}e.exports=B},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise),function(t){window.NggPaginatedGallery=function(e,n){this.displayed_gallery_id=e,this.container=t(n),this.container_name=n,this.get_displayed_gallery_obj=function(){var t="gallery_"+this.displayed_gallery_id;return"undefined"!=typeof window.galleries[t]&&window.galleries[t]},this.enable_ajax_pagination=function(){var e=this;t("body").on("click","a.ngg-browser-prev, a.ngg-browser-next",function(r){var i=!0;t(this).parents(n).each(function(){return t(this).data("nextgen-gallery-id")!=e.displayed_gallery_id||void(i=!1)}),i||(r.preventDefault(),window.ngg_ajax_operaton_count++,t("body, a").css("cursor","wait"),t.get(t(this).attr("href"),function(n){if(window.ngg_ajax_operaton_count--,window.ngg_ajax_operaton_count<=0&&(window.ngg_ajax_operaton_count=0,t("body, a").css("cursor","auto")),n){var r=t(n),i=!1;r.find(e.container_name).each(function(){return!!i||(t(this).data("nextgen-gallery-id")!=e.displayed_gallery_id||void(i=t(this)))}),i&&e.container.each(function(){var n=t(this);if(n.data("nextgen-gallery-id")!=e.displayed_gallery_id)return!0;var r=t(i.html()),o=r.find("img").toArray().map(function(e){return new Promise(function(n,r){var i=new Image;i.src=e.src,t(i).on("load",n)})});return Promise.all(o).then(function(){n.html(r),t(document).trigger("refreshed")}),!0})}}))})};var r=this.get_displayed_gallery_obj();r&&"undefined"!=typeof r.display_settings.ajax_pagination&&parseInt(r.display_settings.ajax_pagination)&&this.enable_ajax_pagination(),"undefined"==typeof window.ngg_ajax_operation_count&&(window.ngg_ajax_operaton_count=0)}}(jQuery);
|
products/photocrati_nextgen/modules/{nextgen_admin/templates/field_generator → nextgen_gallery_display/templates}/thumbnail_settings.php
RENAMED
File without changes
|
products/photocrati_nextgen/modules/nextgen_other_options/module.nextgen_other_options.php
CHANGED
@@ -10,7 +10,14 @@ define('NGG_OTHER_OPTIONS_SLUG', 'ngg_other_options');
|
|
10 |
|
11 |
class M_NextGen_Other_Options extends C_Base_Module
|
12 |
{
|
13 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
{
|
15 |
parent::define(
|
16 |
'photocrati-nextgen_other_options',
|
@@ -18,7 +25,7 @@ class M_NextGen_Other_Options extends C_Base_Module
|
|
18 |
'NextGEN Gallery Others Options Page',
|
19 |
'0.9',
|
20 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
21 |
-
'
|
22 |
'https://www.imagely.com'
|
23 |
);
|
24 |
}
|
10 |
|
11 |
class M_NextGen_Other_Options 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-nextgen_other_options',
|
25 |
'NextGEN Gallery Others Options Page',
|
26 |
'0.9',
|
27 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
28 |
+
'Imagely',
|
29 |
'https://www.imagely.com'
|
30 |
);
|
31 |
}
|
products/photocrati_nextgen/modules/nextgen_pagination/module.nextgen_pagination.php
CHANGED
@@ -6,7 +6,14 @@
|
|
6 |
*/
|
7 |
class M_NextGen_Pagination extends C_Base_Module
|
8 |
{
|
9 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
{
|
11 |
parent::define(
|
12 |
'photocrati-nextgen_pagination',
|
@@ -14,7 +21,7 @@ class M_NextGen_Pagination extends C_Base_Module
|
|
14 |
"Provides pagination for display types",
|
15 |
'0.4',
|
16 |
"https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/",
|
17 |
-
"
|
18 |
"https://www.imagely.com"
|
19 |
);
|
20 |
}
|
6 |
*/
|
7 |
class M_NextGen_Pagination extends C_Base_Module
|
8 |
{
|
9 |
+
function define($id = 'pope-module',
|
10 |
+
$name = 'Pope Module',
|
11 |
+
$description = '',
|
12 |
+
$version = '',
|
13 |
+
$uri = '',
|
14 |
+
$author = '',
|
15 |
+
$author_uri = '',
|
16 |
+
$context = FALSE)
|
17 |
{
|
18 |
parent::define(
|
19 |
'photocrati-nextgen_pagination',
|
21 |
"Provides pagination for display types",
|
22 |
'0.4',
|
23 |
"https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/",
|
24 |
+
"Imagely",
|
25 |
"https://www.imagely.com"
|
26 |
);
|
27 |
}
|
products/photocrati_nextgen/modules/nextgen_pro_upgrade/module.nextgen_pro_upgrade.php
CHANGED
@@ -8,7 +8,14 @@
|
|
8 |
|
9 |
class M_NextGen_Pro_Upgrade extends C_Base_Module
|
10 |
{
|
11 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
{
|
13 |
parent::define(
|
14 |
'photocrati-nextgen_pro_upgrade',
|
@@ -16,7 +23,7 @@ class M_NextGen_Pro_Upgrade extends C_Base_Module
|
|
16 |
'NextGEN Gallery Pro Upgrade Page',
|
17 |
'0.6',
|
18 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
19 |
-
'
|
20 |
'https://www.imagely.com'
|
21 |
);
|
22 |
}
|
8 |
|
9 |
class M_NextGen_Pro_Upgrade extends C_Base_Module
|
10 |
{
|
11 |
+
function define($id = 'pope-module',
|
12 |
+
$name = 'Pope Module',
|
13 |
+
$description = '',
|
14 |
+
$version = '',
|
15 |
+
$uri = '',
|
16 |
+
$author = '',
|
17 |
+
$author_uri = '',
|
18 |
+
$context = FALSE)
|
19 |
{
|
20 |
parent::define(
|
21 |
'photocrati-nextgen_pro_upgrade',
|
23 |
'NextGEN Gallery Pro Upgrade Page',
|
24 |
'0.6',
|
25 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
26 |
+
'Imagely',
|
27 |
'https://www.imagely.com'
|
28 |
);
|
29 |
}
|
products/photocrati_nextgen/modules/nextgen_settings/module.nextgen_settings.php
CHANGED
@@ -5,15 +5,22 @@ class M_NextGen_Settings extends C_Base_Module
|
|
5 |
/**
|
6 |
* Defines the module
|
7 |
*/
|
8 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
{
|
10 |
parent::define(
|
11 |
'photocrati-nextgen_settings',
|
12 |
'NextGEN Gallery Settings',
|
13 |
'Provides central management for NextGEN Gallery settings',
|
14 |
-
'0.
|
15 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
16 |
-
'
|
17 |
'https://www.imagely.com'
|
18 |
);
|
19 |
|
5 |
/**
|
6 |
* Defines the module
|
7 |
*/
|
8 |
+
function define($id = 'pope-module',
|
9 |
+
$name = 'Pope Module',
|
10 |
+
$description = '',
|
11 |
+
$version = '',
|
12 |
+
$uri = '',
|
13 |
+
$author = '',
|
14 |
+
$author_uri = '',
|
15 |
+
$context = FALSE)
|
16 |
{
|
17 |
parent::define(
|
18 |
'photocrati-nextgen_settings',
|
19 |
'NextGEN Gallery Settings',
|
20 |
'Provides central management for NextGEN Gallery settings',
|
21 |
+
'0.16',
|
22 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
23 |
+
'Imagely',
|
24 |
'https://www.imagely.com'
|
25 |
);
|
26 |
|
products/photocrati_nextgen/modules/nextgen_xmlrpc/module.nextgen_xmlrpc.php
CHANGED
@@ -8,7 +8,14 @@
|
|
8 |
|
9 |
class M_NextGen_XmlRpc extends C_Base_Module
|
10 |
{
|
11 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
{
|
13 |
parent::define(
|
14 |
'photocrati-nextgen_xmlrpc',
|
@@ -16,7 +23,7 @@ class M_NextGen_XmlRpc extends C_Base_Module
|
|
16 |
'Provides an XML-RPC API for NextGEN Gallery',
|
17 |
'0.6',
|
18 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
19 |
-
'
|
20 |
'https://www.imagely.com'
|
21 |
);
|
22 |
}
|
8 |
|
9 |
class M_NextGen_XmlRpc extends C_Base_Module
|
10 |
{
|
11 |
+
function define($id = 'pope-module',
|
12 |
+
$name = 'Pope Module',
|
13 |
+
$description = '',
|
14 |
+
$version = '',
|
15 |
+
$uri = '',
|
16 |
+
$author = '',
|
17 |
+
$author_uri = '',
|
18 |
+
$context = FALSE)
|
19 |
{
|
20 |
parent::define(
|
21 |
'photocrati-nextgen_xmlrpc',
|
23 |
'Provides an XML-RPC API for NextGEN Gallery',
|
24 |
'0.6',
|
25 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
26 |
+
'Imagely',
|
27 |
'https://www.imagely.com'
|
28 |
);
|
29 |
}
|
products/photocrati_nextgen/modules/ngglegacy/admin/functions.php
CHANGED
@@ -115,14 +115,12 @@ class nggAdmin{
|
|
115 |
if ($output == false)
|
116 |
return $galleryID;
|
117 |
|
118 |
-
if ($galleryID != false && !isset($_REQUEST['attach_to_post']))
|
119 |
-
|
120 |
-
$
|
121 |
-
$message
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
if ($output) nggGallery::show_message($message, 'gallery_created_msg');
|
126 |
}
|
127 |
return true;
|
128 |
}
|
115 |
if ($output == false)
|
116 |
return $galleryID;
|
117 |
|
118 |
+
if ($galleryID != false && !isset($_REQUEST['attach_to_post']))
|
119 |
+
{
|
120 |
+
$url = admin_url() . 'admin.php?page=nggallery-manage-gallery&mode=edit&gid=' . $galleryID;
|
121 |
+
$message = sprintf(__('Gallery successfully created. <a href="%s" target="_blank">Manage gallery</a>', 'nggallery'), $url);
|
122 |
+
if ($output)
|
123 |
+
nggGallery::show_message($message, 'gallery_created_msg');
|
|
|
|
|
124 |
}
|
125 |
return true;
|
126 |
}
|
products/photocrati_nextgen/modules/ngglegacy/admin/manage.php
CHANGED
@@ -39,10 +39,12 @@ class nggManageGallery {
|
|
39 |
// Should be called via a publish dialog
|
40 |
if ( isset($_POST['page']) && $_POST['page'] == 'publish-post' )
|
41 |
$this->publish_post();
|
|
|
42 |
//Look for other POST process
|
43 |
if ( !empty($_POST) || !empty($_GET) )
|
44 |
$this->processor();
|
45 |
|
|
|
46 |
}
|
47 |
|
48 |
function controller() {
|
39 |
// Should be called via a publish dialog
|
40 |
if ( isset($_POST['page']) && $_POST['page'] == 'publish-post' )
|
41 |
$this->publish_post();
|
42 |
+
|
43 |
//Look for other POST process
|
44 |
if ( !empty($_POST) || !empty($_GET) )
|
45 |
$this->processor();
|
46 |
|
47 |
+
M_NextGen_Admin::emit_do_notices_action();
|
48 |
}
|
49 |
|
50 |
function controller() {
|
products/photocrati_nextgen/modules/ngglegacy/lib/ngg-db.php
CHANGED
@@ -235,14 +235,11 @@ class nggdb
|
|
235 |
* @id The gallery ID
|
236 |
*/
|
237 |
function delete_gallery( $id ) {
|
238 |
-
|
239 |
-
|
240 |
-
$
|
241 |
-
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->nggallery WHERE gid = %d", $id) );
|
242 |
-
|
243 |
wp_cache_delete($id, 'ngg_gallery');
|
244 |
|
245 |
-
//TODO:Remove all tag relationship
|
246 |
return true;
|
247 |
}
|
248 |
|
@@ -605,7 +602,7 @@ class nggdb
|
|
605 |
* @param (optional) int $author
|
606 |
* @return bool result of the ID of the inserted gallery
|
607 |
*/
|
608 |
-
function add_gallery( $title = '', $path = '', $description = '', $pageid = 0, $previewpic = 0, $author = 0 ) {
|
609 |
global $wpdb;
|
610 |
|
611 |
// slug must be unique, we use the title for that
|
@@ -619,6 +616,9 @@ class nggdb
|
|
619 |
|
620 |
$galleryID = (int) $wpdb->insert_id;
|
621 |
|
|
|
|
|
|
|
622 |
//and give me the new id
|
623 |
return $galleryID;
|
624 |
}
|
235 |
* @id The gallery ID
|
236 |
*/
|
237 |
function delete_gallery( $id ) {
|
238 |
+
$mapper = C_Gallery_Mapper::get_instance();
|
239 |
+
$gallery = $mapper->find($id);
|
240 |
+
$mapper->destroy($gallery);
|
|
|
|
|
241 |
wp_cache_delete($id, 'ngg_gallery');
|
242 |
|
|
|
243 |
return true;
|
244 |
}
|
245 |
|
602 |
* @param (optional) int $author
|
603 |
* @return bool result of the ID of the inserted gallery
|
604 |
*/
|
605 |
+
static function add_gallery( $title = '', $path = '', $description = '', $pageid = 0, $previewpic = 0, $author = 0 ) {
|
606 |
global $wpdb;
|
607 |
|
608 |
// slug must be unique, we use the title for that
|
616 |
|
617 |
$galleryID = (int) $wpdb->insert_id;
|
618 |
|
619 |
+
do_action('ngg_created_new_gallery', $galleryID);
|
620 |
+
C_Photocrati_Transient_Manager::flush('displayed_gallery_rendering');
|
621 |
+
|
622 |
//and give me the new id
|
623 |
return $galleryID;
|
624 |
}
|
products/photocrati_nextgen/modules/ngglegacy/module.ngglegacy.php
CHANGED
@@ -10,15 +10,22 @@ define(
|
|
10 |
|
11 |
class M_NggLegacy extends C_Base_Module
|
12 |
{
|
13 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
{
|
15 |
parent::define(
|
16 |
'photocrati-nextgen-legacy',
|
17 |
'NextGEN Legacy',
|
18 |
'Embeds the original version of NextGEN 1.9.3 by Alex Rabe',
|
19 |
-
'0.
|
20 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
21 |
-
'
|
22 |
'https://www.imagely.com'
|
23 |
);
|
24 |
|
@@ -76,13 +83,14 @@ class C_NggLegacy_Installer
|
|
76 |
function uninstall($hard=FALSE)
|
77 |
{
|
78 |
include_once('admin/install.php');
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
|
|
86 |
|
87 |
// now remove the capability
|
88 |
ngg_remove_capability("NextGEN Gallery overview");
|
10 |
|
11 |
class M_NggLegacy 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-nextgen-legacy',
|
24 |
'NextGEN Legacy',
|
25 |
'Embeds the original version of NextGEN 1.9.3 by Alex Rabe',
|
26 |
+
'0.20',
|
27 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
28 |
+
'Imagely',
|
29 |
'https://www.imagely.com'
|
30 |
);
|
31 |
|
83 |
function uninstall($hard=FALSE)
|
84 |
{
|
85 |
include_once('admin/install.php');
|
86 |
+
if ($hard) {
|
87 |
+
delete_option('ngg_init_check');
|
88 |
+
delete_option('ngg_update_exists');
|
89 |
+
delete_option( 'ngg_options' );
|
90 |
+
delete_option( 'ngg_db_version' );
|
91 |
+
delete_option( 'ngg_update_exists' );
|
92 |
+
delete_option( 'ngg_next_update' );
|
93 |
+
}
|
94 |
|
95 |
// now remove the capability
|
96 |
ngg_remove_capability("NextGEN Gallery overview");
|
products/photocrati_nextgen/modules/ngglegacy/view/album-compact.php
CHANGED
@@ -23,9 +23,26 @@ Follow variables are useable :
|
|
23 |
<div class="ngg-album-compact">
|
24 |
<div class="ngg-album-compactbox">
|
25 |
<div class="ngg-album-link">
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
</div>
|
30 |
</div>
|
31 |
<?php if (!empty($image_gen_params)) {
|
23 |
<div class="ngg-album-compact">
|
24 |
<div class="ngg-album-compactbox">
|
25 |
<div class="ngg-album-link">
|
26 |
+
<?php if ($open_gallery_in_lightbox && $gallery->entity_type == 'gallery') { ?>
|
27 |
+
<a <?php echo $gallery->displayed_gallery->effect_code; ?>
|
28 |
+
href="<?php echo esc_attr($gallery->previewpic_fullsized_url); ?>"
|
29 |
+
data-fullsize="<?php echo esc_attr($gallery->previewpic_fullsized_url); ?>"
|
30 |
+
data-src="<?php echo esc_attr($gallery->previewpic_fullsized_url); ?>"
|
31 |
+
data-thumbnail="<?php echo esc_attr($gallery->previewurl); ?>"
|
32 |
+
data-title="<?php echo esc_attr($gallery->previewpic_image->alttext); ?>"
|
33 |
+
data-description="<?php echo esc_attr(stripslashes($gallery->previewpic_image->description)); ?>"
|
34 |
+
data-image-id="<?php echo esc_attr($gallery->previewpic); ?>">
|
35 |
+
<img class="Thumb"
|
36 |
+
alt="<?php echo esc_attr($gallery->title); ?>"
|
37 |
+
src="<?php echo nextgen_esc_url($gallery->previewurl); ?>"/>
|
38 |
+
</a>
|
39 |
+
<?php } else { ?>
|
40 |
+
<a class="Link" href="<?php echo nextgen_esc_url($gallery->pagelink); ?>">
|
41 |
+
<img class="Thumb"
|
42 |
+
alt="<?php echo esc_attr($gallery->title); ?>"
|
43 |
+
src="<?php echo nextgen_esc_url($gallery->previewurl); ?>"/>
|
44 |
+
</a>
|
45 |
+
<?php } ?>
|
46 |
</div>
|
47 |
</div>
|
48 |
<?php if (!empty($image_gen_params)) {
|
products/photocrati_nextgen/modules/router/module.router.php
CHANGED
@@ -2,7 +2,14 @@
|
|
2 |
|
3 |
class M_Router extends C_Base_Module
|
4 |
{
|
5 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
{
|
7 |
parent::define(
|
8 |
'photocrati-router',
|
@@ -10,7 +17,7 @@ class M_Router extends C_Base_Module
|
|
10 |
'Provides routing capabilities for Pope modules',
|
11 |
'0.9',
|
12 |
'https://www.imagely.com',
|
13 |
-
'
|
14 |
'https://www.imagely.com'
|
15 |
);
|
16 |
|
2 |
|
3 |
class M_Router extends C_Base_Module
|
4 |
{
|
5 |
+
function define($id = 'pope-module',
|
6 |
+
$name = 'Pope Module',
|
7 |
+
$description = '',
|
8 |
+
$version = '',
|
9 |
+
$uri = '',
|
10 |
+
$author = '',
|
11 |
+
$author_uri = '',
|
12 |
+
$context = FALSE)
|
13 |
{
|
14 |
parent::define(
|
15 |
'photocrati-router',
|
17 |
'Provides routing capabilities for Pope modules',
|
18 |
'0.9',
|
19 |
'https://www.imagely.com',
|
20 |
+
'Imagely',
|
21 |
'https://www.imagely.com'
|
22 |
);
|
23 |
|
products/photocrati_nextgen/modules/router/package.module.router.php
CHANGED
@@ -27,7 +27,7 @@ class C_Http_Response_Controller extends C_Component
|
|
27 |
}
|
28 |
return self::$_instance;
|
29 |
}
|
30 |
-
function define()
|
31 |
{
|
32 |
$this->add_mixin('Mixin_Http_Response_Actions');
|
33 |
$this->implement('I_Http_Response');
|
27 |
}
|
28 |
return self::$_instance;
|
29 |
}
|
30 |
+
function define($context = FALSE)
|
31 |
{
|
32 |
$this->add_mixin('Mixin_Http_Response_Actions');
|
33 |
$this->implement('I_Http_Response');
|
products/photocrati_nextgen/modules/security/module.security.php
CHANGED
@@ -1,7 +1,14 @@
|
|
1 |
<?php
|
2 |
class M_Security extends C_Base_Module
|
3 |
{
|
4 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
{
|
6 |
parent::define(
|
7 |
'photocrati-security',
|
@@ -9,7 +16,7 @@ class M_Security extends C_Base_Module
|
|
9 |
'Provides utilities to check for credentials and security',
|
10 |
'0.3',
|
11 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
12 |
-
'
|
13 |
'https://www.imagely.com'
|
14 |
);
|
15 |
|
1 |
<?php
|
2 |
class M_Security extends C_Base_Module
|
3 |
{
|
4 |
+
function define($id = 'pope-module',
|
5 |
+
$name = 'Pope Module',
|
6 |
+
$description = '',
|
7 |
+
$version = '',
|
8 |
+
$uri = '',
|
9 |
+
$author = '',
|
10 |
+
$author_uri = '',
|
11 |
+
$context = FALSE)
|
12 |
{
|
13 |
parent::define(
|
14 |
'photocrati-security',
|
16 |
'Provides utilities to check for credentials and security',
|
17 |
'0.3',
|
18 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
19 |
+
'Imagely',
|
20 |
'https://www.imagely.com'
|
21 |
);
|
22 |
|
products/photocrati_nextgen/modules/simplehtmldom/module.simple_html_dom.php
CHANGED
@@ -10,7 +10,14 @@ if (!function_exists(('file_get_html'))) require_once('simplehtmldom/simple_html
|
|
10 |
|
11 |
class M_Simple_Html_Dom extends C_Base_Module
|
12 |
{
|
13 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
{
|
15 |
parent::define(
|
16 |
'photocrati-simple_html_dom',
|
@@ -18,7 +25,7 @@ class M_Simple_Html_Dom extends C_Base_Module
|
|
18 |
'Provides the simple_html_dom utility for other modules to use',
|
19 |
'1.5',
|
20 |
'https://www.imagely.com',
|
21 |
-
'
|
22 |
'https://www.imagely.com'
|
23 |
);
|
24 |
}
|
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',
|
25 |
'Provides the simple_html_dom utility for other modules to use',
|
26 |
'1.5',
|
27 |
'https://www.imagely.com',
|
28 |
+
'Imagely',
|
29 |
'https://www.imagely.com'
|
30 |
);
|
31 |
}
|
products/photocrati_nextgen/modules/third_party_compat/module.third_party_compat.php
CHANGED
@@ -1,7 +1,14 @@
|
|
1 |
<?php
|
2 |
class M_Third_Party_Compat extends C_Base_Module
|
3 |
{
|
4 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
{
|
6 |
parent::define(
|
7 |
'photocrati-third_party_compat',
|
@@ -9,7 +16,7 @@ class M_Third_Party_Compat extends C_Base_Module
|
|
9 |
"Adds Third party compatibility hacks, adjustments, and modifications",
|
10 |
'0.6',
|
11 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
12 |
-
'
|
13 |
'https://www.imagely.com'
|
14 |
);
|
15 |
|
1 |
<?php
|
2 |
class M_Third_Party_Compat extends C_Base_Module
|
3 |
{
|
4 |
+
function define($id = 'pope-module',
|
5 |
+
$name = 'Pope Module',
|
6 |
+
$description = '',
|
7 |
+
$version = '',
|
8 |
+
$uri = '',
|
9 |
+
$author = '',
|
10 |
+
$author_uri = '',
|
11 |
+
$context = FALSE)
|
12 |
{
|
13 |
parent::define(
|
14 |
'photocrati-third_party_compat',
|
16 |
"Adds Third party compatibility hacks, adjustments, and modifications",
|
17 |
'0.6',
|
18 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
19 |
+
'Imagely',
|
20 |
'https://www.imagely.com'
|
21 |
);
|
22 |
|
products/photocrati_nextgen/modules/validation/module.validation.php
CHANGED
@@ -1,7 +1,14 @@
|
|
1 |
<?php
|
2 |
class M_Validation extends C_Base_Module
|
3 |
{
|
4 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
{
|
6 |
parent::define(
|
7 |
'photocrati-validation',
|
@@ -9,7 +16,7 @@ class M_Validation extends C_Base_Module
|
|
9 |
'Provides validation support for objects',
|
10 |
'0.2',
|
11 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
12 |
-
'
|
13 |
'https://www.imagely.com'
|
14 |
);
|
15 |
}
|
1 |
<?php
|
2 |
class M_Validation extends C_Base_Module
|
3 |
{
|
4 |
+
function define($id = 'pope-module',
|
5 |
+
$name = 'Pope Module',
|
6 |
+
$description = '',
|
7 |
+
$version = '',
|
8 |
+
$uri = '',
|
9 |
+
$author = '',
|
10 |
+
$author_uri = '',
|
11 |
+
$context = FALSE)
|
12 |
{
|
13 |
parent::define(
|
14 |
'photocrati-validation',
|
16 |
'Provides validation support for objects',
|
17 |
'0.2',
|
18 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
19 |
+
'Imagely',
|
20 |
'https://www.imagely.com'
|
21 |
);
|
22 |
}
|
products/photocrati_nextgen/modules/widget/module.widget.php
CHANGED
@@ -4,7 +4,14 @@ class M_Widget extends C_Base_Module
|
|
4 |
/**
|
5 |
* Defines the module name & version
|
6 |
*/
|
7 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
{
|
9 |
parent::define(
|
10 |
'photocrati-widget',
|
@@ -12,7 +19,7 @@ class M_Widget extends C_Base_Module
|
|
12 |
'Handles clearing of NextGen Widgets',
|
13 |
'0.6',
|
14 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
15 |
-
'
|
16 |
'https://www.imagely.com'
|
17 |
);
|
18 |
}
|
4 |
/**
|
5 |
* Defines the module name & version
|
6 |
*/
|
7 |
+
function define($id = 'pope-module',
|
8 |
+
$name = 'Pope Module',
|
9 |
+
$description = '',
|
10 |
+
$version = '',
|
11 |
+
$uri = '',
|
12 |
+
$author = '',
|
13 |
+
$author_uri = '',
|
14 |
+
$context = FALSE)
|
15 |
{
|
16 |
parent::define(
|
17 |
'photocrati-widget',
|
19 |
'Handles clearing of NextGen Widgets',
|
20 |
'0.6',
|
21 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
22 |
+
'Imagely',
|
23 |
'https://www.imagely.com'
|
24 |
);
|
25 |
}
|
products/photocrati_nextgen/modules/wordpress_routing/module.wordpress_routing.php
CHANGED
@@ -5,7 +5,14 @@ class M_WordPress_Routing extends C_Base_Module
|
|
5 |
static $_use_canonical_redirect = TRUE;
|
6 |
static $_use_old_slugs = TRUE;
|
7 |
|
8 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
{
|
10 |
parent::define(
|
11 |
'photocrati-wordpress_routing',
|
@@ -13,7 +20,7 @@ class M_WordPress_Routing extends C_Base_Module
|
|
13 |
"Integrates the MVC module's routing implementation with WordPress",
|
14 |
'0.8',
|
15 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
16 |
-
'
|
17 |
'https://www.imagely.com'
|
18 |
);
|
19 |
}
|
5 |
static $_use_canonical_redirect = TRUE;
|
6 |
static $_use_old_slugs = TRUE;
|
7 |
|
8 |
+
function define($id = 'pope-module',
|
9 |
+
$name = 'Pope Module',
|
10 |
+
$description = '',
|
11 |
+
$version = '',
|
12 |
+
$uri = '',
|
13 |
+
$author = '',
|
14 |
+
$author_uri = '',
|
15 |
+
$context = FALSE)
|
16 |
{
|
17 |
parent::define(
|
18 |
'photocrati-wordpress_routing',
|
20 |
"Integrates the MVC module's routing implementation with WordPress",
|
21 |
'0.8',
|
22 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
23 |
+
'Imagely',
|
24 |
'https://www.imagely.com'
|
25 |
);
|
26 |
}
|
products/photocrati_nextgen/modules/wpcli/module.wpcli.php
CHANGED
@@ -2,7 +2,14 @@
|
|
2 |
|
3 |
class M_WPCLI extends C_Base_Module
|
4 |
{
|
5 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
{
|
7 |
parent::define(
|
8 |
'photocrati-wpcli',
|
@@ -10,7 +17,7 @@ class M_WPCLI extends C_Base_Module
|
|
10 |
"Provides additional commands for WP-CLI (https://github.com/wp-cli/wp-cli",
|
11 |
'0.2',
|
12 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
13 |
-
'
|
14 |
'https://www.imagely.com'
|
15 |
);
|
16 |
}
|
@@ -95,6 +102,19 @@ if (defined('WP_CLI') && WP_CLI && class_exists('WP_CLI_Command', FALSE)) {
|
|
95 |
WP_CLI::error("Gallery not found (with id #{$assoc_args['gallery']}");
|
96 |
}
|
97 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
}
|
99 |
|
100 |
WP_CLI::add_command('ngg', 'C_NGG_WPCLI' );
|
2 |
|
3 |
class M_WPCLI extends C_Base_Module
|
4 |
{
|
5 |
+
function define($id = 'pope-module',
|
6 |
+
$name = 'Pope Module',
|
7 |
+
$description = '',
|
8 |
+
$version = '',
|
9 |
+
$uri = '',
|
10 |
+
$author = '',
|
11 |
+
$author_uri = '',
|
12 |
+
$context = FALSE)
|
13 |
{
|
14 |
parent::define(
|
15 |
'photocrati-wpcli',
|
17 |
"Provides additional commands for WP-CLI (https://github.com/wp-cli/wp-cli",
|
18 |
'0.2',
|
19 |
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
20 |
+
'Imagely',
|
21 |
'https://www.imagely.com'
|
22 |
);
|
23 |
}
|
102 |
WP_CLI::error("Gallery not found (with id #{$assoc_args['gallery']}");
|
103 |
}
|
104 |
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Clear all dismissed notifications handled by C_Admin_Notification_Manager
|
108 |
+
*
|
109 |
+
* @synopsis
|
110 |
+
*/
|
111 |
+
function clear_dismissed_notifications($args, $assoc_args)
|
112 |
+
{
|
113 |
+
$settings = C_NextGen_Settings::get_instance();
|
114 |
+
$settings->set('dismissed_notifications', array());
|
115 |
+
$settings->set('gallery_created_after_reviews_introduced', FALSE);
|
116 |
+
$settings->save();
|
117 |
+
}
|
118 |
}
|
119 |
|
120 |
WP_CLI::add_command('ngg', 'C_NGG_WPCLI' );
|
products/photocrati_nextgen/product.photocrati_nextgen.php
CHANGED
@@ -85,16 +85,23 @@ class P_Photocrati_NextGen extends C_Base_Product
|
|
85 |
return $retval;
|
86 |
}
|
87 |
|
88 |
-
function define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
{
|
90 |
parent::define(
|
91 |
'photocrati-nextgen',
|
92 |
'NextGen Gallery',
|
93 |
'NextGen Gallery',
|
94 |
NGG_PLUGIN_VERSION,
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
);
|
99 |
|
100 |
$module_path = implode(DIRECTORY_SEPARATOR, array(dirname(__FILE__), 'modules'));
|
85 |
return $retval;
|
86 |
}
|
87 |
|
88 |
+
function define($id = 'pope-product',
|
89 |
+
$name = 'Pope Product',
|
90 |
+
$description = '',
|
91 |
+
$version = '',
|
92 |
+
$uri = '',
|
93 |
+
$author = '',
|
94 |
+
$author_uri = '',
|
95 |
+
$context = FALSE)
|
96 |
{
|
97 |
parent::define(
|
98 |
'photocrati-nextgen',
|
99 |
'NextGen Gallery',
|
100 |
'NextGen Gallery',
|
101 |
NGG_PLUGIN_VERSION,
|
102 |
+
'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
|
103 |
+
'Imagely',
|
104 |
+
'https://www.imagely.com'
|
105 |
);
|
106 |
|
107 |
$module_path = implode(DIRECTORY_SEPARATOR, array(dirname(__FILE__), 'modules'));
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
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: 2.1
|
6 |
-
Tested up to: 4.7.
|
7 |
License: GPLv2
|
8 |
|
9 |
The most popular WordPress gallery plugin and one of the most popular plugins of all time with over 16.5 million downloads.
|
@@ -187,8 +187,19 @@ For more information, feel free to visit the official website for the NextGEN Ga
|
|
187 |
|
188 |
== Changelog ==
|
189 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
= V2.1.79 - 02.23.2017 =
|
191 |
-
*
|
192 |
|
193 |
= V2.1.77 - 01.31.2017 =
|
194 |
* Changed: Corrected Facebook link
|
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: 2.2.1
|
6 |
+
Tested up to: 4.7.3
|
7 |
License: GPLv2
|
8 |
|
9 |
The most popular WordPress gallery plugin and one of the most popular plugins of all time with over 16.5 million downloads.
|
187 |
|
188 |
== Changelog ==
|
189 |
|
190 |
+
= V2.2.1 - 03.13.2017 =
|
191 |
+
* NEW: Template mechanism for all display types
|
192 |
+
* NEW: Review notices
|
193 |
+
* Changed: Updated branding to Imagely
|
194 |
+
* Changed: Added the ability to click on a gallery title and have it open direct to Pro Lightbox
|
195 |
+
* Fixed: Problems with activation after initial installation
|
196 |
+
* Fixed: Don't display legacy shortcodes after creating new galleries
|
197 |
+
* Fixed: false positive malware detection notices against 'eval'
|
198 |
+
* Fixed: Various PHP notices and warnings
|
199 |
+
* Fixed: Issue with dynamic container height for Imagebrowser display types
|
200 |
+
|
201 |
= V2.1.79 - 02.23.2017 =
|
202 |
+
* Secured: Resolved vulnerability with tag cloud displays
|
203 |
|
204 |
= V2.1.77 - 01.31.2017 =
|
205 |
* Changed: Corrected Facebook link
|