Version Description
- New : Reworked how FooBox loads, to work better with optimization plugins (Autoptimize / WP Rocket)
- Remove : Removed support for Google+ in social sharing
- Update : Updated to handle Chrome's new allow attribute in videos
- Update : Updated to latest FooBox client JS & CSS
Download this release
Release Info
Developer | bradvin |
Plugin | FooBox Image Lightbox WordPress Plugin |
Version | 2.7.0 |
Comparing to | |
See all releases |
Code changes from version 2.6.4 to 2.7.0
- foobox-free.php +2 -2
- free/css/foobox.free.min.css +1 -1
- free/foobox-free.php +12 -56
- free/includes/class-script-generator.php +53 -41
- free/includes/class-settings.php +0 -8
- free/js/foobox.free.min.js +2 -2
- freemius/templates/debug.php +726 -726
- readme.txt +13 -1
foobox-free.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: FooBox Image Lightbox
|
5 |
Plugin URI: http://fooplugins.com/plugins/foobox/
|
6 |
Description: The best responsive lightbox for WordPress.
|
7 |
-
Version: 2.
|
8 |
Author: FooPlugins
|
9 |
Author URI: http://fooplugins.com
|
10 |
License: GPL2
|
@@ -24,7 +24,7 @@ if ( function_exists( 'foobox_fs' ) ) {
|
|
24 |
define( 'FOOBOX_BASE_ACTIVATION_REDIRECT_TRANSIENT_KEY', '_foobox_activation_redirect' );
|
25 |
define( 'FOOBOX_BASE_PATH', plugin_dir_path( __FILE__ ) );
|
26 |
define( 'FOOBOX_BASE_URL', plugin_dir_url( __FILE__ ) );
|
27 |
-
define( 'FOOBOX_BASE_VERSION', '2.
|
28 |
// Create a helper function for easy SDK access.
|
29 |
function foobox_fs()
|
30 |
{
|
4 |
Plugin Name: FooBox Image Lightbox
|
5 |
Plugin URI: http://fooplugins.com/plugins/foobox/
|
6 |
Description: The best responsive lightbox for WordPress.
|
7 |
+
Version: 2.7.0
|
8 |
Author: FooPlugins
|
9 |
Author URI: http://fooplugins.com
|
10 |
License: GPL2
|
24 |
define( 'FOOBOX_BASE_ACTIVATION_REDIRECT_TRANSIENT_KEY', '_foobox_activation_redirect' );
|
25 |
define( 'FOOBOX_BASE_PATH', plugin_dir_path( __FILE__ ) );
|
26 |
define( 'FOOBOX_BASE_URL', plugin_dir_url( __FILE__ ) );
|
27 |
+
define( 'FOOBOX_BASE_VERSION', '2.7.0' );
|
28 |
// Create a helper function for easy SDK access.
|
29 |
function foobox_fs()
|
30 |
{
|
free/css/foobox.free.min.css
CHANGED
@@ -5,4 +5,4 @@
|
|
5 |
* @copyright Steven Usher & Brad Vincent 2014
|
6 |
* @license Released under the MIT license.
|
7 |
* You are free to use FooBox jQuery in personal projects as long as this copyright header is left intact.
|
8 |
-
*/.fbx-close:hover,.fbx-credit a,.fbx-next:hover,.fbx-prev:hover{text-decoration:none}.fbx-modal,.fbx-modal *{box-sizing:content-box}.fbx-modal{position:fixed;top:0;left:0;z-index:9000001;visibility:hidden;width:100%;height:100%;font-family:"Segoe UI",Helvetica,Arial,"Sans Serif",serif;line-height:normal;outline:0!important;transform:translate3d(0,0,0);perspective:0}.fbx-modal.fbx-loading,.fbx-modal.fbx-show{visibility:visible}.fbx-no-scroll{overflow:hidden!important}.fbx-inner-spacer{display:none;padding:40px}.fbx-inner,.fbx-loader{position:absolute;top:50%;left:50%}.fbx-inner{visibility:hidden;overflow:visible!important;margin-top:-5px;margin-left:-5px;min-width:100px;min-height:100px;width:100px;height:100px;z-index:100002}.fbx-show .fbx-inner{visibility:visible}.fbx-loader{visibility:hidden;z-index:100005;margin-top:-40px;margin-left:-40px;width:80px;height:80px;font-size:16px;box-shadow:0 0 3px rgba(0,0,0,.4)}.fbx-loading .fbx-loader,.fbx-show .fbx-caption{visibility:visible}.fbx-phone.fbx-portrait .fbx-loader{margin-top:-18px}.fbx-loader>div{margin:10px;width:60px;height:60px}.fbx-item-current,.fbx-item-next,.fbx-stage{top:0;left:0;margin:0;width:100%;height:100%;padding:0;outline:0;position:absolute;border:none}.fbx-stage{overflow:hidden}.fbx-item-current,.fbx-item-next{-webkit-user-drag:none;overflow:auto}.fbx-loading .fbx-item-current,.fbx-loading .fbx-item-next{overflow:hidden}.fbx-item-next{z-index:100001}.fbx-item-current{z-index:100002}.fbx-error-msg{width:200px;height:200px;position:absolute;top:50%;left:50%;margin-top:-100px;margin-left:-100px}.fbx-error-msg>span{line-height:200px;width:100%;height:100%;display:block}.fbx-error-msg>p{position:absolute;top:100%;text-align:center;width:100%;margin:0}.fbx-item-embed,.fbx-item-iframe,.fbx-item-image,.fbx-item-video{margin:0;padding:0;width:100%;height:100%;outline:0;border:none;display:block}.fbx-item-video>.fbx-video{background-color:#000}.fbx-item-embed embed,.fbx-item-embed iframe,.fbx-item-embed object{margin-bottom:0}.fbx-item-embed>embed,.fbx-item-embed>iframe,.fbx-item-embed>object{max-width:100%;max-height:100%}.fbx-ios .fbx-item-current{-webkit-overflow-scrolling:touch!important;overflow:auto!important}.fbx-ios .fbx-item-iframe{width:1px;min-width:100%}.fbx-close,.fbx-next,.fbx-prev{position:absolute;z-index:100006;display:block;outline:0!important;text-decoration:none;cursor:pointer}.fbx-no-buttons .fbx-next,.fbx-no-buttons .fbx-prev{display:none!important}.fbx-phone .fbx-count,.fbx-phone .fbx-credit em,.fbx-phone.fbx-landscape.fbx-no-nav .fbx-next,.fbx-phone.fbx-landscape.fbx-no-nav .fbx-prev,.fbx-rounded .fbx-next.fbx-disabled,.fbx-rounded .fbx-prev.fbx-disabled{display:none}.fbx-credit{position:absolute;z-index:100003;text-transform:lowercase;font-size:10px}.fbx-credit em{font-style:normal;font-size:10px}.fbx-credit a{font-size:10px}.fbx-credit a:hover span{text-decoration:underline}.fbx-credit a span{letter-spacing:1px;font-size:10px;color:#fff}.fbx-count{position:absolute;z-index:100002;width:100%;text-align:center;font-size:10px}.fbx-btn-transition,.fbx-btn-transition:before{transition-property:color,border-color,opacity,box-shadow;transition-duration:.2s,.2s,.2s,.2s;transition-timing-function:ease-in,linear,ease-in,ease-in;outline:0}.fbx-modal.fbx-phone .fbx-inner{border:none}.fbx-modal.fbx-phone .fbx-close,.fbx-modal.fbx-phone .fbx-next,.fbx-modal.fbx-phone .fbx-prev{position:fixed}.fbx-modal.fbx-phone .fbx-credit{bottom:2px;left:2px}.fbx-modal.fbx-phone.fbx-portrait .fbx-inner-spacer{padding:45px 5px 5px}.fbx-modal.fbx-phone.fbx-portrait .fbx-close,.fbx-modal.fbx-phone.fbx-portrait .fbx-next,.fbx-modal.fbx-phone.fbx-portrait .fbx-prev{border:none;opacity:1;margin:0;top:0;bottom:auto;width:auto;height:40px;border-radius:0;line-height:40px}.fbx-modal.fbx-phone.fbx-portrait .fbx-prev{left:0;right:66%}.fbx-modal.fbx-phone.fbx-portrait .fbx-next{left:33%;right:33%}.fbx-modal.fbx-phone.fbx-portrait .fbx-close{left:66%;right:0}.fbx-modal.fbx-phone.fbx-portrait.fbx-no-buttons .fbx-close{left:0;right:0}.fbx-modal.fbx-phone.fbx-landscape{border-right-width:46px;border-right-style:solid;box-sizing:border-box}.fbx-modal.fbx-phone.fbx-landscape .fbx-inner-spacer{padding:5px}.fbx-modal.fbx-phone.fbx-landscape .fbx-close,.fbx-modal.fbx-phone.fbx-landscape .fbx-next,.fbx-modal.fbx-phone.fbx-landscape .fbx-prev{bottom:auto;left:auto;right:-45px;width:44px;height:44px;line-height:44px;border:none;opacity:1;margin:0}.fbx-modal.fbx-phone.fbx-landscape .fbx-close{top:0;height:60px}.fbx-modal.fbx-phone.fbx-landscape .fbx-prev{top:62px}.fbx-modal.fbx-phone.fbx-landscape .fbx-next{top:108px}@font-face{font-family:foobox;src:url(font/foobox.eot);src:url(font/foobox.eot?#iefix) format('embedded-opentype'),url(font/foobox.woff) format('woff'),url(font/foobox.ttf) format('truetype'),url(font/foobox.svg#foobox) format('svg');font-weight:400;font-style:normal;font-display:fallback}.fbx-modal .fbx-error-msg>span,.fbx-modal .fbx-loader>div,.fbx-modal a.fbx-close,.fbx-modal a.fbx-next,.fbx-modal a.fbx-prev{font-family:foobox;font-size:16px;font-weight:400;text-align:center;outline:0}.fbx-modal .fbx-loader>div{font-size:300%;line-height:60px}.fbx-modal.fbx-loading .fbx-loader>div{animation:spin 2s infinite linear}.fbx-modal .fbx-error-msg>span{font-size:1000%}.fbx-modal .fbx-error-msg>span:before{content:"\e028"}.fbx-close:before{content:"\e002"}.fbx-prev:before{content:"\e000"}.fbx-next:before{content:"\e001"}.fbx-loader>div:before{content:"\e012"}.fbx-flat .fbx-close:before{content:"\e117"}.fbx-flat .fbx-prev:before{content:"\e094"}.fbx-flat .fbx-next:before{content:"\e095"}.fbx-flat .fbx-loader>div:before{content:"\e105"}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(359deg)}}.fbx-rounded .fbx-prev.fbx-btn-shadow,.fbx-rounded .fbx-prev.fbx-btn-shadow:hover{box-shadow:-2px 0 2px rgba(0,0,0,.4)}.fbx-rounded .fbx-next.fbx-btn-shadow,.fbx-rounded .fbx-next.fbx-btn-shadow:hover{box-shadow:2px 0 2px rgba(0,0,0,.4)}.fbx-fullscreen-mode .fbx-btn-shadow,.fbx-fullscreen-mode .fbx-next.fbx-btn-shadow,.fbx-fullscreen-mode .fbx-prev.fbx-btn-shadow,.fbx-inner-shadow,.fbx-rounded .fbx-btn-shadow,.fbx-rounded.fbx-inset-buttons.fbx-desktop .fbx-next.fbx-btn-shadow:before,.fbx-rounded.fbx-inset-buttons.fbx-desktop .fbx-prev.fbx-btn-shadow:before,.fbx-rounded.fbx-inset-buttons.fbx-tablet .fbx-next.fbx-btn-shadow:before,.fbx-rounded.fbx-inset-buttons.fbx-tablet .fbx-prev.fbx-btn-shadow:before,.fbx-sticky-buttons .fbx-next.fbx-btn-shadow,.fbx-sticky-buttons .fbx-prev.fbx-btn-shadow{box-shadow:0 0 12px rgba(0,0,0,.4)}.fbx-fullscreen-mode .fbx-btn-shadow:hover,.fbx-fullscreen-mode .fbx-next.fbx-btn-shadow:hover,.fbx-fullscreen-mode .fbx-prev.fbx-btn-shadow:hover,.fbx-rounded .fbx-btn-shadow:hover,.fbx-rounded.fbx-inset-buttons.fbx-desktop .fbx-next.fbx-btn-shadow:hover:before,.fbx-rounded.fbx-inset-buttons.fbx-desktop .fbx-prev.fbx-btn-shadow:hover:before,.fbx-rounded.fbx-inset-buttons.fbx-tablet .fbx-next.fbx-btn-shadow:hover:before,.fbx-rounded.fbx-inset-buttons.fbx-tablet .fbx-prev.fbx-btn-shadow:hover:before,.fbx-sticky-buttons .fbx-next.fbx-btn-shadow:hover,.fbx-sticky-buttons .fbx-prev.fbx-btn-shadow:hover{box-shadow:0 0 6px rgba(0,0,0,.4)}.fbx-flat .fbx-inner-shadow,.fbx-flat.fbx-fullscreen-mode .fbx-btn-shadow,.fbx-flat.fbx-fullscreen-mode .fbx-btn-shadow:hover,.fbx-flat.fbx-fullscreen-mode .fbx-next.fbx-btn-shadow,.fbx-flat.fbx-fullscreen-mode .fbx-next.fbx-btn-shadow:hover,.fbx-flat.fbx-fullscreen-mode .fbx-prev.fbx-btn-shadow,.fbx-flat.fbx-fullscreen-mode .fbx-prev.fbx-btn-shadow:hover,.fbx-flat.fbx-sticky-buttons .fbx-next.fbx-btn-shadow,.fbx-flat.fbx-sticky-buttons .fbx-next.fbx-btn-shadow:hover,.fbx-flat.fbx-sticky-buttons .fbx-prev.fbx-btn-shadow,.fbx-flat.fbx-sticky-buttons .fbx-prev.fbx-btn-shadow:hover,.fbx-modal.fbx-phone.fbx-fullscreen-mode .fbx-btn-shadow,.fbx-modal.fbx-phone.fbx-fullscreen-mode .fbx-next.fbx-btn-shadow,.fbx-modal.fbx-phone.fbx-fullscreen-mode .fbx-prev.fbx-btn-shadow,.fbx-modal.fbx-phone.fbx-rounded .fbx-btn-shadow,.fbx-modal.fbx-phone.fbx-rounded.fbx-inset-buttons .fbx-next.fbx-btn-shadow:before,.fbx-modal.fbx-phone.fbx-rounded.fbx-inset-buttons .fbx-prev.fbx-btn-shadow:before,.fbx-modal.fbx-phone.fbx-sticky-buttons .fbx-next.fbx-btn-shadow,.fbx-modal.fbx-phone.fbx-sticky-buttons .fbx-prev.fbx-btn-shadow,.fbx-rounded.fbx-inset-buttons .fbx-next.fbx-btn-shadow,.fbx-rounded.fbx-inset-buttons .fbx-next.fbx-btn-shadow:hover,.fbx-rounded.fbx-inset-buttons .fbx-prev.fbx-btn-shadow,.fbx-rounded.fbx-inset-buttons .fbx-prev.fbx-btn-shadow:hover{box-shadow:none}.fbx-rounded .fbx-inner{border:8px solid transparent;border-radius:6px}.fbx-rounded .fbx-item-current,.fbx-rounded .fbx-item-image,.fbx-rounded .fbx-item-next{border-radius:3px}.fbx-rounded .fbx-loader,.fbx-rounded .fbx-loader>div{border-radius:50%}.fbx-rounded .fbx-error-msg{margin-top:-115px}.fbx-rounded .fbx-close{top:-21px;right:-21px;width:28px;height:28px;line-height:28px;border:3px solid transparent;border-radius:50%}.fbx-rounded .fbx-next,.fbx-rounded .fbx-prev{position:absolute;top:50%;margin-top:-50px;width:30px;height:100px;line-height:100px;border:3px solid transparent}.fbx-rounded .fbx-prev{left:-40px;border-radius:6px 0 0 6px}.fbx-rounded .fbx-next{right:-40px;border-radius:0 6px 6px 0}.fbx-rounded.fbx-phone .fbx-next.fbx-disabled,.fbx-rounded.fbx-phone .fbx-prev.fbx-disabled{display:block;cursor:default}.fbx-rounded.fbx-phone .fbx-next.fbx-disabled:before,.fbx-rounded.fbx-phone .fbx-prev.fbx-disabled:before{opacity:0}.fbx-rounded.fbx-desktop .fbx-next,.fbx-rounded.fbx-desktop .fbx-prev{position:absolute}.fbx-rounded .fbx-count,.fbx-rounded .fbx-credit{bottom:-25px}.fbx-rounded .fbx-inner-spacer{padding:40px 40px 50px}.fbx-modal.fbx-rounded.fbx-phone.fbx-portrait .fbx-inner-spacer{padding:45px 5px 5px}.fbx-rounded.fbx-sticky-buttons .fbx-next,.fbx-rounded.fbx-sticky-buttons .fbx-prev{position:fixed;top:50%;margin-top:-50px;width:40px;height:100px;line-height:100px}.fbx-rounded.fbx-sticky-buttons .fbx-prev{left:0;border-radius:0 6px 6px 0}.fbx-rounded.fbx-sticky-buttons .fbx-next{right:0;border-radius:6px 0 0 6px}.fbx-rounded.fbx-sticky-buttons.fbx-full-buttons .fbx-inner-spacer{padding:40px 80px}.fbx-rounded.fbx-phone.fbx-portrait.fbx-sticky-buttons.fbx-full-buttons .fbx-inner-spacer{padding:45px 5px 5px}.fbx-rounded.fbx-phone.fbx-landscape.fbx-sticky-buttons.fbx-full-buttons .fbx-inner-spacer{padding:5px}.fbx-rounded.fbx-sticky-buttons.fbx-full-buttons .fbx-next,.fbx-rounded.fbx-sticky-buttons.fbx-full-buttons .fbx-prev{top:0;bottom:0;border-radius:0;width:4%;min-width:45px;height:auto;opacity:.3}.fbx-rounded.fbx-sticky-buttons.fbx-full-buttons .fbx-next:hover,.fbx-rounded.fbx-sticky-buttons.fbx-full-buttons .fbx-prev:hover{opacity:1}.fbx-rounded.fbx-sticky-buttons.fbx-full-buttons .fbx-next:before,.fbx-rounded.fbx-sticky-buttons.fbx-full-buttons .fbx-prev:before{position:fixed;width:4%;min-width:45px;height:30px;line-height:30px;top:50%;margin-top:-15px}.fbx-rounded.fbx-sticky-buttons.fbx-full-buttons .fbx-prev,.fbx-rounded.fbx-sticky-buttons.fbx-full-buttons .fbx-prev:before{left:0;right:auto}.fbx-rounded.fbx-sticky-buttons.fbx-full-buttons .fbx-next,.fbx-rounded.fbx-sticky-buttons.fbx-full-buttons .fbx-next:before{left:auto;right:0}.fbx-rounded.fbx-phone.fbx-sticky-buttons.fbx-full-buttons .fbx-next:before,.fbx-rounded.fbx-phone.fbx-sticky-buttons.fbx-full-buttons .fbx-prev:before{position:relative;width:auto;min-width:0;height:auto;line-height:inherit;top:auto;margin-top:auto}.fbx-rounded.fbx-phone.fbx-sticky-buttons.fbx-full-buttons .fbx-next,.fbx-rounded.fbx-phone.fbx-sticky-buttons.fbx-full-buttons .fbx-prev{top:0;bottom:auto;border-radius:0;width:auto;min-width:0;height:auto;opacity:1}.fbx-modal.fbx-rounded.fbx-phone.fbx-portrait.fbx-sticky-buttons.fbx-full-buttons .fbx-prev{left:0;right:66%}.fbx-modal.fbx-rounded.fbx-phone.fbx-portrait.fbx-sticky-buttons.fbx-full-buttons .fbx-next{left:33%;right:33%}.fbx-modal.fbx-rounded.fbx-phone.fbx-portrait.fbx-sticky-buttons.fbx-full-buttons .fbx-close{left:66%;right:0}.fbx-modal.fbx-rounded.fbx-phone.fbx-portrait.fbx-no-buttons.fbx-sticky-buttons.fbx-full-buttons .fbx-close{left:0;right:0}.fbx-rounded.fbx-phone.fbx-landscape.fbx-sticky-buttons.fbx-full-buttons .fbx-next,.fbx-rounded.fbx-phone.fbx-landscape.fbx-sticky-buttons.fbx-full-buttons .fbx-prev{bottom:auto;width:34px;height:80px;opacity:.5}.fbx-rounded.fbx-phone.fbx-landscape.fbx-full-buttons .fbx-prev,.fbx-rounded.fbx-phone.fbx-landscape.fbx-sticky-buttons .fbx-prev,.fbx-rounded.fbx-phone.fbx-landscape.fbx-sticky-buttons.fbx-full-buttons .fbx-prev{top:62px}.fbx-rounded.fbx-phone.fbx-landscape.fbx-full-buttons .fbx-next,.fbx-rounded.fbx-phone.fbx-landscape.fbx-sticky-buttons .fbx-next,.fbx-rounded.fbx-phone.fbx-landscape.fbx-sticky-buttons.fbx-full-buttons .fbx-next{top:108px}.fbx-rounded.fbx-phone.fbx-landscape.fbx-sticky-buttons.fbx-full-buttons .fbx-next:hover,.fbx-rounded.fbx-phone.fbx-landscape.fbx-sticky-buttons.fbx-full-buttons .fbx-prev:hover{opacity:1}.fbx-rounded.fbx-phone.fbx-landscape.fbx-sticky-buttons.fbx-full-buttons .fbx-prev{border-radius:0 6px 6px 0}.fbx-rounded.fbx-phone.fbx-landscape.fbx-sticky-buttons.fbx-full-buttons .fbx-next{border-radius:6px 0 0 6px}.fbx-rounded.fbx-inset-buttons.fbx-desktop .fbx-next,.fbx-rounded.fbx-inset-buttons.fbx-desktop .fbx-prev,.fbx-rounded.fbx-inset-buttons.fbx-tablet .fbx-next,.fbx-rounded.fbx-inset-buttons.fbx-tablet .fbx-prev{z-index:100003;position:absolute;top:0;bottom:0;height:100%;width:25%;margin:0;border-radius:0;background-color:transparent;box-sizing:border-box}.fbx-rounded.fbx-inset-buttons.fbx-desktop .fbx-prev,.fbx-rounded.fbx-inset-buttons.fbx-tablet .fbx-prev{left:0}.fbx-rounded.fbx-inset-buttons.fbx-desktop .fbx-next,.fbx-rounded.fbx-inset-buttons.fbx-tablet .fbx-next{right:0}.fbx-rounded.fbx-inset-buttons.fbx-desktop .fbx-next:before,.fbx-rounded.fbx-inset-buttons.fbx-desktop .fbx-prev:before,.fbx-rounded.fbx-inset-buttons.fbx-tablet .fbx-next:before,.fbx-rounded.fbx-inset-buttons.fbx-tablet .fbx-prev:before{width:28px;height:28px;border-radius:50%;position:absolute;top:50%;margin-top:-14px;line-height:28px;border-width:3px;border-style:solid;opacity:0}.fbx-rounded.fbx-inset-buttons .fbx-prev:before{left:10px}.fbx-rounded.fbx-inset-buttons .fbx-next:before{right:10px}.fbx-rounded.fbx-inset-buttons .fbx-next:hover:before,.fbx-rounded.fbx-inset-buttons .fbx-prev:hover:before{opacity:1}.fbx-light,.fbx-light .fbx-caption,.fbx-light .fbx-open-caption,.fbx-light.fbx-phone .fbx-social{background-color:rgba(0,0,0,.7)}.fbx-light .fbx-progress{background-color:rgba(255,255,255,.5)}.fbx-fullscreen-mode.fbx-light{background-color:#d3d3d3}.fbx-light .fbx-inner,.fbx-light.fbx-inset-buttons .fbx-next:before,.fbx-light.fbx-inset-buttons .fbx-prev:before,.fbx-light.fbx-modal,.fbx-modal.fbx-light.fbx-phone .fbx-close:hover,.fbx-modal.fbx-light.fbx-phone .fbx-fullscreen-toggle:hover,.fbx-modal.fbx-light.fbx-phone .fbx-next:hover,.fbx-modal.fbx-light.fbx-phone .fbx-pause:hover,.fbx-modal.fbx-light.fbx-phone .fbx-play:hover,.fbx-modal.fbx-light.fbx-phone .fbx-prev:hover,.fbx-modal.fbx-light.fbx-phone .fbx-social-toggle:hover,.fbx-rounded.fbx-light .fbx-close,.fbx-rounded.fbx-light .fbx-fullscreen-toggle,.fbx-rounded.fbx-light .fbx-pause,.fbx-rounded.fbx-light .fbx-play,.fbx-rounded.fbx-light .fbx-social-toggle{border-color:#FFF}.fbx-light .fbx-close,.fbx-light .fbx-fullscreen-toggle,.fbx-light .fbx-inner,.fbx-light .fbx-loader,.fbx-light .fbx-next,.fbx-light .fbx-pause,.fbx-light .fbx-play,.fbx-light .fbx-prev,.fbx-light .fbx-social-toggle,.fbx-light.fbx-inset-buttons .fbx-next:before,.fbx-light.fbx-inset-buttons .fbx-prev:before{background-color:#FFF}.fbx-flat.fbx-light .fbx-close,.fbx-flat.fbx-light .fbx-fullscreen-toggle,.fbx-flat.fbx-light .fbx-next,.fbx-flat.fbx-light .fbx-pause,.fbx-flat.fbx-light .fbx-play,.fbx-flat.fbx-light .fbx-prev,.fbx-flat.fbx-light .fbx-social-toggle,.fbx-flat.fbx-light.fbx-inset-buttons .fbx-next:before,.fbx-flat.fbx-light.fbx-inset-buttons .fbx-prev:before{background-color:transparent}.fbx-flat.fbx-light.fbx-inset-buttons .fbx-next:before,.fbx-flat.fbx-light.fbx-inset-buttons .fbx-prev:before{border-color:transparent}.fbx-flat.fbx-light.fbx-modal{border-color:rgba(0,0,0,.2)}.fbx-flat.fbx-light.fbx-phone.fbx-portrait .fbx-close,.fbx-flat.fbx-light.fbx-phone.fbx-portrait .fbx-fullscreen-toggle,.fbx-flat.fbx-light.fbx-phone.fbx-portrait .fbx-next,.fbx-flat.fbx-light.fbx-phone.fbx-portrait .fbx-pause,.fbx-flat.fbx-light.fbx-phone.fbx-portrait .fbx-play,.fbx-flat.fbx-light.fbx-phone.fbx-portrait .fbx-prev,.fbx-flat.fbx-light.fbx-phone.fbx-portrait .fbx-social-toggle{background-color:rgba(0,0,0,.2)}.fbx-light .fbx-close,.fbx-light .fbx-close:before,.fbx-light .fbx-error-msg,.fbx-light .fbx-fullscreen-toggle,.fbx-light .fbx-fullscreen-toggle:before,.fbx-light .fbx-loader,.fbx-light .fbx-loader:before,.fbx-light .fbx-next,.fbx-light .fbx-next:before,.fbx-light .fbx-pause,.fbx-light .fbx-pause:before,.fbx-light .fbx-play,.fbx-light .fbx-play:before,.fbx-light .fbx-prev,.fbx-light .fbx-prev:before,.fbx-light .fbx-social-toggle,.fbx-light .fbx-social-toggle:before,.fbx-light.fbx-inset-buttons .fbx-next:before,.fbx-light.fbx-inset-buttons .fbx-prev:before,.fbx-metro.fbx-light .fbx-count,.fbx-metro.fbx-light .fbx-credit a{color:#666!important}.fbx-flat.fbx-light .fbx-close,.fbx-flat.fbx-light .fbx-close:before,.fbx-flat.fbx-light .fbx-count,.fbx-flat.fbx-light .fbx-credit a,.fbx-flat.fbx-light .fbx-fullscreen-toggle,.fbx-flat.fbx-light .fbx-fullscreen-toggle:before,.fbx-flat.fbx-light .fbx-next,.fbx-flat.fbx-light .fbx-next:before,.fbx-flat.fbx-light .fbx-pause,.fbx-flat.fbx-light .fbx-pause:before,.fbx-flat.fbx-light .fbx-play,.fbx-flat.fbx-light .fbx-play:before,.fbx-flat.fbx-light .fbx-prev,.fbx-flat.fbx-light .fbx-prev:before,.fbx-flat.fbx-light .fbx-social-toggle,.fbx-flat.fbx-light .fbx-social-toggle:before{color:#FFF!important}.fbx-light .fbx-close:hover,.fbx-light .fbx-close:hover:before,.fbx-light .fbx-fullscreen-toggle:hover,.fbx-light .fbx-fullscreen-toggle:hover:before,.fbx-light .fbx-next:hover,.fbx-light .fbx-next:hover:before,.fbx-light .fbx-pause:hover,.fbx-light .fbx-pause:hover:before,.fbx-light .fbx-play:hover,.fbx-light .fbx-play:hover:before,.fbx-light .fbx-prev:hover,.fbx-light .fbx-prev:hover:before,.fbx-light .fbx-social-toggle:hover,.fbx-light .fbx-social-toggle:hover:before,.fbx-light.fbx-inset-buttons .fbx-next:hover:before,.fbx-light.fbx-inset-buttons .fbx-prev:hover:before,.fbx-metro.fbx-light .fbx-credit a:hover{color:#bababa!important}.fbx-metro.fbx-light .fbx-close:hover,.fbx-metro.fbx-light .fbx-fullscreen-toggle:hover,.fbx-metro.fbx-light .fbx-next:hover,.fbx-metro.fbx-light .fbx-pause:hover,.fbx-metro.fbx-light .fbx-play:hover,.fbx-metro.fbx-light .fbx-prev:hover,.fbx-metro.fbx-light .fbx-social-toggle:hover{border-color:#bababa}.fbx-flat.fbx-light .fbx-count,.fbx-flat.fbx-light .fbx-credit a,.fbx-rounded.fbx-light .fbx-count,.fbx-rounded.fbx-light .fbx-credit a{color:#888}.fbx-flat.fbx-light .fbx-credit a:hover span,.fbx-rounded.fbx-light .fbx-credit a:hover span{color:#ddd}.fbx-light .fbx-caption{color:#FFF}.fbx-light .fbx-caption-desc,.fbx-light .fbx-caption-desc a{color:#eee}.fbx-light .fbx-item-current::-webkit-scrollbar{width:12px;height:12px}.fbx-light .fbx-item-current::-webkit-scrollbar-track{background:rgba(0,0,0,.1)}.fbx-light .fbx-item-current::-webkit-scrollbar-thumb{background:rgba(0,0,0,.5)}.fbx-light .fbx-item-current::-webkit-scrollbar,.fbx-light .fbx-item-next::-webkit-scrollbar{width:12px;height:12px}.fbx-light .fbx-item-current::-webkit-scrollbar-track,.fbx-light .fbx-item-next::-webkit-scrollbar-track{background:rgba(0,0,0,.1)}.fbx-light .fbx-item-current::-webkit-scrollbar-corner,.fbx-light .fbx-item-current::-webkit-scrollbar-thumb,.fbx-light .fbx-item-next::-webkit-scrollbar-corner,.fbx-light .fbx-item-next::-webkit-scrollbar-thumb{background:rgba(0,0,0,.3)}.fbx-caption{position:absolute;top:auto;right:auto;bottom:0;left:0;z-index:100004;width:100%;text-align:center;font-size:14px;transition:visibility .3s ease,opacity .3s ease,transform .3s ease;opacity:1;transform:translateY(0)}.fbx-caption.fbx-hide-caption{transition:none}.fbx-loading .fbx-caption.fbx-hide-caption,.fbx-open-caption,.fbx-show .fbx-caption.fbx-hide-caption{visibility:hidden}.fbx-show .fbx-caption.fbx-fade-caption{opacity:0;visibility:hidden}.fbx-caption.fbx-slide-caption{transform:translateY(100%)}.fbx-fullscreen-mode .fbx-caption,.fbx-sticky-caption .fbx-caption{position:fixed;z-index:100007}.fbx-close-caption,.fbx-open-caption{position:absolute;color:#FFF!important;font-size:24px;text-decoration:none;cursor:pointer;line-height:20px}.fbx-rounded .fbx-caption{border-radius:0 0 3px 3px}.fbx-modal.fbx-phone .fbx-caption,.fbx-sticky-caption.fbx-rounded .fbx-caption{border-radius:0}.fbx-close-caption{top:0;right:0;padding:3px 3px 10px 10px}.fbx-open-caption{z-index:100004;bottom:0;right:5px;padding:0 10px 10px;opacity:0;transition:opacity .3s ease;border-top-left-radius:6px;border-top-right-radius:6px}.fbx-caption-toggle-only.fbx-captions-hidden .fbx-open-caption,.fbx-pannable-item.fbx-captions-hidden .fbx-open-caption{opacity:1;visibility:visible}.fbx-caption-title{font-size:15px;padding:15px}.fbx-caption-desc{font-size:12px;line-height:20px;padding:15px}.fbx-caption-desc a{font-size:12px}.fbx-caption-title+.fbx-caption-desc{margin-top:-30px}.fbx-phone .fbx-caption{min-height:20px;font-size:12px;line-height:20px}.fbx-phone .fbx-caption-title{font-size:13px;padding:10px}.fbx-phone .fbx-caption-desc{font-size:11px;line-height:15px;padding:10px}.fbx-phone .fbx-caption-title+.fbx-caption-desc{margin-top:-20px}.fbx-modal.fbx-phone .fbx-caption{z-index:100004;bottom:0;position:fixed}.fbx-modal.fbx-phone.fbx-landscape .fbx-caption,.fbx-phone.fbx-landscape.fbx-sticky-caption .fbx-caption{z-index:100004}.fbx-pannable{cursor:-moz-grab;cursor:-webkit-grab;cursor:grab}.fbx-pannable.fbx-panning{cursor:-moz-grabbing;cursor:-webkit-grabbing;cursor:grabbing}.fbx-pannable>div>img.fbx-item{max-width:none;max-height:none}.fbx-pan-overview{cursor:pointer;max-width:150px;max-height:150px;overflow:hidden;background-position:top left;background-size:cover;position:absolute;z-index:100006;border:2px solid #666;box-shadow:0 0 12px rgba(0,0,0,.8)}.fbx-pan-overview.fbx-top-left{top:20px;left:20px}.fbx-pan-overview.fbx-top-right{top:20px;right:32px}.fbx-pan-overview.fbx-bottom-left{bottom:32px;left:20px}.fbx-pan-overview.fbx-bottom-right{bottom:32px;right:32px}.fbx-pan-viewport{position:absolute;top:0;left:0;box-shadow:0 0 300px 300px rgba(0,0,0,.7)}.fbx-ie10.fbx-modal.fbx-phone.fbx-landscape .fbx-close,.fbx-ie10.fbx-modal.fbx-phone.fbx-landscape .fbx-fullscreen-toggle,.fbx-ie10.fbx-modal.fbx-phone.fbx-landscape .fbx-next,.fbx-ie10.fbx-modal.fbx-phone.fbx-landscape .fbx-pause,.fbx-ie10.fbx-modal.fbx-phone.fbx-landscape .fbx-play,.fbx-ie10.fbx-modal.fbx-phone.fbx-landscape .fbx-prev,.fbx-ie10.fbx-modal.fbx-phone.fbx-landscape .fbx-social-toggle,.fbx-ie11.fbx-modal.fbx-phone.fbx-landscape .fbx-close,.fbx-ie11.fbx-modal.fbx-phone.fbx-landscape .fbx-fullscreen-toggle,.fbx-ie11.fbx-modal.fbx-phone.fbx-landscape .fbx-next,.fbx-ie11.fbx-modal.fbx-phone.fbx-landscape .fbx-pause,.fbx-ie11.fbx-modal.fbx-phone.fbx-landscape .fbx-play,.fbx-ie11.fbx-modal.fbx-phone.fbx-landscape .fbx-prev,.fbx-ie11.fbx-modal.fbx-phone.fbx-landscape .fbx-social-toggle,.fbx-ie9.fbx-modal.fbx-phone.fbx-landscape .fbx-close,.fbx-ie9.fbx-modal.fbx-phone.fbx-landscape .fbx-fullscreen-toggle,.fbx-ie9.fbx-modal.fbx-phone.fbx-landscape .fbx-next,.fbx-ie9.fbx-modal.fbx-phone.fbx-landscape .fbx-pause,.fbx-ie9.fbx-modal.fbx-phone.fbx-landscape .fbx-play,.fbx-ie9.fbx-modal.fbx-phone.fbx-landscape .fbx-prev,.fbx-ie9.fbx-modal.fbx-phone.fbx-landscape .fbx-social-toggle{right:1px!important}
|
5 |
* @copyright Steven Usher & Brad Vincent 2014
|
6 |
* @license Released under the MIT license.
|
7 |
* You are free to use FooBox jQuery in personal projects as long as this copyright header is left intact.
|
8 |
+
*/.fbx-close:hover,.fbx-credit a,.fbx-next:hover,.fbx-prev:hover{text-decoration:none}.fbx-modal,.fbx-modal *{box-sizing:content-box}.fbx-modal{position:fixed;top:0;left:0;z-index:9000001;visibility:hidden;width:100%;height:100%;font-family:"Segoe UI",Helvetica,Arial,"Sans Serif",serif;line-height:normal;outline:0!important;transform:translate3d(0,0,0);perspective:0}.fbx-modal.fbx-loading,.fbx-modal.fbx-show{visibility:visible}.fbx-no-scroll{overflow:hidden!important}.fbx-inner-spacer{display:none;padding:40px}.fbx-inner,.fbx-loader{position:absolute;top:50%;left:50%}.fbx-inner{visibility:hidden;overflow:visible!important;margin-top:-5px;margin-left:-5px;min-width:100px;min-height:100px;width:100px;height:100px;z-index:100002}.fbx-show .fbx-inner{visibility:visible}.fbx-loader{visibility:hidden;z-index:100005;margin-top:-40px;margin-left:-40px;width:80px;height:80px;font-size:16px;box-shadow:0 0 3px rgba(0,0,0,.4)}.fbx-phone.fbx-portrait .fbx-loader{margin-top:-18px}.fbx-loading .fbx-loader{visibility:visible}.fbx-loader>div{margin:10px;width:60px;height:60px}.fbx-item-current,.fbx-item-next,.fbx-stage{top:0;left:0;margin:0;width:100%;height:100%;padding:0;outline:0;position:absolute;border:none}.fbx-stage{overflow:hidden}.fbx-item-current,.fbx-item-next{-webkit-user-drag:none;overflow:auto}.fbx-loading .fbx-item-current,.fbx-loading .fbx-item-next{overflow:hidden}.fbx-item-next{z-index:100001}.fbx-item-current{z-index:100002}.fbx-error-msg{width:200px;height:200px;position:absolute;top:50%;left:50%;margin-top:-100px;margin-left:-100px}.fbx-error-msg>span{line-height:200px;width:100%;height:100%;display:block}.fbx-error-msg>p{position:absolute;top:100%;text-align:center;width:100%;margin:0}.fbx-item-embed,.fbx-item-iframe,.fbx-item-image,.fbx-item-video{margin:0;padding:0;width:100%;height:100%;outline:0;border:none;display:block}.fbx-item-video>.fbx-video{background-color:#000}.fbx-item-embed embed,.fbx-item-embed iframe,.fbx-item-embed object{margin-bottom:0}.fbx-item-embed>embed,.fbx-item-embed>iframe,.fbx-item-embed>object{max-width:100%;max-height:100%}.fbx-ios .fbx-item-current{-webkit-overflow-scrolling:touch!important;overflow:auto!important}.fbx-ios .fbx-item-iframe{width:1px;min-width:100%}.fbx-close,.fbx-next,.fbx-prev{position:absolute;z-index:100006;display:block;outline:0!important;text-decoration:none;cursor:pointer}.fbx-no-buttons .fbx-next,.fbx-no-buttons .fbx-prev{display:none!important}.fbx-phone .fbx-count,.fbx-phone .fbx-credit em,.fbx-phone.fbx-landscape.fbx-no-nav .fbx-next,.fbx-phone.fbx-landscape.fbx-no-nav .fbx-prev,.fbx-rounded .fbx-next.fbx-disabled,.fbx-rounded .fbx-prev.fbx-disabled{display:none}.fbx-credit{position:absolute;z-index:100003;text-transform:lowercase;font-size:10px}.fbx-credit em{font-style:normal;font-size:10px}.fbx-credit a{font-size:10px}.fbx-credit a:hover span{text-decoration:underline}.fbx-credit a span{letter-spacing:1px;font-size:10px;color:#fff}.fbx-count{position:absolute;z-index:100002;width:100%;text-align:center;font-size:10px}.fbx-btn-transition,.fbx-btn-transition:before{transition-property:color,border-color,opacity,box-shadow;transition-duration:.2s,.2s,.2s,.2s;transition-timing-function:ease-in,linear,ease-in,ease-in;outline:0}.fbx-modal.fbx-phone .fbx-inner{border:none}.fbx-modal.fbx-phone .fbx-close,.fbx-modal.fbx-phone .fbx-next,.fbx-modal.fbx-phone .fbx-prev{position:fixed}.fbx-modal.fbx-phone .fbx-credit{bottom:2px;left:2px}.fbx-modal.fbx-phone.fbx-portrait .fbx-inner-spacer{padding:45px 5px 5px}.fbx-modal.fbx-phone.fbx-portrait .fbx-close,.fbx-modal.fbx-phone.fbx-portrait .fbx-next,.fbx-modal.fbx-phone.fbx-portrait .fbx-prev{border:none;opacity:1;margin:0;top:0;bottom:auto;width:auto;height:40px;border-radius:0;line-height:40px}.fbx-modal.fbx-phone.fbx-portrait .fbx-prev{left:0;right:66%}.fbx-modal.fbx-phone.fbx-portrait .fbx-next{left:33%;right:33%}.fbx-modal.fbx-phone.fbx-portrait .fbx-close{left:66%;right:0}.fbx-modal.fbx-phone.fbx-portrait.fbx-no-buttons .fbx-close{left:0;right:0}.fbx-modal.fbx-phone.fbx-landscape{border-right-width:46px;border-right-style:solid;box-sizing:border-box}.fbx-modal.fbx-phone.fbx-landscape .fbx-inner-spacer{padding:5px}.fbx-modal.fbx-phone.fbx-landscape .fbx-close,.fbx-modal.fbx-phone.fbx-landscape .fbx-next,.fbx-modal.fbx-phone.fbx-landscape .fbx-prev{bottom:auto;left:auto;right:-45px;width:44px;height:44px;line-height:44px;border:none;opacity:1;margin:0}.fbx-modal.fbx-phone.fbx-landscape .fbx-close{top:0;height:60px}.fbx-modal.fbx-phone.fbx-landscape .fbx-prev{top:62px}.fbx-modal.fbx-phone.fbx-landscape .fbx-next{top:108px}@font-face{font-family:foobox;src:url(font/foobox.eot);src:url(font/foobox.eot?#iefix) format('embedded-opentype'),url(font/foobox.woff) format('woff'),url(font/foobox.ttf) format('truetype'),url(font/foobox.svg#foobox) format('svg');font-weight:400;font-style:normal;font-display:fallback}.foobox_font_preload{font-family:foobox!important;color:transparent!important;position:absolute!important;top:-9999px!important;left:-9999px!important;visibility:hidden!important;opacity:0!important}.fbx-modal .fbx-error-msg>span,.fbx-modal .fbx-loader>div,.fbx-modal a.fbx-close,.fbx-modal a.fbx-next,.fbx-modal a.fbx-prev{font-family:foobox;font-size:16px;font-weight:400;text-align:center;outline:0}.fbx-modal .fbx-loader>div{font-size:300%;line-height:60px}.fbx-modal.fbx-loading .fbx-loader>div{animation:spin 2s infinite linear}.fbx-modal .fbx-error-msg>span{font-size:1000%}.fbx-modal .fbx-error-msg>span:before{content:"\e028"}.fbx-close:before{content:"\e002"}.fbx-prev:before{content:"\e000"}.fbx-next:before{content:"\e001"}.fbx-loader>div:before{content:"\e012"}.fbx-flat .fbx-close:before{content:"\e117"}.fbx-flat .fbx-prev:before{content:"\e094"}.fbx-flat .fbx-next:before{content:"\e095"}.fbx-flat .fbx-loader>div:before{content:"\e105"}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(359deg)}}.fbx-rounded .fbx-prev.fbx-btn-shadow,.fbx-rounded .fbx-prev.fbx-btn-shadow:hover{box-shadow:-2px 0 2px rgba(0,0,0,.4)}.fbx-rounded .fbx-next.fbx-btn-shadow,.fbx-rounded .fbx-next.fbx-btn-shadow:hover{box-shadow:2px 0 2px rgba(0,0,0,.4)}.fbx-fullscreen-mode .fbx-btn-shadow,.fbx-fullscreen-mode .fbx-next.fbx-btn-shadow,.fbx-fullscreen-mode .fbx-prev.fbx-btn-shadow,.fbx-inner-shadow,.fbx-rounded .fbx-btn-shadow,.fbx-rounded.fbx-inset-buttons.fbx-desktop .fbx-next.fbx-btn-shadow:before,.fbx-rounded.fbx-inset-buttons.fbx-desktop .fbx-prev.fbx-btn-shadow:before,.fbx-rounded.fbx-inset-buttons.fbx-tablet .fbx-next.fbx-btn-shadow:before,.fbx-rounded.fbx-inset-buttons.fbx-tablet .fbx-prev.fbx-btn-shadow:before,.fbx-sticky-buttons .fbx-next.fbx-btn-shadow,.fbx-sticky-buttons .fbx-prev.fbx-btn-shadow{box-shadow:0 0 12px rgba(0,0,0,.4)}.fbx-fullscreen-mode .fbx-btn-shadow:hover,.fbx-fullscreen-mode .fbx-next.fbx-btn-shadow:hover,.fbx-fullscreen-mode .fbx-prev.fbx-btn-shadow:hover,.fbx-rounded .fbx-btn-shadow:hover,.fbx-rounded.fbx-inset-buttons.fbx-desktop .fbx-next.fbx-btn-shadow:hover:before,.fbx-rounded.fbx-inset-buttons.fbx-desktop .fbx-prev.fbx-btn-shadow:hover:before,.fbx-rounded.fbx-inset-buttons.fbx-tablet .fbx-next.fbx-btn-shadow:hover:before,.fbx-rounded.fbx-inset-buttons.fbx-tablet .fbx-prev.fbx-btn-shadow:hover:before,.fbx-sticky-buttons .fbx-next.fbx-btn-shadow:hover,.fbx-sticky-buttons .fbx-prev.fbx-btn-shadow:hover{box-shadow:0 0 6px rgba(0,0,0,.4)}.fbx-flat .fbx-inner-shadow,.fbx-flat.fbx-fullscreen-mode .fbx-btn-shadow,.fbx-flat.fbx-fullscreen-mode .fbx-btn-shadow:hover,.fbx-flat.fbx-fullscreen-mode .fbx-next.fbx-btn-shadow,.fbx-flat.fbx-fullscreen-mode .fbx-next.fbx-btn-shadow:hover,.fbx-flat.fbx-fullscreen-mode .fbx-prev.fbx-btn-shadow,.fbx-flat.fbx-fullscreen-mode .fbx-prev.fbx-btn-shadow:hover,.fbx-flat.fbx-sticky-buttons .fbx-next.fbx-btn-shadow,.fbx-flat.fbx-sticky-buttons .fbx-next.fbx-btn-shadow:hover,.fbx-flat.fbx-sticky-buttons .fbx-prev.fbx-btn-shadow,.fbx-flat.fbx-sticky-buttons .fbx-prev.fbx-btn-shadow:hover,.fbx-modal.fbx-phone.fbx-fullscreen-mode .fbx-btn-shadow,.fbx-modal.fbx-phone.fbx-fullscreen-mode .fbx-next.fbx-btn-shadow,.fbx-modal.fbx-phone.fbx-fullscreen-mode .fbx-prev.fbx-btn-shadow,.fbx-modal.fbx-phone.fbx-rounded .fbx-btn-shadow,.fbx-modal.fbx-phone.fbx-rounded.fbx-inset-buttons .fbx-next.fbx-btn-shadow:before,.fbx-modal.fbx-phone.fbx-rounded.fbx-inset-buttons .fbx-prev.fbx-btn-shadow:before,.fbx-modal.fbx-phone.fbx-sticky-buttons .fbx-next.fbx-btn-shadow,.fbx-modal.fbx-phone.fbx-sticky-buttons .fbx-prev.fbx-btn-shadow,.fbx-rounded.fbx-inset-buttons .fbx-next.fbx-btn-shadow,.fbx-rounded.fbx-inset-buttons .fbx-next.fbx-btn-shadow:hover,.fbx-rounded.fbx-inset-buttons .fbx-prev.fbx-btn-shadow,.fbx-rounded.fbx-inset-buttons .fbx-prev.fbx-btn-shadow:hover{box-shadow:none}.fbx-rounded .fbx-inner{border:8px solid transparent;border-radius:6px}.fbx-rounded .fbx-item-current,.fbx-rounded .fbx-item-image,.fbx-rounded .fbx-item-next{border-radius:3px}.fbx-rounded .fbx-loader,.fbx-rounded .fbx-loader>div{border-radius:50%}.fbx-rounded .fbx-error-msg{margin-top:-115px}.fbx-rounded .fbx-close{top:-21px;right:-21px;width:28px;height:28px;line-height:28px;border:3px solid transparent;border-radius:50%}.fbx-rounded .fbx-next,.fbx-rounded .fbx-prev{position:absolute;top:50%;margin-top:-50px;width:30px;height:100px;line-height:100px;border:3px solid transparent}.fbx-rounded .fbx-prev{left:-40px;border-radius:6px 0 0 6px}.fbx-rounded .fbx-next{right:-40px;border-radius:0 6px 6px 0}.fbx-rounded.fbx-phone .fbx-next.fbx-disabled,.fbx-rounded.fbx-phone .fbx-prev.fbx-disabled{display:block;cursor:default}.fbx-rounded.fbx-phone .fbx-next.fbx-disabled:before,.fbx-rounded.fbx-phone .fbx-prev.fbx-disabled:before{opacity:0}.fbx-rounded.fbx-desktop .fbx-next,.fbx-rounded.fbx-desktop .fbx-prev{position:absolute}.fbx-rounded .fbx-count,.fbx-rounded .fbx-credit{bottom:-25px}.fbx-rounded .fbx-inner-spacer{padding:40px 40px 50px}.fbx-modal.fbx-rounded.fbx-phone.fbx-portrait .fbx-inner-spacer{padding:45px 5px 5px}.fbx-rounded.fbx-sticky-buttons .fbx-next,.fbx-rounded.fbx-sticky-buttons .fbx-prev{position:fixed;top:50%;margin-top:-50px;width:40px;height:100px;line-height:100px}.fbx-rounded.fbx-sticky-buttons .fbx-prev{left:0;border-radius:0 6px 6px 0}.fbx-rounded.fbx-sticky-buttons .fbx-next{right:0;border-radius:6px 0 0 6px}.fbx-rounded.fbx-sticky-buttons.fbx-full-buttons .fbx-inner-spacer{padding:40px 80px}.fbx-rounded.fbx-phone.fbx-portrait.fbx-sticky-buttons.fbx-full-buttons .fbx-inner-spacer{padding:45px 5px 5px}.fbx-rounded.fbx-phone.fbx-landscape.fbx-sticky-buttons.fbx-full-buttons .fbx-inner-spacer{padding:5px}.fbx-rounded.fbx-sticky-buttons.fbx-full-buttons .fbx-next,.fbx-rounded.fbx-sticky-buttons.fbx-full-buttons .fbx-prev{top:0;bottom:0;border-radius:0;width:4%;min-width:45px;height:auto;opacity:.3}.fbx-rounded.fbx-sticky-buttons.fbx-full-buttons .fbx-next:hover,.fbx-rounded.fbx-sticky-buttons.fbx-full-buttons .fbx-prev:hover{opacity:1}.fbx-rounded.fbx-sticky-buttons.fbx-full-buttons .fbx-next:before,.fbx-rounded.fbx-sticky-buttons.fbx-full-buttons .fbx-prev:before{position:fixed;width:4%;min-width:45px;height:30px;line-height:30px;top:50%;margin-top:-15px}.fbx-rounded.fbx-sticky-buttons.fbx-full-buttons .fbx-prev,.fbx-rounded.fbx-sticky-buttons.fbx-full-buttons .fbx-prev:before{left:0;right:auto}.fbx-rounded.fbx-sticky-buttons.fbx-full-buttons .fbx-next,.fbx-rounded.fbx-sticky-buttons.fbx-full-buttons .fbx-next:before{left:auto;right:0}.fbx-rounded.fbx-phone.fbx-sticky-buttons.fbx-full-buttons .fbx-next:before,.fbx-rounded.fbx-phone.fbx-sticky-buttons.fbx-full-buttons .fbx-prev:before{position:relative;width:auto;min-width:0;height:auto;line-height:inherit;top:auto;margin-top:auto}.fbx-rounded.fbx-phone.fbx-sticky-buttons.fbx-full-buttons .fbx-next,.fbx-rounded.fbx-phone.fbx-sticky-buttons.fbx-full-buttons .fbx-prev{top:0;bottom:auto;border-radius:0;width:auto;min-width:0;height:auto;opacity:1}.fbx-modal.fbx-rounded.fbx-phone.fbx-portrait.fbx-sticky-buttons.fbx-full-buttons .fbx-prev{left:0;right:66%}.fbx-modal.fbx-rounded.fbx-phone.fbx-portrait.fbx-sticky-buttons.fbx-full-buttons .fbx-next{left:33%;right:33%}.fbx-modal.fbx-rounded.fbx-phone.fbx-portrait.fbx-sticky-buttons.fbx-full-buttons .fbx-close{left:66%;right:0}.fbx-modal.fbx-rounded.fbx-phone.fbx-portrait.fbx-no-buttons.fbx-sticky-buttons.fbx-full-buttons .fbx-close{left:0;right:0}.fbx-rounded.fbx-phone.fbx-landscape.fbx-sticky-buttons.fbx-full-buttons .fbx-next,.fbx-rounded.fbx-phone.fbx-landscape.fbx-sticky-buttons.fbx-full-buttons .fbx-prev{bottom:auto;width:34px;height:80px;opacity:.5}.fbx-rounded.fbx-phone.fbx-landscape.fbx-full-buttons .fbx-prev,.fbx-rounded.fbx-phone.fbx-landscape.fbx-sticky-buttons .fbx-prev,.fbx-rounded.fbx-phone.fbx-landscape.fbx-sticky-buttons.fbx-full-buttons .fbx-prev{top:62px}.fbx-rounded.fbx-phone.fbx-landscape.fbx-full-buttons .fbx-next,.fbx-rounded.fbx-phone.fbx-landscape.fbx-sticky-buttons .fbx-next,.fbx-rounded.fbx-phone.fbx-landscape.fbx-sticky-buttons.fbx-full-buttons .fbx-next{top:108px}.fbx-rounded.fbx-phone.fbx-landscape.fbx-sticky-buttons.fbx-full-buttons .fbx-next:hover,.fbx-rounded.fbx-phone.fbx-landscape.fbx-sticky-buttons.fbx-full-buttons .fbx-prev:hover{opacity:1}.fbx-rounded.fbx-phone.fbx-landscape.fbx-sticky-buttons.fbx-full-buttons .fbx-prev{border-radius:0 6px 6px 0}.fbx-rounded.fbx-phone.fbx-landscape.fbx-sticky-buttons.fbx-full-buttons .fbx-next{border-radius:6px 0 0 6px}.fbx-rounded.fbx-inset-buttons.fbx-desktop .fbx-next,.fbx-rounded.fbx-inset-buttons.fbx-desktop .fbx-prev,.fbx-rounded.fbx-inset-buttons.fbx-tablet .fbx-next,.fbx-rounded.fbx-inset-buttons.fbx-tablet .fbx-prev{z-index:100003;position:absolute;top:0;bottom:0;height:100%;width:25%;margin:0;border-radius:0;background-color:transparent;box-sizing:border-box}.fbx-rounded.fbx-inset-buttons.fbx-desktop .fbx-prev,.fbx-rounded.fbx-inset-buttons.fbx-tablet .fbx-prev{left:0}.fbx-rounded.fbx-inset-buttons.fbx-desktop .fbx-next,.fbx-rounded.fbx-inset-buttons.fbx-tablet .fbx-next{right:0}.fbx-rounded.fbx-inset-buttons.fbx-desktop .fbx-next:before,.fbx-rounded.fbx-inset-buttons.fbx-desktop .fbx-prev:before,.fbx-rounded.fbx-inset-buttons.fbx-tablet .fbx-next:before,.fbx-rounded.fbx-inset-buttons.fbx-tablet .fbx-prev:before{width:28px;height:28px;border-radius:50%;position:absolute;top:50%;margin-top:-14px;line-height:28px;border-width:3px;border-style:solid;opacity:0}.fbx-rounded.fbx-inset-buttons .fbx-prev:before{left:10px}.fbx-rounded.fbx-inset-buttons .fbx-next:before{right:10px}.fbx-rounded.fbx-inset-buttons .fbx-next:hover:before,.fbx-rounded.fbx-inset-buttons .fbx-prev:hover:before{opacity:1}.fbx-light,.fbx-light .fbx-caption,.fbx-light .fbx-open-caption,.fbx-light.fbx-phone .fbx-social{background-color:rgba(0,0,0,.7)}.fbx-light .fbx-progress{background-color:rgba(255,255,255,.5)}.fbx-fullscreen-mode.fbx-light{background-color:#d3d3d3}.fbx-light .fbx-inner,.fbx-light.fbx-inset-buttons .fbx-next:before,.fbx-light.fbx-inset-buttons .fbx-prev:before,.fbx-light.fbx-modal,.fbx-modal.fbx-light.fbx-phone .fbx-close:hover,.fbx-modal.fbx-light.fbx-phone .fbx-fullscreen-toggle:hover,.fbx-modal.fbx-light.fbx-phone .fbx-next:hover,.fbx-modal.fbx-light.fbx-phone .fbx-pause:hover,.fbx-modal.fbx-light.fbx-phone .fbx-play:hover,.fbx-modal.fbx-light.fbx-phone .fbx-prev:hover,.fbx-modal.fbx-light.fbx-phone .fbx-social-toggle:hover,.fbx-rounded.fbx-light .fbx-close,.fbx-rounded.fbx-light .fbx-fullscreen-toggle,.fbx-rounded.fbx-light .fbx-pause,.fbx-rounded.fbx-light .fbx-play,.fbx-rounded.fbx-light .fbx-social-toggle{border-color:#FFF}.fbx-light .fbx-close,.fbx-light .fbx-fullscreen-toggle,.fbx-light .fbx-inner,.fbx-light .fbx-loader,.fbx-light .fbx-next,.fbx-light .fbx-pause,.fbx-light .fbx-play,.fbx-light .fbx-prev,.fbx-light .fbx-social-toggle,.fbx-light.fbx-inset-buttons .fbx-next:before,.fbx-light.fbx-inset-buttons .fbx-prev:before{background-color:#FFF}.fbx-flat.fbx-light .fbx-close,.fbx-flat.fbx-light .fbx-fullscreen-toggle,.fbx-flat.fbx-light .fbx-next,.fbx-flat.fbx-light .fbx-pause,.fbx-flat.fbx-light .fbx-play,.fbx-flat.fbx-light .fbx-prev,.fbx-flat.fbx-light .fbx-social-toggle,.fbx-flat.fbx-light.fbx-inset-buttons .fbx-next:before,.fbx-flat.fbx-light.fbx-inset-buttons .fbx-prev:before{background-color:transparent}.fbx-flat.fbx-light.fbx-inset-buttons .fbx-next:before,.fbx-flat.fbx-light.fbx-inset-buttons .fbx-prev:before{border-color:transparent}.fbx-flat.fbx-light.fbx-modal{border-color:rgba(0,0,0,.2)}.fbx-flat.fbx-light.fbx-phone.fbx-portrait .fbx-close,.fbx-flat.fbx-light.fbx-phone.fbx-portrait .fbx-fullscreen-toggle,.fbx-flat.fbx-light.fbx-phone.fbx-portrait .fbx-next,.fbx-flat.fbx-light.fbx-phone.fbx-portrait .fbx-pause,.fbx-flat.fbx-light.fbx-phone.fbx-portrait .fbx-play,.fbx-flat.fbx-light.fbx-phone.fbx-portrait .fbx-prev,.fbx-flat.fbx-light.fbx-phone.fbx-portrait .fbx-social-toggle{background-color:rgba(0,0,0,.2)}.fbx-light .fbx-close,.fbx-light .fbx-close:before,.fbx-light .fbx-error-msg,.fbx-light .fbx-fullscreen-toggle,.fbx-light .fbx-fullscreen-toggle:before,.fbx-light .fbx-loader,.fbx-light .fbx-loader:before,.fbx-light .fbx-next,.fbx-light .fbx-next:before,.fbx-light .fbx-pause,.fbx-light .fbx-pause:before,.fbx-light .fbx-play,.fbx-light .fbx-play:before,.fbx-light .fbx-prev,.fbx-light .fbx-prev:before,.fbx-light .fbx-social-toggle,.fbx-light .fbx-social-toggle:before,.fbx-light.fbx-inset-buttons .fbx-next:before,.fbx-light.fbx-inset-buttons .fbx-prev:before,.fbx-metro.fbx-light .fbx-count,.fbx-metro.fbx-light .fbx-credit a{color:#666!important}.fbx-flat.fbx-light .fbx-close,.fbx-flat.fbx-light .fbx-close:before,.fbx-flat.fbx-light .fbx-count,.fbx-flat.fbx-light .fbx-credit a,.fbx-flat.fbx-light .fbx-fullscreen-toggle,.fbx-flat.fbx-light .fbx-fullscreen-toggle:before,.fbx-flat.fbx-light .fbx-next,.fbx-flat.fbx-light .fbx-next:before,.fbx-flat.fbx-light .fbx-pause,.fbx-flat.fbx-light .fbx-pause:before,.fbx-flat.fbx-light .fbx-play,.fbx-flat.fbx-light .fbx-play:before,.fbx-flat.fbx-light .fbx-prev,.fbx-flat.fbx-light .fbx-prev:before,.fbx-flat.fbx-light .fbx-social-toggle,.fbx-flat.fbx-light .fbx-social-toggle:before{color:#FFF!important}.fbx-light .fbx-close:hover,.fbx-light .fbx-close:hover:before,.fbx-light .fbx-fullscreen-toggle:hover,.fbx-light .fbx-fullscreen-toggle:hover:before,.fbx-light .fbx-next:hover,.fbx-light .fbx-next:hover:before,.fbx-light .fbx-pause:hover,.fbx-light .fbx-pause:hover:before,.fbx-light .fbx-play:hover,.fbx-light .fbx-play:hover:before,.fbx-light .fbx-prev:hover,.fbx-light .fbx-prev:hover:before,.fbx-light .fbx-social-toggle:hover,.fbx-light .fbx-social-toggle:hover:before,.fbx-light.fbx-inset-buttons .fbx-next:hover:before,.fbx-light.fbx-inset-buttons .fbx-prev:hover:before,.fbx-metro.fbx-light .fbx-credit a:hover{color:#bababa!important}.fbx-metro.fbx-light .fbx-close:hover,.fbx-metro.fbx-light .fbx-fullscreen-toggle:hover,.fbx-metro.fbx-light .fbx-next:hover,.fbx-metro.fbx-light .fbx-pause:hover,.fbx-metro.fbx-light .fbx-play:hover,.fbx-metro.fbx-light .fbx-prev:hover,.fbx-metro.fbx-light .fbx-social-toggle:hover{border-color:#bababa}.fbx-flat.fbx-light .fbx-count,.fbx-flat.fbx-light .fbx-credit a,.fbx-rounded.fbx-light .fbx-count,.fbx-rounded.fbx-light .fbx-credit a{color:#888}.fbx-flat.fbx-light .fbx-credit a:hover span,.fbx-rounded.fbx-light .fbx-credit a:hover span{color:#ddd}.fbx-light .fbx-caption{color:#FFF}.fbx-light .fbx-caption-desc,.fbx-light .fbx-caption-desc a{color:#eee}.fbx-light .fbx-item-current::-webkit-scrollbar{width:12px;height:12px}.fbx-light .fbx-item-current::-webkit-scrollbar-track{background:rgba(0,0,0,.1)}.fbx-light .fbx-item-current::-webkit-scrollbar-thumb{background:rgba(0,0,0,.5)}.fbx-light .fbx-item-current::-webkit-scrollbar,.fbx-light .fbx-item-next::-webkit-scrollbar{width:12px;height:12px}.fbx-light .fbx-item-current::-webkit-scrollbar-track,.fbx-light .fbx-item-next::-webkit-scrollbar-track{background:rgba(0,0,0,.1)}.fbx-light .fbx-item-current::-webkit-scrollbar-corner,.fbx-light .fbx-item-current::-webkit-scrollbar-thumb,.fbx-light .fbx-item-next::-webkit-scrollbar-corner,.fbx-light .fbx-item-next::-webkit-scrollbar-thumb{background:rgba(0,0,0,.3)}.fbx-caption{position:absolute;top:auto;right:auto;bottom:0;left:0;z-index:100004;width:100%;text-align:center;font-size:14px;transition:visibility .3s ease,opacity .3s ease,transform .3s ease;opacity:1;transform:translateY(0)}.fbx-caption.fbx-hide-caption{transition:none}.fbx-show .fbx-caption{visibility:visible}.fbx-loading .fbx-caption.fbx-hide-caption,.fbx-open-caption,.fbx-show .fbx-caption.fbx-hide-caption{visibility:hidden}.fbx-show .fbx-caption.fbx-fade-caption{opacity:0;visibility:hidden}.fbx-caption.fbx-slide-caption{transform:translateY(100%)}.fbx-fullscreen-mode .fbx-caption,.fbx-sticky-caption .fbx-caption{position:fixed;z-index:100007}.fbx-close-caption,.fbx-open-caption{position:absolute;color:#FFF!important;font-size:24px;text-decoration:none;cursor:pointer;line-height:20px}.fbx-rounded .fbx-caption{border-radius:0 0 3px 3px}.fbx-modal.fbx-phone .fbx-caption,.fbx-sticky-caption.fbx-rounded .fbx-caption{border-radius:0}.fbx-close-caption{top:0;right:0;padding:3px 3px 10px 10px}.fbx-open-caption{z-index:100004;bottom:0;right:5px;padding:0 10px 10px;opacity:0;transition:opacity .3s ease;border-top-left-radius:6px;border-top-right-radius:6px}.fbx-caption-toggle-only.fbx-captions-hidden .fbx-open-caption,.fbx-pannable-item.fbx-captions-hidden .fbx-open-caption{opacity:1;visibility:visible}.fbx-caption-title{font-size:15px;padding:15px}.fbx-caption-desc{font-size:12px;line-height:20px;padding:15px}.fbx-caption-desc a{font-size:12px}.fbx-caption-title+.fbx-caption-desc{margin-top:-30px}.fbx-phone .fbx-caption{min-height:20px;font-size:12px;line-height:20px}.fbx-phone .fbx-caption-title{font-size:13px;padding:10px}.fbx-phone .fbx-caption-desc{font-size:11px;line-height:15px;padding:10px}.fbx-phone .fbx-caption-title+.fbx-caption-desc{margin-top:-20px}.fbx-modal.fbx-phone .fbx-caption{z-index:100004;bottom:0;position:fixed}.fbx-modal.fbx-phone.fbx-landscape .fbx-caption,.fbx-phone.fbx-landscape.fbx-sticky-caption .fbx-caption{z-index:100004}.fbx-pannable{cursor:-moz-grab;cursor:-webkit-grab;cursor:grab}.fbx-pannable.fbx-panning{cursor:-moz-grabbing;cursor:-webkit-grabbing;cursor:grabbing}.fbx-pannable>div>img.fbx-item{max-width:none;max-height:none}.fbx-pan-overview{cursor:pointer;max-width:150px;max-height:150px;overflow:hidden;background-position:top left;background-size:cover;position:absolute;z-index:100006;border:2px solid #666;box-shadow:0 0 12px rgba(0,0,0,.8)}.fbx-pan-overview.fbx-top-left{top:20px;left:20px}.fbx-pan-overview.fbx-top-right{top:20px;right:32px}.fbx-pan-overview.fbx-bottom-left{bottom:32px;left:20px}.fbx-pan-overview.fbx-bottom-right{bottom:32px;right:32px}.fbx-pan-viewport{position:absolute;top:0;left:0;box-shadow:0 0 300px 300px rgba(0,0,0,.7)}.fbx-ie10.fbx-modal.fbx-phone.fbx-landscape .fbx-close,.fbx-ie10.fbx-modal.fbx-phone.fbx-landscape .fbx-fullscreen-toggle,.fbx-ie10.fbx-modal.fbx-phone.fbx-landscape .fbx-next,.fbx-ie10.fbx-modal.fbx-phone.fbx-landscape .fbx-pause,.fbx-ie10.fbx-modal.fbx-phone.fbx-landscape .fbx-play,.fbx-ie10.fbx-modal.fbx-phone.fbx-landscape .fbx-prev,.fbx-ie10.fbx-modal.fbx-phone.fbx-landscape .fbx-social-toggle,.fbx-ie11.fbx-modal.fbx-phone.fbx-landscape .fbx-close,.fbx-ie11.fbx-modal.fbx-phone.fbx-landscape .fbx-fullscreen-toggle,.fbx-ie11.fbx-modal.fbx-phone.fbx-landscape .fbx-next,.fbx-ie11.fbx-modal.fbx-phone.fbx-landscape .fbx-pause,.fbx-ie11.fbx-modal.fbx-phone.fbx-landscape .fbx-play,.fbx-ie11.fbx-modal.fbx-phone.fbx-landscape .fbx-prev,.fbx-ie11.fbx-modal.fbx-phone.fbx-landscape .fbx-social-toggle,.fbx-ie9.fbx-modal.fbx-phone.fbx-landscape .fbx-close,.fbx-ie9.fbx-modal.fbx-phone.fbx-landscape .fbx-fullscreen-toggle,.fbx-ie9.fbx-modal.fbx-phone.fbx-landscape .fbx-next,.fbx-ie9.fbx-modal.fbx-phone.fbx-landscape .fbx-pause,.fbx-ie9.fbx-modal.fbx-phone.fbx-landscape .fbx-play,.fbx-ie9.fbx-modal.fbx-phone.fbx-landscape .fbx-prev,.fbx-ie9.fbx-modal.fbx-phone.fbx-landscape .fbx-social-toggle{right:1px!important}
|
free/foobox-free.php
CHANGED
@@ -42,8 +42,9 @@ if (!class_exists('Foobox_Free')) {
|
|
42 |
$this->init( FOOBOXFREE_FILE, FOOBOXFREE_SLUG, FOOBOX_BASE_VERSION, 'FooBox FREE' );
|
43 |
|
44 |
if (is_admin()) {
|
|
|
|
|
45 |
|
46 |
-
add_action('admin_head', array($this, 'admin_inline_content'));
|
47 |
add_action('foobox-free-settings_custom_type_render', array($this, 'custom_admin_settings_render'));
|
48 |
new FooBox_Free_Settings();
|
49 |
|
@@ -58,7 +59,6 @@ if (!class_exists('Foobox_Free')) {
|
|
58 |
|
59 |
// Render JS to the front-end pages
|
60 |
add_action('wp_enqueue_scripts', array($this, 'frontend_print_scripts'), 20);
|
61 |
-
add_action('foobox-free_inline_scripts', array($this, 'inline_dynamic_js'));
|
62 |
|
63 |
// Render CSS to the front-end pages
|
64 |
add_action('wp_enqueue_scripts', array($this, 'frontend_print_styles'));
|
@@ -72,14 +72,8 @@ if (!class_exists('Foobox_Free')) {
|
|
72 |
}
|
73 |
|
74 |
function enqueue_block_editor_assets() {
|
75 |
-
$this->
|
76 |
-
$this->
|
77 |
-
$script = $this->generate_javascript();
|
78 |
-
|
79 |
-
wp_add_inline_script(
|
80 |
-
'foobox-free-min',
|
81 |
-
$script
|
82 |
-
);
|
83 |
}
|
84 |
|
85 |
function custom_admin_settings_render($args = array()) {
|
@@ -123,20 +117,13 @@ if (!class_exists('Foobox_Free')) {
|
|
123 |
require_once FOOBOXFREE_PATH . "includes/upgrade.php";
|
124 |
}
|
125 |
|
126 |
-
function
|
127 |
-
|
128 |
-
$this->frontend_print_styles();
|
129 |
-
}
|
130 |
-
|
131 |
-
function admin_print_scripts() {
|
132 |
-
parent::admin_print_scripts();
|
133 |
-
$this->register_and_enqueue_js( self::JS );
|
134 |
-
}
|
135 |
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
$this->
|
140 |
}
|
141 |
}
|
142 |
|
@@ -164,42 +151,11 @@ if (!class_exists('Foobox_Free')) {
|
|
164 |
|
165 |
wp_add_inline_script(
|
166 |
'foobox-free-min',
|
167 |
-
$foobox_js
|
|
|
168 |
);
|
169 |
}
|
170 |
|
171 |
-
function inline_dynamic_js() {
|
172 |
-
if (!apply_filters('foobox_enqueue_scripts', true)) return;
|
173 |
-
|
174 |
-
$foobox_js = $this->generate_javascript();
|
175 |
-
|
176 |
-
$defer_js = !$this->is_option_checked( 'disable_defer_js', true );
|
177 |
-
|
178 |
-
$script_type = $defer_js ? 'text/foobox' : 'text/javascript';
|
179 |
-
|
180 |
-
echo '<script type="' . $script_type . '">' . $foobox_js . '</script>';
|
181 |
-
|
182 |
-
if ( $defer_js ) {
|
183 |
-
?>
|
184 |
-
<script type="text/javascript">
|
185 |
-
if (window.addEventListener){
|
186 |
-
window.addEventListener("DOMContentLoaded", function() {
|
187 |
-
var arr = document.querySelectorAll("script[type='text/foobox']");
|
188 |
-
for (var x = 0; x < arr.length; x++) {
|
189 |
-
var script = document.createElement("script");
|
190 |
-
script.type = "text/javascript";
|
191 |
-
script.innerHTML = arr[x].innerHTML;
|
192 |
-
arr[x].parentNode.replaceChild(script, arr[x]);
|
193 |
-
}
|
194 |
-
});
|
195 |
-
} else {
|
196 |
-
console.log("FooBox does not support the current browser.");
|
197 |
-
}
|
198 |
-
</script>
|
199 |
-
<?php
|
200 |
-
}
|
201 |
-
}
|
202 |
-
|
203 |
/**
|
204 |
* PLEASE NOTE : This is only here to avoid the problem of hard-coded lightboxes.
|
205 |
* This is not meant to be malicious code to override all lightboxes in favour of FooBox.
|
42 |
$this->init( FOOBOXFREE_FILE, FOOBOXFREE_SLUG, FOOBOX_BASE_VERSION, 'FooBox FREE' );
|
43 |
|
44 |
if (is_admin()) {
|
45 |
+
//enqueue FooBox assets in the admin if necessary
|
46 |
+
add_action('admin_enqueue_scripts', array($this, 'admin_enqueue'), 20);
|
47 |
|
|
|
48 |
add_action('foobox-free-settings_custom_type_render', array($this, 'custom_admin_settings_render'));
|
49 |
new FooBox_Free_Settings();
|
50 |
|
59 |
|
60 |
// Render JS to the front-end pages
|
61 |
add_action('wp_enqueue_scripts', array($this, 'frontend_print_scripts'), 20);
|
|
|
62 |
|
63 |
// Render CSS to the front-end pages
|
64 |
add_action('wp_enqueue_scripts', array($this, 'frontend_print_styles'));
|
72 |
}
|
73 |
|
74 |
function enqueue_block_editor_assets() {
|
75 |
+
$this->frontend_print_scripts();
|
76 |
+
$this->frontend_print_styles();
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
}
|
78 |
|
79 |
function custom_admin_settings_render($args = array()) {
|
117 |
require_once FOOBOXFREE_PATH . "includes/upgrade.php";
|
118 |
}
|
119 |
|
120 |
+
function admin_enqueue() {
|
121 |
+
$screen_id = foo_current_screen_id();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
|
123 |
+
if ( 'toplevel_page_' . FOOBOX_BASE_SLUG === $screen_id ||
|
124 |
+
'foobox_page_' . FOOBOX_BASE_PAGE_SLUG_SETTINGS === $screen_id ) {
|
125 |
+
$this->frontend_print_scripts();
|
126 |
+
$this->frontend_print_styles();
|
127 |
}
|
128 |
}
|
129 |
|
151 |
|
152 |
wp_add_inline_script(
|
153 |
'foobox-free-min',
|
154 |
+
$foobox_js,
|
155 |
+
'before'
|
156 |
);
|
157 |
}
|
158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
/**
|
160 |
* PLEASE NOTE : This is only here to avoid the problem of hard-coded lightboxes.
|
161 |
* This is not meant to be malicious code to override all lightboxes in favour of FooBox.
|
free/includes/class-script-generator.php
CHANGED
@@ -125,19 +125,10 @@ if ( !class_exists( 'FooBox_Free_Script_Generator' ) ) {
|
|
125 |
|
126 |
$info = $foobox->get_plugin_info();
|
127 |
|
128 |
-
$
|
|
|
129 |
|
130 |
-
$
|
131 |
-
|
132 |
-
if ( !empty($js_options) ) {
|
133 |
-
$js .= sprintf( '
|
134 |
-
(function( FOOBOX, $, undefined ) {
|
135 |
-
FOOBOX.o = %s;
|
136 |
-
FOOBOX.init = function() {
|
137 |
-
$(".fbx-link").removeClass("fbx-link");
|
138 |
-
', $js_options );
|
139 |
-
$js_options = 'FOOBOX.o';
|
140 |
-
}
|
141 |
|
142 |
if ( foo_check_plugin_settings_page( FOOBOXFREE_SLUG ) ) {
|
143 |
$foobox_selectors[] = '.demo-gallery,.bad-image';
|
@@ -168,35 +159,56 @@ if ( !class_exists( 'FooBox_Free_Script_Generator' ) ) {
|
|
168 |
|
169 |
$foobox_selectors[] = '.foobox';
|
170 |
|
171 |
-
|
172 |
-
|
173 |
-
';
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
}
|
199 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
|
201 |
return $js;
|
202 |
}
|
125 |
|
126 |
$info = $foobox->get_plugin_info();
|
127 |
|
128 |
+
$seperator = $debug ? '",
|
129 |
+
"' : '", "';
|
130 |
|
131 |
+
$foobox_selectors = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
|
133 |
if ( foo_check_plugin_settings_page( FOOBOXFREE_SLUG ) ) {
|
134 |
$foobox_selectors[] = '.demo-gallery,.bad-image';
|
159 |
|
160 |
$foobox_selectors[] = '.foobox';
|
161 |
|
162 |
+
$js_options = self::generate_js_options( $fbx_options );
|
163 |
+
$disable_others = self::is_option_checked( $fbx_options, 'disable_others', false );
|
164 |
+
$foobox_ready_event = apply_filters( 'foobox_generate_javascript_ready_event', true );
|
165 |
+
$preload_foobox_font = apply_filters( 'foobox_generate_javascript_preload_font', true );
|
166 |
+
if ( $debug ) {
|
167 |
+
$pre_js = apply_filters( 'foobox_generate_javascript_pre', 'console.log("FooBox - Custom JavaScript (Pre)");' );
|
168 |
+
$post_js = apply_filters( 'foobox_generate_javascript_post', 'console.log("FooBox - Custom JavaScript (Post)");' );
|
169 |
+
$captions_js = apply_filters( 'foobox_generate_javascript_captions', 'console.log("FooBox - Custom Captions Code");' );
|
170 |
+
$custom_js = apply_filters( 'foobox_generate_javascript_custom', 'console.log("FooBox - Custom Extra JS");' );
|
171 |
+
} else {
|
172 |
+
$pre_js = apply_filters( 'foobox_generate_javascript_pre', '' );
|
173 |
+
$post_js = apply_filters( 'foobox_generate_javascript_post', '' );
|
174 |
+
$captions_js = apply_filters( 'foobox_generate_javascript_captions', '' );
|
175 |
+
$custom_js = apply_filters( 'foobox_generate_javascript_custom', '' );
|
176 |
+
}
|
177 |
+
$js = sprintf( '/* Run FooBox FREE (v%s) */
|
178 |
+
var FOOBOX = window.FOOBOX = {
|
179 |
+
ready: %s,
|
180 |
+
preloadFont: %s,
|
181 |
+
disableOthers: %s,
|
182 |
+
o: %s,
|
183 |
+
selectors: [
|
184 |
+
%s
|
185 |
+
],
|
186 |
+
pre: function( $ ){
|
187 |
+
// Custom JavaScript (Pre)
|
188 |
+
%s
|
189 |
+
},
|
190 |
+
post: function( $ ){
|
191 |
+
// Custom JavaScript (Post)
|
192 |
+
%s
|
193 |
+
// Custom Captions Code
|
194 |
+
%s
|
195 |
+
},
|
196 |
+
custom: function( $ ){
|
197 |
+
// Custom Extra JS
|
198 |
+
%s
|
199 |
+
}
|
200 |
+
};',
|
201 |
+
$info['version'],
|
202 |
+
$foobox_ready_event ? 'true' : 'false',
|
203 |
+
$preload_foobox_font ? 'true' : 'false',
|
204 |
+
$disable_others ? 'true' : 'false',
|
205 |
+
$js_options,
|
206 |
+
'"' . implode($seperator, $foobox_selectors) . '"',
|
207 |
+
$pre_js,
|
208 |
+
$post_js,
|
209 |
+
$captions_js,
|
210 |
+
$custom_js
|
211 |
+
);
|
212 |
|
213 |
return $js;
|
214 |
}
|
free/includes/class-settings.php
CHANGED
@@ -135,14 +135,6 @@ if ( !class_exists( 'FooBox_Free_Settings' ) ) {
|
|
135 |
'tab' => 'advanced'
|
136 |
);
|
137 |
|
138 |
-
$settings[] = array(
|
139 |
-
'id' => 'disable_defer_js',
|
140 |
-
'title' => __( 'Disable Defer Javascript', 'foobox' ),
|
141 |
-
'desc' => __( 'By default, we defer running the FooBox javascript to work with most optimization plugins. You can choose to turn this off if there are problems.', 'foobox-image-lightbox' ),
|
142 |
-
'type' => 'checkbox',
|
143 |
-
'tab' => 'advanced'
|
144 |
-
);
|
145 |
-
|
146 |
$settings[] = array(
|
147 |
'id' => 'dropie7support',
|
148 |
'title' => __( 'Drop IE7 Support', 'foobox' ),
|
135 |
'tab' => 'advanced'
|
136 |
);
|
137 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
$settings[] = array(
|
139 |
'id' => 'dropie7support',
|
140 |
'title' => __( 'Drop IE7 Support', 'foobox' ),
|
free/js/foobox.free.min.js
CHANGED
@@ -6,5 +6,5 @@
|
|
6 |
* @license Released under the MIT license.
|
7 |
* You are free to use FooBox jQuery in personal projects as long as this copyright header is left intact.
|
8 |
*/
|
9 |
-
!function(a,b,c,undefined){if(a&&b){b.FooBox={defaults:{affiliate:{enabled:!0,prefix:"Powered by ",url:"http://fooplugins.com/plugins/foobox/"},alwaysInit:!1,closeOnOverlayClick:!0,containerCssClass:"fbx-instance",countMessage:"item %index of %total",error:"Could not load the item",excludes:".fbx-link, .nofoobox",externalSelector:"a[data-foobox],input[data-foobox]",fitToScreen:!1,hideScrollbars:!0,loadDelay:0,loaderTimeout:600,modalClass:"",preload:!1,rel:null,resizeSpeed:300,selector:"a",showButtons:!0,showCount:!0,style:"fbx-rounded",theme:"fbx-light",transitionInSpeed:200,transitionOutSpeed:200,initCallback:null,loop:!0},version:"2.0.10",instances:[],ready:function(b){(Function("/*@cc_on return true@*/")()?"complete"===document.readyState:"loading"!==document.readyState)?b(a):setTimeout(function(){FooBox.ready(b)},1)}},FooBox.$=a,FooBox.format=function(a,b,c){var d,e,f=arguments[0];for(d=0;d<arguments.length-1;d++)e=new RegExp("\\{"+d+"\\}","gm"),f=f.replace(e,arguments[d+1]);return f},FooBox.browser={isIE:!1,isChrome:!1,isSafari:!1,isLtSafari10:!1,version:0,css:"",iOS:!1,Mac:!1,isMobile:function(a){return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))}(navigator.userAgent||navigator.vendor||b.opera),check:function(){var a=navigator.appVersion.toLowerCase(),c=navigator.userAgent.toLowerCase(),d=navigator.platform;FooBox.browser.iOS=/(iPad|iPhone|iPod)/g.test(d),1==FooBox.browser.iOS&&(FooBox.browser.css+=" fbx-ios"),FooBox.browser.Mac=/(Mac)/g.test(d),1==FooBox.browser.Mac&&(FooBox.browser.css+=" fbx-mac"),FooBox.browser.isChrome=a.indexOf("chrome")>-1||a.indexOf("crios")>-1,FooBox.browser.isChrome&&(FooBox.browser.css+=" fbx-chrome"),FooBox.browser.isSafari=a.indexOf("safari")>-1&&!FooBox.browser.isChrome,FooBox.browser.isSafari&&(FooBox.browser.css+=" fbx-safari",FooBox.browser.isLtSafari10=/constructor/i.test(b.HTMLElement)),FooBox.browser.isFirefox=c.indexOf("firefox")>-1,FooBox.browser.isFirefox&&(FooBox.browser.css+=" fbx-firefox");var e=c.indexOf("msie "),f=c.indexOf("trident/"),g=c.indexOf("edge/");if(FooBox.browser.isIE=e>-1||f>-1||g>-1,FooBox.browser.isIE){if(e>-1)FooBox.browser.version=parseInt(c.substring(e+5,c.indexOf(".",e)),10);else if(f>-1){var h=c.indexOf("rv:");FooBox.browser.version=parseInt(c.substring(h+3,c.indexOf(".",h)),10)}else g>-1&&(FooBox.browser.version=parseInt(c.substring(g+5,c.indexOf(".",g)),10));FooBox.browser.css=FooBox.format("fbx-ie fbx-ie{0}",FooBox.browser.version)}},supportsTransitions:function(){var a,b=document.body||document.documentElement,c=b.style,d="transition";if("string"==typeof c[d])return!0;a=["Moz","Webkit","Khtml","O","ms"],d=d.charAt(0).toUpperCase()+d.substr(1);for(var e=0;e<a.length;e++)if("string"==typeof c[a[e]+d])return!0;return!1},transitionEnd:function(){var a,b=document.createElement("fakeelement"),c={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(a in c)if(c.hasOwnProperty(a)&&b.style[a]!==undefined)return c[a];return null}},FooBox.browser.check(),FooBox.qualifiedURL=function(a){var b=document.createElement("a");return b.href=a,b.href},c||(c={}),c.log=c.log||function(){},c.warn=c.warn||function(){},c.error=c.error||function(){},c.info=c.info||function(){};var d={write:function(){c.log(FooBox.format.apply(d,arguments))},error:function(){1===arguments.length&&arguments[0]instanceof Error?c.error(arguments[0]):c.error(FooBox.format.apply(d,arguments))}};jQuery.Event.prototype.fb={instance:null,modal:null,options:null},FooBox.raise=function(b,c,d){d=d||{};var e=a.Event(c);return e.fb={},e.fb.instance=b,e.fb.modal=b.modal.element,e.fb.options=b.options,a.extend(!0,e.fb,d),b.element.one(c,function(a){a.stopPropagation()}).trigger(e),e},FooBox.isjQuery=function(a){return a instanceof jQuery?!0:a&&a.jquery},FooBox.options={isMultipart:function(a,b){return"string"==typeof a&&a.length>0&&-1!==a.indexOf(b)},hasProperties:function(a){if("object"!=typeof a)return!1;var b;for(b in a)if(a.hasOwnProperty(b))return!0;return!1},get:function(a,b){if(FooBox.options.isMultipart(b,".")){var c=b.substring(0,b.indexOf(".")),d=b.substring(b.indexOf(".")+1);return a[c]=a[c]||{},FooBox.options.get(a[c],d)}return a[b]},set:function(a,b,c){if(FooBox.options.isMultipart(b,".")){var d=b.substring(0,b.indexOf(".")),e=b.substring(b.indexOf(".")+1);a[d]=a[d]||{},FooBox.options.set(a[d],e,c)}else a[b]=c},merge:function(a,b,c){var d,e=Array.prototype.slice.call(arguments);for(a=e.shift(),b=e.shift(),FooBox.options._merge(a,b),d=0;d<e.length;d++)c=e[d],FooBox.options._merge(a,c);return a},_merge:function(b,c){var d;for(d in c)c.hasOwnProperty(d)&&(FooBox.options.hasProperties(c[d])&&!a.isArray(c[d])?(b[d]=b[d]||{},FooBox.options._merge(b[d],c[d])):a.isArray(c[d])?(b[d]=[],a.extend(!0,b[d],c[d])):b[d]=c[d])}},FooBox.objects={registered:{},ensure:function(a){return FooBox.objects.registered[a]=FooBox.objects.registered[a]||[]},register:function(b,c,d){var e=FooBox.objects.ensure(b);return e.push(c),"object"==typeof d&&a.extend(!0,FooBox.defaults,d),!0},load:function(a,b){var c,e,f=[],g=FooBox.objects.ensure(a);for(e=0;e<g.length;e++)try{c=g[e],f.push(new c(b))}catch(h){d.error(h)}b.objects=b.objects||{},b.objects[a]=f},call:function(b,c,e,f,g){var h,i=Array.prototype.slice.call(arguments);b=i.shift(),c=i.shift(),e=i.shift();for(var j=c.objects[b]||[],k=0;k<j.length;k++)try{if(h=j[k],!a.isFunction(h[e]))continue;h[e].apply(h,i)}catch(l){d.error(l)}},get:function(b,c,d){var e,f=c.objects[b];if(!f||!a.isFunction(d))return null;for(e=0;e<f.length;e++)if(d(f[e]))return f[e];return null}},FooBox.addons={_ns:"addons",validate:function(b){return a.isFunction(b)?!0:(d.error('Expected type "function", received type "{0}".',typeof b),!1)},register:function(a,b){return FooBox.addons.validate(a)?FooBox.objects.register(FooBox.addons._ns,a,b):(d.error("Failed to register the addon."),!1)},load:function(a){FooBox.objects.load(FooBox.addons._ns,a)},call:function(a,b,c,d){var e=Array.prototype.slice.call(arguments);e.unshift(FooBox.addons._ns),FooBox.objects.call.apply(this,e)}},FooBox.handlers={_ns:"handlers",validate:function(b){if(!a.isFunction(b))return d.error('Expected type "function", received type "{0}".',typeof b),!1;var c=new b;return a.isFunction(c.handles)?a.isFunction(c.defaults)?a.isFunction(c.parse)?a.isFunction(c.load)?a.isFunction(c.getSize)?a.isFunction(c.hasChanged)?a.isFunction(c.preload)?!0:(d.error('The required "preload" method is not implemented.'),!1):(d.error('The required "hasChanged" method is not implemented.'),!1):(d.error('The required "getSize" method is not implemented.'),!1):(d.error('The required "load" method is not implemented.'),!1):(d.error('The required "parse" method is not implemented.'),!1):(d.error('The required "defaults" method is not implemented.'),!1):(d.error('The required "handles" method is not implemented.'),!1)},register:function(a,b){return FooBox.handlers.validate(a)?FooBox.objects.register(FooBox.handlers._ns,a,b):(d.error("Failed to register the handler."),!1)},load:function(a){FooBox.objects.load(FooBox.handlers._ns,a)},call:function(a,b,c,d){var e=Array.prototype.slice.call(arguments);e.unshift(FooBox.handlers._ns),FooBox.objects.call.apply(this,e)},get:function(a,b){return FooBox.objects.get(FooBox.handlers._ns,a,function(a){return a.type==b})}},FooBox.Item=function(b,c,d){return this.type=b,this.element=FooBox.isjQuery(c)?c:a(c),this.handler=d,this.width=null,this.height=null,this.url=null,this.overflow=!1,this.preloaded=!1,this.proportion=!1,this.error=!1,this},FooBox.Size=function(a,b){return this.width="number"==typeof a?a:parseInt(a,0),this.height="number"==typeof b?b:parseInt(b,0),this.equalTo=function(a){return this.width==a.width&&this.height==a.height},this},FooBox.Size.check=function(a){return"number"==typeof a?a:isNaN(parseInt(a))?null:parseInt(a)},FooBox.Timer=function(){this.id=null,this.busy=!1;var a=this;return this.start=function(b,c,d){d=d||b,a.stop(),a.id=setTimeout(function(){b.call(d),a.id=null,a.busy=!1},c),a.busy=!0},this.stop=function(){null!==a.id&&a.busy!==!1&&(clearTimeout(a.id),a.id=null,a.busy=!1)},this},a.fn.foobox=function(b){return b=b||{},this.each(function(){var c=a(this),d=c.data("fbx_instance"),e=c.data("__FooGallery__");if(d instanceof FooBox.Instance)if(1==d.options.alwaysInit||e){var f=d.options;f.alwaysInit=!0,d.destroy(),d=new FooBox.Instance(d.id),d.init(this,a.extend(!0,f,b))}else d.reinit(b);else{if(d=a(this).data("fbx_p_instance"),d instanceof FooBox.Instance)return;d=new FooBox.Instance,d.init(this,b)}})},FooBox.Modal=function(c){this.FooBox=c,this.element=null,this.loaderTimeout=new FooBox.Timer,this._first=!1,this._busy=!1,this._closed=!1;var e=this;return this.init=function(a,b){e.setup.html(),e.setup.options(b),e.setup.bind()},this.reinit=function(a){e.setup.options(a)},this.destroy=function(){FooBox.isjQuery(e.element)&&e.element.remove()},this.setup={html:function(){if(!FooBox.isjQuery(e.element)){e.element=a('<div class="fbx-modal"></div>'),e.element.append('<div class="fbx-inner-spacer"></div>');var b=a('<div class="fbx-stage"></div>');b.append('<div class="fbx-item-current"></div>'),b.append('<div class="fbx-item-next"></div>');var c=a('<div class="fbx-inner fbx-inner-shadow"></div>');c.append(b),c.append('<a class="fbx-prev fbx-btn-transition fbx-btn-shadow"></a>'),c.append('<div class="fbx-credit"><a target="_blank" href=""><em></em><span> FooBox</span></a></div>'),c.append('<span class="fbx-count" />'),c.append('<a class="fbx-next fbx-btn-transition fbx-btn-shadow"></a>'),c.append('<a class="fbx-close fbx-btn-transition fbx-btn-shadow"></a>'),e.element.append('<div class="fbx-loader"><div></div></div>'),e.element.append(c),e.FooBox.raise("foobox.setupHtml"),a("body").append(e.element)}},options:function(a){var b;e.element.removeClass().addClass("fbx-modal").addClass(FooBox.format("fbx-{0}",e.FooBox.id)).addClass(e.FooBox.element.data("style")||a.style).addClass(e.FooBox.element.data("theme")||a.theme).addClass(e.FooBox.element.data("modal-class")).addClass(a.modalClass).data("fbx_instance",e.FooBox),e.element.addClass(FooBox.browser.css),b=a.affiliate.enabled?"":"none",e.element.find(".fbx-credit").css("display",b),a.affiliate.enabled&&(e.element.find(".fbx-credit > a").attr("href",a.affiliate.url),e.element.find(".fbx-credit > a > em").text(a.affiliate.prefix)),b=a.showCount&&e.FooBox.items.multiple()?"":"none",e.element.find(".fbx-count").css("display",b),a.showButtons&&e.FooBox.items.multiple()||e.element.addClass("fbx-no-buttons"),e.FooBox.raise("foobox.setupOptions")},bind:function(){1==e.FooBox.options.closeOnOverlayClick&&e.element.off("click.foobox").on("click.foobox",function(b){1==e.FooBox.options.closeOnOverlayClick&&a(b.target).is(".fbx-modal")&&e.close()}),e.element.find(".fbx-close").off("click.foobox").on("click.foobox",function(a){a.preventDefault(),a.stopPropagation(),e.close()}).end().find(".fbx-prev").off("click.foobox").on("click.foobox",function(b){b.preventDefault(),b.stopPropagation(),a(this).hasClass("fbx-disabled")||e.prev()}).end().find(".fbx-next").off("click.foobox").on("click.foobox",function(b){b.preventDefault(),b.stopPropagation(),a(this).hasClass("fbx-disabled")||e.next()})}},this.prioritize=function(){FooBox.instances.length>1&&e.element.nextAll(".fbx-modal:last").after(e.element)},this.preload=function(){if(1==e.FooBox.options.preload){var a=e.FooBox.items.prev();a&&a.handler.preload(a);var b=e.FooBox.items.next();b&&b.handler.preload(b)}},this.show=function(b){function c(a){if(e.loaderTimeout.stop(),e.element.removeClass("fbx-loading"),e._busy=!1,d.error(a),!e.FooBox.raise("foobox.onError",{error:a}).isDefaultPrevented()){var c=e.FooBox.items.error(f.index);null!=c&&e.show(b)}}var f=e.FooBox.items.current();if(f){b=b||!1,e._first=b,e._busy=!0,e._closed=!1,a("body").addClass("fbx-active"),e.FooBox.options.hideScrollbars&&a("html").addClass("fbx-no-scroll"),1==f.error?e.element.addClass("fbx-error"):e.element.removeClass("fbx-error"),e.element.hasClass("fbx-show")||(e.prioritize(),e.element.addClass("fbx-loading").find(".fbx-inner").css({width:"100px",height:"100px","margin-top":"-50px","margin-left":"-50px"}));var g=e.element.find(".fbx-item-current"),h=e.element.find(".fbx-item-next");if(h.hide().css("opacity","0"),e.element.find(".fbx-count").text(e.FooBox.options.countMessage.replace("%index",""+(e.FooBox.items.indexes.current+1)).replace("%total",""+e.FooBox.items.array.length)),e.FooBox.raise("foobox.beforeLoad",{item:f}).isDefaultPrevented())return void(e._busy=!1);if(f.handler.hasChanged(f)){var i=f.index,j=f.element.get(0);f=f.handler.parse(f.element);var k=e.FooBox.raise("foobox.parseItem",{element:f.element,item:f});j.index=k.fb.item.index=i,e.FooBox.items.array[i]=k.fb.item}e.preload(),e.loaderTimeout.start(function(){e.element.addClass("fbx-loading")},e.FooBox.options.loaderTimeout),setTimeout(function(){e.checkForLoop(f),f.handler.load(f,h,function(a){return 1==e._closed?void(e._busy=!1):void e.transitionOut(g,function(){return 1==e._closed?void(e._busy=!1):void e.resize(a,h,function(){return 1==e._closed?void(e._busy=!1):(e.loaderTimeout.stop(),h.show(),void e.transitionIn(h,function(){return 1==e._closed?void(e._busy=!1):(h.add(g).toggleClass("fbx-item-next fbx-item-current"),g.empty(),void(e.element.hasClass("fbx-show")?(e.element.removeClass("fbx-loading"),e.FooBox.raise("foobox.afterLoad",{item:f}),e.triggerFooGalleryLayout(h),e._busy=!1):e.FooBox.raise("foobox.beforeShow",{item:f}).isDefaultPrevented()||(e.element.removeClass("fbx-loading").addClass("fbx-show"),e.FooBox.raise("foobox.afterShow",{item:f}),e.FooBox.raise("foobox.afterLoad",{item:f}),e.triggerFooGalleryLayout(h),e._busy=!1)))},c))},c)},c)},c)},e.FooBox.options.loadDelay)}},this.triggerFooGalleryLayout=function(c){b.FooGallery&&c.find(".foogallery").each(function(){var b=a(this).data("__FooGallery__");b&&b.initialized&&b.layout()})},this.checkForLoop=function(a){1!=e.FooBox.options.loop&&(e.element.find(".fbx-prev, .fbx-next").removeClass("fbx-disabled"),e.FooBox.items.is.first(a)&&e.element.find(".fbx-prev").addClass("fbx-disabled"),e.FooBox.items.is.last(a)&&e.element.find(".fbx-next").addClass("fbx-disabled"))},this.resize=function(b,c,d,f){try{if(0===b.width||0===b.height)return void(a.isFunction(f)&&f(FooBox.format("Invalid size supplied. Width = {0}, Height = {1}",b.width,b.height)));var g=e.FooBox.items.current(),h=new FooBox.Size(b.width,b.height),i=e.element.find(".fbx-inner"),j=e.element.find(".fbx-inner-spacer"),k=parseInt(j.css("padding-top"),0),l=parseInt(j.css("padding-bottom"),0),m=parseInt(j.css("padding-left"),0),n=parseInt(j.css("padding-right"),0),o=parseInt(i.css("border-top-width"),0),p=parseInt(i.css("border-bottom-width"),0),q=parseInt(i.css("border-left-width"),0),r=parseInt(i.css("border-right-width"),0),s=parseInt(i.css("padding-left"),0),t=k+l+2*s+o+p,u=m+n+2*s+q+r,v=new FooBox.Size(parseInt(i.css("width"),0),parseInt(i.css("height"),0)),w=new FooBox.Size(e.element.width()-u,e.element.height()-t),x=w.width/b.width;b.height*x>w.height&&(x=w.height/b.height),e.FooBox.options.fitToScreen===!0||1==g.proportion&&(b.height>w.height||b.width>w.width)?(b.height=Math.floor(b.height*x),b.width=Math.floor(b.width*x)):0==g.proportion&&(b.height>w.height&&(b.height=w.height),b.width>w.width&&(b.width=w.width)),b.height<100&&(b.height=100),b.width<100&&(b.width=100);var y=-(b.height/2+s+(p+o)/2+l/2-k/2),z=-(b.width/2+s+(r+q)/2+n/2-m/2);if(v.equalTo(b))i.css({height:b.height,width:b.width,"margin-top":y,"margin-left":z}),e.overflow(g,h,b,c),e.FooBox.raise("foobox.afterResize",{item:g,size:b}),a.isFunction(d)&&d();else if(!e.FooBox.raise("foobox.beforeResize",{item:g,size:b,offset:{top:y,left:z},error:f,success:d}).isDefaultPrevented())if(y=-(b.height/2+s+(p+o)/2+l/2-k/2),z=-(b.width/2+s+(r+q)/2+n/2-m/2),e.element.hasClass("fbx-show"))if(FooBox.browser.supportsTransitions()){var A=e.FooBox.options.resizeSpeed/1e3,B="all "+A+"s ease-in-out";i.css({WebkitTransition:B,MozTransition:B,MsTransition:B,OTransition:B,transition:B}),i.css({height:b.height,width:b.width,"margin-top":y,"margin-left":z}),setTimeout(function(){i.css({WebkitTransition:"",MozTransition:"",MsTransition:"",OTransition:"",transition:""}),e.overflow(g,h,b,c),e.FooBox.raise("foobox.afterResize",{item:g,size:b}),a.isFunction(d)&&d(b)},e.FooBox.options.resizeSpeed)}else i.animate({height:b.height,width:b.width,"margin-top":y,"margin-left":z},e.FooBox.options.resizeSpeed,function(){e.overflow(g,h,b,c),e.FooBox.raise("foobox.afterResize",{item:g,size:b}),a.isFunction(d)&&d(b)});else i.css({height:b.height,width:b.width,"margin-top":y,"margin-left":z}),e.overflow(g,h,b,c),e.FooBox.raise("foobox.afterResize",{item:g,size:b}),a.isFunction(d)&&d()}catch(C){a.isFunction(f)&&f(C)}},this.overflow=function(a,b,c,d){var f=d.find(".fbx-item");1==a.overflow&&(c.width<.8*b.width||c.height<.8*b.height)||1==a.overflow&&0==a.proportion&&(c.width<b.width||c.height<b.height)||1==a.overflow&&"html"==a.type?("html"==a.type?(f.css({width:"100%",height:"auto",overflow:""}),d.css("overflow","auto")):(f.css({width:b.width,height:b.height,overflow:""}),d.css({"overflow-x":b.width<=c.width?"hidden":"","overflow-y":b.height<=c.height?"hidden":""})),e.FooBox.raise("foobox.showOverflow",{item:a,container:d})):(f.css({width:"",height:"",overflow:"hidden"}),d.css({"overflow-x":"","overflow-y":"",overflow:"hidden"}),e.FooBox.raise("foobox.hideOverflow",{item:a,container:d}))},this.transitionOut=function(b,c,d){try{if(!e.element.hasClass("fbx-show"))return void(a.isFunction(c)&&c());b.animate({opacity:0},b.is(":visible")?e.FooBox.options.transitionOutSpeed:0,function(){a.isFunction(c)&&c()})}catch(f){a.isFunction(d)&&d(f)}},this.transitionIn=function(b,c,d){try{if(!e.element.hasClass("fbx-show"))return b.css({opacity:1}),void(a.isFunction(c)&&c());b.animate({opacity:1},e.FooBox.options.transitionInSpeed,function(){a.isFunction(c)&&c()})}catch(f){a.isFunction(d)&&d(f)}},this.close=function(){e.FooBox.raise("foobox.beforeClose").isDefaultPrevented()||(e._closed=!0,e._busy=!1,e.element.removeClass("fbx-loading fbx-show"),a("body").removeClass("fbx-active"),e.FooBox.raise("foobox.close"),e.element.find(".fbx-item-current, .fbx-item-next").empty(),a("html").removeClass("fbx-no-scroll"),e.FooBox.raise("foobox.afterClose"))},this.prev=function(a){if(1!=e._busy){if(e.FooBox.items.indexes.set(e.FooBox.items.indexes.prev),"string"==typeof a)for(var b=e.FooBox.items.current();b.type!=a;)e.FooBox.items.indexes.set(e.FooBox.items.indexes.prev),b=e.FooBox.items.current();e.show(!1),e.FooBox.raise("foobox.previous")}},this.next=function(a){if(1!=e._busy){if(e.FooBox.items.indexes.set(e.FooBox.items.indexes.next),"string"==typeof a)for(var b=e.FooBox.items.current();b.type!=a;)e.FooBox.items.indexes.set(e.FooBox.items.indexes.next),b=e.FooBox.items.current();e.show(!1),e.FooBox.raise("foobox.next")}},this},FooBox.Instance=function(b){this.id=null,"number"==typeof b?(this.id=b,FooBox.instances[b-1]=this):this.id=FooBox.instances.push(this),this.element=null,this.options=a.extend(!0,{},FooBox.defaults),this.modal=new FooBox.Modal(this),this.objects={},FooBox.addons.load(this),FooBox.handlers.load(this);var c=this;return this.raise=function(a,b){return FooBox.raise(c,a,b)},this.init=function(b,d){c.element=FooBox.isjQuery(b)?b:a(b),c.options=FooBox.options.merge(c.options,d||{}),FooBox.addons.call(c,"preinit",c.element,c.options),c.items.init(),c.items.array.length>0?(c.element.data("fbx_instance",c),c.options.containerCssClass&&c.element.addClass(c.options.containerCssClass),c.setup.bind(),c.modal.init(b,c.options),FooBox.handlers.call(c,"init",c.element,c.options),c.raise("foobox.initialized"),a.isFunction(c.options.initCallback)&&c.options.initCallback.call(c)):c.destroy()},this.reinit=function(a){c.options=FooBox.options.merge(c.options,a||{}),c.items.init(!0),c.items.array.length>0?(c.setup.bind(),c.modal.reinit(c.options),FooBox.handlers.call(c,"reinit",c.options),c.raise("foobox.reinitialized")):c.destroy()},this.destroy=function(){FooBox.addons.call(c,"destroy"),FooBox.handlers.call(c,"destroy"),c.items.destroy(),c.modal.destroy(),c.element.removeClass("fbx-instance fbx-item").data({fbx_instance:null,fbx_p_instance:null}),c.id==FooBox.instances.length?FooBox.instances.splice(c.id-1,1):FooBox.instances[c.id-1]=null,c.raise("foobox.destroy")},this.setup={bind:function(){a(c.options.externalSelector).off("click.fooboxExternal").on("click.fooboxExternal",function(b){b.preventDefault();var c=a(this).data("foobox"),d=a(c),e=d.data("fbx_instance")||d.data("fbx_p_instance");return d.length>0&&e instanceof FooBox.Instance&&e.modal instanceof FooBox.Modal&&e.modal.show(!0),!1})}},this.items={array:[],indexes:{prev:-1,current:0,next:1,direction:"*",set:function(a){var b=c.items.indexes.current;a=a||0,a=a>c.items.array.length-1?0:0>a?c.items.array.length-1:a;var d=a-1,e=a+1;c.items.indexes.current=a,c.items.indexes.prev=0>d?c.items.array.length-1:d,c.items.indexes.next=e>c.items.array.length-1?0:e,c.items.indexes.direction=c.items.indexes._direction(b,a,c.items.array.length-1)},_direction:function(a,b,c){return 0==b&&a==c?">":b==c&&0==a?"<":b>a?">":a>b?"<":"*"}},new_array:function(b){b=b||!1;var d,e,f,g=0;if(1==b){if(c.items.array.length>0){for(var h=0;h<c.items.array.length;h++)d=c.items.array[h],FooBox.isjQuery(d.element)?0==d.element.parents(":first").length&&(c.items.array.splice(h,1),h-=1):d.option||(c.items.array.splice(h,1),h-=1);for(var i=0;i<c.items.array.length;i++)d=c.items.array[i],FooBox.isjQuery(d.element)?(f=d.element.get(0),f.index=d.index=i):d.index=i}}else c.items.array=[];if(a.isArray(c.options.items))for(var j=0;j<c.options.items.length;j++)if(d=c.options.items[j],-1==c.items.indexOf(d))for(var k=0;k<c.objects.handlers.length;k++)if(c.objects.handlers[k].type==d.type){d.index=g,d.option=!0,d.handler=c.objects.handlers[k],d.handler.defaults(d),e=c.raise("foobox.parseItem",{element:null,item:d}),c.items.array.push(e.fb.item),g++;break}},init:function(b){b=b||!1,c.items.new_array(b);var d,e;if(c.element.is(c.options.selector)&&!c.element.is(c.options.excludes)&&c.items.add(c.element))c.element.off("click.item").on("click.item",c.items.clicked);else if(c.element.is(".foogallery")&&(d=c.element.data("__FooGallery__"))&&d.items&&(e=d.items.all()).length>0){d.filter&&a.isArray(d.filter.items)&&(e=d.filter.items.slice(0));var f=a.map(e,function(a){return a.$anchor?a.$anchor.get(0):null});a(f).not(c.options.excludes).off("click.item").filter(function(){return c.items.add(this)}).on("click.item",c.items.clicked),c.element.on("click.item",".fbx-link",c.items.clicked)}else c.element.find(c.options.selector).not(c.options.excludes).off("click.item").filter(function(){return c.items.add(this)}).on("click.item",c.items.clicked),c.element.on("click.item",".fbx-link",c.items.clicked);c.items.rel()},destroy:function(){c.element.off("click.item",".fbx-link",c.items.clicked);var b,d;for(d=0;d<c.items.array.length;d++)b=c.items.array[d],a.isFunction(b.destroy)&&b.destroy(),FooBox.isjQuery(b.element)&&b.element.off("click.item").removeClass("fbx-link").data("fbx_p_instance",null);c.items.array=[]},rel:function(){var b=c.options.rel||c.element.attr("rel")||(c.items.first(function(a){return FooBox.isjQuery(a.element)?"string"==typeof a.element.attr("rel"):!1})||{element:a()}).element.attr("rel");"string"==typeof b&&a('[rel="'+b+'"]').not(c.options.excludes).not(c.element).off("click.item").filter(function(){return c.items.add(this)}).on("click.item",c.items.clicked)},indexOf:function(a,b){if(!a)return-1;b=b||"url";var d;for(d=0;d<c.items.array.length;d++)if(c.items.array[d][b]==a[b])return d;return-1},is:{first:function(a){return c.items.array&&0!=c.items.array.length?c.items.array[0].index==a.index:!1},last:function(a){return c.items.array&&0!=c.items.array.length?c.items.array[c.items.array.length-1].index==a.index:!1}},add:function(b){b=FooBox.isjQuery(b)?b:a(b);var d=c.items.parse(b,c.items.array.length);if(null===d)return!1;var e=b.get(0),f=c.items.indexOf(d);-1!=f?(d=c.items.array[f],e.index=d.index):e.index=d.index=c.items.array.push(d)-1;var g=b.addClass("fbx-link").data("fbx_p_instance");return g instanceof FooBox.Instance||b.data("fbx_p_instance",c),!0},get:function(b){b=FooBox.isjQuery(b)?b:a(b);var d=null,e=b.get(0).index;return e&&e>0&&e<=c.items.array.length-1&&(d=c.items.array[e]),d},parse:function(b,d){b=FooBox.isjQuery(b)?b:a(b);for(var e,f,g=0;g<c.objects.handlers.length;g++)if(c.objects.handlers[g].handles(b,c.element)){e=c.objects.handlers[g].parse(b),isNaN(d)||(e.index=d),f=c.raise("foobox.parseItem",{element:b,item:e});break}return"undefined"!=typeof f&&f.fb.item?f.fb.item:null},error:function(b){function d(b){var c=this;return c.FooBox=b,c.type="error",c.handles=function(){return!1},c.hasChanged=function(){return!1},c.defaults=function(){},c.parse=function(){},c.load=function(b,d,e,f){try{d.empty().append(b.content),a.isFunction(e)&&e(c.getSize(b))}catch(g){a.isFunction(f)&&f(g)}},c.getSize=function(a){return new FooBox.Size(a.width,a.height)},c}if(c.items.array.length>b&&1==c.items.array[b].error)return c.items.array[b];var e,f,g=FooBox.handlers.get(c,"html"),h=!1;if(null==g&&(g=new d(c)),null!==c.options.error.match(/^#/i)&&a(c.options.error).length>0)e=a(c.options.error),h=!0;else{var i=FooBox.format('<div class="fbx-error-msg" data-width="240" data-height="240"><span></span><p>{0}</p></div>',c.options.error);e=a(i)}return f=new FooBox.Item(g.type,e.get(0),g),f.selector=1==h?c.options.error:null,f.index=b,f.error=!0,f.title=e.data("title")||null,f.description=e.data("description")||null,f.width=e.data("width")||240||null,f.height=e.data("height")||240||null,f.content=1==h?null:e,f.fullscreen=!0,f.handler=g,c.items.array[b]=f,f},first:function(a){for(var b=null,d=0;d<c.items.array.length;d++)if(a(c.items.array[d])){b=c.items.array[d];break}return b},current:function(){return c.items.array[c.items.indexes.current]},prev:function(){return c.items.array[c.items.indexes.prev]},next:function(){return c.items.array[c.items.indexes.next]},multiple:function(){return c.items.array.length>1},clicked:function(a){return a.preventDefault(),c.items.indexes.set(this.index),c.modal.show(!0),!1}},this},FooBox.open=function(b){var c,d=null;if("object"==typeof b){var e=document.createElement("a");a(e).foobox(b),d=a(e).data("fbx_instance")}else"number"==typeof b?c=b:(c=parseInt(b||0),c=isNaN(c)?0:c),c=c>FooBox.instances.length-1?FooBox.instances.length-1:0>c?0:c,d=FooBox.instances[c];return null!=d&&d.modal instanceof FooBox.Modal?(d.modal.show(!0),d):null},FooBox.close=function(){var a,b=[],c=null;for(a=0;a<FooBox.instances.length;a++)c=FooBox.instances[a],null!=c&&c.modal instanceof FooBox.Modal&&FooBox.isjQuery(c.modal.element)&&c.modal.element.hasClass("fbx-show")&&b.push(c);for(a=0;a<b.length;a++)c=b[a],c.modal.close()},FooBox.resize=function(c,d){if(c||d){var e,f,g,h;for(e=0;e<FooBox.instances.length;e++)f=FooBox.instances[e],null!=f&&f.modal instanceof FooBox.Modal&&FooBox.isjQuery(f.modal.element)&&f.modal.element.hasClass("fbx-show")&&(g=f.items.current(),h=new FooBox.Size(c||g.width||0,d||g.height||0),g.width=h.width,g.height=h.height,f.modal.resize(h,f.modal.element.find(".fbx-item-current")))}else a(b).trigger("resize.foobox")},FooBox.lateBind=function(c,d){var e=a.extend(!0,{},FooBox.defaults,d||b.FOOBOX&&FOOBOX.o||{}),f=a(c);f.on("click.foobox",e.selector,function(a){a.preventDefault();var b=f.data("fbx_instance");b||(b=f.foobox(e).data("fbx_instance")),b instanceof FooBox.Instance&&"number"==typeof this.index&&(b.items.indexes.set(this.index),b.modal.show(!0))})}}}(jQuery,window,window.console),function(a,b){var c={images:{noRightClick:!1,attr:"href",overflow:!1,fullscreen:!0,showCaptions:!0,regex:/https?:\/\/.*?\/.*?\.(jpg|jpeg|png|gif|bmp)/i,maxWidth:-1,maxHeight:-1,findUrl:function(a,c){if(!c)return"";if(c.data("image"))return c.data("image");var d=c.attr(a.options.images.attr);return"string"==typeof d?b.qualifiedURL(c.attr(a.options.images.attr)):""}}};b.Item.prototype.image=null,b.Item.prototype.maxWidth=null,b.Item.prototype.maxHeight=null,b.ImageHandler=function(c){this.FooBox=c,this.type="image";var d=this;this.handles=function(a){var b=d.FooBox.options.images.findUrl(d.FooBox,a),c="string"==typeof b&&null!=b.match(d.FooBox.options.images.regex),e=d.FooBox.raise("foobox.handlesImage",{element:a,handle:c});return e.fb.handle},this.defaults=function(a){a.fullscreen=a.fullscreen||d.FooBox.options.images.fullscreen,a.captions=a.captions||d.FooBox.options.images.showCaptions,a.social=a.social||!0,a.overflow=a.overflow||d.FooBox.options.images.overflow,a.proportion=a.proportion||!0,a.maxWidth=a.maxWidth||d.FooBox.options.images.maxWidth,a.maxHeight=a.maxHeight||d.FooBox.options.images.maxHeight},this.parse=function(a){var c=new b.Item(d.type,a,this);return d.defaults(c),c.url=d.FooBox.options.images.findUrl(d.FooBox,a)||null,c.width=b.Size.check(a.data("width")||c.width||null),c.height=b.Size.check(a.data("height")||c.height||null),c.fullscreen="boolean"==typeof a.data("fullscreen")?a.data("fullscreen"):c.fullscreen,c.overflow="boolean"==typeof a.data("overflow")?a.data("overflow"):c.overflow,c.proportion="boolean"==typeof a.data("proportion")?a.data("proportion"):c.proportion,c.maxWidth="number"==typeof a.data("maxWidth")?a.data("maxWidth"):c.maxWidth,c.maxHeight="number"==typeof a.data("maxHeight")?a.data("maxHeight"):c.maxHeight,c.image=null,c.image_url=c.url,c},this.load=function(b,c,e,f){try{var g=function(){var f=a(b.image).addClass("fbx-item fbx-item-image");d.FooBox.options.images.noRightClick&&f.on("contextmenu",function(a){return a.preventDefault(),!1}),c.empty().append(f),a.isFunction(e)&&e(d.getSize(b))};b.image&&null!==b.image?g():(b.image=new Image,b.image.onload=function(){b.image.onload=b.image.onerror=null,b.height=b.image.height,b.width=b.image.width,g()},b.image.onerror=function(){b.image.onload=b.image.onerror=null,b.image=null,a.isFunction(f)&&f("An error occurred attempting to load the image.")},b.image.src=b.url)}catch(h){a.isFunction(f)&&f(h);
|
10 |
-
}},this.preload=function(a){if(1!=a.preloaded){var b=new Image;b.src=a.url,a.preloaded=!0}},this.getSize=function(a){if(null!=a.width&&null!=a.height){if(a.maxWidth>0&&a.maxHeight>0&&(a.width>a.maxWidth||a.height>a.maxHeight)){var c=a.width>a.height?a.maxWidth/a.width:a.maxHeight/a.height;a.width*=c,a.height*=c}return new b.Size(a.width,a.height)}return new b.Size(0,0)},this.hasChanged=function(a){if(b.isjQuery(a.element)){var c=d.FooBox.options.images.findUrl(d.FooBox,a.element);return a.url!=c}return!1}},b.handlers.register(b.ImageHandler,c)}(jQuery,window.FooBox),function(a,b){var c={keyboard:{enabled:!0,preventDefault:!1,stopPropagation:!1}};b.Keyboard=function(a){this.FooBox=a;var c=this;this.preinit=function(a){c.handlers.unbind(!0),a.on({"foobox.initialized foobox.reinitialized":c.handlers.initialized,"foobox.setupHtml":c.handlers.setupHtml})},this.destroy=function(){c.handlers.unbind(!0)},this.handlers={unbind:function(a){a=a||!1,a&&c.FooBox.element.off({"foobox.initialized foobox.reinitialized":c.handlers.initialized,"foobox.setupHtml":c.handlers.setupHtml}),c.FooBox.element.off("foobox.afterLoad",c.handlers.afterLoad),b.isjQuery(c.FooBox.modal.element)&&c.FooBox.modal.element.off("keydown.foobox",c.handlers.onKeydown)},initialized:function(){c.handlers.unbind(),1==c.FooBox.options.keyboard.enabled&&(c.FooBox.element.on("foobox.afterLoad",c.handlers.afterLoad),b.isjQuery(c.FooBox.modal.element)&&c.FooBox.modal.element.on("keydown.foobox",c.handlers.onKeydown))},setupHtml:function(a){a.fb.modal.attr("tabindex",0)},afterLoad:function(a){a.fb.modal.focus()},onKeydown:function(a){var b=c.FooBox.modal,d=c.FooBox.options.keyboard;b.element.hasClass("fbx-show")&&(b.element.hasClass("fbx-fullscreen-mode")||27!==a.which?c.FooBox.items.multiple()&&37===a.which?b.prev():c.FooBox.items.multiple()&&39===a.which&&b.next():b.close(),1==d.preventDefault&&a.preventDefault(),1==d.stopPropagation&&a.stopPropagation(),c.FooBox.raise("foobox.keydown",{keyCode:a.which}))}}},b.addons.register(b.Keyboard,c)}(jQuery,window.FooBox),function(a,b){var c={hideNavOnMobile:!1,resizeTimeout:300,breakpoints:{phone:812,tablet:1366},iosInterval:200};b.BPInfo=function(b){var c=a(window);this.width=c.width(),this.height=c.height(),this.orientation=this.width>this.height?"fbx-landscape":"fbx-portrait";var d,e=null;if(a.isArray(b))for(var f=0;f<b.length;f++)if(d=b[f],d&&d.width&&this.width<=d.width){e=d;break}this.breakpoint=null==e?"fbx-desktop":e.name},b.Responsive=function(c){this.FooBox=c,this.breakpoint={values:[],names:""},this.timers={resize:new b.Timer,ios:new b.Timer};var d=this,e=null;this.preinit=function(a){d.handlers.unbind(!0),a.on("foobox.initialized foobox.reinitialized",d.handlers.initialized)},this.destroy=function(){d.handlers.unbind(!0)},this.handlers={unbind:function(b){b=b||!1,b&&d.FooBox.element.off("foobox.initialized foobox.reinitialized",d.handlers.initialized),a(window).off("resize.foobox",d.handlers.resize),d.FooBox.element.off({"foobox.beforeShow":d.handlers.iosBeforeShow,"foobox.close":d.handlers.iosClose})},initialized:function(){d.handlers.unbind(),d.setup.breakpoints(),d.style(),a(window).on("resize.foobox",d.handlers.resize),b.browser.iOS&&(b.browser.isSafari||b.browser.isChrome)&&d.FooBox.element.on({"foobox.beforeShow":d.handlers.iosBeforeShow,"foobox.close":d.handlers.iosClose})},resize:function(){d.timers.resize.start(function(){d.style();var a=d.FooBox,b=d.FooBox.items.current();if(a.modal.element.has("fbx-show")&&null!=b){var c=b.handler.getSize(b),e=a.modal.element.find(".fbx-item-current");a.modal.resize(c,e,function(){a.modal.triggerFooGalleryLayout(e);var c=b.handler.getSize(b),d=e.height();d!=c.height&&a.modal.resize(c,e,function(){a.modal.triggerFooGalleryLayout(e)})})}},d.FooBox.options.resizeTimeout)},iosBeforeShow:function(){d.timers.ios.start(d.handlers.ios,d.FooBox.options.iosInterval)},iosClose:function(){d.timers.ios.stop()},ios:function(){if(!d.FooBox.modal.element.hasClass("fbx-show"))return void d.timers.ios.start(d.handlers.ios,d.FooBox.options.iosInterval);var a=window.orientation||0,c=window.innerHeight,f=90==a||-90==a,g=0,h=0,i=f?screen.availWidth:screen.availHeight;b.browser.isChrome?(g=i-(f?76:56),h=i-(f?0:20)):b.browser.isSafari&&(g=i-88,h=i-(f?0:19)),(null==e||0==e)&&g>=c?(e=!0,d.iosRedraw()):(null==e||1==e)&&c>=h&&(e=!1,d.iosRedraw()),d.timers.ios.start(d.handlers.ios,d.FooBox.options.iosInterval)}},this.setup={breakpoints:function(){d.breakpoint.values=[],d.breakpoint.names="";for(var a in d.FooBox.options.breakpoints)d.FooBox.options.breakpoints.hasOwnProperty(a)&&(d.breakpoint.values.push({name:d.fixName(a),width:d.FooBox.options.breakpoints[a]}),d.breakpoint.names+=d.fixName(a)+" ");d.breakpoint.values.sort(function(a,b){return a.width-b.width})}},this.iosRedraw=function(){window.scrollTo(0,document.body.scrollTop),a(window).trigger("resize")},this.fixName=function(a){return/^fbx-[a-zA-Z0-9]/.test(a)?a:"fbx-"+a},this.style=function(){var a=new b.BPInfo(d.breakpoint.values),c=d.FooBox.modal.element;c.removeClass(d.breakpoint.names).removeClass("fbx-desktop fbx-landscape fbx-portrait").addClass(a.breakpoint).addClass(a.orientation),d.FooBox.options.hideNavOnMobile===!0?c.addClass("fbx-no-nav"):c.removeClass("fbx-no-nav")}},b.Responsive.metaCheck=function(){var b=a("meta[name=viewport]"),c=b.attr("content");if(b.length>0&&"string"==typeof c){for(var d=c.split(","),e=!1,f=!1,g=0;g<d.length;g++){var h=a.trim(d[g]);"width"==h.substring(0,5)&&-1!==h.indexOf("device-width")?e=!0:"initial-scale"==h.substring(0,13)&&(f=!0)}e&&!f&&(d.push("initial-scale=1"),c=d.join(","),b.attr("content",c))}},b.addons.register(b.Responsive,c),b.Responsive.metaCheck()}(jQuery,window.FooBox),function(a,b){var c={captions:{animation:"slide",enabled:!0,descSource:"find",hoverDelay:300,maxHeight:.4,onlyShowOnHover:!1,onlyShowOnClick:!1,overrideDesc:!1,overrideTitle:!1,prettify:!1,titleSource:"image_find"}};b.Item.prototype.captions=!1,b.Item.prototype.title=null,b.Item.prototype.description=null,b.Item.prototype.caption=null,b.Captions=function(c){this.FooBox=c,this.timers={hover:new b.Timer};var d=this;this.preinit=function(a){d.handlers.unbind(!0),a.on({"foobox.initialized foobox.reinitialized":d.handlers.initialized,"foobox.setupHtml":d.handlers.setupHtml,"foobox.setupOptions":d.handlers.setupOptions,"foobox.parseItem":d.handlers.parseItem,"foobox.onError":d.handlers.onError,"foobox.beforeClose":d.handlers.beforeClose})},this.destroy=function(){d.handlers.unbind(!0)},this.handlers={unbind:function(a){a=a||!1,a&&d.FooBox.element.off({"foobox.initialized foobox.reinitialized":d.handlers.initialized,"foobox.setupHtml":d.handlers.setupHtml,"foobox.setupOptions":d.handlers.setupOptions,"foobox.parseItem":d.handlers.parseItem,"foobox.onError":d.handlers.onError,"foobox.beforeClose":d.handlers.beforeClose}),d.FooBox.element.off({"foobox.beforeLoad":d.handlers.beforeLoad,"foobox.afterLoad":d.handlers.afterLoad}),d.FooBox.modal instanceof b.Modal&&b.isjQuery(d.FooBox.modal.element)&&d.FooBox.modal.element.off("mouseenter.captions mouseleave.captions").find(".fbx-item-current, .fbx-item-next").off("click.captions")},initialized:function(a){d.handlers.unbind(),a.fb.options.captions.enabled===!0&&(a.fb.instance.element.on({"foobox.beforeLoad":d.handlers.beforeLoad,"foobox.afterLoad":d.handlers.afterLoad,"foobox.beforeClose":d.handlers.beforeClose}),-1===a.fb.options.modalClass.indexOf("fbx-caption-toggle-only")&&a.fb.modal.find(".fbx-item-current, .fbx-item-next").on("click.captions",d.handlers.toggleCaptions),a.fb.options.captions.onlyShowOnHover===!0&&a.fb.modal.on("mouseenter.captions",".fbx-inner:not(:has(.fbx-item-error))",d.handlers.mouseenter).on("mouseleave.captions",".fbx-inner:not(:has(.fbx-item-error))",d.handlers.mouseleave))},toggleCaptions:function(b){if(a(b.target).is("img")||a(b.target).is(".fbx-close-caption")||a(b.target).is(".fbx-open-caption")){var c=d.FooBox.items.current(),e=d.FooBox.modal.element;c.captions&&!e.hasClass("fbx-error")&&(b.preventDefault(),e.find(".fbx-caption").is(".fbx-fade-caption, .fbx-slide-caption, .fbx-hide-caption")?(e.removeClass("fbx-captions-hidden"),d.show()):(e.addClass("fbx-captions-hidden"),d.hide()))}},mouseenter:function(){d.timers.hover.start(function(){d.show()},d.FooBox.options.captions.hoverDelay)},mouseleave:function(){d.timers.hover.start(function(){d.hide()},d.FooBox.options.captions.hoverDelay)},setupHtml:function(b){var c=a("<div/>",{"class":"fbx-caption"}),e=a("<a/>",{"class":"fbx-open-caption",html:"…"}).on("click.captions",d.handlers.toggleCaptions);"string"==typeof b.fb.options.modalClass&&-1!=b.fb.options.modalClass.indexOf("fbx-sticky-caption")?b.fb.modal.append(c,e):(b.fb.modal.find(".fbx-stage").append(c),b.fb.modal.find(".fbx-inner").append(e))},setupOptions:function(a){a.fb.modal.find(".fbx-caption").addClass(d.animation())},beforeClose:function(a){1!=a.fb.options.captions.onlyShowOnHover&&a.fb.modal.find(".fbx-caption").addClass("fbx-hide-caption")},beforeLoad:function(a){1!=a.fb.options.captions.onlyShowOnHover&&a.fb.modal.find(".fbx-caption").addClass(d.animation())},afterLoad:function(a){var b=a.fb.item;return!b||b.error||b.captionLoaded||(a.fb.instance.raise("foobox.alterCaption",{element:a.fb.element,item:b}),b.captionLoaded=!0),1==a.fb.options.captions.onlyShowOnHover?void d.update():void(0==a.fb.options.captions.onlyShowOnClick&&d.show())},onError:function(a){a.fb.modal.find(".fbx-caption").addClass(d.animation())},parseItem:function(c){var e=c.fb.options.captions;if(c.fb.item.captions&&0!=e.enabled){var f,g,h="";if(null!=c.fb.element){var i=a(c.fb.element).data("titleSource")||a(c.fb.instance.element).data("titleSource")||e.titleSource,j=a(c.fb.element).data("descSource")||a(c.fb.instance.element).data("descSource")||e.descSource;"none"!=i&&(f=c.fb.element.data("captionTitle")||c.fb.element.data("title")||d.text(c.fb.element,i)),"none"!=j&&(g=c.fb.element.data("captionDesc")||c.fb.element.data("description")||d.text(c.fb.element,j))}else f=c.fb.item.title,g=c.fb.item.description;f=null==f||"undefined"==typeof f?"":f+"",g=null==g||"undefined"==typeof g?"":g+"",f&&f==g&&(g=null),h="string"==typeof f&&f.length>0?b.format('<div class="fbx-caption-title">{0}</div>',f):h,h="string"==typeof g&&g.length>0?h+b.format('<div class="fbx-caption-desc">{0}</div>',g):h,c.fb.item.title=f,c.fb.item.description=g,c.fb.item.caption=h,c.fb.instance.raise("foobox.createCaption",{element:c.fb.element,item:c.fb.item})}}},this.text=function(b,c){var e;switch(c){case"find":e=a.trim(b.data("enviraCaption")||b.data("title")||b.attr("title")||b.find("img:first").data("title")||b.find("img:first").data("alt")||b.find("img:first").attr("title")||b.find("img:first").attr("alt"));break;case"image_find":e=a.trim(b.find("img:first").data("title")||b.find("img:first").data("alt")||b.find("img:first").attr("title")||b.find("img:first").attr("alt"));break;case"image":e=a.trim(b.find("img:first").data("title")||b.find("img:first").attr("title"));break;case"image_alt":e=a.trim(b.find("img:first").data("alt")||b.find("img:first").attr("alt"));break;case"anchor":e=a.trim(b.data("enviraCaption")||b.data("title")||b.attr("title"));break;default:e=null}return d.FooBox.options.captions.prettify&&(e=d.prettifier(e)),e},this.animation=function(){switch(d.FooBox.options.captions.animation){case"fade":return"fbx-fade-caption";case"slide":return"fbx-slide-caption";default:return"fbx-hide-caption"}},this.hide=function(){var a=d.FooBox.items.current(),b=d.FooBox.modal.element.find(".fbx-caption");return d.FooBox.options.captions.enabled&&a.captions&&"string"==typeof a.caption&&0!=a.caption.length?(b.addClass(d.animation()),void d.FooBox.raise("foobox.captionsHide",{item:a})):void b.addClass("fbx-hide-caption")},this.show=function(){var a=d.FooBox,c=a.items.current(),e=a.modal.element.find(".fbx-caption");return!a.options.captions.enabled||!c.captions||"string"!=typeof c.caption||0==c.caption.length||a.modal.element.hasClass("fbx-captions-hidden")||b.isjQuery(c.element)&&c.element.hasClass("no-captions")?void e.addClass("fbx-hide-caption"):(d.update(),e.removeClass("fbx-fade-caption fbx-slide-caption fbx-hide-caption"),void d.FooBox.raise("foobox.captionsShow",{item:c}))},this.update=function(){var c=d.FooBox.items.current(),e=d.FooBox.modal.element.find(".fbx-caption");e.html(c.caption).find('a[href^="#"]').filter(function(){var c=a(this).attr("href"),d=a(c),e=d.data("fbx_instance")||d.data("fbx_p_instance");return d.length>0&&e instanceof b.Instance?(a(this).data("hrefTarget",d.get(0)),!0):!1}).off("click.captions").on("click.captions",function(c){c.preventDefault();var e=a(this).data("hrefTarget"),f=a(e).data("fbx_instance")||a(e).data("fbx_p_instance");return f instanceof b.Instance&&(d.FooBox.modal.close(),f.items.indexes.set(e.index),f.modal.show()),!1}),a("<a/>",{"class":"fbx-close-caption",html:"×"}).on("click.captions",d.handlers.toggleCaptions).prependTo(e)},this.prettifier=function(a){return"string"!=typeof a?null:(a=a.replace(/\s*-\d+/g,"").replace(/\s*_\d+/g,"").replace(/-/g," ").replace(/_/g," "),a=a.replace(/\w\S*/g,function(a){return-1!=a.indexOf("#")?a:a.charAt(0).toUpperCase()+a.substr(1).toLowerCase()}))}},b.addons.register(b.Captions,c)}(jQuery,window.FooBox),function(a,b){var c={wordpress:{enabled:!1}};b.Wordpress=function(c){this.FooBox=c;var d=this;this.preinit=function(a){d.handlers.unbind(!0),a.on("foobox.createCaption",d.handlers.onCreateCaption)},this.destroy=function(){d.handlers.unbind(!0)},this.handlers={unbind:function(a){a=a||!1,a&&d.FooBox.element.off("foobox.createCaption",d.handlers.onCreateCaption)},onCreateCaption:function(c){var d=c.fb.options,e=c.fb.instance.element,f=c.fb.item.element,g="",h=c.fb.item.title,i=c.fb.item.description;if(1==d.wordpress.enabled&&b.isjQuery(f)){var j=f.data("captionTitle")||f.data("title"),k=f.data("captionDesc")||f.data("description");if(e.hasClass("gallery"))d.captions.overrideTitle===!1&&(h=j||f.parents(".gallery-item:first").find(".wp-caption-text:first").html()||f.parents(".gallery-item:first").find(".gallery-caption:first").html()||h||""),d.captions.overrideDesc===!1&&(i=k||f.find("img").attr("alt")||i||"");else if(e.hasClass("wp-caption")||f.hasClass("wp-caption"))d.captions.overrideTitle===!1&&(h=j||f.find("img").attr("title")||f.parents(".wp-caption:first").find(".wp-caption-text:first").html()||h||""),d.captions.overrideDesc===!1&&(i=k||f.find("img").attr("alt")||i||"");else if(f.parents(".wp-caption:first").length>0)d.captions.overrideTitle===!1&&(h=j||f.parents(".wp-caption:first").find("img").attr("title")||f.parents(".wp-caption:first").find(".wp-caption-text:first").html()||h||""),d.captions.overrideDesc===!1&&(i=k||f.parents(".wp-caption:first").find("img").attr("alt")||i||"");else if(e.hasClass("tiled-gallery"))d.captions.overrideTitle===!1&&(h=j||f.parents(".tiled-gallery-item:first").find(".tiled-gallery-caption").html()||f.find("img").data("image-title")||f.find("img").attr("title")||h||""),d.captions.overrideDesc===!1&&(i=k||a.trim(f.find("img").data("image-description")).replace(/(^<p>)|(<\/p>$)/gi,"")||i||"");else{if(!e.hasClass("wp-block-gallery")&&!e.hasClass("wp-block-image"))return;d.captions.overrideTitle===!1&&(h=j||f.parents("figure:first").find("figcaption").html()||h||""),d.captions.overrideDesc===!1&&(i=k||i||"")}h+="",i+="",h=h||"",i=i||"";var l=a("<div/>"),m=l.html(h).text(),n=l.html(i).text();(a.trim(h)==a.trim(i)||m==n)&&(i=null),g="string"==typeof h&&h.length>0?b.format('<div class="fbx-caption-title">{0}</div>',h):g,g="string"==typeof i&&i.length>0?g+b.format('<div class="fbx-caption-desc">{0}</div>',i):g,c.fb.item.title=h,c.fb.item.description=i,c.fb.item.caption=g}}}},b.addons.register(b.Wordpress,c)}(jQuery,window.FooBox),function(a,b){var c={pan:{enabled:!0,showOverview:!0,position:"fbx-top-right"}};b.Pan=function(c){this.FooBox=c;var d,e,f,g,h=this,i=!1,j=!1,k=null,l=null,m=null,n=null,o=null,p=0;this.preinit=function(a){h.handlers.unbind(!0),a.on({"foobox.initialized foobox.reinitialized":h.handlers.initialized})},this.destroy=function(){h.handlers.unbind(!0)},this.setOverview=function(){var a=parseInt(n.css("max-width")),b=parseInt(n.css("max-height")),c=a/k.width,d=b/k.height;p=c>d?d:c;var e=k.width*p,f=k.height*p;n.width(e).height(f).css("background-image","url("+k.url+")")},this.setViewport=function(){var a=m.width(),b=m.height(),c=a*p,d=b*p;o.width(c).height(d)},this.disableCaptionImageClick=function(){var a=h.FooBox.modal.element,c=b.objects.get("addons",h.FooBox,function(a){return a instanceof b.Captions});c&&a.find(".fbx-item-current, .fbx-item-next").off("click.captions",c.handlers.toggleCaptions)},this.enableCaptionImageClick=function(){var a=h.FooBox.modal.element,c=b.objects.get("addons",h.FooBox,function(a){return a instanceof b.Captions});c&&a.find(".fbx-item-current, .fbx-item-next").on("click.captions",c.handlers.toggleCaptions)},this.handlers={unbind:function(a){a=a||!1,a&&h.FooBox.element.off({"foobox.initialized foobox.reinitialized":h.handlers.initialized}),h.FooBox.element.off({"foobox.afterLoad":h.handlers.onAfterLoad,"foobox.showOverflow":h.handlers.onShowOverflow,"foobox.hideOverflow foobox.beforeLoad":h.handlers.onHideOverflow}),h.FooBox.modal instanceof b.Modal&&b.isjQuery(h.FooBox.modal.element)&&h.FooBox.modal.element.find(".fbx-stage").off({mousedown:h.handlers.onMouseDown,mousemove:h.handlers.onMouseMove,mouseup:h.handlers.onMouseUp}).removeClass("fbx-pannable fbx-panning")},initialized:function(a){h.handlers.unbind(),a.fb.options.pan.enabled===!0&&h.FooBox.element.on({"foobox.close":h.handlers.onMouseUp,"foobox.afterLoad":h.handlers.onAfterLoad,"foobox.showOverflow":h.handlers.onShowOverflow,"foobox.hideOverflow foobox.beforeLoad":h.handlers.onHideOverflow})},onAfterLoad:function(a){i===!0&&"image"==a.fb.item.handler.type&&(h.setOverview(),h.setViewport())},onShowOverflow:function(b){"image"==b.fb.item.handler.type&&(i===!0?(h.setOverview(),h.setViewport()):(i=!0,h.disableCaptionImageClick(),k=b.fb.item,m=h.FooBox.modal.element.addClass("fbx-pannable-item").find(".fbx-stage").on({mousedown:h.handlers.onMouseDown,mousemove:h.handlers.onMouseMove,"mouseup mouseleave":h.handlers.onMouseUp}).addClass("fbx-pannable"),l=b.fb.container,b.fb.options.pan.showOverview===!0&&(n=a("<div/>",{"class":"fbx-pan-overview"}).addClass(b.fb.options.pan.position).on("click",h.handlers.onOverviewClick).appendTo(m),o=a("<div/>",{"class":"fbx-pan-viewport"}).appendTo(n),l.on("scroll",h.handlers.onScroll),h.setOverview(),h.setViewport())))},onHideOverflow:function(a){i===!0&&(i=!1,h.enableCaptionImageClick(),a.fb.options.pan.showOverview===!0&&n.remove(),l.off("scroll",h.handlers.onScroll),m.off({mousedown:h.handlers.onMouseDown,mousemove:h.handlers.onMouseMove,"mouseup mouseleave":h.handlers.onMouseUp}).removeClass("fbx-pannable fbx-panning"),h.FooBox.modal.element.removeClass("fbx-pannable-item"))},onMouseDown:function(a){if(i===!0){a.preventDefault(),m.addClass("fbx-panning");var b=l.get(0);j=!0,d=a.pageX,e=a.pageY,f=b.scrollLeft,g=b.scrollTop}},onMouseMove:function(a){if(j===!0&&i===!0){var b=l.get(0);b.scrollLeft=f-(a.pageX-d),b.scrollTop=g-(a.pageY-e)}},onMouseUp:function(){i===!0&&(j=!1,m.removeClass("fbx-panning"),d=0,e=0,f=0,g=0)},onScroll:function(){var a=l.get(0),b=a.scrollTop/k.height*100,c=a.scrollLeft/k.width*100;o.css({top:b+"%",left:c+"%"})},onOverviewClick:function(b){var c=a(this).offset(),d=(b.pageX-c.left)/p,e=(b.pageY-c.top)/p,f=d-l.width()/2,g=e-l.height()/2;l.animate({scrollTop:g,scrollLeft:f},300)}}},b.addons.register(b.Pan,c)}(jQuery,window.FooBox),function(a,b){var c={swipe:{enabled:!0,min:80}};b.Swipe=function(a){this.FooBox=a,this.isMoving=!1;var c,d=this;this.preinit=function(a){d.handlers.unbind(!0),a.on("foobox.initialized foobox.reinitialized",d.handlers.initialized)},this.destroy=function(){d.handlers.unbind(!0)},this.handlers={unbind:function(a){a=a||!1,a&&d.FooBox.element.off("foobox.initialized foobox.reinitialized",d.handlers.initialized),d.FooBox.modal instanceof b.Modal&&b.isjQuery(d.FooBox.modal.element)&&d.FooBox.modal.element.off({touchstart:d.handlers.onTouchStart,touchmove:d.handlers.onTouchMove})},initialized:function(a){d.handlers.unbind(),a.fb.options.swipe.enabled===!0&&a.fb.modal.on("touchstart",d.handlers.onTouchStart)},onTouchStart:function(a){var b=a.originalEvent.touches||a.touches;1==b.length&&d.FooBox.items.multiple()&&(c=b[0].pageX,d.isMoving=!0,d.FooBox.modal.element.on("touchmove",d.handlers.onTouchMove))},onTouchMove:function(a){if(d.isMoving){var b=a.originalEvent.touches||a.touches,e=b[0].pageX,f=c-e;Math.abs(f)>=d.FooBox.options.swipe.min&&(d.cancelTouch(),f>0?(d.FooBox.raise("foobox.swipeRight"),d.FooBox.modal.next()):(d.FooBox.raise("foobox.swipeLeft"),d.FooBox.modal.prev()))}}},this.cancelTouch=function(){d.FooBox.modal.element.off("touchmove",d.handlers.onTouchMove),c=null,d.isMoving=!1}},b.addons.register(b.Swipe,c)}(jQuery,window.FooBox);
|
6 |
* @license Released under the MIT license.
|
7 |
* You are free to use FooBox jQuery in personal projects as long as this copyright header is left intact.
|
8 |
*/
|
9 |
+
!function(a,b,c,undefined){if(a&&b){b.FooBox={defaults:{affiliate:{enabled:!0,prefix:"Powered by ",url:"http://fooplugins.com/plugins/foobox/"},alwaysInit:!1,closeOnOverlayClick:!0,containerCssClass:"fbx-instance",countMessage:"item %index of %total",error:"Could not load the item",excludes:".fbx-link, .nofoobox",externalSelector:"a[data-foobox],input[data-foobox]",fitToScreen:!1,hideScrollbars:!0,loadDelay:0,loaderTimeout:600,modalClass:"",preload:!1,rel:null,resizeSpeed:300,selector:"a",showButtons:!0,showCount:!0,style:"fbx-rounded",theme:"fbx-light",transitionInSpeed:200,transitionOutSpeed:200,initCallback:null,loop:!0},version:"2.0.10",instances:[],ready:function(b){(Function("/*@cc_on return true@*/")()?"complete"===document.readyState:"loading"!==document.readyState)?b(a):setTimeout(function(){FooBox.ready(b)},1)}},FooBox.$=a,FooBox.format=function(a,b,c){var d,e,f=arguments[0];for(d=0;d<arguments.length-1;d++)e=new RegExp("\\{"+d+"\\}","gm"),f=f.replace(e,arguments[d+1]);return f},FooBox.browser={isIE:!1,isChrome:!1,isSafari:!1,isLtSafari10:!1,version:0,css:"",iOS:!1,Mac:!1,isMobile:function(a){return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))}(navigator.userAgent||navigator.vendor||b.opera),check:function(){var a=navigator.appVersion.toLowerCase(),c=navigator.userAgent.toLowerCase(),d=navigator.platform;FooBox.browser.iOS=/(iPad|iPhone|iPod)/g.test(d),1==FooBox.browser.iOS&&(FooBox.browser.css+=" fbx-ios"),FooBox.browser.Mac=/(Mac)/g.test(d),1==FooBox.browser.Mac&&(FooBox.browser.css+=" fbx-mac"),FooBox.browser.isChrome=a.indexOf("chrome")>-1||a.indexOf("crios")>-1,FooBox.browser.isChrome&&(FooBox.browser.css+=" fbx-chrome"),FooBox.browser.isSafari=a.indexOf("safari")>-1&&!FooBox.browser.isChrome,FooBox.browser.isSafari&&(FooBox.browser.css+=" fbx-safari",FooBox.browser.isLtSafari10=/constructor/i.test(b.HTMLElement)),FooBox.browser.isFirefox=c.indexOf("firefox")>-1,FooBox.browser.isFirefox&&(FooBox.browser.css+=" fbx-firefox");var e=c.indexOf("msie "),f=c.indexOf("trident/"),g=c.indexOf("edge/");if(FooBox.browser.isIE=e>-1||f>-1||g>-1,FooBox.browser.isIE){if(e>-1)FooBox.browser.version=parseInt(c.substring(e+5,c.indexOf(".",e)),10);else if(f>-1){var h=c.indexOf("rv:");FooBox.browser.version=parseInt(c.substring(h+3,c.indexOf(".",h)),10)}else g>-1&&(FooBox.browser.version=parseInt(c.substring(g+5,c.indexOf(".",g)),10));FooBox.browser.css=FooBox.format("fbx-ie fbx-ie{0}",FooBox.browser.version)}},supportsTransitions:function(){var a,b=document.body||document.documentElement,c=b.style,d="transition";if("string"==typeof c[d])return!0;a=["Moz","Webkit","Khtml","O","ms"],d=d.charAt(0).toUpperCase()+d.substr(1);for(var e=0;e<a.length;e++)if("string"==typeof c[a[e]+d])return!0;return!1},transitionEnd:function(){var a,b=document.createElement("fakeelement"),c={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(a in c)if(c.hasOwnProperty(a)&&b.style[a]!==undefined)return c[a];return null}},FooBox.browser.check(),FooBox.qualifiedURL=function(a){var b=document.createElement("a");return b.href=a,b.href},c||(c={}),c.log=c.log||function(){},c.warn=c.warn||function(){},c.error=c.error||function(){},c.info=c.info||function(){};var d={write:function(){c.log(FooBox.format.apply(d,arguments))},error:function(){1===arguments.length&&arguments[0]instanceof Error?c.error(arguments[0]):c.error(FooBox.format.apply(d,arguments))}};jQuery.Event.prototype.fb={instance:null,modal:null,options:null},FooBox.raise=function(b,c,d){d=d||{};var e=a.Event(c);return e.fb={},e.fb.instance=b,e.fb.modal=b.modal.element,e.fb.options=b.options,a.extend(!0,e.fb,d),b.element.one(c,function(a){a.stopPropagation()}).trigger(e),e},FooBox.isjQuery=function(a){return a instanceof jQuery?!0:a&&a.jquery},FooBox.options={isMultipart:function(a,b){return"string"==typeof a&&a.length>0&&-1!==a.indexOf(b)},hasProperties:function(a){if("object"!=typeof a)return!1;var b;for(b in a)if(a.hasOwnProperty(b))return!0;return!1},get:function(a,b){if(FooBox.options.isMultipart(b,".")){var c=b.substring(0,b.indexOf(".")),d=b.substring(b.indexOf(".")+1);return a[c]=a[c]||{},FooBox.options.get(a[c],d)}return a[b]},set:function(a,b,c){if(FooBox.options.isMultipart(b,".")){var d=b.substring(0,b.indexOf(".")),e=b.substring(b.indexOf(".")+1);a[d]=a[d]||{},FooBox.options.set(a[d],e,c)}else a[b]=c},merge:function(a,b,c){var d,e=Array.prototype.slice.call(arguments);for(a=e.shift(),b=e.shift(),FooBox.options._merge(a,b),d=0;d<e.length;d++)c=e[d],FooBox.options._merge(a,c);return a},_merge:function(b,c){var d;for(d in c)c.hasOwnProperty(d)&&(FooBox.options.hasProperties(c[d])&&!a.isArray(c[d])?(b[d]=b[d]||{},FooBox.options._merge(b[d],c[d])):a.isArray(c[d])?(b[d]=[],a.extend(!0,b[d],c[d])):b[d]=c[d])}},FooBox.objects={registered:{},ensure:function(a){return FooBox.objects.registered[a]=FooBox.objects.registered[a]||[]},register:function(b,c,d){var e=FooBox.objects.ensure(b);return e.push(c),"object"==typeof d&&a.extend(!0,FooBox.defaults,d),!0},load:function(a,b){var c,e,f=[],g=FooBox.objects.ensure(a);for(e=0;e<g.length;e++)try{c=g[e],f.push(new c(b))}catch(h){d.error(h)}b.objects=b.objects||{},b.objects[a]=f},call:function(b,c,e,f,g){var h,i=Array.prototype.slice.call(arguments);b=i.shift(),c=i.shift(),e=i.shift();for(var j=c.objects[b]||[],k=0;k<j.length;k++)try{if(h=j[k],!a.isFunction(h[e]))continue;h[e].apply(h,i)}catch(l){d.error(l)}},get:function(b,c,d){var e,f=c.objects[b];if(!f||!a.isFunction(d))return null;for(e=0;e<f.length;e++)if(d(f[e]))return f[e];return null}},FooBox.addons={_ns:"addons",validate:function(b){return a.isFunction(b)?!0:(d.error('Expected type "function", received type "{0}".',typeof b),!1)},register:function(a,b){return FooBox.addons.validate(a)?FooBox.objects.register(FooBox.addons._ns,a,b):(d.error("Failed to register the addon."),!1)},load:function(a){FooBox.objects.load(FooBox.addons._ns,a)},call:function(a,b,c,d){var e=Array.prototype.slice.call(arguments);e.unshift(FooBox.addons._ns),FooBox.objects.call.apply(this,e)}},FooBox.handlers={_ns:"handlers",validate:function(b){if(!a.isFunction(b))return d.error('Expected type "function", received type "{0}".',typeof b),!1;var c=new b;return a.isFunction(c.handles)?a.isFunction(c.defaults)?a.isFunction(c.parse)?a.isFunction(c.load)?a.isFunction(c.getSize)?a.isFunction(c.hasChanged)?a.isFunction(c.preload)?!0:(d.error('The required "preload" method is not implemented.'),!1):(d.error('The required "hasChanged" method is not implemented.'),!1):(d.error('The required "getSize" method is not implemented.'),!1):(d.error('The required "load" method is not implemented.'),!1):(d.error('The required "parse" method is not implemented.'),!1):(d.error('The required "defaults" method is not implemented.'),!1):(d.error('The required "handles" method is not implemented.'),!1)},register:function(a,b){return FooBox.handlers.validate(a)?FooBox.objects.register(FooBox.handlers._ns,a,b):(d.error("Failed to register the handler."),!1)},load:function(a){FooBox.objects.load(FooBox.handlers._ns,a)},call:function(a,b,c,d){var e=Array.prototype.slice.call(arguments);e.unshift(FooBox.handlers._ns),FooBox.objects.call.apply(this,e)},get:function(a,b){return FooBox.objects.get(FooBox.handlers._ns,a,function(a){return a.type==b})}},FooBox.Item=function(b,c,d){return this.type=b,this.element=FooBox.isjQuery(c)?c:a(c),this.handler=d,this.width=null,this.height=null,this.url=null,this.overflow=!1,this.preloaded=!1,this.proportion=!1,this.error=!1,this},FooBox.Size=function(a,b){return this.width="number"==typeof a?a:parseInt(a,0),this.height="number"==typeof b?b:parseInt(b,0),this.equalTo=function(a){return this.width==a.width&&this.height==a.height},this},FooBox.Size.check=function(a){return"number"==typeof a?a:isNaN(parseInt(a))?null:parseInt(a)},FooBox.Timer=function(){this.id=null,this.busy=!1;var a=this;return this.start=function(b,c,d){d=d||b,a.stop(),a.id=setTimeout(function(){b.call(d),a.id=null,a.busy=!1},c),a.busy=!0},this.stop=function(){null!==a.id&&a.busy!==!1&&(clearTimeout(a.id),a.id=null,a.busy=!1)},this},a.fn.foobox=function(b){return b=b||{},this.each(function(){var c=a(this),d=c.data("fbx_instance"),e=c.data("__FooGallery__");if(d instanceof FooBox.Instance)if(1==d.options.alwaysInit||e){var f=d.options;f.alwaysInit=!0,d.destroy(),d=new FooBox.Instance(d.id),d.init(this,a.extend(!0,f,b))}else d.reinit(b);else{if(d=a(this).data("fbx_p_instance"),d instanceof FooBox.Instance)return;d=new FooBox.Instance,d.init(this,b)}})},FooBox.Modal=function(c){this.FooBox=c,this.element=null,this.loaderTimeout=new FooBox.Timer,this._first=!1,this._busy=!1,this._closed=!1;var e=this;return this.init=function(a,b){e.setup.html(),e.setup.options(b),e.setup.bind()},this.reinit=function(a){e.setup.options(a)},this.destroy=function(){FooBox.isjQuery(e.element)&&e.element.remove()},this.setup={html:function(){if(!FooBox.isjQuery(e.element)){e.element=a('<div class="fbx-modal"></div>'),e.element.append('<div class="fbx-inner-spacer"></div>');var b=a('<div class="fbx-stage"></div>');b.append('<div class="fbx-item-current"></div>'),b.append('<div class="fbx-item-next"></div>');var c=a('<div class="fbx-inner fbx-inner-shadow"></div>');c.append(b),c.append('<a class="fbx-prev fbx-btn-transition fbx-btn-shadow"></a>'),c.append('<div class="fbx-credit"><a target="_blank" href=""><em></em><span> FooBox</span></a></div>'),c.append('<span class="fbx-count" />'),c.append('<a class="fbx-next fbx-btn-transition fbx-btn-shadow"></a>'),c.append('<a class="fbx-close fbx-btn-transition fbx-btn-shadow"></a>'),e.element.append('<div class="fbx-loader"><div></div></div>'),e.element.append(c),e.FooBox.raise("foobox.setupHtml"),a("body").append(e.element)}},options:function(a){var b;e.element.removeClass().addClass("fbx-modal").addClass(FooBox.format("fbx-{0}",e.FooBox.id)).addClass(e.FooBox.element.data("style")||a.style).addClass(e.FooBox.element.data("theme")||a.theme).addClass(e.FooBox.element.data("modal-class")).addClass(a.modalClass).data("fbx_instance",e.FooBox),e.element.addClass(FooBox.browser.css),b=a.affiliate.enabled?"":"none",e.element.find(".fbx-credit").css("display",b),a.affiliate.enabled&&(e.element.find(".fbx-credit > a").attr("href",a.affiliate.url),e.element.find(".fbx-credit > a > em").text(a.affiliate.prefix)),b=a.showCount&&e.FooBox.items.multiple()?"":"none",e.element.find(".fbx-count").css("display",b),a.showButtons&&e.FooBox.items.multiple()||e.element.addClass("fbx-no-buttons"),e.FooBox.raise("foobox.setupOptions")},bind:function(){1==e.FooBox.options.closeOnOverlayClick&&e.element.off("click.foobox").on("click.foobox",function(b){1==e.FooBox.options.closeOnOverlayClick&&a(b.target).is(".fbx-modal")&&e.close()}),e.element.find(".fbx-close").off("click.foobox").on("click.foobox",function(a){a.preventDefault(),a.stopPropagation(),e.close()}).end().find(".fbx-prev").off("click.foobox").on("click.foobox",function(b){b.preventDefault(),b.stopPropagation(),a(this).hasClass("fbx-disabled")||e.prev()}).end().find(".fbx-next").off("click.foobox").on("click.foobox",function(b){b.preventDefault(),b.stopPropagation(),a(this).hasClass("fbx-disabled")||e.next()})}},this.prioritize=function(){FooBox.instances.length>1&&e.element.nextAll(".fbx-modal:last").after(e.element)},this.preload=function(){if(1==e.FooBox.options.preload){var a=e.FooBox.items.prev();a&&a.handler.preload(a);var b=e.FooBox.items.next();b&&b.handler.preload(b)}},this.show=function(b){function c(a){if(e.loaderTimeout.stop(),e.element.removeClass("fbx-loading"),e._busy=!1,d.error(a),!e.FooBox.raise("foobox.onError",{error:a}).isDefaultPrevented()){var c=e.FooBox.items.error(f.index);null!=c&&e.show(b)}}var f=e.FooBox.items.current();if(f){b=b||!1,e._first=b,e._busy=!0,e._closed=!1,a("body").addClass("fbx-active"),e.FooBox.options.hideScrollbars&&a("html").addClass("fbx-no-scroll"),1==f.error?e.element.addClass("fbx-error"):e.element.removeClass("fbx-error"),e.element.hasClass("fbx-show")||(e.prioritize(),e.element.addClass("fbx-loading").find(".fbx-inner").css({width:"100px",height:"100px","margin-top":"-50px","margin-left":"-50px"}));var g=e.element.find(".fbx-item-current"),h=e.element.find(".fbx-item-next");if(h.hide().css("opacity","0"),e.element.find(".fbx-count").text(e.FooBox.options.countMessage.replace("%index",""+(e.FooBox.items.indexes.current+1)).replace("%total",""+e.FooBox.items.array.length)),e.FooBox.raise("foobox.beforeLoad",{item:f}).isDefaultPrevented())return void(e._busy=!1);if(f.handler.hasChanged(f)){var i=f.index,j=f.element.get(0);f=f.handler.parse(f.element);var k=e.FooBox.raise("foobox.parseItem",{element:f.element,item:f});j.index=k.fb.item.index=i,e.FooBox.items.array[i]=k.fb.item}e.preload(),e.loaderTimeout.start(function(){e.element.addClass("fbx-loading")},e.FooBox.options.loaderTimeout),setTimeout(function(){e.checkForLoop(f),f.handler.load(f,h,function(a){return 1==e._closed?void(e._busy=!1):void e.transitionOut(g,function(){return 1==e._closed?void(e._busy=!1):void e.resize(a,h,function(){return 1==e._closed?void(e._busy=!1):(e.loaderTimeout.stop(),h.show(),void e.transitionIn(h,function(){return 1==e._closed?void(e._busy=!1):(h.add(g).toggleClass("fbx-item-next fbx-item-current"),g.empty(),void(e.element.hasClass("fbx-show")?(e.element.removeClass("fbx-loading"),e.FooBox.raise("foobox.afterLoad",{item:f}),e.triggerFooGalleryLayout(h),e._busy=!1):e.FooBox.raise("foobox.beforeShow",{item:f}).isDefaultPrevented()||(e.element.removeClass("fbx-loading").addClass("fbx-show"),e.FooBox.raise("foobox.afterShow",{item:f}),e.FooBox.raise("foobox.afterLoad",{item:f}),e.triggerFooGalleryLayout(h),e._busy=!1)))},c))},c)},c)},c)},e.FooBox.options.loadDelay)}},this.triggerFooGalleryLayout=function(c){b.FooGallery&&c.find(".foogallery").each(function(){var b=a(this).data("__FooGallery__");b&&b.initialized&&b.layout()})},this.checkForLoop=function(a){1!=e.FooBox.options.loop&&(e.element.find(".fbx-prev, .fbx-next").removeClass("fbx-disabled"),e.FooBox.items.is.first(a)&&e.element.find(".fbx-prev").addClass("fbx-disabled"),e.FooBox.items.is.last(a)&&e.element.find(".fbx-next").addClass("fbx-disabled"))},this.resize=function(b,c,d,f){try{if(0===b.width||0===b.height)return void(a.isFunction(f)&&f(FooBox.format("Invalid size supplied. Width = {0}, Height = {1}",b.width,b.height)));var g=e.FooBox.items.current(),h=new FooBox.Size(b.width,b.height),i=e.element.find(".fbx-inner"),j=e.element.find(".fbx-inner-spacer"),k=parseInt(j.css("padding-top"),0),l=parseInt(j.css("padding-bottom"),0),m=parseInt(j.css("padding-left"),0),n=parseInt(j.css("padding-right"),0),o=parseInt(i.css("border-top-width"),0),p=parseInt(i.css("border-bottom-width"),0),q=parseInt(i.css("border-left-width"),0),r=parseInt(i.css("border-right-width"),0),s=parseInt(i.css("padding-left"),0),t=k+l+2*s+o+p,u=m+n+2*s+q+r,v=new FooBox.Size(parseInt(i.css("width"),0),parseInt(i.css("height"),0)),w=new FooBox.Size(e.element.width()-u,e.element.height()-t),x=w.width/b.width;b.height*x>w.height&&(x=w.height/b.height),e.FooBox.options.fitToScreen===!0||1==g.proportion&&(b.height>w.height||b.width>w.width)?(b.height=Math.floor(b.height*x),b.width=Math.floor(b.width*x)):0==g.proportion&&(b.height>w.height&&(b.height=w.height),b.width>w.width&&(b.width=w.width)),b.height<100&&(b.height=100),b.width<100&&(b.width=100);var y=-(b.height/2+s+(p+o)/2+l/2-k/2),z=-(b.width/2+s+(r+q)/2+n/2-m/2);if(v.equalTo(b))i.css({height:b.height,width:b.width,"margin-top":y,"margin-left":z}),e.overflow(g,h,b,c),e.FooBox.raise("foobox.afterResize",{item:g,size:b}),a.isFunction(d)&&d();else if(!e.FooBox.raise("foobox.beforeResize",{item:g,size:b,offset:{top:y,left:z},error:f,success:d}).isDefaultPrevented())if(y=-(b.height/2+s+(p+o)/2+l/2-k/2),z=-(b.width/2+s+(r+q)/2+n/2-m/2),e.element.hasClass("fbx-show"))if(FooBox.browser.supportsTransitions()){var A=e.FooBox.options.resizeSpeed/1e3,B="all "+A+"s ease-in-out";i.css({WebkitTransition:B,MozTransition:B,MsTransition:B,OTransition:B,transition:B}),i.css({height:b.height,width:b.width,"margin-top":y,"margin-left":z}),setTimeout(function(){i.css({WebkitTransition:"",MozTransition:"",MsTransition:"",OTransition:"",transition:""}),e.overflow(g,h,b,c),e.FooBox.raise("foobox.afterResize",{item:g,size:b}),a.isFunction(d)&&d(b)},e.FooBox.options.resizeSpeed)}else i.animate({height:b.height,width:b.width,"margin-top":y,"margin-left":z},e.FooBox.options.resizeSpeed,function(){e.overflow(g,h,b,c),e.FooBox.raise("foobox.afterResize",{item:g,size:b}),a.isFunction(d)&&d(b)});else i.css({height:b.height,width:b.width,"margin-top":y,"margin-left":z}),e.overflow(g,h,b,c),e.FooBox.raise("foobox.afterResize",{item:g,size:b}),a.isFunction(d)&&d()}catch(C){a.isFunction(f)&&f(C)}},this.overflow=function(a,b,c,d){var f=d.find(".fbx-item");1==a.overflow&&(c.width<.8*b.width||c.height<.8*b.height)||1==a.overflow&&0==a.proportion&&(c.width<b.width||c.height<b.height)||1==a.overflow&&"html"==a.type?("html"==a.type?(f.css({width:"100%",height:"auto",overflow:""}),d.css("overflow","auto")):(f.css({width:b.width,height:b.height,overflow:""}),d.css({"overflow-x":b.width<=c.width?"hidden":"","overflow-y":b.height<=c.height?"hidden":""})),e.FooBox.raise("foobox.showOverflow",{item:a,container:d})):(f.css({width:"",height:"",overflow:"hidden"}),d.css({"overflow-x":"","overflow-y":"",overflow:"hidden"}),e.FooBox.raise("foobox.hideOverflow",{item:a,container:d}))},this.transitionOut=function(b,c,d){try{if(!e.element.hasClass("fbx-show"))return void(a.isFunction(c)&&c());b.animate({opacity:0},b.is(":visible")?e.FooBox.options.transitionOutSpeed:0,function(){a.isFunction(c)&&c()})}catch(f){a.isFunction(d)&&d(f)}},this.transitionIn=function(b,c,d){try{if(!e.element.hasClass("fbx-show"))return b.css({opacity:1}),void(a.isFunction(c)&&c());b.animate({opacity:1},e.FooBox.options.transitionInSpeed,function(){a.isFunction(c)&&c()})}catch(f){a.isFunction(d)&&d(f)}},this.close=function(){e.FooBox.raise("foobox.beforeClose").isDefaultPrevented()||(e._closed=!0,e._busy=!1,e.element.removeClass("fbx-loading fbx-show"),a("body").removeClass("fbx-active"),e.FooBox.raise("foobox.close"),e.element.find(".fbx-item-current, .fbx-item-next").empty(),a("html").removeClass("fbx-no-scroll"),e.FooBox.raise("foobox.afterClose"))},this.prev=function(a){if(1!=e._busy){if(e.FooBox.items.indexes.set(e.FooBox.items.indexes.prev),"string"==typeof a)for(var b=e.FooBox.items.current();b.type!=a;)e.FooBox.items.indexes.set(e.FooBox.items.indexes.prev),b=e.FooBox.items.current();e.show(!1),e.FooBox.raise("foobox.previous")}},this.next=function(a){if(1!=e._busy){if(e.FooBox.items.indexes.set(e.FooBox.items.indexes.next),"string"==typeof a)for(var b=e.FooBox.items.current();b.type!=a;)e.FooBox.items.indexes.set(e.FooBox.items.indexes.next),b=e.FooBox.items.current();e.show(!1),e.FooBox.raise("foobox.next")}},this},FooBox.Instance=function(b){this.id=null,"number"==typeof b?(this.id=b,FooBox.instances[b-1]=this):this.id=FooBox.instances.push(this),this.element=null,this.options=a.extend(!0,{},FooBox.defaults),this.modal=new FooBox.Modal(this),this.objects={},FooBox.addons.load(this),FooBox.handlers.load(this);var c=this;return this.raise=function(a,b){return FooBox.raise(c,a,b)},this.init=function(b,d){c.element=FooBox.isjQuery(b)?b:a(b),c.options=FooBox.options.merge(c.options,d||{}),FooBox.addons.call(c,"preinit",c.element,c.options),c.items.init(),c.items.array.length>0?(c.element.data("fbx_instance",c),c.options.containerCssClass&&c.element.addClass(c.options.containerCssClass),c.setup.bind(),c.modal.init(b,c.options),FooBox.handlers.call(c,"init",c.element,c.options),c.raise("foobox.initialized"),a.isFunction(c.options.initCallback)&&c.options.initCallback.call(c)):c.destroy()},this.reinit=function(a){c.options=FooBox.options.merge(c.options,a||{}),c.items.init(!0),c.items.array.length>0?(c.setup.bind(),c.modal.reinit(c.options),FooBox.handlers.call(c,"reinit",c.options),c.raise("foobox.reinitialized")):c.destroy()},this.destroy=function(){FooBox.addons.call(c,"destroy"),FooBox.handlers.call(c,"destroy"),c.items.destroy(),c.modal.destroy(),c.element.removeClass("fbx-instance fbx-item").data({fbx_instance:null,fbx_p_instance:null}),c.id==FooBox.instances.length?FooBox.instances.splice(c.id-1,1):FooBox.instances[c.id-1]=null,c.raise("foobox.destroy")},this.setup={bind:function(){a(c.options.externalSelector).off("click.fooboxExternal").on("click.fooboxExternal",function(b){b.preventDefault();var c=a(this).data("foobox"),d=a(c),e=d.data("fbx_instance")||d.data("fbx_p_instance");return d.length>0&&e instanceof FooBox.Instance&&e.modal instanceof FooBox.Modal&&e.modal.show(!0),!1})}},this.items={array:[],indexes:{prev:-1,current:0,next:1,direction:"*",set:function(a){var b=c.items.indexes.current;a=a||0,a=a>c.items.array.length-1?0:0>a?c.items.array.length-1:a;var d=a-1,e=a+1;c.items.indexes.current=a,c.items.indexes.prev=0>d?c.items.array.length-1:d,c.items.indexes.next=e>c.items.array.length-1?0:e,c.items.indexes.direction=c.items.indexes._direction(b,a,c.items.array.length-1)},_direction:function(a,b,c){return 0==b&&a==c?">":b==c&&0==a?"<":b>a?">":a>b?"<":"*"}},new_array:function(b){b=b||!1;var d,e,f,g=0;if(1==b){if(c.items.array.length>0){for(var h=0;h<c.items.array.length;h++)d=c.items.array[h],FooBox.isjQuery(d.element)?0==d.element.parents(":first").length&&(c.items.array.splice(h,1),h-=1):d.option||(c.items.array.splice(h,1),h-=1);for(var i=0;i<c.items.array.length;i++)d=c.items.array[i],FooBox.isjQuery(d.element)?(f=d.element.get(0),f.index=d.index=i):d.index=i}}else c.items.array=[];if(a.isArray(c.options.items))for(var j=0;j<c.options.items.length;j++)if(d=c.options.items[j],-1==c.items.indexOf(d))for(var k=0;k<c.objects.handlers.length;k++)if(c.objects.handlers[k].type==d.type){d.index=g,d.option=!0,d.handler=c.objects.handlers[k],d.handler.defaults(d),e=c.raise("foobox.parseItem",{element:null,item:d}),c.items.array.push(e.fb.item),g++;break}},init:function(b){b=b||!1,c.items.new_array(b);var d,e;if(c.element.is(c.options.selector)&&!c.element.is(c.options.excludes)&&c.items.add(c.element))c.element.off("click.item").on("click.item",c.items.clicked);else if(c.element.is(".foogallery")&&(d=c.element.data("__FooGallery__"))&&d.items&&(e=d.items.all()).length>0){d.filter&&a.isArray(d.filter.items)&&(e=d.filter.items.slice(0));var f=a.map(e,function(a){return a.$anchor?a.$anchor.get(0):null});a(f).not(c.options.excludes).off("click.item").filter(function(){return c.items.add(this)}).on("click.item",c.items.clicked),c.element.on("click.item",".fbx-link",c.items.clicked)}else c.element.find(c.options.selector).not(c.options.excludes).off("click.item").filter(function(){return c.items.add(this)}).on("click.item",c.items.clicked),c.element.on("click.item",".fbx-link",c.items.clicked);c.items.rel()},destroy:function(){c.element.off("click.item",".fbx-link",c.items.clicked);var b,d;for(d=0;d<c.items.array.length;d++)b=c.items.array[d],a.isFunction(b.destroy)&&b.destroy(),FooBox.isjQuery(b.element)&&b.element.off("click.item").removeClass("fbx-link").data("fbx_p_instance",null);c.items.array=[]},rel:function(){var b=c.options.rel||c.element.attr("rel")||(c.items.first(function(a){return FooBox.isjQuery(a.element)?"string"==typeof a.element.attr("rel"):!1})||{element:a()}).element.attr("rel");"string"==typeof b&&a('[rel="'+b+'"]').not(c.options.excludes).not(c.element).off("click.item").filter(function(){return c.items.add(this)}).on("click.item",c.items.clicked)},indexOf:function(a,b){if(!a)return-1;b=b||"url";var d;for(d=0;d<c.items.array.length;d++)if(c.items.array[d][b]==a[b])return d;return-1},is:{first:function(a){return c.items.array&&0!=c.items.array.length?c.items.array[0].index==a.index:!1},last:function(a){return c.items.array&&0!=c.items.array.length?c.items.array[c.items.array.length-1].index==a.index:!1}},add:function(b){b=FooBox.isjQuery(b)?b:a(b);var d=c.items.parse(b,c.items.array.length);if(null===d)return!1;var e=b.get(0),f=c.items.indexOf(d);-1!=f?(d=c.items.array[f],e.index=d.index):e.index=d.index=c.items.array.push(d)-1;var g=b.addClass("fbx-link").data("fbx_p_instance");return g instanceof FooBox.Instance||b.data("fbx_p_instance",c),!0},get:function(b){b=FooBox.isjQuery(b)?b:a(b);var d=null,e=b.get(0).index;return e&&e>0&&e<=c.items.array.length-1&&(d=c.items.array[e]),d},parse:function(b,d){b=FooBox.isjQuery(b)?b:a(b);for(var e,f,g=0;g<c.objects.handlers.length;g++)if(c.objects.handlers[g].handles(b,c.element)){e=c.objects.handlers[g].parse(b),isNaN(d)||(e.index=d),f=c.raise("foobox.parseItem",{element:b,item:e});break}return"undefined"!=typeof f&&f.fb.item?f.fb.item:null},error:function(b){function d(b){var c=this;return c.FooBox=b,c.type="error",c.handles=function(){return!1},c.hasChanged=function(){return!1},c.defaults=function(){},c.parse=function(){},c.load=function(b,d,e,f){try{d.empty().append(b.content),a.isFunction(e)&&e(c.getSize(b))}catch(g){a.isFunction(f)&&f(g)}},c.getSize=function(a){return new FooBox.Size(a.width,a.height)},c}if(c.items.array.length>b&&1==c.items.array[b].error)return c.items.array[b];var e,f,g=FooBox.handlers.get(c,"html"),h=!1;if(null==g&&(g=new d(c)),null!==c.options.error.match(/^#/i)&&a(c.options.error).length>0)e=a(c.options.error),h=!0;else{var i=FooBox.format('<div class="fbx-error-msg" data-width="240" data-height="240"><span></span><p>{0}</p></div>',c.options.error);e=a(i)}return f=new FooBox.Item(g.type,e.get(0),g),f.selector=1==h?c.options.error:null,f.index=b,f.error=!0,f.title=e.data("title")||null,f.description=e.data("description")||null,f.width=e.data("width")||240||null,f.height=e.data("height")||240||null,f.content=1==h?null:e,f.fullscreen=!0,f.handler=g,c.items.array[b]=f,f},first:function(a){for(var b=null,d=0;d<c.items.array.length;d++)if(a(c.items.array[d])){b=c.items.array[d];break}return b},current:function(){return c.items.array[c.items.indexes.current]},prev:function(){return c.items.array[c.items.indexes.prev]},next:function(){return c.items.array[c.items.indexes.next]},multiple:function(){return c.items.array.length>1},clicked:function(a){return a.preventDefault(),c.items.indexes.set(this.index),c.modal.show(!0),!1}},this},FooBox.open=function(b){var c,d=null;if("object"==typeof b){var e=document.createElement("a");a(e).foobox(b),d=a(e).data("fbx_instance")}else"number"==typeof b?c=b:(c=parseInt(b||0),c=isNaN(c)?0:c),c=c>FooBox.instances.length-1?FooBox.instances.length-1:0>c?0:c,d=FooBox.instances[c];return null!=d&&d.modal instanceof FooBox.Modal?(d.modal.show(!0),d):null},FooBox.close=function(){var a,b=[],c=null;for(a=0;a<FooBox.instances.length;a++)c=FooBox.instances[a],null!=c&&c.modal instanceof FooBox.Modal&&FooBox.isjQuery(c.modal.element)&&c.modal.element.hasClass("fbx-show")&&b.push(c);for(a=0;a<b.length;a++)c=b[a],c.modal.close()},FooBox.resize=function(c,d){if(c||d){var e,f,g,h;for(e=0;e<FooBox.instances.length;e++)f=FooBox.instances[e],null!=f&&f.modal instanceof FooBox.Modal&&FooBox.isjQuery(f.modal.element)&&f.modal.element.hasClass("fbx-show")&&(g=f.items.current(),h=new FooBox.Size(c||g.width||0,d||g.height||0),g.width=h.width,g.height=h.height,f.modal.resize(h,f.modal.element.find(".fbx-item-current")))}else a(b).trigger("resize.foobox")},FooBox.lateBind=function(c,d){var e=a.extend(!0,{},FooBox.defaults,d||b.FOOBOX&&FOOBOX.o||{}),f=a(c);f.on("click.foobox",e.selector,function(a){a.preventDefault();var b=f.data("fbx_instance");b||(b=f.foobox(e).data("fbx_instance")),b instanceof FooBox.Instance&&"number"==typeof this.index&&(b.items.indexes.set(this.index),b.modal.show(!0))})}}}(jQuery,window,window.console),function(a,b){var c={images:{noRightClick:!1,attr:"href",overflow:!1,fullscreen:!0,showCaptions:!0,regex:/https?:\/\/.*?\/.*?\.(jpg|jpeg|png|gif|bmp|webp|svg)/i,maxWidth:-1,maxHeight:-1,findUrl:function(a,c){if(!c)return"";if(c.data("image"))return c.data("image");var d=c.attr(a.options.images.attr);return"string"==typeof d?b.qualifiedURL(c.attr(a.options.images.attr)):""}}};b.Item.prototype.image=null,b.Item.prototype.maxWidth=null,b.Item.prototype.maxHeight=null,b.ImageHandler=function(c){this.FooBox=c,this.type="image";var d=this;this.handles=function(a){var b=d.FooBox.options.images.findUrl(d.FooBox,a),c="string"==typeof b&&null!=b.match(d.FooBox.options.images.regex),e=d.FooBox.raise("foobox.handlesImage",{element:a,handle:c});return e.fb.handle},this.defaults=function(a){a.fullscreen=a.fullscreen||d.FooBox.options.images.fullscreen,a.captions=a.captions||d.FooBox.options.images.showCaptions,a.social=a.social||!0,a.overflow=a.overflow||d.FooBox.options.images.overflow,a.proportion=a.proportion||!0,a.maxWidth=a.maxWidth||d.FooBox.options.images.maxWidth,a.maxHeight=a.maxHeight||d.FooBox.options.images.maxHeight},this.parse=function(a){var c=new b.Item(d.type,a,this);return d.defaults(c),c.url=d.FooBox.options.images.findUrl(d.FooBox,a)||null,c.width=b.Size.check(a.data("width")||c.width||null),c.height=b.Size.check(a.data("height")||c.height||null),c.fullscreen="boolean"==typeof a.data("fullscreen")?a.data("fullscreen"):c.fullscreen,c.overflow="boolean"==typeof a.data("overflow")?a.data("overflow"):c.overflow,c.proportion="boolean"==typeof a.data("proportion")?a.data("proportion"):c.proportion,c.maxWidth="number"==typeof a.data("maxWidth")?a.data("maxWidth"):c.maxWidth,c.maxHeight="number"==typeof a.data("maxHeight")?a.data("maxHeight"):c.maxHeight,c.image=null,c.image_url=c.url,c},this.load=function(b,c,e,f){try{var g=function(){var f=a(b.image).addClass("fbx-item fbx-item-image");d.FooBox.options.images.noRightClick&&f.on("contextmenu",function(a){return a.preventDefault(),!1}),c.empty().append(f),a.isFunction(e)&&e(d.getSize(b))};b.image&&null!==b.image?g():(b.image=new Image,b.image.onload=function(){b.image.onload=b.image.onerror=null,b.width&&b.height||(b.height=b.image.height,b.width=b.image.width),g()},b.image.onerror=function(){b.image.onload=b.image.onerror=null,b.image=null,a.isFunction(f)&&f("An error occurred attempting to load the image.")},b.image.src=b.url);
|
10 |
+
}catch(h){a.isFunction(f)&&f(h)}},this.preload=function(a){if(1!=a.preloaded){var b=new Image;b.src=a.url,a.preloaded=!0}},this.getSize=function(a){if(null!=a.width&&null!=a.height){if(a.maxWidth>0&&a.maxHeight>0&&(a.width>a.maxWidth||a.height>a.maxHeight)){var c=a.width>a.height?a.maxWidth/a.width:a.maxHeight/a.height;a.width*=c,a.height*=c}return new b.Size(a.width,a.height)}return new b.Size(0,0)},this.hasChanged=function(a){if(b.isjQuery(a.element)){var c=d.FooBox.options.images.findUrl(d.FooBox,a.element);return a.url!=c}return!1}},b.handlers.register(b.ImageHandler,c)}(jQuery,window.FooBox),function(a,b){var c={keyboard:{enabled:!0,preventDefault:!1,stopPropagation:!1}};b.Keyboard=function(a){this.FooBox=a;var c=this;this.preinit=function(a){c.handlers.unbind(!0),a.on({"foobox.initialized foobox.reinitialized":c.handlers.initialized,"foobox.setupHtml":c.handlers.setupHtml})},this.destroy=function(){c.handlers.unbind(!0)},this.handlers={unbind:function(a){a=a||!1,a&&c.FooBox.element.off({"foobox.initialized foobox.reinitialized":c.handlers.initialized,"foobox.setupHtml":c.handlers.setupHtml}),c.FooBox.element.off("foobox.afterLoad",c.handlers.afterLoad),b.isjQuery(c.FooBox.modal.element)&&c.FooBox.modal.element.off("keydown.foobox",c.handlers.onKeydown)},initialized:function(){c.handlers.unbind(),1==c.FooBox.options.keyboard.enabled&&(c.FooBox.element.on("foobox.afterLoad",c.handlers.afterLoad),b.isjQuery(c.FooBox.modal.element)&&c.FooBox.modal.element.on("keydown.foobox",c.handlers.onKeydown))},setupHtml:function(a){a.fb.modal.attr("tabindex",0)},afterLoad:function(a){a.fb.modal.focus()},onKeydown:function(a){var b=c.FooBox.modal,d=c.FooBox.options.keyboard;b.element.hasClass("fbx-show")&&(b.element.hasClass("fbx-fullscreen-mode")||27!==a.which?c.FooBox.items.multiple()&&37===a.which?b.prev():c.FooBox.items.multiple()&&39===a.which&&b.next():b.close(),1==d.preventDefault&&a.preventDefault(),1==d.stopPropagation&&a.stopPropagation(),c.FooBox.raise("foobox.keydown",{keyCode:a.which}))}}},b.addons.register(b.Keyboard,c)}(jQuery,window.FooBox),function(a,b){var c={hideNavOnMobile:!1,resizeTimeout:300,breakpoints:{phone:812,tablet:1366},iosInterval:200};b.BPInfo=function(b){var c=a(window);this.width=c.width(),this.height=c.height(),this.orientation=this.width>this.height?"fbx-landscape":"fbx-portrait";var d,e=null;if(a.isArray(b))for(var f=0;f<b.length;f++)if(d=b[f],d&&d.width&&this.width<=d.width){e=d;break}this.breakpoint=null==e?"fbx-desktop":e.name},b.Responsive=function(c){this.FooBox=c,this.breakpoint={values:[],names:""},this.timers={resize:new b.Timer,ios:new b.Timer};var d=this,e=null;this.preinit=function(a){d.handlers.unbind(!0),a.on("foobox.initialized foobox.reinitialized",d.handlers.initialized)},this.destroy=function(){d.handlers.unbind(!0)},this.handlers={unbind:function(b){b=b||!1,b&&d.FooBox.element.off("foobox.initialized foobox.reinitialized",d.handlers.initialized),a(window).off("resize.foobox",d.handlers.resize),d.FooBox.element.off({"foobox.beforeShow":d.handlers.iosBeforeShow,"foobox.close":d.handlers.iosClose})},initialized:function(){d.handlers.unbind(),d.setup.breakpoints(),d.style(),a(window).on("resize.foobox",d.handlers.resize),b.browser.iOS&&(b.browser.isSafari||b.browser.isChrome)&&d.FooBox.element.on({"foobox.beforeShow":d.handlers.iosBeforeShow,"foobox.close":d.handlers.iosClose})},resize:function(){d.timers.resize.start(function(){d.style();var a=d.FooBox,b=d.FooBox.items.current();if(a.modal.element.has("fbx-show")&&null!=b){var c=b.handler.getSize(b),e=a.modal.element.find(".fbx-item-current");a.modal.resize(c,e,function(){a.modal.triggerFooGalleryLayout(e);var c=b.handler.getSize(b),d=e.height();d!=c.height&&a.modal.resize(c,e,function(){a.modal.triggerFooGalleryLayout(e)})})}},d.FooBox.options.resizeTimeout)},iosBeforeShow:function(){d.timers.ios.start(d.handlers.ios,d.FooBox.options.iosInterval)},iosClose:function(){d.timers.ios.stop()},ios:function(){if(!d.FooBox.modal.element.hasClass("fbx-show"))return void d.timers.ios.start(d.handlers.ios,d.FooBox.options.iosInterval);var a=window.orientation||0,c=window.innerHeight,f=90==a||-90==a,g=0,h=0,i=f?screen.availWidth:screen.availHeight;b.browser.isChrome?(g=i-(f?76:56),h=i-(f?0:20)):b.browser.isSafari&&(g=i-88,h=i-(f?0:19)),(null==e||0==e)&&g>=c?(e=!0,d.iosRedraw()):(null==e||1==e)&&c>=h&&(e=!1,d.iosRedraw()),d.timers.ios.start(d.handlers.ios,d.FooBox.options.iosInterval)}},this.setup={breakpoints:function(){d.breakpoint.values=[],d.breakpoint.names="";for(var a in d.FooBox.options.breakpoints)d.FooBox.options.breakpoints.hasOwnProperty(a)&&(d.breakpoint.values.push({name:d.fixName(a),width:d.FooBox.options.breakpoints[a]}),d.breakpoint.names+=d.fixName(a)+" ");d.breakpoint.values.sort(function(a,b){return a.width-b.width})}},this.iosRedraw=function(){window.scrollTo(0,document.body.scrollTop),a(window).trigger("resize")},this.fixName=function(a){return/^fbx-[a-zA-Z0-9]/.test(a)?a:"fbx-"+a},this.style=function(){var a=new b.BPInfo(d.breakpoint.values),c=d.FooBox.modal.element;c.removeClass(d.breakpoint.names).removeClass("fbx-desktop fbx-landscape fbx-portrait").addClass(a.breakpoint).addClass(a.orientation),d.FooBox.options.hideNavOnMobile===!0?c.addClass("fbx-no-nav"):c.removeClass("fbx-no-nav")}},b.Responsive.metaCheck=function(){var b=a("meta[name=viewport]"),c=b.attr("content");if(b.length>0&&"string"==typeof c){for(var d=c.split(","),e=!1,f=!1,g=0;g<d.length;g++){var h=a.trim(d[g]);"width"==h.substring(0,5)&&-1!==h.indexOf("device-width")?e=!0:"initial-scale"==h.substring(0,13)&&(f=!0)}e&&!f&&(d.push("initial-scale=1"),c=d.join(","),b.attr("content",c))}},b.addons.register(b.Responsive,c),b.Responsive.metaCheck()}(jQuery,window.FooBox),function(a,b){var c={captions:{animation:"slide",enabled:!0,descSource:"find",hoverDelay:300,maxHeight:.4,onlyShowOnHover:!1,onlyShowOnClick:!1,overrideDesc:!1,overrideTitle:!1,prettify:!1,titleSource:"image_find"}};b.Item.prototype.captions=!1,b.Item.prototype.title=null,b.Item.prototype.description=null,b.Item.prototype.caption=null,b.Captions=function(c){this.FooBox=c,this.timers={hover:new b.Timer};var d=this;this.preinit=function(a){d.handlers.unbind(!0),a.on({"foobox.initialized foobox.reinitialized":d.handlers.initialized,"foobox.setupHtml":d.handlers.setupHtml,"foobox.setupOptions":d.handlers.setupOptions,"foobox.parseItem":d.handlers.parseItem,"foobox.onError":d.handlers.onError,"foobox.beforeClose":d.handlers.beforeClose})},this.destroy=function(){d.handlers.unbind(!0)},this.handlers={unbind:function(a){a=a||!1,a&&d.FooBox.element.off({"foobox.initialized foobox.reinitialized":d.handlers.initialized,"foobox.setupHtml":d.handlers.setupHtml,"foobox.setupOptions":d.handlers.setupOptions,"foobox.parseItem":d.handlers.parseItem,"foobox.onError":d.handlers.onError,"foobox.beforeClose":d.handlers.beforeClose}),d.FooBox.element.off({"foobox.beforeLoad":d.handlers.beforeLoad,"foobox.afterLoad":d.handlers.afterLoad}),d.FooBox.modal instanceof b.Modal&&b.isjQuery(d.FooBox.modal.element)&&d.FooBox.modal.element.off("mouseenter.captions mouseleave.captions").find(".fbx-item-current, .fbx-item-next").off("click.captions")},initialized:function(a){d.handlers.unbind(),a.fb.options.captions.enabled===!0&&(a.fb.instance.element.on({"foobox.beforeLoad":d.handlers.beforeLoad,"foobox.afterLoad":d.handlers.afterLoad,"foobox.beforeClose":d.handlers.beforeClose}),-1===a.fb.options.modalClass.indexOf("fbx-caption-toggle-only")&&a.fb.modal.find(".fbx-item-current, .fbx-item-next").on("click.captions",d.handlers.toggleCaptions),a.fb.options.captions.onlyShowOnHover===!0&&a.fb.modal.on("mouseenter.captions",".fbx-inner:not(:has(.fbx-item-error))",d.handlers.mouseenter).on("mouseleave.captions",".fbx-inner:not(:has(.fbx-item-error))",d.handlers.mouseleave))},toggleCaptions:function(b){if(a(b.target).is("img")||a(b.target).is(".fbx-close-caption")||a(b.target).is(".fbx-open-caption")){var c=d.FooBox.items.current(),e=d.FooBox.modal.element;c.captions&&!e.hasClass("fbx-error")&&(b.preventDefault(),e.find(".fbx-caption").is(".fbx-fade-caption, .fbx-slide-caption, .fbx-hide-caption")?(e.removeClass("fbx-captions-hidden"),d.show()):(e.addClass("fbx-captions-hidden"),d.hide()))}},mouseenter:function(){d.timers.hover.start(function(){d.show()},d.FooBox.options.captions.hoverDelay)},mouseleave:function(){d.timers.hover.start(function(){d.hide()},d.FooBox.options.captions.hoverDelay)},setupHtml:function(b){var c=a("<div/>",{"class":"fbx-caption"}),e=a("<a/>",{"class":"fbx-open-caption",html:"…"}).on("click.captions",d.handlers.toggleCaptions);"string"==typeof b.fb.options.modalClass&&-1!=b.fb.options.modalClass.indexOf("fbx-sticky-caption")?b.fb.modal.append(c,e):(b.fb.modal.find(".fbx-stage").append(c),b.fb.modal.find(".fbx-inner").append(e))},setupOptions:function(a){a.fb.modal.find(".fbx-caption").addClass(d.animation())},beforeClose:function(a){1!=a.fb.options.captions.onlyShowOnHover&&a.fb.modal.find(".fbx-caption").addClass("fbx-hide-caption")},beforeLoad:function(a){1!=a.fb.options.captions.onlyShowOnHover&&a.fb.modal.find(".fbx-caption").addClass(d.animation())},afterLoad:function(a){var b=a.fb.item;return!b||b.error||b.captionLoaded||(a.fb.instance.raise("foobox.alterCaption",{element:a.fb.element,item:b}),b.captionLoaded=!0),1==a.fb.options.captions.onlyShowOnHover?void d.update():void(0==a.fb.options.captions.onlyShowOnClick&&d.show())},onError:function(a){a.fb.modal.find(".fbx-caption").addClass(d.animation())},parseItem:function(c){var e=c.fb.options.captions;if(c.fb.item.captions&&0!=e.enabled){var f,g,h="";if(null!=c.fb.element){var i=a(c.fb.element).data("titleSource")||a(c.fb.instance.element).data("titleSource")||e.titleSource,j=a(c.fb.element).data("descSource")||a(c.fb.instance.element).data("descSource")||e.descSource;"none"!=i&&(f=c.fb.element.data("captionTitle")||c.fb.element.data("title")||d.text(c.fb.element,i)),"none"!=j&&(g=c.fb.element.data("captionDesc")||c.fb.element.data("description")||d.text(c.fb.element,j))}else f=c.fb.item.title,g=c.fb.item.description;f=null==f||"undefined"==typeof f?"":f+"",g=null==g||"undefined"==typeof g?"":g+"",f&&f==g&&(g=null),h="string"==typeof f&&f.length>0?b.format('<div class="fbx-caption-title">{0}</div>',f):h,h="string"==typeof g&&g.length>0?h+b.format('<div class="fbx-caption-desc">{0}</div>',g):h,c.fb.item.title=f,c.fb.item.description=g,c.fb.item.caption=h,c.fb.instance.raise("foobox.createCaption",{element:c.fb.element,item:c.fb.item})}}},this.text=function(b,c){var e;switch(c){case"find":e=a.trim(b.data("enviraCaption")||b.data("title")||b.attr("title")||b.find("img:first").data("title")||b.find("img:first").data("alt")||b.find("img:first").attr("title")||b.find("img:first").attr("alt"));break;case"image_find":e=a.trim(b.find("img:first").data("title")||b.find("img:first").data("alt")||b.find("img:first").attr("title")||b.find("img:first").attr("alt"));break;case"image":e=a.trim(b.find("img:first").data("title")||b.find("img:first").attr("title"));break;case"image_alt":e=a.trim(b.find("img:first").data("alt")||b.find("img:first").attr("alt"));break;case"anchor":e=a.trim(b.data("enviraCaption")||b.data("title")||b.attr("title"));break;default:e=null}return d.FooBox.options.captions.prettify&&(e=d.prettifier(e)),e},this.animation=function(){switch(d.FooBox.options.captions.animation){case"fade":return"fbx-fade-caption";case"slide":return"fbx-slide-caption";default:return"fbx-hide-caption"}},this.hide=function(){var a=d.FooBox.items.current(),b=d.FooBox.modal.element.find(".fbx-caption");return d.FooBox.options.captions.enabled&&a.captions&&"string"==typeof a.caption&&0!=a.caption.length?(b.addClass(d.animation()),void d.FooBox.raise("foobox.captionsHide",{item:a})):void b.addClass("fbx-hide-caption")},this.show=function(){var a=d.FooBox,c=a.items.current(),e=a.modal.element.find(".fbx-caption");return!a.options.captions.enabled||!c.captions||"string"!=typeof c.caption||0==c.caption.length||a.modal.element.hasClass("fbx-captions-hidden")||b.isjQuery(c.element)&&c.element.hasClass("no-captions")?void e.addClass("fbx-hide-caption"):(d.update(),e.removeClass("fbx-fade-caption fbx-slide-caption fbx-hide-caption"),void d.FooBox.raise("foobox.captionsShow",{item:c}))},this.update=function(){var c=d.FooBox.items.current(),e=d.FooBox.modal.element.find(".fbx-caption");e.html(c.caption).find('a[href^="#"]').filter(function(){var c=a(this).attr("href"),d=a(c),e=d.data("fbx_instance")||d.data("fbx_p_instance");return d.length>0&&e instanceof b.Instance?(a(this).data("hrefTarget",d.get(0)),!0):!1}).off("click.captions").on("click.captions",function(c){c.preventDefault();var e=a(this).data("hrefTarget"),f=a(e).data("fbx_instance")||a(e).data("fbx_p_instance");return f instanceof b.Instance&&(d.FooBox.modal.close(),f.items.indexes.set(e.index),f.modal.show()),!1}),a("<a/>",{"class":"fbx-close-caption",html:"×"}).on("click.captions",d.handlers.toggleCaptions).prependTo(e)},this.prettifier=function(a){return"string"!=typeof a?null:(a=a.replace(/\s*-\d+/g,"").replace(/\s*_\d+/g,"").replace(/-/g," ").replace(/_/g," "),a=a.replace(/\w\S*/g,function(a){return-1!=a.indexOf("#")?a:a.charAt(0).toUpperCase()+a.substr(1).toLowerCase()}))}},b.addons.register(b.Captions,c)}(jQuery,window.FooBox),function(a,b){var c={wordpress:{enabled:!1}};b.Wordpress=function(c){this.FooBox=c;var d=this;this.preinit=function(a){d.handlers.unbind(!0),a.on("foobox.createCaption",d.handlers.onCreateCaption)},this.destroy=function(){d.handlers.unbind(!0)},this.handlers={unbind:function(a){a=a||!1,a&&d.FooBox.element.off("foobox.createCaption",d.handlers.onCreateCaption)},onCreateCaption:function(c){var d=c.fb.options,e=c.fb.instance.element,f=c.fb.item.element,g="",h=c.fb.item.title,i=c.fb.item.description;if(1==d.wordpress.enabled&&b.isjQuery(f)){var j=f.data("captionTitle")||f.data("title"),k=f.data("captionDesc")||f.data("description");if(e.hasClass("gallery"))d.captions.overrideTitle===!1&&(h=j||f.parents(".gallery-item:first").find(".wp-caption-text:first").html()||f.parents(".gallery-item:first").find(".gallery-caption:first").html()||h||""),d.captions.overrideDesc===!1&&(i=k||f.find("img").attr("alt")||i||"");else if(e.hasClass("wp-caption")||f.hasClass("wp-caption"))d.captions.overrideTitle===!1&&(h=j||f.find("img").attr("title")||f.parents(".wp-caption:first").find(".wp-caption-text:first").html()||h||""),d.captions.overrideDesc===!1&&(i=k||f.find("img").attr("alt")||i||"");else if(f.parents(".wp-caption:first").length>0)d.captions.overrideTitle===!1&&(h=j||f.parents(".wp-caption:first").find("img").attr("title")||f.parents(".wp-caption:first").find(".wp-caption-text:first").html()||h||""),d.captions.overrideDesc===!1&&(i=k||f.parents(".wp-caption:first").find("img").attr("alt")||i||"");else if(e.hasClass("tiled-gallery"))d.captions.overrideTitle===!1&&(h=j||f.parents(".tiled-gallery-item:first").find(".tiled-gallery-caption").html()||f.find("img").data("image-title")||f.find("img").attr("title")||h||""),d.captions.overrideDesc===!1&&(i=k||a.trim(f.find("img").data("image-description")).replace(/(^<p>)|(<\/p>$)/gi,"")||i||"");else{if(!e.hasClass("wp-block-gallery")&&!e.hasClass("wp-block-image"))return;d.captions.overrideTitle===!1&&(h=j||f.parents("figure:first").find("figcaption").html()||h||""),d.captions.overrideDesc===!1&&(i=k||i||"")}h+="",i+="",h=h||"",i=i||"";var l=a("<div/>"),m=l.html(h).text(),n=l.html(i).text();(a.trim(h)==a.trim(i)||m==n)&&(i=null),g="string"==typeof h&&h.length>0?b.format('<div class="fbx-caption-title">{0}</div>',h):g,g="string"==typeof i&&i.length>0?g+b.format('<div class="fbx-caption-desc">{0}</div>',i):g,c.fb.item.title=h,c.fb.item.description=i,c.fb.item.caption=g}}}},b.addons.register(b.Wordpress,c)}(jQuery,window.FooBox),function(a,b){var c={pan:{enabled:!0,showOverview:!0,position:"fbx-top-right"}};b.Pan=function(c){this.FooBox=c;var d,e,f,g,h=this,i=!1,j=!1,k=null,l=null,m=null,n=null,o=null,p=0;this.preinit=function(a){h.handlers.unbind(!0),a.on({"foobox.initialized foobox.reinitialized":h.handlers.initialized})},this.destroy=function(){h.handlers.unbind(!0)},this.setOverview=function(){var a=parseInt(n.css("max-width")),b=parseInt(n.css("max-height")),c=a/k.width,d=b/k.height;p=c>d?d:c;var e=k.width*p,f=k.height*p;n.width(e).height(f).css("background-image","url("+k.url+")")},this.setViewport=function(){var a=m.width(),b=m.height(),c=a*p,d=b*p;o.width(c).height(d)},this.disableCaptionImageClick=function(){var a=h.FooBox.modal.element,c=b.objects.get("addons",h.FooBox,function(a){return a instanceof b.Captions});c&&a.find(".fbx-item-current, .fbx-item-next").off("click.captions",c.handlers.toggleCaptions)},this.enableCaptionImageClick=function(){var a=h.FooBox.modal.element,c=b.objects.get("addons",h.FooBox,function(a){return a instanceof b.Captions});c&&a.find(".fbx-item-current, .fbx-item-next").on("click.captions",c.handlers.toggleCaptions)},this.handlers={unbind:function(a){a=a||!1,a&&h.FooBox.element.off({"foobox.initialized foobox.reinitialized":h.handlers.initialized}),h.FooBox.element.off({"foobox.afterLoad":h.handlers.onAfterLoad,"foobox.showOverflow":h.handlers.onShowOverflow,"foobox.hideOverflow foobox.beforeLoad":h.handlers.onHideOverflow}),h.FooBox.modal instanceof b.Modal&&b.isjQuery(h.FooBox.modal.element)&&h.FooBox.modal.element.find(".fbx-stage").off({mousedown:h.handlers.onMouseDown,mousemove:h.handlers.onMouseMove,mouseup:h.handlers.onMouseUp}).removeClass("fbx-pannable fbx-panning")},initialized:function(a){h.handlers.unbind(),a.fb.options.pan.enabled===!0&&h.FooBox.element.on({"foobox.close":h.handlers.onMouseUp,"foobox.afterLoad":h.handlers.onAfterLoad,"foobox.showOverflow":h.handlers.onShowOverflow,"foobox.hideOverflow foobox.beforeLoad":h.handlers.onHideOverflow})},onAfterLoad:function(a){i===!0&&"image"==a.fb.item.handler.type&&(h.setOverview(),h.setViewport())},onShowOverflow:function(b){"image"==b.fb.item.handler.type&&(i===!0?(h.setOverview(),h.setViewport()):(i=!0,h.disableCaptionImageClick(),k=b.fb.item,m=h.FooBox.modal.element.addClass("fbx-pannable-item").find(".fbx-stage").on({mousedown:h.handlers.onMouseDown,mousemove:h.handlers.onMouseMove,"mouseup mouseleave":h.handlers.onMouseUp}).addClass("fbx-pannable"),l=b.fb.container,b.fb.options.pan.showOverview===!0&&(n=a("<div/>",{"class":"fbx-pan-overview"}).addClass(b.fb.options.pan.position).on("click",h.handlers.onOverviewClick).appendTo(m),o=a("<div/>",{"class":"fbx-pan-viewport"}).appendTo(n),l.on("scroll",h.handlers.onScroll),h.setOverview(),h.setViewport())))},onHideOverflow:function(a){i===!0&&(i=!1,h.enableCaptionImageClick(),a.fb.options.pan.showOverview===!0&&n.remove(),l.off("scroll",h.handlers.onScroll),m.off({mousedown:h.handlers.onMouseDown,mousemove:h.handlers.onMouseMove,"mouseup mouseleave":h.handlers.onMouseUp}).removeClass("fbx-pannable fbx-panning"),h.FooBox.modal.element.removeClass("fbx-pannable-item"))},onMouseDown:function(a){if(i===!0){a.preventDefault(),m.addClass("fbx-panning");var b=l.get(0);j=!0,d=a.pageX,e=a.pageY,f=b.scrollLeft,g=b.scrollTop}},onMouseMove:function(a){if(j===!0&&i===!0){var b=l.get(0);b.scrollLeft=f-(a.pageX-d),b.scrollTop=g-(a.pageY-e)}},onMouseUp:function(){i===!0&&(j=!1,m.removeClass("fbx-panning"),d=0,e=0,f=0,g=0)},onScroll:function(){var a=l.get(0),b=a.scrollTop/k.height*100,c=a.scrollLeft/k.width*100;o.css({top:b+"%",left:c+"%"})},onOverviewClick:function(b){var c=a(this).offset(),d=(b.pageX-c.left)/p,e=(b.pageY-c.top)/p,f=d-l.width()/2,g=e-l.height()/2;l.animate({scrollTop:g,scrollLeft:f},300)}}},b.addons.register(b.Pan,c)}(jQuery,window.FooBox),function(a,b){var c={swipe:{enabled:!0,min:80}},d=!1;try{var e=Object.defineProperty({},"passive",{get:function(){d=!0}});window.addEventListener("testPassive",null,e),window.removeEventListener("testPassive",null,e)}catch(f){}b.Swipe=function(a){this.FooBox=a,this.isMoving=!1;var c,e=this;this.preinit=function(a){e.handlers.unbind(!0),a.on("foobox.initialized foobox.reinitialized",e.handlers.initialized)},this.destroy=function(){e.handlers.unbind(!0)},this.handlers={unbind:function(a){if(a=a||!1,a&&e.FooBox.element.off("foobox.initialized foobox.reinitialized",e.handlers.initialized),e.FooBox.modal instanceof b.Modal&&b.isjQuery(e.FooBox.modal.element)){var c=e.FooBox.modal.element.get(0);c.addEventListener?c.removeEventListener("touchstart",e.handlers.onTouchStart,d?{passive:!0}:!1):e.FooBox.modal.element.off("touchstart",e.handlers.onTouchStart),e.FooBox.modal.element.off("touchmove",e.handlers.onTouchMove)}},initialized:function(a){if(e.handlers.unbind(),a.fb.options.swipe.enabled===!0){var b=a.fb.modal.get(0);b.addEventListener?b.addEventListener("touchstart",e.handlers.onTouchStart,d?{passive:!0}:!1):a.fb.modal.on("touchstart",e.handlers.onTouchStart)}},onTouchStart:function(a){var b=a.originalEvent.touches||a.touches;1==b.length&&e.FooBox.items.multiple()&&(c=b[0].pageX,e.isMoving=!0,e.FooBox.modal.element.on("touchmove",e.handlers.onTouchMove))},onTouchMove:function(a){if(e.isMoving){var b=a.originalEvent.touches||a.touches,d=b[0].pageX,f=c-d;Math.abs(f)>=e.FooBox.options.swipe.min&&(e.cancelTouch(),f>0?(e.FooBox.raise("foobox.swipeRight"),e.FooBox.modal.next()):(e.FooBox.raise("foobox.swipeLeft"),e.FooBox.modal.prev()))}}},this.cancelTouch=function(){e.FooBox.modal.element.off("touchmove",e.handlers.onTouchMove),c=null,e.isMoving=!1}},b.addons.register(b.Swipe,c)}(jQuery,window.FooBox),function(a,b,c){if(!c)return void console.log("No configuration for FooBox found.");if(c.o&&c.customOptions&&a.extend(!0,c.o,c.customOptions),c.init=function(){if(a(".fbx-link").removeClass("fbx-link"),a.isFunction(c.pre))try{c.pre(a)}catch(b){console.error(b)}if(c.disableOthers&&(a("a.thickbox").removeClass("thickbox").unbind("click"),a("#TB_overlay, #TB_load, #TB_window").remove()),a.each(c.selectors,function(b,d){a(d).foobox(c.o)}),c.disableOthers&&a(".fbx-link").unbind(".prettyphoto").unbind(".fb"),a.isFunction(c.post))try{c.post(a)}catch(b){console.error(b)}},b.once=function(){var b=a("body");c.preloadFont&&b.append(a("<span/>",{"class":"foobox_font_preload",text:"f"})),c.init(),a(document).trigger("foobox-after-init"),b.on("post-load",c.init)},c.ready?b.ready(b.once):a(b.once),a.isFunction(c.custom))try{c.custom(a)}catch(d){console.error(d)}}(jQuery,window.FooBox,window.FOOBOX);
|
freemius/templates/debug.php
CHANGED
@@ -1,726 +1,726 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.1.1
|
7 |
-
*/
|
8 |
-
|
9 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
-
exit;
|
11 |
-
}
|
12 |
-
|
13 |
-
global $fs_active_plugins;
|
14 |
-
|
15 |
-
$fs_options = FS_Options::instance( WP_FS__ACCOUNTS_OPTION_NAME, true );
|
16 |
-
|
17 |
-
$off_text = fs_text_x_inline( 'Off', 'as turned off' );
|
18 |
-
$on_text = fs_text_x_inline( 'On', 'as turned on' );
|
19 |
-
?>
|
20 |
-
<h1><?php echo fs_text_inline( 'Freemius Debug' ) . ' - ' . fs_text_inline( 'SDK' ) . ' v.' . $fs_active_plugins->newest->version ?></h1>
|
21 |
-
<div>
|
22 |
-
<!-- Debugging Switch -->
|
23 |
-
<?php //$debug_mode = get_option( 'fs_debug_mode', null ) ?>
|
24 |
-
<span class="switch-label"><?php fs_esc_html_echo_x_inline( 'Debugging', 'as code debugging' ) ?></span>
|
25 |
-
|
26 |
-
<div class="switch <?php echo WP_FS__DEBUG_SDK ? 'off' : 'on' ?>">
|
27 |
-
<div class="toggle"></div>
|
28 |
-
<span class="on"><?php echo esc_html( $on_text ) ?></span>
|
29 |
-
<span class="off"><?php echo esc_html( $off_text ) ?></span>
|
30 |
-
</div>
|
31 |
-
<script type="text/javascript">
|
32 |
-
(function ($) {
|
33 |
-
$(document).ready(function () {
|
34 |
-
// Switch toggle
|
35 |
-
$('.switch').click(function () {
|
36 |
-
$(this)
|
37 |
-
.toggleClass('on')
|
38 |
-
.toggleClass('off');
|
39 |
-
|
40 |
-
$.post(ajaxurl, {
|
41 |
-
action: 'fs_toggle_debug_mode',
|
42 |
-
is_on : ($(this).hasClass('off') ? 1 : 0)
|
43 |
-
}, function (response) {
|
44 |
-
if (1 == response) {
|
45 |
-
// Refresh page on success.
|
46 |
-
location.reload();
|
47 |
-
}
|
48 |
-
});
|
49 |
-
});
|
50 |
-
});
|
51 |
-
}(jQuery));
|
52 |
-
</script>
|
53 |
-
</div>
|
54 |
-
<h2><?php fs_esc_html_echo_inline( 'Actions', 'actions' ) ?></h2>
|
55 |
-
<table>
|
56 |
-
<tbody>
|
57 |
-
<tr>
|
58 |
-
<td>
|
59 |
-
<!-- Delete All Accounts -->
|
60 |
-
<form action="" method="POST">
|
61 |
-
<input type="hidden" name="fs_action" value="restart_freemius">
|
62 |
-
<?php wp_nonce_field( 'restart_freemius' ) ?>
|
63 |
-
<button class="button button-primary"
|
64 |
-
onclick="if (confirm('<?php fs_esc_attr_echo_inline( 'Are you sure you want to delete all Freemius data?', 'delete-all-confirm' ) ?>')) this.parentNode.submit(); return false;"><?php fs_esc_html_echo_inline( 'Delete All Accounts' ) ?></button>
|
65 |
-
</form>
|
66 |
-
</td>
|
67 |
-
<td>
|
68 |
-
<!-- Clear API Cache -->
|
69 |
-
<form action="" method="POST">
|
70 |
-
<input type="hidden" name="fs_clear_api_cache" value="true">
|
71 |
-
<button class="button button-primary"><?php fs_esc_html_echo_inline( 'Clear API Cache' ) ?></button>
|
72 |
-
</form>
|
73 |
-
</td>
|
74 |
-
<td>
|
75 |
-
<!-- Clear Updates Transients -->
|
76 |
-
<form action="" method="POST">
|
77 |
-
<input type="hidden" name="fs_action" value="clear_updates_data">
|
78 |
-
<?php wp_nonce_field( 'clear_updates_data' ) ?>
|
79 |
-
<button class="button"><?php fs_esc_html_echo_inline( 'Clear Updates Transients' ) ?></button>
|
80 |
-
</form>
|
81 |
-
</td>
|
82 |
-
<td>
|
83 |
-
<!-- Sync Data with Server -->
|
84 |
-
<form action="" method="POST">
|
85 |
-
<input type="hidden" name="background_sync" value="true">
|
86 |
-
<button class="button button-primary"><?php fs_esc_html_echo_inline( 'Sync Data From Server' ) ?></button>
|
87 |
-
</form>
|
88 |
-
</td>
|
89 |
-
<?php if ( fs_is_network_admin() && true !== $fs_options->get_option( 'ms_migration_complete', false, true ) ) : ?>
|
90 |
-
<td>
|
91 |
-
<!-- Migrate Options to Network -->
|
92 |
-
<form action="" method="POST">
|
93 |
-
<input type="hidden" name="fs_action" value="migrate_options_to_network">
|
94 |
-
<?php wp_nonce_field( 'migrate_options_to_network' ) ?>
|
95 |
-
<button class="button button-primary"><?php fs_esc_html_echo_inline( 'Migrate Options to Network' ) ?></button>
|
96 |
-
</form>
|
97 |
-
</td>
|
98 |
-
<?php endif ?>
|
99 |
-
<td>
|
100 |
-
<button id="fs_load_db_option" class="button"><?php fs_esc_html_echo_inline( 'Load DB Option' ) ?></button>
|
101 |
-
</td>
|
102 |
-
<td>
|
103 |
-
<button id="fs_set_db_option" class="button"><?php fs_esc_html_echo_inline( 'Set DB Option' ) ?></button>
|
104 |
-
</td>
|
105 |
-
</tr>
|
106 |
-
</tbody>
|
107 |
-
</table>
|
108 |
-
<script type="text/javascript">
|
109 |
-
(function ($) {
|
110 |
-
$('#fs_load_db_option').click(function () {
|
111 |
-
var optionName = prompt('Please enter the option name:');
|
112 |
-
|
113 |
-
if (optionName) {
|
114 |
-
$.post(ajaxurl, {
|
115 |
-
action : 'fs_get_db_option',
|
116 |
-
_wpnonce : '<?php echo wp_create_nonce( 'fs_get_db_option' ) ?>',
|
117 |
-
option_name: optionName
|
118 |
-
}, function (response) {
|
119 |
-
if (response.data.value)
|
120 |
-
prompt('The option value is:', response.data.value);
|
121 |
-
else
|
122 |
-
alert('Oops... Option does not exist in the DB.');
|
123 |
-
});
|
124 |
-
}
|
125 |
-
});
|
126 |
-
|
127 |
-
$('#fs_set_db_option').click(function () {
|
128 |
-
var optionName = prompt('Please enter the option name:');
|
129 |
-
|
130 |
-
if (optionName) {
|
131 |
-
var optionValue = prompt('Please enter the option value:');
|
132 |
-
|
133 |
-
if (optionValue) {
|
134 |
-
$.post(ajaxurl, {
|
135 |
-
action : 'fs_set_db_option',
|
136 |
-
_wpnonce : '<?php echo wp_create_nonce( 'fs_set_db_option' ) ?>',
|
137 |
-
option_name : optionName,
|
138 |
-
option_value: optionValue
|
139 |
-
}, function () {
|
140 |
-
alert('Option was successfully set.');
|
141 |
-
});
|
142 |
-
}
|
143 |
-
}
|
144 |
-
});
|
145 |
-
})(jQuery);
|
146 |
-
</script>
|
147 |
-
<?php
|
148 |
-
if ( ! defined( 'FS_API__ADDRESS' ) ) {
|
149 |
-
define( 'FS_API__ADDRESS', '://api.freemius.com' );
|
150 |
-
}
|
151 |
-
if ( ! defined( 'FS_API__SANDBOX_ADDRESS' ) ) {
|
152 |
-
define( 'FS_API__SANDBOX_ADDRESS', '://sandbox-api.freemius.com' );
|
153 |
-
}
|
154 |
-
|
155 |
-
$defines = array(
|
156 |
-
array(
|
157 |
-
'key' => 'WP_FS__REMOTE_ADDR',
|
158 |
-
'val' => WP_FS__REMOTE_ADDR,
|
159 |
-
),
|
160 |
-
array(
|
161 |
-
'key' => 'WP_FS__ADDRESS_PRODUCTION',
|
162 |
-
'val' => WP_FS__ADDRESS_PRODUCTION,
|
163 |
-
),
|
164 |
-
array(
|
165 |
-
'key' => 'FS_API__ADDRESS',
|
166 |
-
'val' => FS_API__ADDRESS,
|
167 |
-
),
|
168 |
-
array(
|
169 |
-
'key' => 'FS_API__SANDBOX_ADDRESS',
|
170 |
-
'val' => FS_API__SANDBOX_ADDRESS,
|
171 |
-
),
|
172 |
-
array(
|
173 |
-
'key' => 'WP_FS__DIR',
|
174 |
-
'val' => WP_FS__DIR,
|
175 |
-
),
|
176 |
-
)
|
177 |
-
?>
|
178 |
-
<br>
|
179 |
-
<table class="widefat">
|
180 |
-
<thead>
|
181 |
-
<tr>
|
182 |
-
<th><?php fs_esc_html_echo_inline( 'Key', 'key' ) ?></th>
|
183 |
-
<th><?php fs_esc_html_echo_inline( 'Value', 'value' ) ?></th>
|
184 |
-
</tr>
|
185 |
-
</thead>
|
186 |
-
<tbody>
|
187 |
-
<?php $alternate = false;
|
188 |
-
foreach ( $defines as $p ) : ?>
|
189 |
-
<tr<?php if ( $alternate ) {
|
190 |
-
echo ' class="alternate"';
|
191 |
-
} ?>>
|
192 |
-
<td><?php echo $p['key'] ?></td>
|
193 |
-
<td><?php echo $p['val'] ?></td>
|
194 |
-
</tr>
|
195 |
-
<?php $alternate = ! $alternate ?>
|
196 |
-
<?php endforeach ?>
|
197 |
-
</tbody>
|
198 |
-
</table>
|
199 |
-
<h2><?php fs_esc_html_echo_x_inline( 'SDK Versions', 'as software development kit versions', 'sdk-versions' ) ?></h2>
|
200 |
-
<table id="fs_sdks" class="widefat">
|
201 |
-
<thead>
|
202 |
-
<tr>
|
203 |
-
<th><?php fs_esc_html_echo_x_inline( 'Version', 'product version' ) ?></th>
|
204 |
-
<th><?php fs_esc_html_echo_inline( 'SDK Path' ) ?></th>
|
205 |
-
<th><?php fs_esc_html_echo_inline( 'Module Path' ) ?></th>
|
206 |
-
<th><?php fs_esc_html_echo_inline( 'Is Active' ) ?></th>
|
207 |
-
</tr>
|
208 |
-
</thead>
|
209 |
-
<tbody>
|
210 |
-
<?php foreach ( $fs_active_plugins->plugins as $sdk_path => $data ) : ?>
|
211 |
-
<?php $is_active = ( WP_FS__SDK_VERSION == $data->version ) ?>
|
212 |
-
<tr<?php if ( $is_active ) {
|
213 |
-
echo ' style="background: #E6FFE6; font-weight: bold"';
|
214 |
-
} ?>>
|
215 |
-
<td><?php echo $data->version ?></td>
|
216 |
-
<td><?php echo $sdk_path ?></td>
|
217 |
-
<td><?php echo $data->plugin_path ?></td>
|
218 |
-
<td><?php echo ( $is_active ) ? 'Active' : 'Inactive' ?></td>
|
219 |
-
</tr>
|
220 |
-
<?php endforeach ?>
|
221 |
-
</tbody>
|
222 |
-
</table>
|
223 |
-
|
224 |
-
<?php
|
225 |
-
$module_types = array(
|
226 |
-
WP_FS__MODULE_TYPE_PLUGIN,
|
227 |
-
WP_FS__MODULE_TYPE_THEME
|
228 |
-
);
|
229 |
-
?>
|
230 |
-
|
231 |
-
<?php foreach ( $module_types as $module_type ) : ?>
|
232 |
-
<?php $modules = $fs_options->get_option( $module_type . 's' ) ?>
|
233 |
-
<?php if ( is_array( $modules ) && count( $modules ) > 0 ) : ?>
|
234 |
-
<h2><?php echo esc_html( ( WP_FS__MODULE_TYPE_PLUGIN == $module_type ) ? fs_text_inline( 'Plugins', 'plugins' ) : fs_text_inline( 'Themes', 'themes' ) ) ?></h2>
|
235 |
-
<table id="fs_<?php echo $module_type ?>" class="widefat">
|
236 |
-
<thead>
|
237 |
-
<tr>
|
238 |
-
<th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th>
|
239 |
-
<th><?php fs_esc_html_echo_inline( 'Slug' ) ?></th>
|
240 |
-
<th><?php fs_esc_html_echo_x_inline( 'Version', 'product version' ) ?></th>
|
241 |
-
<th><?php fs_esc_html_echo_inline( 'Title' ) ?></th>
|
242 |
-
<th><?php fs_esc_html_echo_x_inline( 'API', 'as application program interface' ) ?></th>
|
243 |
-
<th><?php fs_esc_html_echo_inline( 'Freemius State' ) ?></th>
|
244 |
-
<th><?php fs_esc_html_echo_inline( 'Module Path' ) ?></th>
|
245 |
-
<th><?php fs_esc_html_echo_inline( 'Public Key' ) ?></th>
|
246 |
-
<?php if ( is_multisite() ) : ?>
|
247 |
-
<th><?php fs_esc_html_echo_inline( 'Network Blog' ) ?></th>
|
248 |
-
<th><?php fs_esc_html_echo_inline( 'Network User' ) ?></th>
|
249 |
-
<?php endif ?>
|
250 |
-
<th><?php fs_esc_html_echo_inline( 'Actions' ) ?></th>
|
251 |
-
</tr>
|
252 |
-
</thead>
|
253 |
-
<tbody>
|
254 |
-
<?php foreach ( $modules as $slug => $data ) : ?>
|
255 |
-
<?php
|
256 |
-
if ( WP_FS__MODULE_TYPE_THEME !== $module_type ) {
|
257 |
-
$is_active = is_plugin_active( $data->file );
|
258 |
-
} else {
|
259 |
-
$current_theme = wp_get_theme();
|
260 |
-
$is_active = ( $current_theme->stylesheet === $data->file );
|
261 |
-
|
262 |
-
if ( ! $is_active && is_child_theme() ) {
|
263 |
-
$parent_theme = $current_theme->parent();
|
264 |
-
|
265 |
-
$is_active = ( ( $parent_theme instanceof WP_Theme ) && $parent_theme->stylesheet === $data->file );
|
266 |
-
}
|
267 |
-
}
|
268 |
-
?>
|
269 |
-
<?php $fs = $is_active ? freemius( $data->id ) : null ?>
|
270 |
-
<tr<?php if ( $is_active ) {
|
271 |
-
if ( $fs->has_api_connectivity() && $fs->is_on() ) {
|
272 |
-
echo ' style="background: #E6FFE6; font-weight: bold"';
|
273 |
-
} else {
|
274 |
-
echo ' style="background: #ffd0d0; font-weight: bold"';
|
275 |
-
}
|
276 |
-
} ?>>
|
277 |
-
<td><?php echo $data->id ?></td>
|
278 |
-
<td><?php echo $slug ?></td>
|
279 |
-
<td><?php echo $data->version ?></td>
|
280 |
-
<td><?php echo $data->title ?></td>
|
281 |
-
<td<?php if ( $is_active && ! $fs->has_api_connectivity() ) {
|
282 |
-
echo ' style="color: red; text-transform: uppercase;"';
|
283 |
-
} ?>><?php if ( $is_active ) {
|
284 |
-
echo esc_html( $fs->has_api_connectivity() ?
|
285 |
-
fs_text_x_inline( 'Connected', 'as connection was successful' ) :
|
286 |
-
fs_text_x_inline( 'Blocked', 'as connection blocked' )
|
287 |
-
);
|
288 |
-
} ?></td>
|
289 |
-
<td<?php if ( $is_active && ! $fs->is_on() ) {
|
290 |
-
echo ' style="color: red; text-transform: uppercase;"';
|
291 |
-
} ?>><?php if ( $is_active ) {
|
292 |
-
echo esc_html( $fs->is_on() ?
|
293 |
-
$on_text :
|
294 |
-
$off_text
|
295 |
-
);
|
296 |
-
} ?></td>
|
297 |
-
<td><?php echo $data->file ?></td>
|
298 |
-
<td><?php echo $data->public_key ?></td>
|
299 |
-
<?php if ( is_multisite() ) : ?>
|
300 |
-
<?php
|
301 |
-
$network_blog_id = null;
|
302 |
-
$network_user = null;
|
303 |
-
|
304 |
-
if ( is_object( $fs ) ) {
|
305 |
-
$network_blog_id = $fs->get_network_install_blog_id();
|
306 |
-
$network_user = $fs->get_network_user();
|
307 |
-
}
|
308 |
-
?>
|
309 |
-
<td><?php echo is_numeric( $network_blog_id ) ? $network_blog_id : '' ?></td>
|
310 |
-
<td><?php if ( is_object( $network_user ) ) {
|
311 |
-
echo $network_user->email;
|
312 |
-
} ?></td>
|
313 |
-
<?php endif ?>
|
314 |
-
<td>
|
315 |
-
<?php if ( $is_active ) : ?>
|
316 |
-
<?php if ( $fs->has_trial_plan() ) : ?>
|
317 |
-
<form action="" method="POST">
|
318 |
-
<input type="hidden" name="fs_action" value="simulate_trial">
|
319 |
-
<input type="hidden" name="module_id" value="<?php echo $fs->get_id() ?>">
|
320 |
-
<?php wp_nonce_field( 'simulate_trial' ) ?>
|
321 |
-
|
322 |
-
<button type="submit" class="button button-primary simulate-trial"><?php fs_esc_html_echo_inline( 'Simulate Trial Promotion' ) ?></button>
|
323 |
-
</form>
|
324 |
-
<?php endif ?>
|
325 |
-
<?php if ( $fs->is_registered() ) : ?>
|
326 |
-
<a class="button" href="<?php echo $fs->get_account_url() ?>"><?php fs_esc_html_echo_inline( 'Account', 'account' ) ?></a>
|
327 |
-
<?php endif ?>
|
328 |
-
<?php if ( fs_is_network_admin() && ! $fs->is_network_upgrade_mode() ) : ?>
|
329 |
-
<form action="" method="POST">
|
330 |
-
<input type="hidden" name="fs_action" value="simulate_network_upgrade">
|
331 |
-
<input type="hidden" name="module_id" value="<?php echo $fs->get_id() ?>">
|
332 |
-
<?php wp_nonce_field( 'simulate_network_upgrade' ) ?>
|
333 |
-
|
334 |
-
<button type="submit" class="button button-small"><?php fs_esc_html_echo_inline( 'Simulate Network Upgrade' ) ?></button>
|
335 |
-
</form>
|
336 |
-
<?php endif ?>
|
337 |
-
<?php endif ?>
|
338 |
-
</td>
|
339 |
-
</tr>
|
340 |
-
<?php endforeach ?>
|
341 |
-
</tbody>
|
342 |
-
</table>
|
343 |
-
<?php endif ?>
|
344 |
-
<?php endforeach ?>
|
345 |
-
<?php foreach ( $module_types as $module_type ) : ?>
|
346 |
-
<?php
|
347 |
-
/**
|
348 |
-
* @var array $VARS
|
349 |
-
* @var array[string]FS_Site|array[string]FS_Site[] $sites_map
|
350 |
-
*/
|
351 |
-
$sites_map = $VARS[ $module_type . '_sites' ];
|
352 |
-
|
353 |
-
$is_multisite = is_multisite();
|
354 |
-
$all_plans = false;
|
355 |
-
$plans = false;
|
356 |
-
?>
|
357 |
-
<?php if ( is_array( $sites_map ) && count( $sites_map ) > 0 ) : ?>
|
358 |
-
<h2><?php echo esc_html( sprintf(
|
359 |
-
/* translators: %s: 'plugin' or 'theme' */
|
360 |
-
fs_text_inline( '%s Installs', 'module-installs' ),
|
361 |
-
( WP_FS__MODULE_TYPE_PLUGIN === $module_type ? fs_text_inline( 'Plugin', 'plugin' ) : fs_text_inline( 'Theme', 'theme' ) )
|
362 |
-
) ) ?> / <?php fs_esc_html_echo_x_inline( 'Sites', 'like websites', 'sites' ) ?></h2>
|
363 |
-
<table id="fs_<?php echo $module_type ?>_installs" class="widefat">
|
364 |
-
<thead>
|
365 |
-
<tr>
|
366 |
-
<th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th>
|
367 |
-
<?php if ( $is_multisite ) : ?>
|
368 |
-
<th><?php fs_esc_html_echo_inline( 'Blog ID' ) ?></th>
|
369 |
-
<th><?php fs_esc_html_echo_inline( 'Address' ) ?></th>
|
370 |
-
<?php endif ?>
|
371 |
-
<th><?php fs_esc_html_echo_inline( 'Slug' ) ?></th>
|
372 |
-
<th><?php fs_esc_html_echo_inline( 'User ID' ) ?></th>
|
373 |
-
<th><?php fs_esc_html_echo_x_inline( 'Plan', 'as product pricing plan', 'plan' ) ?></th>
|
374 |
-
<th><?php fs_esc_html_echo_inline( 'Public Key' ) ?></th>
|
375 |
-
<th><?php fs_esc_html_echo_inline( 'Secret Key' ) ?></th>
|
376 |
-
<th><?php fs_esc_html_echo_inline( 'Actions' ) ?></th>
|
377 |
-
</tr>
|
378 |
-
</thead>
|
379 |
-
<tbody>
|
380 |
-
<?php foreach ( $sites_map as $slug => $sites ) : ?>
|
381 |
-
<?php if ( ! is_array( $sites ) ) {
|
382 |
-
$sites = array( $sites );
|
383 |
-
} ?>
|
384 |
-
<?php foreach ( $sites as $site ) : ?>
|
385 |
-
<tr>
|
386 |
-
<td><?php echo $site->id ?></td>
|
387 |
-
<?php if ( $is_multisite ) : ?>
|
388 |
-
<td><?php echo $site->blog_id ?></td>
|
389 |
-
<td><?php echo fs_strip_url_protocol( $site->url ) ?></td>
|
390 |
-
<?php endif ?>
|
391 |
-
<td><?php echo $slug ?></td>
|
392 |
-
<td><?php echo $site->user_id ?></td>
|
393 |
-
<td><?php
|
394 |
-
$plan_name = '';
|
395 |
-
if ( FS_Plugin_Plan::is_valid_id( $site->plan_id ) ) {
|
396 |
-
if ( false === $all_plans ) {
|
397 |
-
$option_name = 'plans';
|
398 |
-
if ( WP_FS__MODULE_TYPE_PLUGIN !== $module_type ) {
|
399 |
-
$option_name = $module_type . '_' . $option_name;
|
400 |
-
}
|
401 |
-
|
402 |
-
$all_plans = $fs_options->get_option( $option_name, array() );
|
403 |
-
}
|
404 |
-
|
405 |
-
if ( false === $plans ) {
|
406 |
-
$plans = $all_plans[ $slug ];
|
407 |
-
}
|
408 |
-
|
409 |
-
foreach ( $plans as $plan ) {
|
410 |
-
$plan_id = Freemius::_decrypt( $plan->id );
|
411 |
-
|
412 |
-
if ( $site->plan_id == $plan_id ) {
|
413 |
-
$plan_name = Freemius::_decrypt( $plan->name );
|
414 |
-
break;
|
415 |
-
}
|
416 |
-
}
|
417 |
-
}
|
418 |
-
|
419 |
-
echo $plan_name;
|
420 |
-
?></td>
|
421 |
-
<td><?php echo $site->public_key ?></td>
|
422 |
-
<td><?php echo esc_html( $site->secret_key ) ?></td>
|
423 |
-
<td>
|
424 |
-
<form action="" method="POST">
|
425 |
-
<input type="hidden" name="fs_action" value="delete_install">
|
426 |
-
<?php wp_nonce_field( 'delete_install' ) ?>
|
427 |
-
<input type="hidden" name="module_id" value="<?php echo $site->plugin_id ?>">
|
428 |
-
<?php if ( $is_multisite ) : ?>
|
429 |
-
<input type="hidden" name="blog_id" value="<?php echo $site->blog_id ?>">
|
430 |
-
<?php endif ?>
|
431 |
-
<input type="hidden" name="module_type" value="<?php echo $module_type ?>">
|
432 |
-
<input type="hidden" name="slug" value="<?php echo $slug ?>">
|
433 |
-
<button type="submit" class="button"><?php fs_esc_html_echo_x_inline( 'Delete', 'verb', 'delete' ) ?></button>
|
434 |
-
</form>
|
435 |
-
</td>
|
436 |
-
</tr>
|
437 |
-
<?php endforeach ?>
|
438 |
-
<?php endforeach ?>
|
439 |
-
</tbody>
|
440 |
-
</table>
|
441 |
-
<?php endif ?>
|
442 |
-
<?php endforeach ?>
|
443 |
-
<?php
|
444 |
-
$addons = $VARS['addons'];
|
445 |
-
?>
|
446 |
-
<?php foreach ( $addons as $plugin_id => $plugin_addons ) : ?>
|
447 |
-
<h2><?php echo esc_html( sprintf( fs_text_inline( 'Add Ons of module %s', 'addons-of-x' ), $plugin_id ) ) ?></h2>
|
448 |
-
<table id="fs_addons" class="widefat">
|
449 |
-
<thead>
|
450 |
-
<tr>
|
451 |
-
<th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th>
|
452 |
-
<th><?php fs_esc_html_echo_inline( 'Title' ) ?></th>
|
453 |
-
<th><?php fs_esc_html_echo_inline( 'Slug' ) ?></th>
|
454 |
-
<th><?php fs_esc_html_echo_x_inline( 'Version', 'product version' ) ?></th>
|
455 |
-
<th><?php fs_esc_html_echo_inline( 'Public Key' ) ?></th>
|
456 |
-
<th><?php fs_esc_html_echo_inline( 'Secret Key' ) ?></th>
|
457 |
-
</tr>
|
458 |
-
</thead>
|
459 |
-
<tbody>
|
460 |
-
<?php
|
461 |
-
/**
|
462 |
-
* @var FS_Plugin[] $plugin_addons
|
463 |
-
*/
|
464 |
-
foreach ( $plugin_addons as $addon ) : ?>
|
465 |
-
<tr>
|
466 |
-
<td><?php echo $addon->id ?></td>
|
467 |
-
<td><?php echo $addon->title ?></td>
|
468 |
-
<td><?php echo $addon->slug ?></td>
|
469 |
-
<td><?php echo $addon->version ?></td>
|
470 |
-
<td><?php echo $addon->public_key ?></td>
|
471 |
-
<td><?php echo esc_html( $addon->secret_key ) ?></td>
|
472 |
-
</tr>
|
473 |
-
<?php endforeach ?>
|
474 |
-
</tbody>
|
475 |
-
</table>
|
476 |
-
<?php endforeach ?>
|
477 |
-
<?php
|
478 |
-
/**
|
479 |
-
* @var FS_User[] $users
|
480 |
-
*/
|
481 |
-
$users = $VARS['users'];
|
482 |
-
?>
|
483 |
-
<?php if ( is_array( $users ) && 0 < count( $users ) ) : ?>
|
484 |
-
<h2><?php fs_esc_html_echo_inline( 'Users' ) ?></h2>
|
485 |
-
<table id="fs_users" class="widefat">
|
486 |
-
<thead>
|
487 |
-
<tr>
|
488 |
-
<th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th>
|
489 |
-
<th><?php fs_esc_html_echo_inline( 'Name' ) ?></th>
|
490 |
-
<th><?php fs_esc_html_echo_inline( 'Email' ) ?></th>
|
491 |
-
<th><?php fs_esc_html_echo_inline( 'Verified' ) ?></th>
|
492 |
-
<th><?php fs_esc_html_echo_inline( 'Public Key' ) ?></th>
|
493 |
-
<th><?php fs_esc_html_echo_inline( 'Secret Key' ) ?></th>
|
494 |
-
<th><?php fs_esc_html_echo_inline( 'Actions' ) ?></th>
|
495 |
-
</tr>
|
496 |
-
</thead>
|
497 |
-
<tbody>
|
498 |
-
<?php foreach ( $users as $user_id => $user ) : ?>
|
499 |
-
<tr>
|
500 |
-
<td><?php echo $user->id ?></td>
|
501 |
-
<td><?php echo $user->get_name() ?></td>
|
502 |
-
<td><a href="mailto:<?php echo esc_attr( $user->email ) ?>"><?php echo $user->email ?></a></td>
|
503 |
-
<td><?php echo json_encode( $user->is_verified ) ?></td>
|
504 |
-
<td><?php echo $user->public_key ?></td>
|
505 |
-
<td><?php echo esc_html( $user->secret_key ) ?></td>
|
506 |
-
<td>
|
507 |
-
<form action="" method="POST">
|
508 |
-
<input type="hidden" name="fs_action" value="delete_user">
|
509 |
-
<?php wp_nonce_field( 'delete_user' ) ?>
|
510 |
-
<input type="hidden" name="user_id" value="<?php echo $user->id ?>">
|
511 |
-
<button type="submit" class="button"><?php fs_esc_html_echo_x_inline( 'Delete', 'verb', 'delete' ) ?></button>
|
512 |
-
</form>
|
513 |
-
</td>
|
514 |
-
</tr>
|
515 |
-
<?php endforeach ?>
|
516 |
-
</tbody>
|
517 |
-
</table>
|
518 |
-
<?php endif ?>
|
519 |
-
<?php foreach ( $module_types as $module_type ) : ?>
|
520 |
-
<?php $licenses = $VARS[ $module_type . '_licenses' ] ?>
|
521 |
-
<?php if ( is_array( $licenses ) && count( $licenses ) > 0 ) : ?>
|
522 |
-
<h2><?php echo esc_html( sprintf( fs_text_inline( '%s Licenses', 'module-licenses' ), ( WP_FS__MODULE_TYPE_PLUGIN === $module_type ? fs_text_inline( 'Plugin', 'plugin' ) : fs_text_inline( 'Theme', 'theme' ) ) ) ) ?></h2>
|
523 |
-
<table id="fs_<?php echo $module_type ?>_licenses" class="widefat">
|
524 |
-
<thead>
|
525 |
-
<tr>
|
526 |
-
<th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th>
|
527 |
-
<th><?php fs_esc_html_echo_inline( 'Plugin ID' ) ?></th>
|
528 |
-
<th><?php fs_esc_html_echo_inline( 'User ID' ) ?></th>
|
529 |
-
<th><?php fs_esc_html_echo_inline( 'Plan ID' ) ?></th>
|
530 |
-
<th><?php fs_esc_html_echo_inline( 'Quota' ) ?></th>
|
531 |
-
<th><?php fs_esc_html_echo_inline( 'Activated' ) ?></th>
|
532 |
-
<th><?php fs_esc_html_echo_inline( 'Blocking' ) ?></th>
|
533 |
-
<th><?php fs_esc_html_echo_inline( 'License Key' ) ?></th>
|
534 |
-
<th><?php fs_esc_html_echo_x_inline( 'Expiration', 'as expiration date' ) ?></th>
|
535 |
-
</tr>
|
536 |
-
</thead>
|
537 |
-
<tbody>
|
538 |
-
<?php foreach ( $licenses as $license ) : ?>
|
539 |
-
<tr>
|
540 |
-
<td><?php echo $license->id ?></td>
|
541 |
-
<td><?php echo $license->plugin_id ?></td>
|
542 |
-
<td><?php echo $license->user_id ?></td>
|
543 |
-
<td><?php echo $license->plan_id ?></td>
|
544 |
-
<td><?php echo $license->is_unlimited() ? 'Unlimited' : ( $license->is_single_site() ? 'Single Site' : $license->quota ) ?></td>
|
545 |
-
<td><?php echo $license->activated ?></td>
|
546 |
-
<td><?php echo $license->is_block_features ? 'Blocking' : 'Flexible' ?></td>
|
547 |
-
<td><?php echo esc_html( $license->secret_key ) ?></td>
|
548 |
-
<td><?php echo $license->expiration ?></td>
|
549 |
-
</tr>
|
550 |
-
<?php endforeach ?>
|
551 |
-
</tbody>
|
552 |
-
</table>
|
553 |
-
<?php endif ?>
|
554 |
-
<?php endforeach ?>
|
555 |
-
<?php if ( FS_Logger::is_storage_logging_on() ) : ?>
|
556 |
-
|
557 |
-
<h2><?php fs_esc_html_echo_inline( 'Debug Log', 'debug-log' ) ?></h2>
|
558 |
-
|
559 |
-
<div id="fs_debug_filters">
|
560 |
-
<select name="type">
|
561 |
-
<option value="" selected="selected"><?php fs_esc_html_echo_inline( 'All Types', 'all-types' ) ?></option>
|
562 |
-
<option value="warn_error">Warnings & Errors</option>
|
563 |
-
<option value="error">Errors</option>
|
564 |
-
<option value="warn">Warnings</option>
|
565 |
-
<option value="info">Info</option>
|
566 |
-
</select>
|
567 |
-
<select name="request_type">
|
568 |
-
<option value="" selected="selected"><?php fs_esc_html_echo_inline( 'All Requests', 'all-requests' ) ?></option>
|
569 |
-
<option value="call">Sync</option>
|
570 |
-
<option value="ajax">AJAX</option>
|
571 |
-
<option value="cron">WP Cron</option>
|
572 |
-
</select>
|
573 |
-
<input name="file" type="text" placeholder="<?php fs_esc_attr_echo_inline( 'File' ) ?>"/>
|
574 |
-
<input name="function" type="text" placeholder="<?php fs_esc_attr_echo_inline( 'Function' ) ?>"/>
|
575 |
-
<input name="process_id" type="text" placeholder="<?php fs_esc_attr_echo_inline( 'Process ID' ) ?>"/>
|
576 |
-
<input name="logger" type="text" placeholder="<?php fs_esc_attr_echo_inline( 'Logger' ) ?>"/>
|
577 |
-
<input name="message" type="text" placeholder="<?php fs_esc_attr_echo_inline( 'Message' ) ?>"/>
|
578 |
-
<div style="margin: 10px 0">
|
579 |
-
<button id="fs_filter" class="button" style="float: left"><i class="dashicons dashicons-filter"></i> <?php fs_esc_html_echo_inline( 'Filter', 'filter' ) ?>
|
580 |
-
</button>
|
581 |
-
|
582 |
-
<form action="" method="POST" style="float: left; margin-left: 10px;">
|
583 |
-
<input type="hidden" name="fs_action" value="download_logs">
|
584 |
-
<?php wp_nonce_field( 'download_logs' ) ?>
|
585 |
-
<div class="fs-filters"></div>
|
586 |
-
<button id="fs_download" class="button" type="submit"><i
|
587 |
-
class="dashicons dashicons-download"></i> <?php fs_esc_html_echo_inline( 'Download' ) ?></button>
|
588 |
-
</form>
|
589 |
-
<div style="clear: both"></div>
|
590 |
-
</div>
|
591 |
-
</div>
|
592 |
-
|
593 |
-
<div id="fs_log_book" style="height: 300px; overflow: auto;">
|
594 |
-
<table class="widefat">
|
595 |
-
<thead>
|
596 |
-
<tr>
|
597 |
-
<th>#</th>
|
598 |
-
<th><?php fs_esc_html_echo_inline( 'Type' ) ?></th>
|
599 |
-
<th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th>
|
600 |
-
<th><?php fs_esc_html_echo_inline( 'Function' ) ?></th>
|
601 |
-
<th><?php fs_esc_html_echo_inline( 'Message' ) ?></th>
|
602 |
-
<th><?php fs_esc_html_echo_inline( 'File' ) ?></th>
|
603 |
-
<th><?php fs_esc_html_echo_inline( 'Timestamp' ) ?></th>
|
604 |
-
</tr>
|
605 |
-
</thead>
|
606 |
-
<tbody>
|
607 |
-
<tr style="display: none">
|
608 |
-
<td>{$log.log_order}.</td>
|
609 |
-
<td class="fs-col--type">{$log.type}</td>
|
610 |
-
<td class="fs-col--logger">{$log.logger}</td>
|
611 |
-
<td class="fs-col--function">{$log.function}</td>
|
612 |
-
<td class="fs-col--message">
|
613 |
-
<a href="#" onclick="jQuery(this).parent().find('div').toggle(); return false;">
|
614 |
-
<nobr>{$log.message_short}</nobr>
|
615 |
-
</a>
|
616 |
-
<div style="display: none;">{$log.message}</div>
|
617 |
-
</td>
|
618 |
-
<td class="fs-col--file">{$log.file}:{$log.line}</td>
|
619 |
-
<td class="fs-col--timestamp">{$log.created}</td>
|
620 |
-
</tr>
|
621 |
-
|
622 |
-
</tbody>
|
623 |
-
</table>
|
624 |
-
</div>
|
625 |
-
<script type="text/javascript">
|
626 |
-
jQuery(document).ready(function ($) {
|
627 |
-
var filtersChanged = false,
|
628 |
-
offset = 0,
|
629 |
-
limit = 200,
|
630 |
-
prevFiltersSignature = null;
|
631 |
-
|
632 |
-
var getFilters = function () {
|
633 |
-
var filters = {},
|
634 |
-
signature = '';
|
635 |
-
|
636 |
-
$('#fs_debug_filters').find('select, input').each(function (i, e) {
|
637 |
-
var $element = $(e);
|
638 |
-
|
639 |
-
if ('hidden' === $element.attr('type'))
|
640 |
-
return;
|
641 |
-
|
642 |
-
var val = $element.val();
|
643 |
-
if ('' !== val.trim()) {
|
644 |
-
var name = $(e).attr('name');
|
645 |
-
filters[name] = val;
|
646 |
-
signature += name + '=' + val + '~';
|
647 |
-
}
|
648 |
-
});
|
649 |
-
|
650 |
-
if (signature != prevFiltersSignature) {
|
651 |
-
filtersChanged = true;
|
652 |
-
prevFiltersSignature = signature;
|
653 |
-
} else {
|
654 |
-
filtersChanged = false;
|
655 |
-
}
|
656 |
-
|
657 |
-
return filters;
|
658 |
-
};
|
659 |
-
|
660 |
-
$('#fs_download').parent().submit(function () {
|
661 |
-
var filters = getFilters(),
|
662 |
-
hiddenFields = '';
|
663 |
-
|
664 |
-
for (var f in filters) {
|
665 |
-
if (filters.hasOwnProperty(f)) {
|
666 |
-
hiddenFields += '<input type="hidden" name="filters[' + f + ']" value="' + filters[f] + '" />';
|
667 |
-
}
|
668 |
-
}
|
669 |
-
|
670 |
-
$(this).find('.fs-filters').html(hiddenFields);
|
671 |
-
});
|
672 |
-
|
673 |
-
var loadLogs = function () {
|
674 |
-
var $tbody = $('#fs_log_book tbody'),
|
675 |
-
template = $tbody.find('tr:first-child').html(),
|
676 |
-
filters = getFilters();
|
677 |
-
|
678 |
-
if (!filtersChanged) {
|
679 |
-
offset += limit;
|
680 |
-
} else {
|
681 |
-
// Cleanup table for new filter (only keep template row).
|
682 |
-
$tbody.find('tr').each(function (i, e) {
|
683 |
-
if (0 == i)
|
684 |
-
return;
|
685 |
-
|
686 |
-
$(e).remove();
|
687 |
-
});
|
688 |
-
|
689 |
-
offset = 0;
|
690 |
-
}
|
691 |
-
|
692 |
-
$.post(ajaxurl, {
|
693 |
-
action : 'fs_get_debug_log',
|
694 |
-
filters: filters,
|
695 |
-
offset : offset,
|
696 |
-
limit : limit
|
697 |
-
}, function (response) {
|
698 |
-
|
699 |
-
for (var i = 0; i < response.data.length; i++) {
|
700 |
-
var templateCopy = template;
|
701 |
-
|
702 |
-
response.data[i].message_short = (response.data[i].message.length > 32) ?
|
703 |
-
response.data[i].message.substr(0, 32) + '...' :
|
704 |
-
response.data[i].message;
|
705 |
-
|
706 |
-
for (var p in response.data[i]) {
|
707 |
-
if (response.data[i].hasOwnProperty(p)) {
|
708 |
-
templateCopy = templateCopy.replace('{$log.' + p + '}', response.data[i][p]);
|
709 |
-
}
|
710 |
-
}
|
711 |
-
|
712 |
-
$tbody.append('<tr' + (i % 2 ? ' class="alternate"' : '') + '>' + templateCopy + '</tr>');
|
713 |
-
}
|
714 |
-
});
|
715 |
-
};
|
716 |
-
|
717 |
-
$('#fs_filter').click(function () {
|
718 |
-
loadLogs();
|
719 |
-
|
720 |
-
return false;
|
721 |
-
});
|
722 |
-
|
723 |
-
loadLogs();
|
724 |
-
});
|
725 |
-
</script>
|
726 |
-
<?php endif ?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.1.1
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
|
13 |
+
global $fs_active_plugins;
|
14 |
+
|
15 |
+
$fs_options = FS_Options::instance( WP_FS__ACCOUNTS_OPTION_NAME, true );
|
16 |
+
|
17 |
+
$off_text = fs_text_x_inline( 'Off', 'as turned off' );
|
18 |
+
$on_text = fs_text_x_inline( 'On', 'as turned on' );
|
19 |
+
?>
|
20 |
+
<h1><?php echo fs_text_inline( 'Freemius Debug' ) . ' - ' . fs_text_inline( 'SDK' ) . ' v.' . $fs_active_plugins->newest->version ?></h1>
|
21 |
+
<div>
|
22 |
+
<!-- Debugging Switch -->
|
23 |
+
<?php //$debug_mode = get_option( 'fs_debug_mode', null ) ?>
|
24 |
+
<span class="switch-label"><?php fs_esc_html_echo_x_inline( 'Debugging', 'as code debugging' ) ?></span>
|
25 |
+
|
26 |
+
<div class="switch <?php echo WP_FS__DEBUG_SDK ? 'off' : 'on' ?>">
|
27 |
+
<div class="toggle"></div>
|
28 |
+
<span class="on"><?php echo esc_html( $on_text ) ?></span>
|
29 |
+
<span class="off"><?php echo esc_html( $off_text ) ?></span>
|
30 |
+
</div>
|
31 |
+
<script type="text/javascript">
|
32 |
+
(function ($) {
|
33 |
+
$(document).ready(function () {
|
34 |
+
// Switch toggle
|
35 |
+
$('.switch').click(function () {
|
36 |
+
$(this)
|
37 |
+
.toggleClass('on')
|
38 |
+
.toggleClass('off');
|
39 |
+
|
40 |
+
$.post(ajaxurl, {
|
41 |
+
action: 'fs_toggle_debug_mode',
|
42 |
+
is_on : ($(this).hasClass('off') ? 1 : 0)
|
43 |
+
}, function (response) {
|
44 |
+
if (1 == response) {
|
45 |
+
// Refresh page on success.
|
46 |
+
location.reload();
|
47 |
+
}
|
48 |
+
});
|
49 |
+
});
|
50 |
+
});
|
51 |
+
}(jQuery));
|
52 |
+
</script>
|
53 |
+
</div>
|
54 |
+
<h2><?php fs_esc_html_echo_inline( 'Actions', 'actions' ) ?></h2>
|
55 |
+
<table>
|
56 |
+
<tbody>
|
57 |
+
<tr>
|
58 |
+
<td>
|
59 |
+
<!-- Delete All Accounts -->
|
60 |
+
<form action="" method="POST">
|
61 |
+
<input type="hidden" name="fs_action" value="restart_freemius">
|
62 |
+
<?php wp_nonce_field( 'restart_freemius' ) ?>
|
63 |
+
<button class="button button-primary"
|
64 |
+
onclick="if (confirm('<?php fs_esc_attr_echo_inline( 'Are you sure you want to delete all Freemius data?', 'delete-all-confirm' ) ?>')) this.parentNode.submit(); return false;"><?php fs_esc_html_echo_inline( 'Delete All Accounts' ) ?></button>
|
65 |
+
</form>
|
66 |
+
</td>
|
67 |
+
<td>
|
68 |
+
<!-- Clear API Cache -->
|
69 |
+
<form action="" method="POST">
|
70 |
+
<input type="hidden" name="fs_clear_api_cache" value="true">
|
71 |
+
<button class="button button-primary"><?php fs_esc_html_echo_inline( 'Clear API Cache' ) ?></button>
|
72 |
+
</form>
|
73 |
+
</td>
|
74 |
+
<td>
|
75 |
+
<!-- Clear Updates Transients -->
|
76 |
+
<form action="" method="POST">
|
77 |
+
<input type="hidden" name="fs_action" value="clear_updates_data">
|
78 |
+
<?php wp_nonce_field( 'clear_updates_data' ) ?>
|
79 |
+
<button class="button"><?php fs_esc_html_echo_inline( 'Clear Updates Transients' ) ?></button>
|
80 |
+
</form>
|
81 |
+
</td>
|
82 |
+
<td>
|
83 |
+
<!-- Sync Data with Server -->
|
84 |
+
<form action="" method="POST">
|
85 |
+
<input type="hidden" name="background_sync" value="true">
|
86 |
+
<button class="button button-primary"><?php fs_esc_html_echo_inline( 'Sync Data From Server' ) ?></button>
|
87 |
+
</form>
|
88 |
+
</td>
|
89 |
+
<?php if ( fs_is_network_admin() && true !== $fs_options->get_option( 'ms_migration_complete', false, true ) ) : ?>
|
90 |
+
<td>
|
91 |
+
<!-- Migrate Options to Network -->
|
92 |
+
<form action="" method="POST">
|
93 |
+
<input type="hidden" name="fs_action" value="migrate_options_to_network">
|
94 |
+
<?php wp_nonce_field( 'migrate_options_to_network' ) ?>
|
95 |
+
<button class="button button-primary"><?php fs_esc_html_echo_inline( 'Migrate Options to Network' ) ?></button>
|
96 |
+
</form>
|
97 |
+
</td>
|
98 |
+
<?php endif ?>
|
99 |
+
<td>
|
100 |
+
<button id="fs_load_db_option" class="button"><?php fs_esc_html_echo_inline( 'Load DB Option' ) ?></button>
|
101 |
+
</td>
|
102 |
+
<td>
|
103 |
+
<button id="fs_set_db_option" class="button"><?php fs_esc_html_echo_inline( 'Set DB Option' ) ?></button>
|
104 |
+
</td>
|
105 |
+
</tr>
|
106 |
+
</tbody>
|
107 |
+
</table>
|
108 |
+
<script type="text/javascript">
|
109 |
+
(function ($) {
|
110 |
+
$('#fs_load_db_option').click(function () {
|
111 |
+
var optionName = prompt('Please enter the option name:');
|
112 |
+
|
113 |
+
if (optionName) {
|
114 |
+
$.post(ajaxurl, {
|
115 |
+
action : 'fs_get_db_option',
|
116 |
+
_wpnonce : '<?php echo wp_create_nonce( 'fs_get_db_option' ) ?>',
|
117 |
+
option_name: optionName
|
118 |
+
}, function (response) {
|
119 |
+
if (response.data.value)
|
120 |
+
prompt('The option value is:', response.data.value);
|
121 |
+
else
|
122 |
+
alert('Oops... Option does not exist in the DB.');
|
123 |
+
});
|
124 |
+
}
|
125 |
+
});
|
126 |
+
|
127 |
+
$('#fs_set_db_option').click(function () {
|
128 |
+
var optionName = prompt('Please enter the option name:');
|
129 |
+
|
130 |
+
if (optionName) {
|
131 |
+
var optionValue = prompt('Please enter the option value:');
|
132 |
+
|
133 |
+
if (optionValue) {
|
134 |
+
$.post(ajaxurl, {
|
135 |
+
action : 'fs_set_db_option',
|
136 |
+
_wpnonce : '<?php echo wp_create_nonce( 'fs_set_db_option' ) ?>',
|
137 |
+
option_name : optionName,
|
138 |
+
option_value: optionValue
|
139 |
+
}, function () {
|
140 |
+
alert('Option was successfully set.');
|
141 |
+
});
|
142 |
+
}
|
143 |
+
}
|
144 |
+
});
|
145 |
+
})(jQuery);
|
146 |
+
</script>
|
147 |
+
<?php
|
148 |
+
if ( ! defined( 'FS_API__ADDRESS' ) ) {
|
149 |
+
define( 'FS_API__ADDRESS', '://api.freemius.com' );
|
150 |
+
}
|
151 |
+
if ( ! defined( 'FS_API__SANDBOX_ADDRESS' ) ) {
|
152 |
+
define( 'FS_API__SANDBOX_ADDRESS', '://sandbox-api.freemius.com' );
|
153 |
+
}
|
154 |
+
|
155 |
+
$defines = array(
|
156 |
+
array(
|
157 |
+
'key' => 'WP_FS__REMOTE_ADDR',
|
158 |
+
'val' => WP_FS__REMOTE_ADDR,
|
159 |
+
),
|
160 |
+
array(
|
161 |
+
'key' => 'WP_FS__ADDRESS_PRODUCTION',
|
162 |
+
'val' => WP_FS__ADDRESS_PRODUCTION,
|
163 |
+
),
|
164 |
+
array(
|
165 |
+
'key' => 'FS_API__ADDRESS',
|
166 |
+
'val' => FS_API__ADDRESS,
|
167 |
+
),
|
168 |
+
array(
|
169 |
+
'key' => 'FS_API__SANDBOX_ADDRESS',
|
170 |
+
'val' => FS_API__SANDBOX_ADDRESS,
|
171 |
+
),
|
172 |
+
array(
|
173 |
+
'key' => 'WP_FS__DIR',
|
174 |
+
'val' => WP_FS__DIR,
|
175 |
+
),
|
176 |
+
)
|
177 |
+
?>
|
178 |
+
<br>
|
179 |
+
<table class="widefat">
|
180 |
+
<thead>
|
181 |
+
<tr>
|
182 |
+
<th><?php fs_esc_html_echo_inline( 'Key', 'key' ) ?></th>
|
183 |
+
<th><?php fs_esc_html_echo_inline( 'Value', 'value' ) ?></th>
|
184 |
+
</tr>
|
185 |
+
</thead>
|
186 |
+
<tbody>
|
187 |
+
<?php $alternate = false;
|
188 |
+
foreach ( $defines as $p ) : ?>
|
189 |
+
<tr<?php if ( $alternate ) {
|
190 |
+
echo ' class="alternate"';
|
191 |
+
} ?>>
|
192 |
+
<td><?php echo $p['key'] ?></td>
|
193 |
+
<td><?php echo $p['val'] ?></td>
|
194 |
+
</tr>
|
195 |
+
<?php $alternate = ! $alternate ?>
|
196 |
+
<?php endforeach ?>
|
197 |
+
</tbody>
|
198 |
+
</table>
|
199 |
+
<h2><?php fs_esc_html_echo_x_inline( 'SDK Versions', 'as software development kit versions', 'sdk-versions' ) ?></h2>
|
200 |
+
<table id="fs_sdks" class="widefat">
|
201 |
+
<thead>
|
202 |
+
<tr>
|
203 |
+
<th><?php fs_esc_html_echo_x_inline( 'Version', 'product version' ) ?></th>
|
204 |
+
<th><?php fs_esc_html_echo_inline( 'SDK Path' ) ?></th>
|
205 |
+
<th><?php fs_esc_html_echo_inline( 'Module Path' ) ?></th>
|
206 |
+
<th><?php fs_esc_html_echo_inline( 'Is Active' ) ?></th>
|
207 |
+
</tr>
|
208 |
+
</thead>
|
209 |
+
<tbody>
|
210 |
+
<?php foreach ( $fs_active_plugins->plugins as $sdk_path => $data ) : ?>
|
211 |
+
<?php $is_active = ( WP_FS__SDK_VERSION == $data->version ) ?>
|
212 |
+
<tr<?php if ( $is_active ) {
|
213 |
+
echo ' style="background: #E6FFE6; font-weight: bold"';
|
214 |
+
} ?>>
|
215 |
+
<td><?php echo $data->version ?></td>
|
216 |
+
<td><?php echo $sdk_path ?></td>
|
217 |
+
<td><?php echo $data->plugin_path ?></td>
|
218 |
+
<td><?php echo ( $is_active ) ? 'Active' : 'Inactive' ?></td>
|
219 |
+
</tr>
|
220 |
+
<?php endforeach ?>
|
221 |
+
</tbody>
|
222 |
+
</table>
|
223 |
+
|
224 |
+
<?php
|
225 |
+
$module_types = array(
|
226 |
+
WP_FS__MODULE_TYPE_PLUGIN,
|
227 |
+
WP_FS__MODULE_TYPE_THEME
|
228 |
+
);
|
229 |
+
?>
|
230 |
+
|
231 |
+
<?php foreach ( $module_types as $module_type ) : ?>
|
232 |
+
<?php $modules = $fs_options->get_option( $module_type . 's' ) ?>
|
233 |
+
<?php if ( is_array( $modules ) && count( $modules ) > 0 ) : ?>
|
234 |
+
<h2><?php echo esc_html( ( WP_FS__MODULE_TYPE_PLUGIN == $module_type ) ? fs_text_inline( 'Plugins', 'plugins' ) : fs_text_inline( 'Themes', 'themes' ) ) ?></h2>
|
235 |
+
<table id="fs_<?php echo $module_type ?>" class="widefat">
|
236 |
+
<thead>
|
237 |
+
<tr>
|
238 |
+
<th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th>
|
239 |
+
<th><?php fs_esc_html_echo_inline( 'Slug' ) ?></th>
|
240 |
+
<th><?php fs_esc_html_echo_x_inline( 'Version', 'product version' ) ?></th>
|
241 |
+
<th><?php fs_esc_html_echo_inline( 'Title' ) ?></th>
|
242 |
+
<th><?php fs_esc_html_echo_x_inline( 'API', 'as application program interface' ) ?></th>
|
243 |
+
<th><?php fs_esc_html_echo_inline( 'Freemius State' ) ?></th>
|
244 |
+
<th><?php fs_esc_html_echo_inline( 'Module Path' ) ?></th>
|
245 |
+
<th><?php fs_esc_html_echo_inline( 'Public Key' ) ?></th>
|
246 |
+
<?php if ( is_multisite() ) : ?>
|
247 |
+
<th><?php fs_esc_html_echo_inline( 'Network Blog' ) ?></th>
|
248 |
+
<th><?php fs_esc_html_echo_inline( 'Network User' ) ?></th>
|
249 |
+
<?php endif ?>
|
250 |
+
<th><?php fs_esc_html_echo_inline( 'Actions' ) ?></th>
|
251 |
+
</tr>
|
252 |
+
</thead>
|
253 |
+
<tbody>
|
254 |
+
<?php foreach ( $modules as $slug => $data ) : ?>
|
255 |
+
<?php
|
256 |
+
if ( WP_FS__MODULE_TYPE_THEME !== $module_type ) {
|
257 |
+
$is_active = is_plugin_active( $data->file );
|
258 |
+
} else {
|
259 |
+
$current_theme = wp_get_theme();
|
260 |
+
$is_active = ( $current_theme->stylesheet === $data->file );
|
261 |
+
|
262 |
+
if ( ! $is_active && is_child_theme() ) {
|
263 |
+
$parent_theme = $current_theme->parent();
|
264 |
+
|
265 |
+
$is_active = ( ( $parent_theme instanceof WP_Theme ) && $parent_theme->stylesheet === $data->file );
|
266 |
+
}
|
267 |
+
}
|
268 |
+
?>
|
269 |
+
<?php $fs = $is_active ? freemius( $data->id ) : null ?>
|
270 |
+
<tr<?php if ( $is_active ) {
|
271 |
+
if ( $fs->has_api_connectivity() && $fs->is_on() ) {
|
272 |
+
echo ' style="background: #E6FFE6; font-weight: bold"';
|
273 |
+
} else {
|
274 |
+
echo ' style="background: #ffd0d0; font-weight: bold"';
|
275 |
+
}
|
276 |
+
} ?>>
|
277 |
+
<td><?php echo $data->id ?></td>
|
278 |
+
<td><?php echo $slug ?></td>
|
279 |
+
<td><?php echo $data->version ?></td>
|
280 |
+
<td><?php echo $data->title ?></td>
|
281 |
+
<td<?php if ( $is_active && ! $fs->has_api_connectivity() ) {
|
282 |
+
echo ' style="color: red; text-transform: uppercase;"';
|
283 |
+
} ?>><?php if ( $is_active ) {
|
284 |
+
echo esc_html( $fs->has_api_connectivity() ?
|
285 |
+
fs_text_x_inline( 'Connected', 'as connection was successful' ) :
|
286 |
+
fs_text_x_inline( 'Blocked', 'as connection blocked' )
|
287 |
+
);
|
288 |
+
} ?></td>
|
289 |
+
<td<?php if ( $is_active && ! $fs->is_on() ) {
|
290 |
+
echo ' style="color: red; text-transform: uppercase;"';
|
291 |
+
} ?>><?php if ( $is_active ) {
|
292 |
+
echo esc_html( $fs->is_on() ?
|
293 |
+
$on_text :
|
294 |
+
$off_text
|
295 |
+
);
|
296 |
+
} ?></td>
|
297 |
+
<td><?php echo $data->file ?></td>
|
298 |
+
<td><?php echo $data->public_key ?></td>
|
299 |
+
<?php if ( is_multisite() ) : ?>
|
300 |
+
<?php
|
301 |
+
$network_blog_id = null;
|
302 |
+
$network_user = null;
|
303 |
+
|
304 |
+
if ( is_object( $fs ) ) {
|
305 |
+
$network_blog_id = $fs->get_network_install_blog_id();
|
306 |
+
$network_user = $fs->get_network_user();
|
307 |
+
}
|
308 |
+
?>
|
309 |
+
<td><?php echo is_numeric( $network_blog_id ) ? $network_blog_id : '' ?></td>
|
310 |
+
<td><?php if ( is_object( $network_user ) ) {
|
311 |
+
echo $network_user->email;
|
312 |
+
} ?></td>
|
313 |
+
<?php endif ?>
|
314 |
+
<td>
|
315 |
+
<?php if ( $is_active ) : ?>
|
316 |
+
<?php if ( $fs->has_trial_plan() ) : ?>
|
317 |
+
<form action="" method="POST">
|
318 |
+
<input type="hidden" name="fs_action" value="simulate_trial">
|
319 |
+
<input type="hidden" name="module_id" value="<?php echo $fs->get_id() ?>">
|
320 |
+
<?php wp_nonce_field( 'simulate_trial' ) ?>
|
321 |
+
|
322 |
+
<button type="submit" class="button button-primary simulate-trial"><?php fs_esc_html_echo_inline( 'Simulate Trial Promotion' ) ?></button>
|
323 |
+
</form>
|
324 |
+
<?php endif ?>
|
325 |
+
<?php if ( $fs->is_registered() ) : ?>
|
326 |
+
<a class="button" href="<?php echo $fs->get_account_url() ?>"><?php fs_esc_html_echo_inline( 'Account', 'account' ) ?></a>
|
327 |
+
<?php endif ?>
|
328 |
+
<?php if ( fs_is_network_admin() && ! $fs->is_network_upgrade_mode() ) : ?>
|
329 |
+
<form action="" method="POST">
|
330 |
+
<input type="hidden" name="fs_action" value="simulate_network_upgrade">
|
331 |
+
<input type="hidden" name="module_id" value="<?php echo $fs->get_id() ?>">
|
332 |
+
<?php wp_nonce_field( 'simulate_network_upgrade' ) ?>
|
333 |
+
|
334 |
+
<button type="submit" class="button button-small"><?php fs_esc_html_echo_inline( 'Simulate Network Upgrade' ) ?></button>
|
335 |
+
</form>
|
336 |
+
<?php endif ?>
|
337 |
+
<?php endif ?>
|
338 |
+
</td>
|
339 |
+
</tr>
|
340 |
+
<?php endforeach ?>
|
341 |
+
</tbody>
|
342 |
+
</table>
|
343 |
+
<?php endif ?>
|
344 |
+
<?php endforeach ?>
|
345 |
+
<?php foreach ( $module_types as $module_type ) : ?>
|
346 |
+
<?php
|
347 |
+
/**
|
348 |
+
* @var array $VARS
|
349 |
+
* @var array[string]FS_Site|array[string]FS_Site[] $sites_map
|
350 |
+
*/
|
351 |
+
$sites_map = $VARS[ $module_type . '_sites' ];
|
352 |
+
|
353 |
+
$is_multisite = is_multisite();
|
354 |
+
$all_plans = false;
|
355 |
+
$plans = false;
|
356 |
+
?>
|
357 |
+
<?php if ( is_array( $sites_map ) && count( $sites_map ) > 0 ) : ?>
|
358 |
+
<h2><?php echo esc_html( sprintf(
|
359 |
+
/* translators: %s: 'plugin' or 'theme' */
|
360 |
+
fs_text_inline( '%s Installs', 'module-installs' ),
|
361 |
+
( WP_FS__MODULE_TYPE_PLUGIN === $module_type ? fs_text_inline( 'Plugin', 'plugin' ) : fs_text_inline( 'Theme', 'theme' ) )
|
362 |
+
) ) ?> / <?php fs_esc_html_echo_x_inline( 'Sites', 'like websites', 'sites' ) ?></h2>
|
363 |
+
<table id="fs_<?php echo $module_type ?>_installs" class="widefat">
|
364 |
+
<thead>
|
365 |
+
<tr>
|
366 |
+
<th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th>
|
367 |
+
<?php if ( $is_multisite ) : ?>
|
368 |
+
<th><?php fs_esc_html_echo_inline( 'Blog ID' ) ?></th>
|
369 |
+
<th><?php fs_esc_html_echo_inline( 'Address' ) ?></th>
|
370 |
+
<?php endif ?>
|
371 |
+
<th><?php fs_esc_html_echo_inline( 'Slug' ) ?></th>
|
372 |
+
<th><?php fs_esc_html_echo_inline( 'User ID' ) ?></th>
|
373 |
+
<th><?php fs_esc_html_echo_x_inline( 'Plan', 'as product pricing plan', 'plan' ) ?></th>
|
374 |
+
<th><?php fs_esc_html_echo_inline( 'Public Key' ) ?></th>
|
375 |
+
<th><?php fs_esc_html_echo_inline( 'Secret Key' ) ?></th>
|
376 |
+
<th><?php fs_esc_html_echo_inline( 'Actions' ) ?></th>
|
377 |
+
</tr>
|
378 |
+
</thead>
|
379 |
+
<tbody>
|
380 |
+
<?php foreach ( $sites_map as $slug => $sites ) : ?>
|
381 |
+
<?php if ( ! is_array( $sites ) ) {
|
382 |
+
$sites = array( $sites );
|
383 |
+
} ?>
|
384 |
+
<?php foreach ( $sites as $site ) : ?>
|
385 |
+
<tr>
|
386 |
+
<td><?php echo $site->id ?></td>
|
387 |
+
<?php if ( $is_multisite ) : ?>
|
388 |
+
<td><?php echo $site->blog_id ?></td>
|
389 |
+
<td><?php echo fs_strip_url_protocol( $site->url ) ?></td>
|
390 |
+
<?php endif ?>
|
391 |
+
<td><?php echo $slug ?></td>
|
392 |
+
<td><?php echo $site->user_id ?></td>
|
393 |
+
<td><?php
|
394 |
+
$plan_name = '';
|
395 |
+
if ( FS_Plugin_Plan::is_valid_id( $site->plan_id ) ) {
|
396 |
+
if ( false === $all_plans ) {
|
397 |
+
$option_name = 'plans';
|
398 |
+
if ( WP_FS__MODULE_TYPE_PLUGIN !== $module_type ) {
|
399 |
+
$option_name = $module_type . '_' . $option_name;
|
400 |
+
}
|
401 |
+
|
402 |
+
$all_plans = $fs_options->get_option( $option_name, array() );
|
403 |
+
}
|
404 |
+
|
405 |
+
if ( false === $plans ) {
|
406 |
+
$plans = $all_plans[ $slug ];
|
407 |
+
}
|
408 |
+
|
409 |
+
foreach ( $plans as $plan ) {
|
410 |
+
$plan_id = Freemius::_decrypt( $plan->id );
|
411 |
+
|
412 |
+
if ( $site->plan_id == $plan_id ) {
|
413 |
+
$plan_name = Freemius::_decrypt( $plan->name );
|
414 |
+
break;
|
415 |
+
}
|
416 |
+
}
|
417 |
+
}
|
418 |
+
|
419 |
+
echo $plan_name;
|
420 |
+
?></td>
|
421 |
+
<td><?php echo $site->public_key ?></td>
|
422 |
+
<td><?php echo esc_html( $site->secret_key ) ?></td>
|
423 |
+
<td>
|
424 |
+
<form action="" method="POST">
|
425 |
+
<input type="hidden" name="fs_action" value="delete_install">
|
426 |
+
<?php wp_nonce_field( 'delete_install' ) ?>
|
427 |
+
<input type="hidden" name="module_id" value="<?php echo $site->plugin_id ?>">
|
428 |
+
<?php if ( $is_multisite ) : ?>
|
429 |
+
<input type="hidden" name="blog_id" value="<?php echo $site->blog_id ?>">
|
430 |
+
<?php endif ?>
|
431 |
+
<input type="hidden" name="module_type" value="<?php echo $module_type ?>">
|
432 |
+
<input type="hidden" name="slug" value="<?php echo $slug ?>">
|
433 |
+
<button type="submit" class="button"><?php fs_esc_html_echo_x_inline( 'Delete', 'verb', 'delete' ) ?></button>
|
434 |
+
</form>
|
435 |
+
</td>
|
436 |
+
</tr>
|
437 |
+
<?php endforeach ?>
|
438 |
+
<?php endforeach ?>
|
439 |
+
</tbody>
|
440 |
+
</table>
|
441 |
+
<?php endif ?>
|
442 |
+
<?php endforeach ?>
|
443 |
+
<?php
|
444 |
+
$addons = $VARS['addons'];
|
445 |
+
?>
|
446 |
+
<?php foreach ( $addons as $plugin_id => $plugin_addons ) : ?>
|
447 |
+
<h2><?php echo esc_html( sprintf( fs_text_inline( 'Add Ons of module %s', 'addons-of-x' ), $plugin_id ) ) ?></h2>
|
448 |
+
<table id="fs_addons" class="widefat">
|
449 |
+
<thead>
|
450 |
+
<tr>
|
451 |
+
<th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th>
|
452 |
+
<th><?php fs_esc_html_echo_inline( 'Title' ) ?></th>
|
453 |
+
<th><?php fs_esc_html_echo_inline( 'Slug' ) ?></th>
|
454 |
+
<th><?php fs_esc_html_echo_x_inline( 'Version', 'product version' ) ?></th>
|
455 |
+
<th><?php fs_esc_html_echo_inline( 'Public Key' ) ?></th>
|
456 |
+
<th><?php fs_esc_html_echo_inline( 'Secret Key' ) ?></th>
|
457 |
+
</tr>
|
458 |
+
</thead>
|
459 |
+
<tbody>
|
460 |
+
<?php
|
461 |
+
/**
|
462 |
+
* @var FS_Plugin[] $plugin_addons
|
463 |
+
*/
|
464 |
+
foreach ( $plugin_addons as $addon ) : ?>
|
465 |
+
<tr>
|
466 |
+
<td><?php echo $addon->id ?></td>
|
467 |
+
<td><?php echo $addon->title ?></td>
|
468 |
+
<td><?php echo $addon->slug ?></td>
|
469 |
+
<td><?php echo $addon->version ?></td>
|
470 |
+
<td><?php echo $addon->public_key ?></td>
|
471 |
+
<td><?php echo esc_html( $addon->secret_key ) ?></td>
|
472 |
+
</tr>
|
473 |
+
<?php endforeach ?>
|
474 |
+
</tbody>
|
475 |
+
</table>
|
476 |
+
<?php endforeach ?>
|
477 |
+
<?php
|
478 |
+
/**
|
479 |
+
* @var FS_User[] $users
|
480 |
+
*/
|
481 |
+
$users = $VARS['users'];
|
482 |
+
?>
|
483 |
+
<?php if ( is_array( $users ) && 0 < count( $users ) ) : ?>
|
484 |
+
<h2><?php fs_esc_html_echo_inline( 'Users' ) ?></h2>
|
485 |
+
<table id="fs_users" class="widefat">
|
486 |
+
<thead>
|
487 |
+
<tr>
|
488 |
+
<th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th>
|
489 |
+
<th><?php fs_esc_html_echo_inline( 'Name' ) ?></th>
|
490 |
+
<th><?php fs_esc_html_echo_inline( 'Email' ) ?></th>
|
491 |
+
<th><?php fs_esc_html_echo_inline( 'Verified' ) ?></th>
|
492 |
+
<th><?php fs_esc_html_echo_inline( 'Public Key' ) ?></th>
|
493 |
+
<th><?php fs_esc_html_echo_inline( 'Secret Key' ) ?></th>
|
494 |
+
<th><?php fs_esc_html_echo_inline( 'Actions' ) ?></th>
|
495 |
+
</tr>
|
496 |
+
</thead>
|
497 |
+
<tbody>
|
498 |
+
<?php foreach ( $users as $user_id => $user ) : ?>
|
499 |
+
<tr>
|
500 |
+
<td><?php echo $user->id ?></td>
|
501 |
+
<td><?php echo $user->get_name() ?></td>
|
502 |
+
<td><a href="mailto:<?php echo esc_attr( $user->email ) ?>"><?php echo $user->email ?></a></td>
|
503 |
+
<td><?php echo json_encode( $user->is_verified ) ?></td>
|
504 |
+
<td><?php echo $user->public_key ?></td>
|
505 |
+
<td><?php echo esc_html( $user->secret_key ) ?></td>
|
506 |
+
<td>
|
507 |
+
<form action="" method="POST">
|
508 |
+
<input type="hidden" name="fs_action" value="delete_user">
|
509 |
+
<?php wp_nonce_field( 'delete_user' ) ?>
|
510 |
+
<input type="hidden" name="user_id" value="<?php echo $user->id ?>">
|
511 |
+
<button type="submit" class="button"><?php fs_esc_html_echo_x_inline( 'Delete', 'verb', 'delete' ) ?></button>
|
512 |
+
</form>
|
513 |
+
</td>
|
514 |
+
</tr>
|
515 |
+
<?php endforeach ?>
|
516 |
+
</tbody>
|
517 |
+
</table>
|
518 |
+
<?php endif ?>
|
519 |
+
<?php foreach ( $module_types as $module_type ) : ?>
|
520 |
+
<?php $licenses = $VARS[ $module_type . '_licenses' ] ?>
|
521 |
+
<?php if ( is_array( $licenses ) && count( $licenses ) > 0 ) : ?>
|
522 |
+
<h2><?php echo esc_html( sprintf( fs_text_inline( '%s Licenses', 'module-licenses' ), ( WP_FS__MODULE_TYPE_PLUGIN === $module_type ? fs_text_inline( 'Plugin', 'plugin' ) : fs_text_inline( 'Theme', 'theme' ) ) ) ) ?></h2>
|
523 |
+
<table id="fs_<?php echo $module_type ?>_licenses" class="widefat">
|
524 |
+
<thead>
|
525 |
+
<tr>
|
526 |
+
<th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th>
|
527 |
+
<th><?php fs_esc_html_echo_inline( 'Plugin ID' ) ?></th>
|
528 |
+
<th><?php fs_esc_html_echo_inline( 'User ID' ) ?></th>
|
529 |
+
<th><?php fs_esc_html_echo_inline( 'Plan ID' ) ?></th>
|
530 |
+
<th><?php fs_esc_html_echo_inline( 'Quota' ) ?></th>
|
531 |
+
<th><?php fs_esc_html_echo_inline( 'Activated' ) ?></th>
|
532 |
+
<th><?php fs_esc_html_echo_inline( 'Blocking' ) ?></th>
|
533 |
+
<th><?php fs_esc_html_echo_inline( 'License Key' ) ?></th>
|
534 |
+
<th><?php fs_esc_html_echo_x_inline( 'Expiration', 'as expiration date' ) ?></th>
|
535 |
+
</tr>
|
536 |
+
</thead>
|
537 |
+
<tbody>
|
538 |
+
<?php foreach ( $licenses as $license ) : ?>
|
539 |
+
<tr>
|
540 |
+
<td><?php echo $license->id ?></td>
|
541 |
+
<td><?php echo $license->plugin_id ?></td>
|
542 |
+
<td><?php echo $license->user_id ?></td>
|
543 |
+
<td><?php echo $license->plan_id ?></td>
|
544 |
+
<td><?php echo $license->is_unlimited() ? 'Unlimited' : ( $license->is_single_site() ? 'Single Site' : $license->quota ) ?></td>
|
545 |
+
<td><?php echo $license->activated ?></td>
|
546 |
+
<td><?php echo $license->is_block_features ? 'Blocking' : 'Flexible' ?></td>
|
547 |
+
<td><?php echo esc_html( $license->secret_key ) ?></td>
|
548 |
+
<td><?php echo $license->expiration ?></td>
|
549 |
+
</tr>
|
550 |
+
<?php endforeach ?>
|
551 |
+
</tbody>
|
552 |
+
</table>
|
553 |
+
<?php endif ?>
|
554 |
+
<?php endforeach ?>
|
555 |
+
<?php if ( FS_Logger::is_storage_logging_on() ) : ?>
|
556 |
+
|
557 |
+
<h2><?php fs_esc_html_echo_inline( 'Debug Log', 'debug-log' ) ?></h2>
|
558 |
+
|
559 |
+
<div id="fs_debug_filters">
|
560 |
+
<select name="type">
|
561 |
+
<option value="" selected="selected"><?php fs_esc_html_echo_inline( 'All Types', 'all-types' ) ?></option>
|
562 |
+
<option value="warn_error">Warnings & Errors</option>
|
563 |
+
<option value="error">Errors</option>
|
564 |
+
<option value="warn">Warnings</option>
|
565 |
+
<option value="info">Info</option>
|
566 |
+
</select>
|
567 |
+
<select name="request_type">
|
568 |
+
<option value="" selected="selected"><?php fs_esc_html_echo_inline( 'All Requests', 'all-requests' ) ?></option>
|
569 |
+
<option value="call">Sync</option>
|
570 |
+
<option value="ajax">AJAX</option>
|
571 |
+
<option value="cron">WP Cron</option>
|
572 |
+
</select>
|
573 |
+
<input name="file" type="text" placeholder="<?php fs_esc_attr_echo_inline( 'File' ) ?>"/>
|
574 |
+
<input name="function" type="text" placeholder="<?php fs_esc_attr_echo_inline( 'Function' ) ?>"/>
|
575 |
+
<input name="process_id" type="text" placeholder="<?php fs_esc_attr_echo_inline( 'Process ID' ) ?>"/>
|
576 |
+
<input name="logger" type="text" placeholder="<?php fs_esc_attr_echo_inline( 'Logger' ) ?>"/>
|
577 |
+
<input name="message" type="text" placeholder="<?php fs_esc_attr_echo_inline( 'Message' ) ?>"/>
|
578 |
+
<div style="margin: 10px 0">
|
579 |
+
<button id="fs_filter" class="button" style="float: left"><i class="dashicons dashicons-filter"></i> <?php fs_esc_html_echo_inline( 'Filter', 'filter' ) ?>
|
580 |
+
</button>
|
581 |
+
|
582 |
+
<form action="" method="POST" style="float: left; margin-left: 10px;">
|
583 |
+
<input type="hidden" name="fs_action" value="download_logs">
|
584 |
+
<?php wp_nonce_field( 'download_logs' ) ?>
|
585 |
+
<div class="fs-filters"></div>
|
586 |
+
<button id="fs_download" class="button" type="submit"><i
|
587 |
+
class="dashicons dashicons-download"></i> <?php fs_esc_html_echo_inline( 'Download' ) ?></button>
|
588 |
+
</form>
|
589 |
+
<div style="clear: both"></div>
|
590 |
+
</div>
|
591 |
+
</div>
|
592 |
+
|
593 |
+
<div id="fs_log_book" style="height: 300px; overflow: auto;">
|
594 |
+
<table class="widefat">
|
595 |
+
<thead>
|
596 |
+
<tr>
|
597 |
+
<th>#</th>
|
598 |
+
<th><?php fs_esc_html_echo_inline( 'Type' ) ?></th>
|
599 |
+
<th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th>
|
600 |
+
<th><?php fs_esc_html_echo_inline( 'Function' ) ?></th>
|
601 |
+
<th><?php fs_esc_html_echo_inline( 'Message' ) ?></th>
|
602 |
+
<th><?php fs_esc_html_echo_inline( 'File' ) ?></th>
|
603 |
+
<th><?php fs_esc_html_echo_inline( 'Timestamp' ) ?></th>
|
604 |
+
</tr>
|
605 |
+
</thead>
|
606 |
+
<tbody>
|
607 |
+
<tr style="display: none">
|
608 |
+
<td>{$log.log_order}.</td>
|
609 |
+
<td class="fs-col--type">{$log.type}</td>
|
610 |
+
<td class="fs-col--logger">{$log.logger}</td>
|
611 |
+
<td class="fs-col--function">{$log.function}</td>
|
612 |
+
<td class="fs-col--message">
|
613 |
+
<a href="#" onclick="jQuery(this).parent().find('div').toggle(); return false;">
|
614 |
+
<nobr>{$log.message_short}</nobr>
|
615 |
+
</a>
|
616 |
+
<div style="display: none;">{$log.message}</div>
|
617 |
+
</td>
|
618 |
+
<td class="fs-col--file">{$log.file}:{$log.line}</td>
|
619 |
+
<td class="fs-col--timestamp">{$log.created}</td>
|
620 |
+
</tr>
|
621 |
+
|
622 |
+
</tbody>
|
623 |
+
</table>
|
624 |
+
</div>
|
625 |
+
<script type="text/javascript">
|
626 |
+
jQuery(document).ready(function ($) {
|
627 |
+
var filtersChanged = false,
|
628 |
+
offset = 0,
|
629 |
+
limit = 200,
|
630 |
+
prevFiltersSignature = null;
|
631 |
+
|
632 |
+
var getFilters = function () {
|
633 |
+
var filters = {},
|
634 |
+
signature = '';
|
635 |
+
|
636 |
+
$('#fs_debug_filters').find('select, input').each(function (i, e) {
|
637 |
+
var $element = $(e);
|
638 |
+
|
639 |
+
if ('hidden' === $element.attr('type'))
|
640 |
+
return;
|
641 |
+
|
642 |
+
var val = $element.val();
|
643 |
+
if ('' !== val.trim()) {
|
644 |
+
var name = $(e).attr('name');
|
645 |
+
filters[name] = val;
|
646 |
+
signature += name + '=' + val + '~';
|
647 |
+
}
|
648 |
+
});
|
649 |
+
|
650 |
+
if (signature != prevFiltersSignature) {
|
651 |
+
filtersChanged = true;
|
652 |
+
prevFiltersSignature = signature;
|
653 |
+
} else {
|
654 |
+
filtersChanged = false;
|
655 |
+
}
|
656 |
+
|
657 |
+
return filters;
|
658 |
+
};
|
659 |
+
|
660 |
+
$('#fs_download').parent().submit(function () {
|
661 |
+
var filters = getFilters(),
|
662 |
+
hiddenFields = '';
|
663 |
+
|
664 |
+
for (var f in filters) {
|
665 |
+
if (filters.hasOwnProperty(f)) {
|
666 |
+
hiddenFields += '<input type="hidden" name="filters[' + f + ']" value="' + filters[f] + '" />';
|
667 |
+
}
|
668 |
+
}
|
669 |
+
|
670 |
+
$(this).find('.fs-filters').html(hiddenFields);
|
671 |
+
});
|
672 |
+
|
673 |
+
var loadLogs = function () {
|
674 |
+
var $tbody = $('#fs_log_book tbody'),
|
675 |
+
template = $tbody.find('tr:first-child').html(),
|
676 |
+
filters = getFilters();
|
677 |
+
|
678 |
+
if (!filtersChanged) {
|
679 |
+
offset += limit;
|
680 |
+
} else {
|
681 |
+
// Cleanup table for new filter (only keep template row).
|
682 |
+
$tbody.find('tr').each(function (i, e) {
|
683 |
+
if (0 == i)
|
684 |
+
return;
|
685 |
+
|
686 |
+
$(e).remove();
|
687 |
+
});
|
688 |
+
|
689 |
+
offset = 0;
|
690 |
+
}
|
691 |
+
|
692 |
+
$.post(ajaxurl, {
|
693 |
+
action : 'fs_get_debug_log',
|
694 |
+
filters: filters,
|
695 |
+
offset : offset,
|
696 |
+
limit : limit
|
697 |
+
}, function (response) {
|
698 |
+
|
699 |
+
for (var i = 0; i < response.data.length; i++) {
|
700 |
+
var templateCopy = template;
|
701 |
+
|
702 |
+
response.data[i].message_short = (response.data[i].message.length > 32) ?
|
703 |
+
response.data[i].message.substr(0, 32) + '...' :
|
704 |
+
response.data[i].message;
|
705 |
+
|
706 |
+
for (var p in response.data[i]) {
|
707 |
+
if (response.data[i].hasOwnProperty(p)) {
|
708 |
+
templateCopy = templateCopy.replace('{$log.' + p + '}', response.data[i][p]);
|
709 |
+
}
|
710 |
+
}
|
711 |
+
|
712 |
+
$tbody.append('<tr' + (i % 2 ? ' class="alternate"' : '') + '>' + templateCopy + '</tr>');
|
713 |
+
}
|
714 |
+
});
|
715 |
+
};
|
716 |
+
|
717 |
+
$('#fs_filter').click(function () {
|
718 |
+
loadLogs();
|
719 |
+
|
720 |
+
return false;
|
721 |
+
});
|
722 |
+
|
723 |
+
loadLogs();
|
724 |
+
});
|
725 |
+
</script>
|
726 |
+
<?php endif ?>
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: bradvin, fooplugins, freemius
|
|
3 |
Donate link: http://fooplugins.com
|
4 |
Tags: lightbox,media,images,gallery,modal,gutenberg
|
5 |
Requires at least: 3.5.1
|
6 |
-
Tested up to: 5.
|
7 |
Stable tag: trunk
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -89,6 +89,18 @@ There is a setting to try and disable hard coded lightboxes, but this is not a s
|
|
89 |
|
90 |
== Changelog ==
|
91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
= 2.6.4 =
|
93 |
* IMPORTANT : Please update to address a security vulnerability.
|
94 |
* Fix : Security vulnerability
|
3 |
Donate link: http://fooplugins.com
|
4 |
Tags: lightbox,media,images,gallery,modal,gutenberg
|
5 |
Requires at least: 3.5.1
|
6 |
+
Tested up to: 5.2
|
7 |
Stable tag: trunk
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
89 |
|
90 |
== Changelog ==
|
91 |
|
92 |
+
= 2.7.0 =
|
93 |
+
* New : Reworked how FooBox loads, to work better with optimization plugins (Autoptimize / WP Rocket)
|
94 |
+
* Remove : Removed support for Google+ in social sharing
|
95 |
+
* Update : Updated to handle Chrome's new allow attribute in videos
|
96 |
+
* Update : Updated to latest FooBox client JS & CSS
|
97 |
+
|
98 |
+
= 2.6.5 =
|
99 |
+
* New : Added support for SVG images
|
100 |
+
* New : Added support for WebP images
|
101 |
+
* Fix : Fixed scroll blocking violation warnings in dev tools
|
102 |
+
* Update : Updated to latest FooBox client JS & CSS
|
103 |
+
|
104 |
= 2.6.4 =
|
105 |
* IMPORTANT : Please update to address a security vulnerability.
|
106 |
* Fix : Security vulnerability
|