rtMedia for WordPress, BuddyPress and bbPress - Version 3.2.12

Version Description

  • lib updated for magnific popup and media-element, bug fixes
Download this release

Release Info

Developer faishal
Plugin Icon 128x128 rtMedia for WordPress, BuddyPress and bbPress
Version 3.2.12
Comparing to
See all releases

Code changes from version 3.2.11 to 3.2.12

app/admin/RTMediaAdmin.php CHANGED
@@ -46,6 +46,7 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
46
add_filter("attachment_fields_to_save", array($this,"save_video_thumbnail"), null, 2);
47
add_action ( 'admin_notices', array( $this, 'rtmedia_regenerate_thumbnail_notice' ) );
48
add_action ( 'wp_ajax_rtmedia_hide_video_thumb_admin_notice', array( $this, 'rtmedia_hide_video_thumb_admin_notice' ), 1 );
49
$obj_encoding = new RTMediaEncoding(true);
50
if ($obj_encoding->api_key){
51
add_filter ("media_row_actions", array($this,"add_reencode_link"), null, 2);
@@ -75,37 +76,66 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
75
$this->rtmedia_encoding = new RTMediaEncoding();
76
if(! defined("RTMEDIA_PRO_VERSION") )
77
add_action ( 'rtmedia_before_default_admin_widgets', array( $this, 'rtmedia_advertisement' ),1);
78
- // if( $this->check_for_addon_update_notice() ) {
79
- // add_action ( 'admin_notices', array( $this, 'rtmedia_addon_update_notice' ) );
80
- // }
81
}
82
83
- // function rtmedia_addon_update_notice() {
84
- // echo '<div class="error rtmedia-addon-upate-notice">
85
- // <p> <b>'.__('rtMedia:').'</b> '.__('Please update all premium add-ons that you had purchased from rtCamp from your ','rtmedia').' <a href="https://rtcamp.com/my-account/" target="_blank">'.__('account',"rtmedia").'</a> </p>
86
- // </div>';
87
- // }
88
-
89
- // function check_for_addon_update_notice() {
90
- // $return_falg = false;
91
- // if( defined( 'RTMEDIA_INSTAGRAM_PATH' ) ) {
92
- // $plugin_info = get_plugin_data(RTMEDIA_INSTAGRAM_PATH.'index.php');
93
- // if( isset( $plugin_info['Version'] ) && $plugin_info['Version'] < "2.1.2" ) {
94
- // $return_falg = true;
95
- // }
96
- // } else if( defined( 'RTMEDIA_PHOTO_TAGGING_PATH' ) ) {
97
- // $plugin_info = get_plugin_data(RTMEDIA_PHOTO_TAGGING_PATH.'index.php');
98
- // if( isset( $plugin_info['Version'] ) && $plugin_info['Version'] < "2.2.1" ) {
99
- // $return_falg = true;
100
- // }
101
- // } else if( defined( 'RTMEDIA_PRO_PATH' ) ) {
102
- // $plugin_info = get_plugin_data(RTMEDIA_PRO_PATH.'index.php');
103
- // if( isset( $plugin_info['Version'] ) && $plugin_info['Version'] < "1.8.1" ) {
104
- // $return_falg = true;
105
- // }
106
- // }
107
- // return $return_falg;
108
- // }
109
110
function bp_admin_tabs() {
111
if ( current_user_can ( 'manage_options' ) ) {
@@ -522,9 +552,17 @@ if ( ! class_exists ( 'RTMediaAdmin' ) ) {
522
523
function rtmedia_hide_video_thumb_admin_notice() {
524
if(rtmedia_update_site_option("rtmedia-video-thumb-notice", "hide"))
525
- echo "1";
526
else
527
- echo "0";
528
die();
529
}
530
46
add_filter("attachment_fields_to_save", array($this,"save_video_thumbnail"), null, 2);
47
add_action ( 'admin_notices', array( $this, 'rtmedia_regenerate_thumbnail_notice' ) );
48
add_action ( 'wp_ajax_rtmedia_hide_video_thumb_admin_notice', array( $this, 'rtmedia_hide_video_thumb_admin_notice' ), 1 );
49
+ add_action ( 'wp_ajax_rtmedia_hide_addon_update_notice', array( $this, 'rtmedia_hide_addon_update_notice' ), 1 );
50
$obj_encoding = new RTMediaEncoding(true);
51
if ($obj_encoding->api_key){
52
add_filter ("media_row_actions", array($this,"add_reencode_link"), null, 2);
76
$this->rtmedia_encoding = new RTMediaEncoding();
77
if(! defined("RTMEDIA_PRO_VERSION") )
78
add_action ( 'rtmedia_before_default_admin_widgets', array( $this, 'rtmedia_advertisement' ),1);
79
+ if( $this->check_for_addon_update_notice() ) {
80
+ add_action ( 'admin_notices', array( $this, 'rtmedia_addon_update_notice' ) );
81
+ }
82
}
83
84
+ function rtmedia_addon_update_notice() {
85
+ $site_option = rtmedia_get_site_option("rtmedia-addon-update-notice");
86
+ if(!$site_option || $site_option != "hide") {
87
+ rtmedia_update_site_option("rtmedia-addon-update-notice", "show");
88
+ echo '<div class="error rtmedia-addon-upate-notice">
89
+ <p> <b>'.__('rtMedia:').'</b> '.__('Please update all premium add-ons that you had purchased from rtCamp from your ','rtmedia').' <a href="https://rtcamp.com/my-account/" target="_blank">'.__('account',"rtmedia").'</a>. <a href="#" onclick="rtmedia_hide_addon_update_notice()" style="float:right">Hide</a> </p>
90
+ </div>';
91
+ }
92
+
93
+ ?>
94
+ <script type="text/javascript">
95
+ function rtmedia_hide_addon_update_notice() {
96
+ var data = {
97
+ action: 'rtmedia_hide_addon_update_notice'
98
+ };
99
+ jQuery.post(ajaxurl, data, function(response) {
100
+ response = response.trim();
101
+ if(response === "1")
102
+ jQuery('.rtmedia-addon-upate-notice').remove();
103
+ });
104
+ }
105
+ </script>
106
+ <?php
107
+ }
108
+
109
+ function check_for_addon_update_notice() {
110
+ $return_falg = false;
111
+ if( defined( 'RTMEDIA_INSTAGRAM_PATH' ) ) {
112
+ $plugin_info = get_plugin_data(RTMEDIA_INSTAGRAM_PATH.'index.php');
113
+ if( isset( $plugin_info['Version'] ) && $plugin_info['Version'] < "2.1.2" ) {
114
+ $return_falg = true;
115
+ }
116
+ } else if( defined( 'RTMEDIA_PHOTO_TAGGING_PATH' ) ) {
117
+ $plugin_info = get_plugin_data(RTMEDIA_PHOTO_TAGGING_PATH.'index.php');
118
+ if( isset( $plugin_info['Version'] ) && $plugin_info['Version'] < "2.2.1" ) {
119
+ $return_falg = true;
120
+ }
121
+ } else if( defined( 'RTMEDIA_PRO_PATH' ) ) {
122
+ $plugin_info = get_plugin_data(RTMEDIA_PRO_PATH.'index.php');
123
+ if( isset( $plugin_info['Version'] ) && $plugin_info['Version'] < "1.8.1" ) {
124
+ $return_falg = true;
125
+ }
126
+ } else if( defined( 'RTMEDIA_FFMPEG_PATH' ) ) {
127
+ $plugin_info = get_plugin_data(RTMEDIA_FFMPEG_PATH.'index.php');
128
+ if( isset( $plugin_info['Version'] ) && $plugin_info['Version'] < "2.1.1" ) {
129
+ $return_falg = true;
130
+ }
131
+ } else if( defined( 'RTMEDIA_KALTURA_PATH' ) ) {
132
+ $plugin_info = get_plugin_data(RTMEDIA_KALTURA_PATH.'index.php');
133
+ if( isset( $plugin_info['Version'] ) && $plugin_info['Version'] < "3.0.3" ) {
134
+ $return_falg = true;
135
+ }
136
+ }
137
+ return $return_falg;
138
+ }
139
140
function bp_admin_tabs() {
141
if ( current_user_can ( 'manage_options' ) ) {
552
553
function rtmedia_hide_video_thumb_admin_notice() {
554
if(rtmedia_update_site_option("rtmedia-video-thumb-notice", "hide"))
555
+ echo "1";
556
+ else
557
+ echo "0";
558
+ die();
559
+ }
560
+
561
+ function rtmedia_hide_addon_update_notice() {
562
+ if(rtmedia_update_site_option("rtmedia-addon-update-notice", "hide"))
563
+ echo "1";
564
else
565
+ echo "0";
566
die();
567
}
568
app/assets/js/rtMedia.backbone.js CHANGED
@@ -192,17 +192,20 @@ jQuery(function($) {
192
} else {
193
o_is_edit_allowed = is_edit_allowed;
194
}
195
- $("#rtmedia-gallery-item-template").load(template_url, {
196
- backbone: true,
197
- is_album: o_is_album,
198
- is_edit_allowed: o_is_edit_allowed
199
- }, function(response, status, xhr) {
200
-
201
- $(document).on("click", "#rtMedia-galary-next", function(e) {
202
- $(this).hide();
203
- e.preventDefault();
204
- galleryObj.getNext(nextpage, $(this).parent().parent().parent(), $(this));
205
- });
206
});
207
208
@@ -239,7 +242,7 @@ jQuery(function($) {
239
zIndex: 2
240
});
241
if(a!==false)
242
- $("#rtMedia-upload-button").after("<span>(" + rtmedia_max_file_msg + plupload.formatSize(this.uploader.settings.max_file_size) + ")</span>")
243
244
return this;
245
},
192
} else {
193
o_is_edit_allowed = is_edit_allowed;
194
}
195
+ var rtmedia_load_template_flag = true;
196
+ $(document).on("click", "#rtMedia-galary-next", function(e) {
197
+ if( rtmedia_load_template_flag == true ) {
198
+ $("#rtmedia-gallery-item-template").load(template_url, {
199
+ backbone: true,
200
+ is_album: o_is_album,
201
+ is_edit_allowed: o_is_edit_allowed
202
+ },function(){
203
+ rtmedia_load_template_flag = false;
204
+ });
205
+ }
206
+ $(this).hide();
207
+ e.preventDefault();
208
+ galleryObj.getNext(nextpage, $(this).parent().parent().parent(), $(this));
209
});
210
211
242
zIndex: 2
243
});
244
if(a!==false)
245
+ $("#rtMedia-upload-button").after("<span>( <strong>" + rtmedia_max_file_msg + "</strong> "+ this.uploader.settings.max_file_size_msg + ")</span>")
246
247
return this;
248
},
app/assets/js/rtMedia.js CHANGED
@@ -61,6 +61,19 @@ function apply_rtMagnificPopup(selector){
61
}
62
}
63
});
64
});
65
}
66
var rtMediaHook = {
61
}
62
}
63
});
64
+
65
+ if (jQuery(window).width() < 600) {
66
+ jQuery('#whats-new').focus( function(){
67
+ jQuery("#whats-new-options").animate({
68
+ height:'100px'
69
+ });
70
+ });
71
+ jQuery('#whats-new').blur( function(){
72
+ jQuery("#whats-new-options").animate({
73
+ height:'100px'
74
+ });
75
+ });
76
+ }
77
});
78
}
79
var rtMediaHook = {
app/main/RTMedia.php CHANGED
@@ -87,6 +87,9 @@ class RTMedia
87
*
88
* Buddypress Media Auto Upgradation
89
*/
90
$this->update_db();
91
$this->default_thumbnail = apply_filters('rtmedia_default_thumbnail', RTMEDIA_URL . 'assets/thumb_default.png');
92
add_action('init', array($this, 'check_global_album'));
@@ -95,12 +98,11 @@ class RTMedia
95
add_action('plugins_loaded', array($this, 'admin_init'));
96
add_action('wp_enqueue_scripts', array('RTMediaGalleryShortcode', 'register_scripts'));
97
add_action('wp_enqueue_scripts', array(&$this, 'enqueue_scripts_styles'), 999);
98
- add_action('rt_db_upgrade', array($this, 'fix_parent_id'));
99
- add_action('rt_db_upgrade', array($this, 'fix_privacy'));
100
include(RTMEDIA_PATH . 'app/main/controllers/template/rt-template-functions.php');
101
add_filter('intermediate_image_sizes_advanced', array($this, 'filter_image_sizes_details'));
102
add_filter('intermediate_image_sizes', array($this, 'filter_image_sizes'));
103
add_filter("site_option_upload_filetypes",array(&$this, "filter_allow_mime_type_mu"),1,1);
104
}
105
function filter_allow_mime_type_mu($options){
106
$allowed_types = array();
@@ -148,8 +150,22 @@ class RTMedia
148
}
149
150
function fix_privacy() {
151
$model = new RTMediaModel();
152
$update_sql = "UPDATE $model->table_name SET privacy = '80' where privacy = '-1' ";
153
}
154
155
function set_site_options() {
@@ -763,7 +779,7 @@ class RTMedia
763
wp_localize_script('rtmedia-main', 'rtmedia_album_created_msg', ' ' . __('album created successfully.',"rtMedia"));
764
wp_localize_script('rtmedia-main', 'rtmedia_something_wrong_msg', __('Something went wrong. Please try again.',"rtMedia"));
765
wp_localize_script('rtmedia-main', 'rtmedia_empty_album_name_msg', __('Enter an album name.',"rtMedia"));
766
- wp_localize_script('rtmedia-main', 'rtmedia_max_file_msg', __('Max file size is',"rtMedia"));
767
}
768
769
function set_bp_bar() {
@@ -804,6 +820,16 @@ class RTMedia
804
return $sizes;
805
}
806
807
function filter_image_sizes($sizes) {
808
if (isset($_REQUEST['postid'])) { //For Regenerate Thumbnails Plugin
809
if ($parent_id = get_post_field('post_parent', $_REQUEST['postid'])) {
87
*
88
* Buddypress Media Auto Upgradation
89
*/
90
+ add_action('rt_db_upgrade', array($this, 'fix_parent_id'));
91
+ add_action('rt_db_upgrade', array($this, 'fix_privacy'));
92
+ add_action('rt_db_upgrade', array($this, 'fix_db_collation'));
93
$this->update_db();
94
$this->default_thumbnail = apply_filters('rtmedia_default_thumbnail', RTMEDIA_URL . 'assets/thumb_default.png');
95
add_action('init', array($this, 'check_global_album'));
98
add_action('plugins_loaded', array($this, 'admin_init'));
99
add_action('wp_enqueue_scripts', array('RTMediaGalleryShortcode', 'register_scripts'));
100
add_action('wp_enqueue_scripts', array(&$this, 'enqueue_scripts_styles'), 999);
101
include(RTMEDIA_PATH . 'app/main/controllers/template/rt-template-functions.php');
102
add_filter('intermediate_image_sizes_advanced', array($this, 'filter_image_sizes_details'));
103
add_filter('intermediate_image_sizes', array($this, 'filter_image_sizes'));
104
add_filter("site_option_upload_filetypes",array(&$this, "filter_allow_mime_type_mu"),1,1);
105
+ add_filter( 'image_size_names_choose', array($this,'rtmedia_custom_image_sizes_choose' ));
106
}
107
function filter_allow_mime_type_mu($options){
108
$allowed_types = array();
150
}
151
152
function fix_privacy() {
153
+ global $wpdb;
154
$model = new RTMediaModel();
155
$update_sql = "UPDATE $model->table_name SET privacy = '80' where privacy = '-1' ";
156
+ $wpdb->query($update_sql);
157
+ }
158
+
159
+ function fix_db_collation() {
160
+ global $wpdb;
161
+ $model = new RTMediaModel();
162
+ $interaction_model = new RTMediaInteractionModel();
163
+ $update_media_sql = "ALTER TABLE ".$model->table_name." CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci";
164
+ $wpdb->query($update_media_sql);
165
+ $update_media_meta_sql = "ALTER TABLE ".$wpdb->base_prefix.$model->meta_table_name." CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci";
166
+ $wpdb->query($update_media_meta_sql);
167
+ $update_media_interaction_sql = "ALTER TABLE ".$interaction_model->table_name." CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci";
168
+ $wpdb->query($update_media_interaction_sql);
169
}
170
171
function set_site_options() {
779
wp_localize_script('rtmedia-main', 'rtmedia_album_created_msg', ' ' . __('album created successfully.',"rtMedia"));
780
wp_localize_script('rtmedia-main', 'rtmedia_something_wrong_msg', __('Something went wrong. Please try again.',"rtMedia"));
781
wp_localize_script('rtmedia-main', 'rtmedia_empty_album_name_msg', __('Enter an album name.',"rtMedia"));
782
+ wp_localize_script('rtmedia-main', 'rtmedia_max_file_msg', __('Max file Limit',"rtMedia"));
783
}
784
785
function set_bp_bar() {
820
return $sizes;
821
}
822
823
+ function rtmedia_custom_image_sizes_choose( $sizes ) {
824
+ $custom_sizes = array(
825
+ 'rt_media_thumbnail' => "rtMedia Thumbnail",
826
+ 'rt_media_activity_image' => "rtMedia Activity Image",
827
+ 'rt_media_single_image' => "rtMedia Single Image",
828
+ 'rt_media_featured_image' => "rtMedia Fetured Image",
829
+ );
830
+ return array_merge( $sizes, $custom_sizes );
831
+ }
832
+
833
function filter_image_sizes($sizes) {
834
if (isset($_REQUEST['postid'])) { //For Regenerate Thumbnails Plugin
835
if ($parent_id = get_post_field('post_parent', $_REQUEST['postid'])) {
app/main/controllers/activity/RTMediaBuddyPressActivity.php CHANGED
@@ -153,7 +153,8 @@ class RTMediaBuddyPressActivity {
153
'silverlight_xap_url' => includes_url ( 'js/plupload/plupload.silverlight.xap' ),
154
'file_data_name' => 'rtmedia_file', // key passed to $_FILE.
155
'multi_selection' => true,
156
- 'multipart_params' => apply_filters ( 'rtmedia-multi-params', array( 'redirect' => 'no', 'rtmedia_update' => 'true', 'action' => 'wp_handle_upload', '_wp_http_referer' => $_SERVER[ 'REQUEST_URI' ], 'mode' => 'file_upload', 'rtmedia_upload_nonce' => RTMediaUploadView::upload_nonce_generator ( false, true ) ) )
157
);
158
if ( wp_is_mobile () )
159
$params[ 'multi_selection' ] = false;
153
'silverlight_xap_url' => includes_url ( 'js/plupload/plupload.silverlight.xap' ),
154
'file_data_name' => 'rtmedia_file', // key passed to $_FILE.
155
'multi_selection' => true,
156
+ 'multipart_params' => apply_filters ( 'rtmedia-multi-params', array( 'redirect' => 'no', 'rtmedia_update' => 'true', 'action' => 'wp_handle_upload', '_wp_http_referer' => $_SERVER[ 'REQUEST_URI' ], 'mode' => 'file_upload', 'rtmedia_upload_nonce' => RTMediaUploadView::upload_nonce_generator ( false, true ) ) ),
157
+ 'max_file_size_msg' => apply_filters("rtmedia_plupload_file_size_msg",min ( array( ini_get ( 'upload_max_filesize' ), ini_get ( 'post_max_size' ) ) ))
158
);
159
if ( wp_is_mobile () )
160
$params[ 'multi_selection' ] = false;
app/main/controllers/shortcodes/RTMediaGalleryShortcode.php CHANGED
@@ -27,7 +27,7 @@ class RTMediaGalleryShortcode {
27
//add_action('init', array($this, 'register_scripts'));
28
//add_action('wp_footer', array($this, 'print_script'));
29
}
30
-
31
function ajax_rtmedia_get_template(){
32
if(isset($_REQUEST["template"])){
33
$template_url = RTMediaTemplate::locate_template( $_REQUEST["template"], "media/", false );
@@ -68,7 +68,8 @@ class RTMediaGalleryShortcode {
68
'silverlight_xap_url' => includes_url ( 'js/plupload/plupload.silverlight.xap' ),
69
'file_data_name' => 'rtmedia_file', // key passed to $_FILE.
70
'multi_selection' => true,
71
- 'multipart_params' => apply_filters ( 'rtmedia-multi-params', array( 'redirect' => 'no', 'action' => 'wp_handle_upload', '_wp_http_referer' => $_SERVER[ 'REQUEST_URI' ], 'mode' => 'file_upload', 'rtmedia_upload_nonce' => RTMediaUploadView::upload_nonce_generator ( false, true ) ) )
72
);
73
if ( wp_is_mobile () )
74
$params[ 'multi_selection' ] = false;
@@ -121,6 +122,9 @@ class RTMediaGalleryShortcode {
121
}
122
123
global $rtmedia_query;
124
$rtmedia_query->is_gallery_shortcode = true;// to check if gallery shortcode is executed to display the gallery.
125
126
$template = new RTMediaTemplate();
27
//add_action('init', array($this, 'register_scripts'));
28
//add_action('wp_footer', array($this, 'print_script'));
29
}
30
+
31
function ajax_rtmedia_get_template(){
32
if(isset($_REQUEST["template"])){
33
$template_url = RTMediaTemplate::locate_template( $_REQUEST["template"], "media/", false );
68
'silverlight_xap_url' => includes_url ( 'js/plupload/plupload.silverlight.xap' ),
69
'file_data_name' => 'rtmedia_file', // key passed to $_FILE.
70
'multi_selection' => true,
71
+ 'multipart_params' => apply_filters ( 'rtmedia-multi-params', array( 'redirect' => 'no', 'action' => 'wp_handle_upload', '_wp_http_referer' => $_SERVER[ 'REQUEST_URI' ], 'mode' => 'file_upload', 'rtmedia_upload_nonce' => RTMediaUploadView::upload_nonce_generator ( false, true ) ) ),
72
+ 'max_file_size_msg' => apply_filters("rtmedia_plupload_file_size_msg",min ( array( ini_get ( 'upload_max_filesize' ), ini_get ( 'post_max_size' ) ) ))
73
);
74
if ( wp_is_mobile () )
75
$params[ 'multi_selection' ] = false;
122
}
123
124
global $rtmedia_query;
125
+ if(!$rtmedia_query) {
126
+ $rtmedia_query = new RTMediaQuery();
127
+ }
128
$rtmedia_query->is_gallery_shortcode = true;// to check if gallery shortcode is executed to display the gallery.
129
130
$template = new RTMediaTemplate();
app/main/controllers/template/RTMediaAJAX.php CHANGED
@@ -24,7 +24,8 @@ class RTMediaAJAX {
24
function create_album(){
25
if ( isset($_POST['name']) && $_POST['name'] && is_rtmedia_album_enable()) {
26
if(isset($_POST['context']) && $_POST['context'] =="group"){
27
- if(can_user_create_album_in_group() == false){
28
echo false;
29
wp_die();
30
}
@@ -57,4 +58,4 @@ class RTMediaAJAX {
57
}
58
wp_die();
59
}
60
- }
24
function create_album(){
25
if ( isset($_POST['name']) && $_POST['name'] && is_rtmedia_album_enable()) {
26
if(isset($_POST['context']) && $_POST['context'] =="group"){
27
+ $group_id = !empty( $_POST['group_id']) ? $_POST['group_id'] : '';
28
+ if(can_user_create_album_in_group($group_id) == false){
29
echo false;
30
wp_die();
31
}
58
}
59
wp_die();
60
}
61
+ }
app/main/controllers/template/rt-template-functions.php CHANGED
@@ -1056,7 +1056,7 @@ function rtmedia_user_album_list ( $get_all = false ) {
1056
$option = "$global_option";
1057
if($profile_option != "")
1058
$option.= "<optgroup label='".__("Profile Albums","rtmedia")." ' value = 'profile'>$profile_option</optgroup>";
1059
- if($option_group != "")
1060
$option.="<optgroup label='".__("Group Albums","rtmedia")."' value = 'group'>$option_group</optgroup>";
1061
if ( $option )
1062
return $option;
1056
$option = "$global_option";
1057
if($profile_option != "")
1058
$option.= "<optgroup label='".__("Profile Albums","rtmedia")." ' value = 'profile'>$profile_option</optgroup>";
1059
+ if($option_group != "" && class_exists('BuddyPress') )
1060
$option.="<optgroup label='".__("Group Albums","rtmedia")."' value = 'group'>$option_group</optgroup>";
1061
if ( $option )
1062
return $option;
index.php CHANGED
@@ -4,7 +4,7 @@
4
Plugin Name: rtMedia for WordPress, BuddyPress and bbPress
5
Plugin URI: http://rtcamp.com/buddypress-media/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
6
Description: This plugin adds missing media rich features like photos, videos and audio uploading to BuddyPress which are essential if you are building social network, seriously!
7
- Version: 3.2.11
8
Author: rtCamp
9
Text Domain: rtmedia
10
Author URI: http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
4
Plugin Name: rtMedia for WordPress, BuddyPress and bbPress
5
Plugin URI: http://rtcamp.com/buddypress-media/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
6
Description: This plugin adds missing media rich features like photos, videos and audio uploading to BuddyPress which are essential if you are building social network, seriously!
7
+ Version: 3.2.12
8
Author: rtCamp
9
Text Domain: rtmedia
10
Author URI: http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
lib/magnific/magnific.css CHANGED
@@ -4,7 +4,7 @@
4
left: 0;
5
width: 100%;
6
height: 100%;
7
- z-index: 502;
8
overflow: hidden;
9
position: fixed;
10
background: #0b0b0b;
@@ -16,13 +16,12 @@
16
left: 0;
17
width: 100%;
18
height: 100%;
19
- z-index: 503;
20
position: fixed;
21
outline: none !important;
22
-webkit-backface-visibility: hidden; }
23
24
.mfp-container {
25
- height: 100%;
26
text-align: center;
27
position: absolute;
28
width: 100%;
@@ -30,7 +29,6 @@
30
left: 0;
31
top: 0;
32
padding: 0 8px;
33
- padding-top:30px;
34
-webkit-box-sizing: border-box;
35
-moz-box-sizing: border-box;
36
box-sizing: border-box; }
@@ -50,18 +48,16 @@
50
vertical-align: middle;
51
margin: 0 auto;
52
text-align: left;
53
- z-index: 505; }
54
55
- .mfp-inline-holder .mfp-content,
56
- .mfp-ajax-holder .mfp-content {
57
width: 100%;
58
cursor: auto; }
59
60
.mfp-ajax-cur {
61
cursor: progress; }
62
63
- .mfp-zoom-out-cur,
64
- .mfp-zoom-out-cur .mfp-image-holder .mfp-close {
65
cursor: -moz-zoom-out;
66
cursor: -webkit-zoom-out;
67
cursor: zoom-out; }
@@ -75,10 +71,7 @@
75
.mfp-auto-cursor .mfp-content {
76
cursor: auto; }
77
78
- .mfp-close,
79
- .mfp-arrow,
80
- .mfp-preloader,
81
- .mfp-counter {
82
-webkit-user-select: none;
83
-moz-user-select: none;
84
user-select: none; }
@@ -98,13 +91,11 @@
98
margin-top: -0.8em;
99
left: 8px;
100
right: 8px;
101
- z-index: 504; }
102
-
103
- .mfp-preloader a {
104
- color: #cccccc; }
105
-
106
- .mfp-preloader a:hover {
107
- color: white; }
108
109
.mfp-s-ready .mfp-preloader {
110
display: none; }
@@ -112,17 +103,18 @@
112
.mfp-s-error .mfp-content {
113
display: none; }
114
115
- button.mfp-close,
116
- button.mfp-arrow {
117
overflow: visible;
118
cursor: pointer;
119
background: transparent;
120
border: 0;
121
-webkit-appearance: none;
122
display: block;
123
padding: 0;
124
- z-index: 506; }
125
-
126
button::-moz-focus-inner {
127
padding: 0;
128
border: 0; }
@@ -148,10 +140,9 @@ button::-moz-focus-inner {
148
top: 1px; }
149
150
.mfp-close-btn-in .mfp-close {
151
- color: #fff; }
152
153
- .mfp-image-holder .mfp-close,
154
- .mfp-iframe-holder .mfp-close {
155
color: white;
156
right: -6px;
157
text-align: right;
@@ -168,7 +159,6 @@ button::-moz-focus-inner {
168
169
.mfp-arrow {
170
position: absolute;
171
- top: 0;
172
opacity: 0.65;
173
margin: 0;
174
top: 50%;
@@ -177,85 +167,70 @@ button::-moz-focus-inner {
177
width: 90px;
178
height: 110px;
179
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); }
180
-
181
- .mfp-arrow:active {
182
- margin-top: -54px; }
183
-
184
- .mfp-arrow:hover,
185
- .mfp-arrow:focus {
186
- opacity: 1; }
187
-
188
- .mfp-arrow:before, .mfp-arrow:after,
189
- .mfp-arrow .mfp-b,
190
- .mfp-arrow .mfp-a {
191
- content: '';
192
- display: block;
193
- width: 0;
194
- height: 0;
195
- position: absolute;
196
- left: 0;
197
- top: 0;
198
- margin-top: 35px;
199
- margin-left: 35px;
200
- border: solid transparent; }
201
- .mfp-arrow:after,
202
- .mfp-arrow .mfp-a {
203
- opacity: 0.8;
204
- border-top-width: 12px;
205
- border-bottom-width: 12px;
206
- top: 8px; }
207
- .mfp-arrow:before,
208
- .mfp-arrow .mfp-b {
209
- border-top-width: 20px;
210
- border-bottom-width: 20px; }
211
212
.mfp-arrow-left {
213
left: 0; }
214
- .mfp-arrow-left:after,
215
- .mfp-arrow-left .mfp-a {
216
- border-right: 12px solid black;
217
- left: 5px; }
218
- .mfp-arrow-left:before,
219
- .mfp-arrow-left .mfp-b {
220
- border-right: 20px solid white; }
221
222
.mfp-arrow-right {
223
right: 0; }
224
- .mfp-arrow-right:after,
225
- .mfp-arrow-right .mfp-a {
226
- border-left: 12px solid black;
227
- left: 3px; }
228
- .mfp-arrow-right:before,
229
- .mfp-arrow-right .mfp-b {
230
- border-left: 20px solid white; }
231
232
.mfp-iframe-holder {
233
padding-top: 40px;
234
padding-bottom: 40px; }
235
-
236
- .mfp-iframe-holder .mfp-content {
237
- line-height: 0;
238
- width: 100%;
239
- max-width: 900px; }
240
241
.mfp-iframe-scaler {
242
width: 100%;
243
height: 0;
244
overflow: hidden;
245
padding-top: 56.25%; }
246
-
247
- .mfp-iframe-scaler iframe {
248
- position: absolute;
249
- display: block;
250
- top: 0;
251
- left: 0;
252
- width: 100%;
253
- height: 100%;
254
- box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
255
- background: black; }
256
-
257
- .mfp-iframe-holder .mfp-close {
258
- top: -40px; }
259
260
/* Main image in popup */
261
img.mfp-img {
@@ -271,21 +246,26 @@ img.mfp-img {
271
margin: 0 auto; }
272
273
/* The shadow behind the image */
274
- .mfp-figure:after {
275
- content: '';
276
- position: absolute;
277
- left: 0;
278
- top: 40px;
279
- bottom: 40px;
280
- display: block;
281
- right: 0;
282
- width: auto;
283
- height: auto;
284
- z-index: -1;
285
- box-shadow: 0 0 8px rgba(0, 0, 0, 0.6); }
286
-
287
.mfp-figure {
288
line-height: 0; }
289
290
.mfp-bottom-bar {
291
margin-top: -36px;
@@ -299,15 +279,9 @@ img.mfp-img {
299
text-align: left;
300
line-height: 18px;
301
color: #f3f3f3;
302
- word-break: break-word;
303
padding-right: 36px; }
304
305
- .mfp-figure small {
306
- color: #bdbdbd;
307
- display: block;
308
- font-size: 12px;
309
- line-height: 14px; }
310
-
311
.mfp-image-holder .mfp-content {
312
max-width: 100%; }
313
@@ -316,20 +290,21 @@ img.mfp-img {
316
317
@media screen and (max-width: 800px) and (orientation: landscape), screen and (max-height: 300px) {
318
/**
319
- * Remove all paddings around the image on small screen
320
- */
321
.mfp-img-mobile .mfp-image-holder {
322
padding-left: 0;
323
padding-right: 0; }
324
-
325
.mfp-img-mobile img.mfp-img {
326
padding: 0; }
327
-
328
- /* The shadow behind the image */
329
- .mfp-img-mobile .mfp-figure:after {
330
- top: 0;
331
- bottom: 0; }
332
-
333
.mfp-img-mobile .mfp-bottom-bar {
334
background: rgba(0, 0, 0, 0.6);
335
bottom: 0;
@@ -340,14 +315,11 @@ img.mfp-img {
340
-webkit-box-sizing: border-box;
341
-moz-box-sizing: border-box;
342
box-sizing: border-box; }
343
-
344
- .mfp-img-mobile .mfp-bottom-bar:empty {
345
- padding: 0; }
346
-
347
.mfp-img-mobile .mfp-counter {
348
right: 5px;
349
top: 3px; }
350
-
351
.mfp-img-mobile .mfp-close {
352
top: 0;
353
right: 0;
@@ -357,27 +329,22 @@ img.mfp-img {
357
background: rgba(0, 0, 0, 0.6);
358
position: fixed;
359
text-align: center;
360
- padding: 0; }
361
362
- .mfp-img-mobile .mfp-figure small {
363
- display: inline;
364
- margin-left: 5px; } }
365
- @media all and (max-width: 800px) {
366
.mfp-arrow {
367
-webkit-transform: scale(0.75);
368
transform: scale(0.75); }
369
-
370
.mfp-arrow-left {
371
-webkit-transform-origin: 0;
372
transform-origin: 0; }
373
-
374
.mfp-arrow-right {
375
-webkit-transform-origin: 100%;
376
transform-origin: 100%; }
377
-
378
.mfp-container {
379
padding-left: 6px;
380
padding-right: 6px; } }
381
.mfp-ie7 .mfp-img {
382
padding: 0; }
383
.mfp-ie7 .mfp-bottom-bar {
@@ -393,4 +360,4 @@ img.mfp-img {
393
.mfp-ie7 .mfp-close {
394
top: 0;
395
right: 0;
396
- padding-top: 0; }
4
left: 0;
5
width: 100%;
6
height: 100%;
7
+ z-index: 1042;
8
overflow: hidden;
9
position: fixed;
10
background: #0b0b0b;
16
left: 0;
17
width: 100%;
18
height: 100%;
19
+ z-index: 1043;
20
position: fixed;
21
outline: none !important;
22
-webkit-backface-visibility: hidden; }
23
24
.mfp-container {
25
text-align: center;
26
position: absolute;
27
width: 100%;
29
left: 0;
30
top: 0;
31
padding: 0 8px;
32
-webkit-box-sizing: border-box;
33
-moz-box-sizing: border-box;
34
box-sizing: border-box; }
48
vertical-align: middle;
49
margin: 0 auto;
50
text-align: left;
51
+ z-index: 1045; }
52
53
+ .mfp-inline-holder .mfp-content, .mfp-ajax-holder .mfp-content {
54
width: 100%;
55
cursor: auto; }
56
57
.mfp-ajax-cur {
58
cursor: progress; }
59
60
+ .mfp-zoom-out-cur, .mfp-zoom-out-cur .mfp-image-holder .mfp-close {
61
cursor: -moz-zoom-out;
62
cursor: -webkit-zoom-out;
63
cursor: zoom-out; }
71
.mfp-auto-cursor .mfp-content {
72
cursor: auto; }
73
74
+ .mfp-close, .mfp-arrow, .mfp-preloader, .mfp-counter {
75
-webkit-user-select: none;
76
-moz-user-select: none;
77
user-select: none; }
91
margin-top: -0.8em;
92
left: 8px;
93
right: 8px;
94
+ z-index: 1044; }
95
+ .mfp-preloader a {
96
+ color: #cccccc; }
97
+ .mfp-preloader a:hover {
98
+ color: white; }
99
100
.mfp-s-ready .mfp-preloader {
101
display: none; }
103
.mfp-s-error .mfp-content {
104
display: none; }
105
106
+ button.mfp-close, button.mfp-arrow {
107
overflow: visible;
108
cursor: pointer;
109
background: transparent;
110
border: 0;
111
-webkit-appearance: none;
112
display: block;
113
+ outline: none;
114
padding: 0;
115
+ z-index: 1046;
116
+ -webkit-box-shadow: none;
117
+ box-shadow: none; }
118
button::-moz-focus-inner {
119
padding: 0;
120
border: 0; }
140
top: 1px; }
141
142
.mfp-close-btn-in .mfp-close {
143
+ color: #333333; }
144
145
+ .mfp-image-holder .mfp-close, .mfp-iframe-holder .mfp-close {
146
color: white;
147
right: -6px;
148
text-align: right;
159
160
.mfp-arrow {
161
position: absolute;
162
opacity: 0.65;
163
margin: 0;
164
top: 50%;
167
width: 90px;
168
height: 110px;
169
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); }
170
+ .mfp-arrow:active {
171
+ margin-top: -54px; }
172
+ .mfp-arrow:hover, .mfp-arrow:focus {
173
+ opacity: 1; }
174
+ .mfp-arrow:before, .mfp-arrow:after, .mfp-arrow .mfp-b, .mfp-arrow .mfp-a {
175
+ content: '';
176
+ display: block;
177
+ width: 0;
178
+ height: 0;
179
+ position: absolute;
180
+ left: 0;
181
+ top: 0;
182
+ margin-top: 35px;
183
+ margin-left: 35px;
184
+ border: medium inset transparent; }
185
+ .mfp-arrow:after, .mfp-arrow .mfp-a {
186
+ border-top-width: 13px;
187
+ border-bottom-width: 13px;
188
+ top: 8px; }
189
+ .mfp-arrow:before, .mfp-arrow .mfp-b {
190
+ border-top-width: 21px;
191
+ border-bottom-width: 21px; }
192
193
.mfp-arrow-left {
194
left: 0; }
195
+ .mfp-arrow-left:after, .mfp-arrow-left .mfp-a {
196
+ border-right: 17px solid white;
197
+ margin-left: 31px; }
198
+ .mfp-arrow-left:before, .mfp-arrow-left .mfp-b {
199
+ margin-left: 25px;
200
+ border-right: 27px solid #3f3f3f; }
201
202
.mfp-arrow-right {
203
right: 0; }
204
+ .mfp-arrow-right:after, .mfp-arrow-right .mfp-a {
205
+ border-left: 17px solid white;
206
+ margin-left: 39px; }
207
+ .mfp-arrow-right:before, .mfp-arrow-right .mfp-b {
208
+ border-left: 27px solid #3f3f3f; }
209
210
.mfp-iframe-holder {
211
padding-top: 40px;
212
padding-bottom: 40px; }
213
+ .mfp-iframe-holder .mfp-content {
214
+ line-height: 0;
215
+ width: 100%;
216
+ max-width: 900px; }
217
+ .mfp-iframe-holder .mfp-close {
218
+ top: -40px; }
219
220
.mfp-iframe-scaler {
221
width: 100%;
222
height: 0;
223
overflow: hidden;
224
padding-top: 56.25%; }
225
+ .mfp-iframe-scaler iframe {
226
+ position: absolute;
227
+ display: block;
228
+ top: 0;
229
+ left: 0;
230
+ width: 100%;
231
+ height: 100%;
232
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
233
+ background: black; }
234
235
/* Main image in popup */
236
img.mfp-img {
246
margin: 0 auto; }
247
248
/* The shadow behind the image */
249
.mfp-figure {
250
line-height: 0; }
251
+ .mfp-figure:after {
252
+ content: '';
253
+ position: absolute;
254
+ left: 0;
255
+ top: 40px;
256
+ bottom: 40px;
257
+ display: block;
258
+ right: 0;
259
+ width: auto;
260
+ height: auto;
261
+ z-index: -1;
262
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
263
+ background: #444444; }
264
+ .mfp-figure small {
265
+ color: #bdbdbd;
266
+ display: block;
267
+ font-size: 12px;
268
+ line-height: 14px; }
269
270
.mfp-bottom-bar {
271
margin-top: -36px;
279
text-align: left;
280
line-height: 18px;
281
color: #f3f3f3;
282
+ word-wrap: break-word;
283
padding-right: 36px; }
284
285
.mfp-image-holder .mfp-content {
286
max-width: 100%; }
287
290
291
@media screen and (max-width: 800px) and (orientation: landscape), screen and (max-height: 300px) {
292
/**
293
+ * Remove all paddings around the image on small screen
294
+ */
295
.mfp-img-mobile .mfp-image-holder {
296
padding-left: 0;
297
padding-right: 0; }
298
.mfp-img-mobile img.mfp-img {
299
padding: 0; }
300
+ .mfp-img-mobile .mfp-figure {
301
+ /* The shadow behind the image */ }
302
+ .mfp-img-mobile .mfp-figure:after {
303
+ top: 0;
304
+ bottom: 0; }
305
+ .mfp-img-mobile .mfp-figure small {
306
+ display: inline;
307
+ margin-left: 5px; }
308
.mfp-img-mobile .mfp-bottom-bar {
309
background: rgba(0, 0, 0, 0.6);
310
bottom: 0;
315
-webkit-box-sizing: border-box;
316
-moz-box-sizing: border-box;
317
box-sizing: border-box; }
318
+ .mfp-img-mobile .mfp-bottom-bar:empty {
319
+ padding: 0; }
320
.mfp-img-mobile .mfp-counter {
321
right: 5px;
322
top: 3px; }
323
.mfp-img-mobile .mfp-close {
324
top: 0;
325
right: 0;
329
background: rgba(0, 0, 0, 0.6);
330
position: fixed;
331
text-align: center;
332
+ padding: 0; } }
333
334
+ @media all and (max-width: 900px) {
335
.mfp-arrow {
336
-webkit-transform: scale(0.75);
337
transform: scale(0.75); }
338
.mfp-arrow-left {
339
-webkit-transform-origin: 0;
340
transform-origin: 0; }
341
.mfp-arrow-right {
342
-webkit-transform-origin: 100%;
343
transform-origin: 100%; }
344
.mfp-container {
345
padding-left: 6px;
346
padding-right: 6px; } }
347
+
348
.mfp-ie7 .mfp-img {
349
padding: 0; }
350
.mfp-ie7 .mfp-bottom-bar {
360
.mfp-ie7 .mfp-close {
361
top: 0;
362
right: 0;
363
+ padding-top: 0; }
lib/magnific/magnific.js CHANGED
@@ -1,3 +1,2042 @@
1
- // Magnific Popup v0.8.9 by Dmitry Semenov
2
- // http://bit.ly/magnific-popup#build=inline+ajax+gallery+retina+fastclick
3
- (function(a){var b="Close",c="AfterClose",d="BeforeAppend",e="MarkupParse",f="Open",g="Change",h="mfp",i="."+h,j="mfp-ready",k="mfp-removing",l="mfp-prevent-close",m,n=function(){},o=!!window.jQuery,p,q=a(window),r,s,t,u,v,w=function(a,b){m.ev.on(h+a+i,b)},x=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},y=function(b,c){m.ev.triggerHandler(h+b,c),m.st.callbacks&&(b=b.charAt(0).toLowerCase()+b.slice(1),m.st.callbacks[b]&&m.st.callbacks[b].apply(m,a.isArray(c)?c:[c]))},z=function(){(m.st.focus?m.content.find(m.st.focus).eq(0):m.wrap).focus()},A=function(b){if(b!==v||!m.currTemplate.closeBtn)m.currTemplate.closeBtn=a(m.st.closeMarkup.replace("%title%",m.st.tClose)),v=b;return m.currTemplate.closeBtn},B=function(){a.magnificPopup.instance||(m=new n,m.init(),a.magnificPopup.instance=m)},C=function(b){if(a(b).hasClass(l))return;var c=m.st.closeOnContentClick,d=m.st.closeOnBgClick;if(c&&d)return!0;if(!m.content||a(b).hasClass("mfp-close")||m.preloader&&b===m.preloader[0])return!0;if(b!==m.content[0]&&!a.contains(m.content[0],b)){if(d)return!0}else if(c)return!0;return!1};n.prototype={constructor:n,init:function(){var b=navigator.appVersion;m.isIE7=b.indexOf("MSIE 7.")!==-1,m.isIE8=b.indexOf("MSIE 8.")!==-1,m.isLowIE=m.isIE7||m.isIE8,m.isAndroid=/android/gi.test(b),m.isIOS=/iphone|ipad|ipod/gi.test(b),m.probablyMobile=m.isAndroid||m.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),r=a(document.body),s=a(document),m.popupsCache={}},open:function(b){var c;if(b.isObj===!1){m.items=b.items.toArray(),m.index=0;var d=b.items,g;for(c=0;c<d.length;c++){g=d[c],g.parsed&&(g=g.el[0]);if(g===b.el[0]){m.index=c;break}}}else m.items=a.isArray(b.items)?b.items:[b.items],m.index=b.index||0;if(m.isOpen){m.updateItemHTML();return}m.types=[],u="",m.ev=b.mainEl||s,b.key?(m.popupsCache[b.key]||(m.popupsCache[b.key]={}),m.currTemplate=m.popupsCache[b.key]):m.currTemplate={},m.st=a.extend(!0,{},a.magnificPopup.defaults,b),m.fixedContentPos=m.st.fixedContentPos==="auto"?!m.probablyMobile:m.st.fixedContentPos,m.bgOverlay||(m.bgOverlay=x("bg").on("click"+i,function(){m.close()}),m.wrap=x("wrap").attr("tabindex",-1).on("click"+i,function(a){C(a.target)&&m.close()}),m.container=x("container",m.wrap)),m.contentContainer=x("content"),m.st.preloader&&(m.preloader=x("preloader",m.container,m.st.tLoading));var h=a.magnificPopup.modules;for(c=0;c<h.length;c++){var k=h[c];k=k.charAt(0).toUpperCase()+k.slice(1),m["init"+k].call(m)}y("BeforeOpen"),m.st.closeBtnInside?(w(e,function(a,b,c,d){c.close_replaceWith=A(d.type)}),u+=" mfp-close-btn-in"):m.wrap.append(A()),m.st.alignTop&&(u+=" mfp-align-top"),m.fixedContentPos?m.wrap.css({overflow:m.st.overflowY,overflowX:"hidden",overflowY:m.st.overflowY}):m.wrap.css({top:q.scrollTop(),position:"absolute"}),(m.st.fixedBgPos===!1||m.st.fixedBgPos==="auto"&&!m.fixedContentPos)&&m.bgOverlay.css({height:s.height(),position:"absolute"}),s.on("keyup"+i,function(a){a.keyCode===27&&m.close()}),q.on("resize"+i,function(){m.updateSize()}),m.st.closeOnContentClick||(u+=" mfp-auto-cursor"),u&&m.wrap.addClass(u);var l=m.wH=q.height(),n={};if(m.fixedContentPos&&m._hasScrollBar(l)){var o=m._getScrollbarSize();o&&(n.paddingRight=o)}m.fixedContentPos&&(m.isIE7?a("body, html").css("overflow","hidden"):n.overflow="hidden");var p=m.st.mainClass;m.isIE7&&(p+=" mfp-ie7"),p&&m._addClassToMFP(p),m.updateItemHTML(),y("BuildControls"),r.css(n),m.bgOverlay.add(m.wrap).prependTo(document.body),m._lastFocusedEl=document.activeElement,setTimeout(function(){m.content?(m._addClassToMFP(j),z()):m.bgOverlay.addClass(j),s.on("focusin"+i,function(b){if(b.target!==m.wrap[0]&&!a.contains(m.wrap[0],b.target))return z(),!1})},16),m.isOpen=!0,m.updateSize(l),y(f)},close:function(){if(!m.isOpen)return;m.isOpen=!1,m.st.removalDelay&&!m.isLowIE?(m._addClassToMFP(k),setTimeout(function(){m._close()},m.st.removalDelay)):m._close()},_close:function(){y(b);var d=k+" "+j+" ";m.bgOverlay.detach(),m.wrap.detach(),m.container.empty(),m.st.mainClass&&(d+=m.st.mainClass+" "),m._removeClassFromMFP(d);if(m.fixedContentPos){var e={paddingRight:""};m.isIE7?a("body, html").css("overflow",""):e.overflow="",r.css(e)}s.off("keyup"+i+" focusin"+i),m.ev.off(i),m.wrap.attr("class","mfp-wrap").removeAttr("style"),m.bgOverlay.attr("class","mfp-bg"),m.container.attr("class","mfp-container"),(!m.st.closeBtnInside||m.currTemplate[m.currItem.type]===!0)&&m.currTemplate.closeBtn&&m.currTemplate.closeBtn.detach(),m._lastFocusedEl&&a(m._lastFocusedEl).focus(),m.currItem=null,m.content=null,m.currTemplate=null,m.prevHeight=0,y(c)},updateSize:function(a){if(m.isIOS){var b=document.documentElement.clientWidth/window.innerWidth,c=window.innerHeight*b;m.wrap.css("height",c),m.wH=c}else m.wH=a||q.height();m.fixedContentPos||m.wrap.css("height",m.wH),y("Resize")},updateItemHTML:function(){var b=m.items[m.index];m.contentContainer.detach(),m.content&&m.content.detach(),b.parsed||(b=m.parseEl(m.index));var c=b.type;y("BeforeChange",[m.currItem?m.currItem.type:"",c]),m.currItem=b;if(!m.currTemplate[c]){var d=m.st[c]?m.st[c].markup:!1;y("FirstMarkupParse",d),d?m.currTemplate[c]=a(d):m.currTemplate[c]=!0}t&&t!==b.type&&m.container.removeClass("mfp-"+t+"-holder");var e=m["get"+c.charAt(0).toUpperCase()+c.slice(1)](b,m.currTemplate[c]);m.appendContent(e,c),b.preloaded=!0,y(g,b),t=b.type,m.container.prepend(m.contentContainer),y("AfterChange")},appendContent:function(a,b){m.content=a,a?m.st.closeBtnInside&&m.currTemplate[b]===!0?m.content.find(".mfp-close").length||m.content.append(A()):m.content=a:m.content="",y(d),m.container.addClass("mfp-"+b+"-holder"),m.contentContainer.append(m.content)},parseEl:function(b){var c=m.items[b],d=c.type;c.tagName?c={el:a(c)}:c={data:c,src:c.src};if(c.el){var e=m.types;for(var f=0;f<e.length;f++)if(c.el.hasClass("mfp-"+e[f])){d=e[f];break}c.src=c.el.attr("data-mfp-src"),c.src||(c.src=c.el.attr("href"))}return c.type=d||m.st.type||"inline",c.index=b,c.parsed=!0,m.items[b]=c,y("ElementParse",c),m.items[b]},addGroup:function(a,b){var c=function(c){c.mfpEl=this,m._openClick(c,a,b)};b||(b={});var d="click.magnificPopup";b.mainEl=a,b.items?(b.isObj=!0,a.off(d).on(d,c)):(b.isObj=!1,b.delegate?a.off(d).on(d,b.delegate,c):(b.items=a,a.off(d).on(d,c)))},_openClick:function(b,c,d){var e=d.midClick!==undefined?d.midClick:a.magnificPopup.defaults.midClick;if(e||b.which!==2){var f=d.disableOn!==undefined?d.disableOn:a.magnificPopup.defaults.disableOn;if(f)if(a.isFunction(f)){if(!f.call(m))return!0}else if(q.width()<f)return!0;b.type&&(b.preventDefault(),m.isOpen&&b.stopPropagation()),d.el=a(b.mfpEl),d.delegate&&(d.items=c.find(d.delegate)),m.open(d)}},updateStatus:function(a,b){if(m.preloader){p!==a&&m.container.removeClass("mfp-s-"+p),!b&&a==="loading"&&(b=m.st.tLoading);var c={status:a,text:b};y("UpdateStatus",c),a=c.status,b=c.text,m.preloader.html(b),m.preloader.find("a").click(function(a){a.stopImmediatePropagation()}),m.container.addClass("mfp-s-"+a),p=a}},_addClassToMFP:function(a){m.bgOverlay.addClass(a),m.wrap.addClass(a)},_removeClassFromMFP:function(a){this.bgOverlay.removeClass(a),m.wrap.removeClass(a)},_hasScrollBar:function(a){return(m.isIE7?s.height():document.body.scrollHeight)>(a||q.height())},_parseMarkup:function(b,c,d){var f;d.data&&(c=a.extend(d.data,c)),y(e,[b,c,d]),a.each(c,function(a,c){if(c===undefined||c===!1)return!0;f=a.split("_");if(f.length>1){var d=b.find(i+"-"+f[0]);if(d.length>0){var e=f[1];e==="replaceWith"?d[0]!==c[0]&&d.replaceWith(c):e==="img"?d.is("img")?d.attr("src",c):d.replaceWith('<img src="'+c+'" class="'+d.attr("class")+'" />'):d.attr(f[1],c)}}else b.find(i+"-"+a).html(c)})},_getScrollbarSize:function(){if(m.scrollbarSize===undefined){var a=document.createElement("div");a.id="mfp-sbm",a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),m.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return m.scrollbarSize}},a.magnificPopup={instance:null,proto:n.prototype,modules:[],open:function(a,b){return B(),a||(a={}),a.isObj=!0,a.index=b||0,this.instance.open(a)},close:function(){return a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,alignTop:!1,removalDelay:0,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">&times;</button>',tClose:"Close (Esc)",tLoading:"Loading..."}},a.fn.magnificPopup=function(b){B();var c=a(this);if(typeof b=="string")if(b==="open"){var d,e=o?c.data("magnificPopup"):c[0].magnificPopup,f=parseInt(arguments[1],10)||0;e.items?d=e.items[f]:(d=c,e.delegate&&(d=d.find(e.delegate)),d=d.eq(f)),m._openClick({mfpEl:d},c,e)}else m.isOpen&&m[b].apply(m,Array.prototype.slice.call(arguments,1));else o?c.data("magnificPopup",b):c[0].magnificPopup=b,m.addGroup(c,b);return c};var D="inline",E,F,G,H=function(){G&&(F.after(G.addClass(E)).detach(),G=null)};a.magnificPopup.registerModule(D,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){m.types.push(D),w(b+"."+D,function(){H()})},getInline:function(b,c){H();if(b.src){var d=m.st.inline,e=a(b.src);if(e.length){var f=e[0].parentNode;f&&f.tagName&&(F||(E=d.hiddenClass,F=x(E),E="mfp-"+E),G=e.after(F).detach().removeClass(E)),m.updateStatus("ready")}else m.updateStatus("error",d.tNotFound),e=a("<div>");return b.inlineElement=e,e}return m.updateStatus("ready"),m._parseMarkup(c,{},b),c}}});var I="ajax",J,K=function(){J&&r.removeClass(J)};a.magnificPopup.registerModule(I,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){m.types.push(I),J=m.st.ajax.cursor,w(b+"."+I,function(){K(),m.req&&m.req.abort()})},getAjax:function(b){J&&r.addClass(J),m.updateStatus("loading");var c=a.extend({url:b.src,success:function(c,d,e){var f={data:c,xhr:e};y("ParseAjax",f),m.appendContent(a(f.data),I),b.finished=!0,K(),z(),setTimeout(function(){m.wrap.addClass(j)},16),m.updateStatus("ready"),y("AjaxContentAdded")},error:function(){K(),b.finished=b.loadError=!0,m.updateStatus("error",m.st.ajax.tError.replace("%url%",b.src))}},m.st.ajax.settings);return m.req=a.ajax(c),""}}});var L=function(a){var b=m.items.length;return a>b-1?a-b:a<0?b+a:a},M=function(a,b,c){return a.replace("%curr%",b+1).replace("%total%",c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var c=m.st.gallery,d=".mfp-gallery",h=Boolean(a.fn.mfpFastClick);m.direction=!0;if(!c||!c.enabled)return!1;u+=" mfp-gallery",w(f+d,function(){c.navigateByImgClick&&m.wrap.on("click"+d,".mfp-img",function(){if(m.items.length>1)return m.next(),!1}),s.on("keydown"+d,function(a){a.keyCode===37?m.prev():a.keyCode===39&&m.next()})}),w("UpdateStatus"+d,function(a,b){b.text&&(b.text=M(b.text,m.currItem.index,m.items.length))}),w(e+d,function(a,b,d,e){var f=m.items.length;d.counter=f>1?M(c.tCounter,e.index,f):""}),w("BuildControls"+d,function(){if(m.items.length>1&&c.arrows&&!m.arrowLeft){var b=c.arrowMarkup,d=m.arrowLeft=a(b.replace("%title%",c.tPrev).replace("%dir%","left")).addClass(l),e=m.arrowRight=a(b.replace("%title%",c.tNext).replace("%dir%","right")).addClass(l),f=h?"mfpFastClick":"click";d[f](function(){m.prev()}),e[f](function(){m.next()}),m.isIE7&&(x("b",d[0],!1,!0),x("a",d[0],!1,!0),x("b",e[0],!1,!0),x("a",e[0],!1,!0)),m.container.append(d.add(e))}}),w(g+d,function(){m._preloadTimeout&&clearTimeout(m._preloadTimeout),m._preloadTimeout=setTimeout(function(){m.preloadNearbyImages(),m._preloadTimeout=null},16)}),w(b+d,function(){s.off(d),m.wrap.off("click"+d),m.arrowLeft&&h&&m.arrowLeft.add(m.arrowRight).destroyMfpFastClick(),m.arrowRight=m.arrowLeft=null})},next:function(){m.direction=!0,m.index=L(m.index+1),m.updateItemHTML()},prev:function(){m.direction=!1,m.index=L(m.index-1),m.updateItemHTML()},goTo:function(a){m.direction=a>=m.index,m.index=a,m.updateItemHTML()},preloadNearbyImages:function(){var a=m.st.gallery.preload,b=Math.min(a[0],m.items.length),c=Math.min(a[1],m.items.length),d;for(d=1;d<=(m.direction?c:b);d++)m._preloadItem(m.index+d);for(d=1;d<=(m.direction?b:c);d++)m._preloadItem(m.index-d)},_preloadItem:function(b){b=L(b);if(m.items[b].preloaded)return;var c=m.items[b];c.parsed||(c=m.parseEl(b)),y("LazyLoad",c),c.type==="image"&&(c.img=a('<img class="mfp-img" />').on("load.mfploader",function(){c.hasSize=!0}).on("error.mfploader",function(){c.hasSize=!0,c.loadError=!0}).attr("src",c.src)),c.preloaded=!0}}});var N="retina";a.magnificPopup.registerModule(N,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+#x2F;,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=m.st.retina,b=a.ratio;b=isNaN(b)?b():b,b>1&&(w("ImageHasSize."+N,function(a,c){c.img.css({"max-width":c.img[0].naturalWidth/b,width:"100%"})}),w("ElementParse."+N,function(c,d){d.src=a.replaceSrc(d,b)}))}}}}),function(){var b=1e3,c="ontouchstart"in window,d=function(){q.off("touchmove"+f+" touchend"+f)},e="mfpFastClick",f="."+e;a.fn.mfpFastClick=function(e){return a(this).each(function(){var g=a(this),h;if(c){var i,j,k,l,m,n;g.on("touchstart"+f,function(a){l=!1,n=1,m=a.originalEvent?a.originalEvent.touches[0]:a.touches[0],j=m.clientX,k=m.clientY,q.on("touchmove"+f,function(a){m=a.originalEvent?a.originalEvent.touches:a.touches,n=m.length,m=m[0];if(Math.abs(m.clientX-j)>10||Math.abs(m.clientY-k)>10)l=!0,d()}).on("touchend"+f,function(a){d();if(l||n>1)return;h=!0,a.preventDefault(),clearTimeout(i),i=setTimeout(function(){h=!1},b),e()})})}g.on("click"+f,function(){h||e()})})},a.fn.destroyMfpFastClick=function(){a(this).off("touchstart"+f+" click"+f),c&&q.off("touchmove"+f+" touchend"+f)}}()})(window.jQuery||window.Zepto)
1
+ /*! Magnific Popup - v0.9.9 - 2013-11-15
2
+ * http://dimsemenov.com/plugins/magnific-popup/
3
+ * Copyright (c) 2013 Dmitry Semenov; */
4
+ ;(function($) {
5
+
6
+ /*>>core*/
7
+ /**
8
+ *
9
+ * Magnific Popup Core JS file
10
+ *
11
+ */
12
+
13
+
14
+ /**
15
+ * Private static constants
16
+ */
17
+ var CLOSE_EVENT = 'Close',
18
+ BEFORE_CLOSE_EVENT = 'BeforeClose',
19
+ AFTER_CLOSE_EVENT = 'AfterClose',
20
+ BEFORE_APPEND_EVENT = 'BeforeAppend',
21
+ MARKUP_PARSE_EVENT = 'MarkupParse',
22
+ OPEN_EVENT = 'Open',
23
+ CHANGE_EVENT = 'Change',
24
+ NS = 'mfp',
25
+ EVENT_NS = '.' + NS,
26
+ READY_CLASS = 'mfp-ready',
27
+ REMOVING_CLASS = 'mfp-removing',
28
+ PREVENT_CLOSE_CLASS = 'mfp-prevent-close';
29
+
30
+
31
+ /**
32
+ * Private vars
33
+ */
34
+ var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this'
35
+ MagnificPopup = function(){},
36
+ _isJQ = !!(window.jQuery),
37
+ _prevStatus,
38
+ _window = $(window),
39
+ _body,
40
+ _document,
41
+ _prevContentType,
42
+ _wrapClasses,
43
+ _currPopupType;
44
+
45
+
46
+ /**
47
+ * Private functions
48
+ */
49
+ var _mfpOn = function(name, f) {
50
+ mfp.ev.on(NS + name + EVENT_NS, f);
51
+ },
52
+ _getEl = function(className, appendTo, html, raw) {
53
+ var el = document.createElement('div');
54
+ el.className = 'mfp-'+className;
55
+ if(html) {
56
+ el.innerHTML = html;
57
+ }
58
+ if(!raw) {
59
+ el = $(el);
60
+ if(appendTo) {
61
+ el.appendTo(appendTo);
62
+ }
63
+ } else if(appendTo) {
64
+ appendTo.appendChild(el);
65
+ }
66
+ return el;
67
+ },
68
+ _mfpTrigger = function(e, data) {
69
+ mfp.ev.triggerHandler(NS + e, data);
70
+
71
+ if(mfp.st.callbacks) {
72
+ // converts "mfpEventName" to "eventName" callback and triggers it if it's present
73
+ e = e.charAt(0).toLowerCase() + e.slice(1);
74
+ if(mfp.st.callbacks[e]) {
75
+ mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]);
76
+ }
77
+ }
78
+ },
79
+ _getCloseBtn = function(type) {
80
+ if(type !== _currPopupType || !mfp.currTemplate.closeBtn) {
81
+ mfp.currTemplate.closeBtn = $( mfp.st.closeMarkup.replace('%title%', mfp.st.tClose ) );
82
+ _currPopupType = type;
83
+ }
84
+ return mfp.currTemplate.closeBtn;
85
+ },
86
+ // Initialize Magnific Popup only when called at least once
87
+ _checkInstance = function() {
88
+ if(!$.magnificPopup.instance) {
89
+ mfp = new MagnificPopup();
90
+ mfp.init();
91
+ $.magnificPopup.instance = mfp;
92
+ }
93
+ },
94
+ // CSS transition detection, http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr
95
+ supportsTransitions = function() {
96
+ var s = document.createElement('p').style, // 's' for style. better to create an element if body yet to exist
97
+ v = ['ms','O','Moz','Webkit']; // 'v' for vendor
98
+
99
+ if( s['transition'] !== undefined ) {
100
+ return true;
101
+ }
102
+
103
+ while( v.length ) {
104
+ if( v.pop() + 'Transition' in s ) {
105
+ return true;
106
+ }
107
+ }
108
+
109
+ return false;
110
+ };
111
+
112
+
113
+
114
+ /**
115
+ * Public functions
116
+ */
117
+ MagnificPopup.prototype = {
118
+
119
+ constructor: MagnificPopup,
120
+
121
+ /**
122
+ * Initializes Magnific Popup plugin.
123
+ * This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed
124
+ */
125
+ init: function() {
126
+ var appVersion = navigator.appVersion;
127
+ mfp.isIE7 = appVersion.indexOf("MSIE 7.") !== -1;
128
+ mfp.isIE8 = appVersion.indexOf("MSIE 8.") !== -1;
129
+ mfp.isLowIE = mfp.isIE7 || mfp.isIE8;
130
+ mfp.isAndroid = (/android/gi).test(appVersion);
131
+ mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion);
132
+ mfp.supportsTransition = supportsTransitions();
133
+
134
+ // We disable fixed positioned lightbox on devices that don't handle it nicely.
135
+ // If you know a better way of detecting this - let me know.
136
+ mfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) );
137
+ _body = $(document.body);
138
+ _document = $(document);
139
+
140
+ mfp.popupsCache = {};
141
+ },
142
+
143
+ /**
144
+ * Opens popup
145
+ * @param data [description]
146
+ */
147
+ open: function(data) {
148
+
149
+ var i;
150
+
151
+ if(data.isObj === false) {
152
+ // convert jQuery collection to array to avoid conflicts later
153
+ mfp.items = data.items.toArray();
154
+
155
+ mfp.index = 0;
156
+ var items = data.items,
157
+ item;
158
+ for(i = 0; i < items.length; i++) {
159
+ item = items[i];
160
+ if(item.parsed) {
161
+ item = item.el[0];
162
+ }
163
+ if(item === data.el[0]) {
164
+ mfp.index = i;
165
+ break;
166
+ }
167
+ }
168
+ } else {
169
+ mfp.items = $.isArray(data.items) ? data.items : [data.items];
170
+ mfp.index = data.index || 0;
171
+ }
172
+
173
+ // if popup is already opened - we just update the content
174
+ if(mfp.isOpen) {
175
+ mfp.updateItemHTML();
176
+ return;
177
+ }
178
+
179
+ mfp.types = [];
180
+ _wrapClasses = '';
181
+ if(data.mainEl && data.mainEl.length) {
182
+ mfp.ev = data.mainEl.eq(0);
183
+ } else {
184
+ mfp.ev = _document;
185
+ }
186
+
187
+ if(data.key) {
188
+ if(!mfp.popupsCache[data.key]) {
189
+ mfp.popupsCache[data.key] = {};
190
+ }
191
+ mfp.currTemplate = mfp.popupsCache[data.key];
192
+ } else {
193
+ mfp.currTemplate = {};
194
+ }
195
+
196
+
197
+
198
+ mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data );
199
+ mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos;
200
+
201
+ if(mfp.st.modal) {
202
+ mfp.st.closeOnContentClick = false;
203
+ mfp.st.closeOnBgClick = false;
204
+ mfp.st.showCloseBtn = false;
205
+ mfp.st.enableEscapeKey = false;
206
+ }
207
+
208
+
209
+ // Building markup
210
+ // main containers are created only once
211
+ if(!mfp.bgOverlay) {
212
+
213
+ // Dark overlay
214
+ mfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS, function() {
215
+ mfp.close();
216
+ });
217
+
218
+ mfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click'+EVENT_NS, function(e) {
219
+ if(mfp._checkIfClose(e.target)) {
220
+ mfp.close();
221
+ }
222
+ });
223
+
224
+ mfp.container = _getEl('container', mfp.wrap);
225
+ }
226
+
227
+ mfp.contentContainer = _getEl('content');
228
+ if(mfp.st.preloader) {
229
+ mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading);
230
+ }
231
+
232
+
233
+ // Initializing modules
234
+ var modules = $.magnificPopup.modules;
235
+ for(i = 0; i < modules.length; i++) {
236
+ var n = modules[i];
237
+ n = n.charAt(0).toUpperCase() + n.slice(1);
238
+ mfp['init'+n].call(mfp);
239
+ }
240
+ _mfpTrigger('BeforeOpen');
241
+
242
+
243
+ if(mfp.st.showCloseBtn) {
244
+ // Close button
245
+ if(!mfp.st.closeBtnInside) {
246
+ mfp.wrap.append( _getCloseBtn() );
247
+ } else {
248
+ _mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) {
249
+ values.close_replaceWith = _getCloseBtn(item.type);
250
+ });
251
+ _wrapClasses += ' mfp-close-btn-in';
252
+ }
253
+ }
254
+
255
+ if(mfp.st.alignTop) {
256
+ _wrapClasses += ' mfp-align-top';
257
+ }
258
+
259
+
260
+
261
+ if(mfp.fixedContentPos) {
262
+ mfp.wrap.css({
263
+ overflow: mfp.st.overflowY,
264
+ overflowX: 'hidden',
265
+ overflowY: mfp.st.overflowY
266
+ });
267
+ } else {
268
+ mfp.wrap.css({
269
+ top: _window.scrollTop(),
270
+ position: 'absolute'
271
+ });
272
+ }
273
+ if( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) ) {
274
+ mfp.bgOverlay.css({
275
+ height: _document.height(),
276
+ position: 'absolute'
277
+ });
278
+ }
279
+
280
+
281
+
282
+ if(mfp.st.enableEscapeKey) {
283
+ // Close on ESC key
284
+ _document.on('keyup' + EVENT_NS, function(e) {
285
+ if(e.keyCode === 27) {
286
+ mfp.close();
287
+ }
288
+ });
289
+ }
290
+
291
+ _window.on('resize' + EVENT_NS, function() {
292
+ mfp.updateSize();
293
+ });
294
+
295
+
296
+ if(!mfp.st.closeOnContentClick) {
297
+ _wrapClasses += ' mfp-auto-cursor';
298
+ }
299
+
300
+ if(_wrapClasses)
301
+ mfp.wrap.addClass(_wrapClasses);
302
+
303
+
304
+ // this triggers recalculation of layout, so we get it once to not to trigger twice
305
+ var windowHeight = mfp.wH = _window.height();
306
+
307
+
308
+ var windowStyles = {};
309
+
310
+ if( mfp.fixedContentPos ) {
311
+ if(mfp._hasScrollBar(windowHeight)){
312
+ var s = mfp._getScrollbarSize();
313
+ if(s) {
314
+ windowStyles.marginRight = s;
315
+ }
316
+ }
317
+ }
318
+
319
+ if(mfp.fixedContentPos) {
320
+ if(!mfp.isIE7) {
321
+ windowStyles.overflow = 'hidden';
322
+ } else {
323
+ // ie7 double-scroll bug
324
+ $('body, html').css('overflow', 'hidden');
325
+ }
326
+ }
327
+
328
+
329
+
330
+ var classesToadd = mfp.st.mainClass;
331
+ if(mfp.isIE7) {
332
+ classesToadd += ' mfp-ie7';
333
+ }
334
+ if(classesToadd) {
335
+ mfp._addClassToMFP( classesToadd );
336
+ }
337
+
338
+ // add content
339
+ mfp.updateItemHTML();
340
+
341
+ _mfpTrigger('BuildControls');
342
+
343
+
344
+ // remove scrollbar, add margin e.t.c
345
+ $('html').css(windowStyles);
346
+
347
+ // add everything to DOM
348
+ mfp.bgOverlay.add(mfp.wrap).prependTo( document.body );
349
+
350
+
351
+
352
+ // Save last focused element
353
+ mfp._lastFocusedEl = document.activeElement;
354
+
355
+ // Wait for next cycle to allow CSS transition
356
+ setTimeout(function() {
357
+
358
+ if(mfp.content) {
359
+ mfp._addClassToMFP(READY_CLASS);
360
+ mfp._setFocus();
361
+ } else {
362
+ // if content is not defined (not loaded e.t.c) we add class only for BG
363
+ mfp.bgOverlay.addClass(READY_CLASS);
364
+ }
365
+
366
+ // Trap the focus in popup
367
+ _document.on('focusin' + EVENT_NS, mfp._onFocusIn);
368
+
369
+ }, 16);
370
+
371
+ mfp.isOpen = true;
372
+ mfp.updateSize(windowHeight);
373
+ _mfpTrigger(OPEN_EVENT);
374
+
375
+ return data;
376
+ },
377
+
378
+ /**
379
+ * Closes the popup
380
+ */
381
+ close: function() {
382
+ if(!mfp.isOpen) return;
383
+ _mfpTrigger(BEFORE_CLOSE_EVENT);
384
+
385
+ mfp.isOpen = false;
386
+ // for CSS3 animation
387
+ if(mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition ) {
388
+ mfp._addClassToMFP(REMOVING_CLASS);
389
+ setTimeout(function() {
390
+ mfp._close();
391
+ }, mfp.st.removalDelay);
392
+ } else {
393
+ mfp._close();
394
+ }
395
+ },
396
+
397
+ /**
398
+ * Helper for close() function
399
+ */
400
+ _close: function() {
401
+ _mfpTrigger(CLOSE_EVENT);
402
+
403
+ var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' ';
404
+
405
+ mfp.bgOverlay.detach();
406
+ mfp.wrap.detach();
407
+ mfp.container.empty();
408
+
409
+ if(mfp.st.mainClass) {
410
+ classesToRemove += mfp.st.mainClass + ' ';
411
+ }
412
+
413
+ mfp._removeClassFromMFP(classesToRemove);
414
+
415
+ if(mfp.fixedContentPos) {
416
+ var windowStyles = {marginRight: ''};
417
+ if(mfp.isIE7) {
418
+ $('body, html').css('overflow', '');
419
+ } else {
420
+ windowStyles.overflow = '';
421
+ }
422
+ $('html').css(windowStyles);
423
+ }
424
+
425
+ _document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS);
426
+ mfp.ev.off(EVENT_NS);
427
+
428
+ // clean up DOM elements that aren't removed
429
+ mfp.wrap.attr('class', 'mfp-wrap').removeAttr('style');
430
+ mfp.bgOverlay.attr('class', 'mfp-bg');
431
+ mfp.container.attr('class', 'mfp-container');
432
+
433
+ // remove close button from target element
434
+ if(mfp.st.showCloseBtn &&
435
+ (!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) {
436
+ if(mfp.currTemplate.closeBtn)
437
+ mfp.currTemplate.closeBtn.detach();
438
+ }
439
+
440
+
441
+ if(mfp._lastFocusedEl) {
442
+ $(mfp._lastFocusedEl).focus(); // put tab focus back
443
+ }
444
+ mfp.currItem = null;
445
+ mfp.content = null;
446
+ mfp.currTemplate = null;
447
+ mfp.prevHeight = 0;
448
+
449
+ _mfpTrigger(AFTER_CLOSE_EVENT);
450
+ },
451
+
452
+ updateSize: function(winHeight) {
453
+
454
+ if(mfp.isIOS) {
455
+ // fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2
456
+ var zoomLevel = document.documentElement.clientWidth / window.innerWidth;
457
+ var height = window.innerHeight * zoomLevel;
458
+ mfp.wrap.css('height', height);
459
+ mfp.wH = height;
460
+ } else {
461
+ mfp.wH = winHeight || _window.height();
462
+ }
463
+ // Fixes #84: popup incorrectly positioned with position:relative on body
464
+ if(!mfp.fixedContentPos) {
465
+ mfp.wrap.css('height', mfp.wH);
466
+ }
467
+
468
+ _mfpTrigger('Resize');
469
+
470
+ },
471
+
472
+ /**
473
+ * Set content of popup based on current index
474
+ */
475
+ updateItemHTML: function() {
476
+ var item = mfp.items[mfp.index];
477
+
478
+ // Detach and perform modifications
479
+ mfp.contentContainer.detach();
480
+
481
+ if(mfp.content)
482
+ mfp.content.detach();
483
+
484
+ if(!item.parsed) {
485
+ item = mfp.parseEl( mfp.index );
486
+ }
487
+
488
+ var type = item.type;
489
+
490
+ _mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]);
491
+ // BeforeChange event works like so:
492
+ // _mfpOn('BeforeChange', function(e, prevType, newType) { });
493
+
494
+ mfp.currItem = item;
495
+
496
+
497
+
498
+
499
+
500
+ if(!mfp.currTemplate[type]) {
501
+ var markup = mfp.st[type] ? mfp.st[type].markup : false;
502
+
503
+ // allows to modify markup
504
+ _mfpTrigger('FirstMarkupParse', markup);
505
+
506
+ if(markup) {
507
+ mfp.currTemplate[type] = $(markup);
508
+ } else {
509
+ // if there is no markup found we just define that template is parsed
510
+ mfp.currTemplate[type] = true;
511
+ }
512
+ }
513
+
514
+ if(_prevContentType && _prevContentType !== item.type) {
515
+ mfp.container.removeClass('mfp-'+_prevContentType+'-holder');
516
+ }
517
+
518
+ var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]);
519
+ mfp.appendContent(newContent, type);
520
+
521
+ item.preloaded = true;
522
+
523
+ _mfpTrigger(CHANGE_EVENT, item);
524
+ _prevContentType = item.type;
525
+
526
+ // Append container back after its content changed
527
+ mfp.container.prepend(mfp.contentContainer);
528
+
529
+ _mfpTrigger('AfterChange');
530
+ },
531
+
532
+
533
+ /**
534
+ * Set HTML content of popup
535
+ */
536
+ appendContent: function(newContent, type) {
537
+ mfp.content = newContent;
538
+
539
+ if(newContent) {
540
+ if(mfp.st.showCloseBtn && mfp.st.closeBtnInside &&
541
+ mfp.currTemplate[type] === true) {
542
+ // if there is no markup, we just append close button element inside
543
+ if(!mfp.content.find('.mfp-close').length) {
544
+ mfp.content.append(_getCloseBtn());
545
+ }
546
+ } else {
547
+ mfp.content = newContent;
548
+ }
549
+ } else {
550
+ mfp.content = '';
551
+ }
552
+
553
+ _mfpTrigger(BEFORE_APPEND_EVENT);
554
+ mfp.container.addClass('mfp-'+type+'-holder');
555
+
556
+ mfp.contentContainer.append(mfp.content);
557
+ },
558
+
559
+
560
+
561
+
562
+ /**
563
+ * Creates Magnific Popup data object based on given data
564
+ * @param {int} index Index of item to parse
565
+ */
566
+ parseEl: function(index) {
567
+ var item = mfp.items[index],
568
+ type = item.type;
569
+
570
+ if(item.tagName) {
571
+ item = { el: $(item) };
572
+ } else {
573
+ item = { data: item, src: item.src };
574
+ }
575
+
576
+ if(item.el) {
577
+ var types = mfp.types;
578
+
579
+ // check for 'mfp-TYPE' class
580
+ for(var i = 0; i < types.length; i++) {
581
+ if( item.el.hasClass('mfp-'+types[i]) ) {
582
+ type = types[i];
583
+ break;
584
+ }
585
+ }
586
+
587
+ item.src = item.el.attr('data-mfp-src');
588
+ if(!item.src) {
589
+ item.src = item.el.attr('href');
590
+ }
591
+ }
592
+
593
+ item.type = type || mfp.st.type || 'inline';
594
+ item.index = index;
595
+ item.parsed = true;
596
+ mfp.items[index] = item;
597
+ _mfpTrigger('ElementParse', item);
598
+
599
+ return mfp.items[index];
600
+ },
601
+
602
+
603
+ /**
604
+ * Initializes single popup or a group of popups
605
+ */
606
+ addGroup: function(el, options) {
607
+ var eHandler = function(e) {
608
+ e.mfpEl = this;
609
+ mfp._openClick(e, el, options);
610
+ };
611
+
612
+ if(!options) {
613
+ options = {};
614
+ }
615
+
616
+ var eName = 'click.magnificPopup';
617
+ options.mainEl = el;
618
+
619
+ if(options.items) {
620
+ options.isObj = true;
621
+ el.off(eName).on(eName, eHandler);
622
+ } else {
623
+ options.isObj = false;
624
+ if(options.delegate) {
625
+ el.off(eName).on(eName, options.delegate , eHandler);
626
+ } else {
627
+ options.items = el;
628
+ el.off(eName).on(eName, eHandler);
629
+ }
630
+ }
631
+ },
632
+ _openClick: function(e, el, options) {
633
+ var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick;
634
+
635
+
636
+ if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey ) ) {
637
+ return;
638
+ }
639
+
640
+ var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn;
641
+
642
+ if(disableOn) {
643
+ if($.isFunction(disableOn)) {
644
+ if( !disableOn.call(mfp) ) {
645
+ return true;
646
+ }
647
+ } else { // else it's number
648
+ if( _window.width() < disableOn ) {
649
+ return true;
650
+ }
651
+ }
652
+ }
653
+
654
+ if(e.type) {
655
+ e.preventDefault();
656
+
657
+ // This will prevent popup from closing if element is inside and popup is already opened
658
+ if(mfp.isOpen) {
659
+ e.stopPropagation();
660
+ }
661
+ }
662
+
663
+
664
+ options.el = $(e.mfpEl);
665
+ if(options.delegate) {
666
+ options.items = el.find(options.delegate);
667
+ }
668
+ mfp.open(options);
669
+ },
670
+
671
+
672
+ /**
673
+ * Updates text on preloader
674
+ */
675
+ updateStatus: function(status, text) {
676
+
677
+ if(mfp.preloader) {
678
+ if(_prevStatus !== status) {
679
+ mfp.container.removeClass('mfp-s-'+_prevStatus);
680
+ }
681
+
682
+ if(!text && status === 'loading') {
683
+ text = mfp.st.tLoading;
684
+ }
685
+
686
+ var data = {
687
+ status: status,
688
+ text: text
689
+ };
690
+ // allows to modify status
691
+ _mfpTrigger('UpdateStatus', data);
692
+
693
+ status = data.status;
694
+ text = data.text;
695
+
696
+ mfp.preloader.html(text);
697
+
698
+ mfp.preloader.find('a').on('click', function(e) {
699
+ e.stopImmediatePropagation();
700
+ });
701
+
702
+ mfp.container.addClass('mfp-s-'+status);
703
+ _prevStatus = status;
704
+ }
705
+ },
706
+
707
+
708
+ /*
709
+ "Private" helpers that aren't private at all
710
+ */
711
+ // Check to close popup or not
712
+ // "target" is an element that was clicked
713
+ _checkIfClose: function(target) {
714
+
715
+ if($(target).hasClass(PREVENT_CLOSE_CLASS)) {
716
+ return;
717
+ }
718
+
719
+ var closeOnContent = mfp.st.closeOnContentClick;
720
+ var closeOnBg = mfp.st.closeOnBgClick;
721
+
722
+ if(closeOnContent && closeOnBg) {
723