Version Description
Download this release
Release Info
Developer | pasyuk |
Plugin | Gmedia Photo Gallery |
Version | 1.9.16 |
Comparing to | |
See all releases |
Code changes from version 1.8.94 to 1.9.16
- admin/admin.php +10 -2
- admin/ajax.php +43 -30
- admin/assets/css/gmedia.admin.css +13 -8
- admin/assets/css/gmedia.metabox.css +48 -256
- admin/assets/img/image.png +0 -0
- admin/assets/js/gmedia.admin.js +92 -24
- admin/pages/addmedia/tpl/import.php +2 -2
- admin/pages/addmedia/tpl/panel-heading.php +11 -1
- admin/pages/addmedia/tpl/upload.php +4 -3
- admin/pages/galleries/edit-gallery.php +19 -7
- admin/pages/galleries/functions.php +1 -1
- admin/pages/galleries/galleries.php +1 -1
- admin/pages/galleries/tpl/choose-module.php +67 -7
- admin/pages/galleries/tpl/galleries-panel-heading.php +4 -1
- admin/pages/galleries/tpl/gallery-edit-item.php +5 -13
- admin/pages/galleries/tpl/gallery-panel-heading.php +1 -1
- admin/pages/galleries/tpl/modal-build-query.php +52 -26
- admin/pages/galleries/tpl/module-settings.php +1 -0
- admin/pages/library/functions.php +8 -7
- admin/pages/library/library.php +7 -0
- admin/pages/library/tpl/edit-item.php +25 -16
- admin/pages/library/tpl/list-item.php +7 -1
- admin/pages/library/tpl/panel-heading.php +4 -4
- admin/pages/modules/edit-preset.php +1 -1
- admin/pages/modules/functions.php +2 -2
- admin/pages/modules/modules.php +2 -1
- admin/pages/modules/tpl/modal-modulezip.php +2 -2
- admin/pages/settings/settings.php +1 -1
- admin/pages/settings/tpl/common.php +8 -0
- admin/pages/settings/tpl/permalinks.php +36 -0
- admin/pages/terms/functions.php +7 -2
- admin/pages/terms/terms.php +1 -1
- admin/pages/terms/tpl/album-create-item.php +1 -1
- admin/pages/terms/tpl/album-edit-item.php +6 -6
- admin/pages/terms/tpl/category-create-item.php +1 -1
- admin/pages/terms/tpl/category-edit-item.php +6 -6
- admin/pages/terms/tpl/tag-create-item.php +1 -1
- admin/pages/terms/tpl/term-panel-heading.php +1 -1
- admin/pages/terms/tpl/terms-panel-heading.php +1 -1
- admin/processor/class.processor.galleries.php +44 -13
- admin/processor/class.processor.library.php +35 -22
- admin/processor/class.processor.modules.php +13 -13
- admin/processor/class.processor.settings.php +31 -4
- admin/processor/class.processor.terms.php +18 -11
- admin/tpl/comments.php +21 -15
- admin/tpl/modal-customfield.php +1 -1
- admin/tpl/modal-share.php +2 -2
- admin/tpl/search-form.php +4 -1
- app/access.php +145 -73
- app/inc/json.auth.php +2 -2
- assets/gmedia.global.front.js +14 -1
- assets/mag-popup/jquery.magnific-popup.js +1860 -0
- assets/mag-popup/jquery.magnific-popup.min.js +4 -4
- assets/mag-popup/magnific-popup.css +294 -296
- assets/swiper/maps/swiper.jquery.min.js.map +1 -0
- assets/swiper/swiper.jquery.js +4630 -0
- assets/velocity/velocity.min.js +4 -0
- assets/wavesurfer/wavesurfer.js +113 -49
- assets/wavesurfer/wavesurfer.min.js +3 -58
- assets/wavesurfer/wavesurfer.min.js.map +1 -0
- config/setup.php +15 -5
- config/update.php +19 -12
- config/wp-load.php +3 -3
- grand-media.php +137 -45
- inc/compatibility.php +69 -6
- inc/core.php +226 -122
- inc/db.connect.php +8 -3
admin/admin.php
CHANGED
@@ -176,6 +176,14 @@ class GmediaAdmin{
|
|
176 |
}
|
177 |
}
|
178 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
?>
|
180 |
<div id="gmedia-container" class="gmedia-admin">
|
181 |
<div id="gmedia-header" class="clearfix">
|
@@ -278,14 +286,14 @@ class GmediaAdmin{
|
|
278 |
}
|
279 |
reset($ajax_operations);
|
280 |
$ajax = key($ajax_operations);
|
281 |
-
$nonce = wp_create_nonce('
|
282 |
?>
|
283 |
<script type="text/javascript">
|
284 |
jQuery(document).ready(function($) {
|
285 |
var header = $('#gmedia-header');
|
286 |
header.append('<div id="ajax-long-operation"><div class="progress"><div class="progress-bar progress-bar-info" style="width: 0%;"></div><div class="progress-bar-indicator">0%</div></div></div>');
|
287 |
gmAjaxLongOperation = function() {
|
288 |
-
jQuery.post(ajaxurl, {action: '<?php echo $ajax; ?>',
|
289 |
if(r.data) {
|
290 |
jQuery('.progress-bar-info', header).width(r.data.progress);
|
291 |
var indicator = r.data.info? r.data.info + ' ' + r.data.progress : r.data.progress;
|
176 |
}
|
177 |
}
|
178 |
|
179 |
+
// global $wpdb;
|
180 |
+
// $query = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}gmedia_term");
|
181 |
+
// foreach($query as $item){
|
182 |
+
// $name = $gmCore->mb_convert_encoding_utf8($item->name);
|
183 |
+
// $wpdb->update($wpdb->prefix . 'gmedia_term', array('name' => $name), array('term_id' => $item->term_id));
|
184 |
+
// }
|
185 |
+
// echo '<pre>' . print_r($query, true) . '</pre>';
|
186 |
+
|
187 |
?>
|
188 |
<div id="gmedia-container" class="gmedia-admin">
|
189 |
<div id="gmedia-header" class="clearfix">
|
286 |
}
|
287 |
reset($ajax_operations);
|
288 |
$ajax = key($ajax_operations);
|
289 |
+
$nonce = wp_create_nonce('gmedia_ajax_long_operations');
|
290 |
?>
|
291 |
<script type="text/javascript">
|
292 |
jQuery(document).ready(function($) {
|
293 |
var header = $('#gmedia-header');
|
294 |
header.append('<div id="ajax-long-operation"><div class="progress"><div class="progress-bar progress-bar-info" style="width: 0%;"></div><div class="progress-bar-indicator">0%</div></div></div>');
|
295 |
gmAjaxLongOperation = function() {
|
296 |
+
jQuery.post(ajaxurl, {action: '<?php echo $ajax; ?>', _wpnonce_ajax_long_operations: '<?php echo $nonce; ?>'}, function(r) {
|
297 |
if(r.data) {
|
298 |
jQuery('.progress-bar-info', header).width(r.data.progress);
|
299 |
var indicator = r.data.info? r.data.info + ' ' + r.data.progress : r.data.progress;
|
admin/ajax.php
CHANGED
@@ -33,7 +33,9 @@ function gmedia_update_data(){
|
|
33 |
$fileinfo = $gmCore->fileinfo($gmedia['filename'] . '.' . $gmuid['extension']);
|
34 |
if(false !== $fileinfo){
|
35 |
if('image' == $fileinfo['dirname'] && file_is_displayable_image($fileinfo['dirpath'] . '/' . $item->gmuid)){
|
36 |
-
|
|
|
|
|
37 |
@rename($fileinfo['dirpath_thumb'] . '/' . $item->gmuid, $fileinfo['filepath_thumb']);
|
38 |
}
|
39 |
if(@rename($fileinfo['dirpath'] . '/' . $item->gmuid, $fileinfo['filepath'])){
|
@@ -101,9 +103,9 @@ function gmedia_update_data(){
|
|
101 |
$result = $gmDB->get_gmedia($id);
|
102 |
}
|
103 |
|
104 |
-
include_once(GMEDIA_ABSPATH . 'admin/pages/library/functions.php');
|
105 |
gmedia_item_more_data($result);
|
106 |
if('image' != $result->type){
|
|
|
107 |
$result->thumbnail = gmedia_item_thumbnail($result);
|
108 |
}
|
109 |
|
@@ -140,7 +142,7 @@ function gmedia_update_data(){
|
|
140 |
add_action('wp_ajax_gmedit_save', 'gmedit_save');
|
141 |
function gmedit_save(){
|
142 |
global $gmDB, $gmCore, $gmGallery;
|
143 |
-
check_ajax_referer(
|
144 |
if(!current_user_can('gmedia_edit_media')){
|
145 |
die('-1');
|
146 |
}
|
@@ -215,10 +217,15 @@ function gmedit_save(){
|
|
215 |
}
|
216 |
}
|
217 |
|
|
|
218 |
if('thumb' == $applyto){
|
219 |
$editfile = $fileinfo['filepath_thumb'];
|
220 |
} else{
|
221 |
$editfile = $fileinfo['filepath'];
|
|
|
|
|
|
|
|
|
222 |
}
|
223 |
if(!@file_put_contents($editfile, $image['data'])){
|
224 |
$fail = $fileinfo['basename'] . ": " . __('Can\'t write to file. Permission denied', 'grand-media');
|
@@ -230,8 +237,11 @@ function gmedit_save(){
|
|
230 |
|
231 |
// Web-image
|
232 |
if('thumb' !== $applyto){
|
233 |
-
if(
|
234 |
$gmCore->copy_exif($fileinfo['filepath_original'], $fileinfo['filepath']);
|
|
|
|
|
|
|
235 |
}
|
236 |
}
|
237 |
// Thumbnail
|
@@ -259,7 +269,7 @@ function gmedit_save(){
|
|
259 |
}
|
260 |
|
261 |
$thumbis = false;
|
262 |
-
if(
|
263 |
$thumbis = true;
|
264 |
rename($fileinfo['filepath_thumb'], $fileinfo['filepath_thumb'] . '.tmp');
|
265 |
}
|
@@ -306,7 +316,7 @@ function gmedit_save(){
|
|
306 |
add_action('wp_ajax_gmedit_restore', 'gmedit_restore');
|
307 |
function gmedit_restore(){
|
308 |
global $gmCore;
|
309 |
-
check_ajax_referer(
|
310 |
if(!current_user_can('gmedia_edit_media')){
|
311 |
die('-1');
|
312 |
}
|
@@ -969,7 +979,7 @@ function gmedia_get_modal(){
|
|
969 |
<button type="button" onclick="jQuery('#ajax-modal-form').submit()" class="btn <?php echo $button_class; ?>"><?php echo $modal_button; ?></button>
|
970 |
<?php
|
971 |
}
|
972 |
-
wp_nonce_field('gmedia_action');
|
973 |
?>
|
974 |
</div>
|
975 |
</form><!-- /.modal-content -->
|
@@ -981,7 +991,7 @@ add_action('wp_ajax_gmedia_tag_edit', 'gmedia_tag_edit');
|
|
981 |
function gmedia_tag_edit(){
|
982 |
global $gmCore, $gmDB;
|
983 |
|
984 |
-
check_ajax_referer('
|
985 |
if(!current_user_can('gmedia_tag_manage') && !current_user_can('gmedia_edit_others_media')){
|
986 |
$out['error'] = $gmCore->alert('danger', __("You are not allowed to edit others media", 'grand-media'));
|
987 |
header('Content-Type: application/json; charset=' . get_option('blog_charset'), true);
|
@@ -999,13 +1009,13 @@ function gmedia_tag_edit(){
|
|
999 |
if(is_wp_error($term_id)){
|
1000 |
$out['error'] = $gmCore->alert('danger', $term_id->get_error_message());
|
1001 |
} else{
|
1002 |
-
$out['msg'] = $gmCore->alert('info', sprintf(__("Tag #%d
|
1003 |
}
|
1004 |
} else{
|
1005 |
$out['error'] = $gmCore->alert('danger', __("A term with the name provided already exists", 'grand-media'));
|
1006 |
}
|
1007 |
} else{
|
1008 |
-
$out['error'] = $gmCore->alert('danger', __("A term with the id provided
|
1009 |
}
|
1010 |
} else{
|
1011 |
$out['error'] = $gmCore->alert('danger', __("Term name can't be only digits or empty", 'grand-media'));
|
@@ -1092,9 +1102,9 @@ function gmedia_module_install(){
|
|
1092 |
WP_Filesystem();
|
1093 |
}
|
1094 |
if(!is_object($wp_filesystem)){
|
1095 |
-
$result = new WP_Error('fs_unavailable', __('Could not access filesystem.', '
|
1096 |
} elseif($wp_filesystem->errors->get_error_code()){
|
1097 |
-
$result = new WP_Error('fs_error', __('Filesystem error', '
|
1098 |
} else{
|
1099 |
if($module && is_dir($to_folder . $module)){
|
1100 |
$gmCore->delete_folder($to_folder . $module);
|
@@ -1109,7 +1119,9 @@ function gmedia_module_install(){
|
|
1109 |
echo $gmCore->alert('danger', $result->get_error_message());
|
1110 |
die();
|
1111 |
} else{
|
1112 |
-
echo $gmCore->alert('success', sprintf(__("The `%s` module
|
|
|
|
|
1113 |
}
|
1114 |
} else{
|
1115 |
echo $gmCore->alert('danger', __('No file specified', 'grand-media'));
|
@@ -1136,7 +1148,7 @@ function gmedia_import_wpmedia_modal(){
|
|
1136 |
</div>
|
1137 |
<div class="modal-body" style="position:relative; min-height:270px;">
|
1138 |
<form id="import_form" name="import_form" target="import_window" action="<?php echo admin_url('admin-ajax.php'); ?>" method="POST" accept-charset="utf-8">
|
1139 |
-
<?php wp_nonce_field('
|
1140 |
<input type="hidden" name="action" value="gmedia_import_handler"/>
|
1141 |
<input type="hidden" id="import-action" name="import" value="import-wpmedia"/>
|
1142 |
<input type="hidden" name="selected" value="<?php $ckey = "gmedia_library:wpmedia";
|
@@ -1292,7 +1304,7 @@ function gmedia_relimage(){
|
|
1292 |
/** @var $wpdb wpdb */
|
1293 |
global $wpdb, $gmCore, $gmDB;
|
1294 |
|
1295 |
-
check_ajax_referer("
|
1296 |
|
1297 |
// check for correct capability
|
1298 |
if(!current_user_can('gmedia_library')){
|
@@ -1392,7 +1404,7 @@ function gmedia_ftp_browser(){
|
|
1392 |
}
|
1393 |
|
1394 |
// if nonce is not correct it returns -1
|
1395 |
-
check_ajax_referer('
|
1396 |
|
1397 |
// start from the default path
|
1398 |
$root = trailingslashit(ABSPATH);
|
@@ -1522,7 +1534,7 @@ function gmedia_upload_handler(){
|
|
1522 |
nocache_headers();
|
1523 |
|
1524 |
// if nonce is not correct it returns -1
|
1525 |
-
check_ajax_referer('
|
1526 |
if(!current_user_can('gmedia_upload')){
|
1527 |
wp_die(__('You do not have permission to upload files in Gmedia Library.'));
|
1528 |
}
|
@@ -1594,7 +1606,7 @@ function gmedia_import_handler(){
|
|
1594 |
//send_origin_headers();
|
1595 |
nocache_headers();
|
1596 |
|
1597 |
-
check_admin_referer('
|
1598 |
if(!current_user_can('gmedia_import')){
|
1599 |
wp_die(__('You do not have permission to upload files.'));
|
1600 |
}
|
@@ -1647,7 +1659,7 @@ function gmedia_import_handler(){
|
|
1647 |
$gmuid = basename($filepath);
|
1648 |
if(in_array($gmuid, $gmedias)){
|
1649 |
$fileinfo = $gmCore->fileinfo($gmuid, false);
|
1650 |
-
if(!(('image' == $fileinfo['dirname']) && !
|
1651 |
unset($files[ $i ]);
|
1652 |
}
|
1653 |
}
|
@@ -1821,7 +1833,7 @@ add_action('wp_ajax_gmedia_share_page', 'gmedia_share_page');
|
|
1821 |
function gmedia_share_page(){
|
1822 |
global $gmCore, $user_ID;
|
1823 |
// if nonce is not correct it returns -1
|
1824 |
-
check_ajax_referer('
|
1825 |
|
1826 |
$sharelink = $gmCore->_post('sharelink', '');
|
1827 |
$email = $gmCore->_post('email', '');
|
@@ -1889,7 +1901,7 @@ EOT;
|
|
1889 |
add_action('wp_ajax_gmedia_add_custom_field', 'gmedia_add_custom_field');
|
1890 |
function gmedia_add_custom_field(){
|
1891 |
global $gmDB, $user_ID, $gmCore;
|
1892 |
-
check_ajax_referer('gmedia_custom_field', '
|
1893 |
|
1894 |
$meta_type = 'gmedia';
|
1895 |
|
@@ -1934,7 +1946,7 @@ function gmedia_add_custom_field(){
|
|
1934 |
add_action('wp_ajax_gmedia_delete_custom_field', 'gmedia_delete_custom_field');
|
1935 |
function gmedia_delete_custom_field(){
|
1936 |
global $gmDB, $user_ID, $gmCore;
|
1937 |
-
check_ajax_referer('gmedia_custom_field', '
|
1938 |
|
1939 |
$meta_type = 'gmedia';
|
1940 |
|
@@ -1976,7 +1988,7 @@ function gmedia_delete_custom_field(){
|
|
1976 |
add_action('wp_ajax_gmedia_term_add_custom_field', 'gmedia_term_add_custom_field');
|
1977 |
function gmedia_term_add_custom_field(){
|
1978 |
global $gmDB, $user_ID, $gmCore;
|
1979 |
-
check_ajax_referer('gmedia_custom_field', '
|
1980 |
|
1981 |
$meta_type = 'gmedia_term';
|
1982 |
|
@@ -2023,7 +2035,7 @@ function gmedia_term_add_custom_field(){
|
|
2023 |
add_action('wp_ajax_gmedia_term_delete_custom_field', 'gmedia_term_delete_custom_field');
|
2024 |
function gmedia_term_delete_custom_field(){
|
2025 |
global $gmDB, $user_ID, $gmCore;
|
2026 |
-
check_ajax_referer('gmedia_custom_field', '
|
2027 |
|
2028 |
$meta_type = 'gmedia_term';
|
2029 |
|
@@ -2068,7 +2080,7 @@ function gmedia_term_delete_custom_field(){
|
|
2068 |
add_action('wp_ajax_gmedia_term_sortorder', 'gmedia_term_sortorder');
|
2069 |
function gmedia_term_sortorder(){
|
2070 |
global $gmDB, $user_ID, $gmCore;
|
2071 |
-
check_ajax_referer('
|
2072 |
|
2073 |
$term_id = $gmCore->_post('term_id');
|
2074 |
$idx0 = (int)$gmCore->_post('idx0');
|
@@ -2083,7 +2095,7 @@ function gmedia_term_sortorder(){
|
|
2083 |
}
|
2084 |
|
2085 |
if(!$term_id || !($term_id = $gmDB->term_exists($term_id))){
|
2086 |
-
wp_send_json(array('error' => array('code' => 101, 'message' => __('A term with the id provided
|
2087 |
}
|
2088 |
$term = $gmDB->get_term($term_id);
|
2089 |
if(((int)$term->global != (int)$user_ID) && !current_user_can('gmedia_edit_others_media')){
|
@@ -2139,7 +2151,7 @@ add_action('wp_ajax_gmedia_hash_files', 'gmedia_hash_files');
|
|
2139 |
function gmedia_hash_files(){
|
2140 |
global $wpdb, $gmCore, $gmDB;
|
2141 |
|
2142 |
-
check_ajax_referer('
|
2143 |
|
2144 |
$all_count = wp_cache_get('gmedia_count_all');
|
2145 |
if(false === $all_count){
|
@@ -2169,9 +2181,10 @@ function gmedia_hash_files(){
|
|
2169 |
|
2170 |
foreach($unhashed as $item){
|
2171 |
$fileinfo = $gmCore->fileinfo($item->gmuid, false);
|
2172 |
-
$
|
|
|
2173 |
$gmDB->update_metadata($meta_type = 'gmedia', $item->ID, $meta_key = '_hash', $hash_file);
|
2174 |
-
$file_size = filesize($
|
2175 |
$gmDB->update_metadata($meta_type = 'gmedia', $item->ID, $meta_key = '_size', $file_size);
|
2176 |
}
|
2177 |
|
@@ -2184,7 +2197,7 @@ add_action('wp_ajax_gmedia_recreate_images', 'gmedia_recreate_images');
|
|
2184 |
function gmedia_recreate_images(){
|
2185 |
global $gmCore;
|
2186 |
|
2187 |
-
check_ajax_referer('
|
2188 |
|
2189 |
$gmid = 0;
|
2190 |
$ajax_operations = get_option('gmedia_ajax_long_operations', array());
|
33 |
$fileinfo = $gmCore->fileinfo($gmedia['filename'] . '.' . $gmuid['extension']);
|
34 |
if(false !== $fileinfo){
|
35 |
if('image' == $fileinfo['dirname'] && file_is_displayable_image($fileinfo['dirpath'] . '/' . $item->gmuid)){
|
36 |
+
if(is_file($fileinfo['dirpath_original'] . '/' . $item->gmuid)){
|
37 |
+
@rename($fileinfo['dirpath_original'] . '/' . $item->gmuid, $fileinfo['filepath_original']);
|
38 |
+
}
|
39 |
@rename($fileinfo['dirpath_thumb'] . '/' . $item->gmuid, $fileinfo['filepath_thumb']);
|
40 |
}
|
41 |
if(@rename($fileinfo['dirpath'] . '/' . $item->gmuid, $fileinfo['filepath'])){
|
103 |
$result = $gmDB->get_gmedia($id);
|
104 |
}
|
105 |
|
|
|
106 |
gmedia_item_more_data($result);
|
107 |
if('image' != $result->type){
|
108 |
+
include_once(GMEDIA_ABSPATH . 'admin/pages/library/functions.php');
|
109 |
$result->thumbnail = gmedia_item_thumbnail($result);
|
110 |
}
|
111 |
|
142 |
add_action('wp_ajax_gmedit_save', 'gmedit_save');
|
143 |
function gmedit_save(){
|
144 |
global $gmDB, $gmCore, $gmGallery;
|
145 |
+
check_ajax_referer('gmedia_edit', '_wpnonce_edit');
|
146 |
if(!current_user_can('gmedia_edit_media')){
|
147 |
die('-1');
|
148 |
}
|
217 |
}
|
218 |
}
|
219 |
|
220 |
+
$no_original = false;
|
221 |
if('thumb' == $applyto){
|
222 |
$editfile = $fileinfo['filepath_thumb'];
|
223 |
} else{
|
224 |
$editfile = $fileinfo['filepath'];
|
225 |
+
if(('JPG' == $extensions[ $size[2] ]) && !is_file($fileinfo['filepath_original'])){
|
226 |
+
$no_original = true;
|
227 |
+
@copy($editfile, $fileinfo['filepath_original']);
|
228 |
+
}
|
229 |
}
|
230 |
if(!@file_put_contents($editfile, $image['data'])){
|
231 |
$fail = $fileinfo['basename'] . ": " . __('Can\'t write to file. Permission denied', 'grand-media');
|
237 |
|
238 |
// Web-image
|
239 |
if('thumb' !== $applyto){
|
240 |
+
if('JPG' == $extensions[ $size[2] ]){
|
241 |
$gmCore->copy_exif($fileinfo['filepath_original'], $fileinfo['filepath']);
|
242 |
+
if($no_original){
|
243 |
+
@unlink($fileinfo['filepath_original']);
|
244 |
+
}
|
245 |
}
|
246 |
}
|
247 |
// Thumbnail
|
269 |
}
|
270 |
|
271 |
$thumbis = false;
|
272 |
+
if(is_file($fileinfo['filepath_thumb'])){
|
273 |
$thumbis = true;
|
274 |
rename($fileinfo['filepath_thumb'], $fileinfo['filepath_thumb'] . '.tmp');
|
275 |
}
|
316 |
add_action('wp_ajax_gmedit_restore', 'gmedit_restore');
|
317 |
function gmedit_restore(){
|
318 |
global $gmCore;
|
319 |
+
check_ajax_referer('gmedia_edit', '_wpnonce_edit');
|
320 |
if(!current_user_can('gmedia_edit_media')){
|
321 |
die('-1');
|
322 |
}
|
979 |
<button type="button" onclick="jQuery('#ajax-modal-form').submit()" class="btn <?php echo $button_class; ?>"><?php echo $modal_button; ?></button>
|
980 |
<?php
|
981 |
}
|
982 |
+
wp_nonce_field('gmedia_action', '_wpnonce_action');
|
983 |
?>
|
984 |
</div>
|
985 |
</form><!-- /.modal-content -->
|
991 |
function gmedia_tag_edit(){
|
992 |
global $gmCore, $gmDB;
|
993 |
|
994 |
+
check_ajax_referer('gmedia_terms', '_wpnonce_terms');
|
995 |
if(!current_user_can('gmedia_tag_manage') && !current_user_can('gmedia_edit_others_media')){
|
996 |
$out['error'] = $gmCore->alert('danger', __("You are not allowed to edit others media", 'grand-media'));
|
997 |
header('Content-Type: application/json; charset=' . get_option('blog_charset'), true);
|
1009 |
if(is_wp_error($term_id)){
|
1010 |
$out['error'] = $gmCore->alert('danger', $term_id->get_error_message());
|
1011 |
} else{
|
1012 |
+
$out['msg'] = $gmCore->alert('info', sprintf(__("Tag #%d successfully updated", 'grand-media'), $term_id));
|
1013 |
}
|
1014 |
} else{
|
1015 |
$out['error'] = $gmCore->alert('danger', __("A term with the name provided already exists", 'grand-media'));
|
1016 |
}
|
1017 |
} else{
|
1018 |
+
$out['error'] = $gmCore->alert('danger', __("A term with the id provided does not exists", 'grand-media'));
|
1019 |
}
|
1020 |
} else{
|
1021 |
$out['error'] = $gmCore->alert('danger', __("Term name can't be only digits or empty", 'grand-media'));
|
1102 |
WP_Filesystem();
|
1103 |
}
|
1104 |
if(!is_object($wp_filesystem)){
|
1105 |
+
$result = new WP_Error('fs_unavailable', __('Could not access filesystem.', 'grand-media'));
|
1106 |
} elseif($wp_filesystem->errors->get_error_code()){
|
1107 |
+
$result = new WP_Error('fs_error', __('Filesystem error', 'grand-media'), $wp_filesystem->errors);
|
1108 |
} else{
|
1109 |
if($module && is_dir($to_folder . $module)){
|
1110 |
$gmCore->delete_folder($to_folder . $module);
|
1119 |
echo $gmCore->alert('danger', $result->get_error_message());
|
1120 |
die();
|
1121 |
} else{
|
1122 |
+
echo $gmCore->alert('success', sprintf(__("The `%s` module successfully installed", 'grand-media'), $module));
|
1123 |
+
// Try to clear cache after module update
|
1124 |
+
@$gmCore->clear_cache();
|
1125 |
}
|
1126 |
} else{
|
1127 |
echo $gmCore->alert('danger', __('No file specified', 'grand-media'));
|
1148 |
</div>
|
1149 |
<div class="modal-body" style="position:relative; min-height:270px;">
|
1150 |
<form id="import_form" name="import_form" target="import_window" action="<?php echo admin_url('admin-ajax.php'); ?>" method="POST" accept-charset="utf-8">
|
1151 |
+
<?php wp_nonce_field('gmedia_import', '_wpnonce_import'); ?>
|
1152 |
<input type="hidden" name="action" value="gmedia_import_handler"/>
|
1153 |
<input type="hidden" id="import-action" name="import" value="import-wpmedia"/>
|
1154 |
<input type="hidden" name="selected" value="<?php $ckey = "gmedia_library:wpmedia";
|
1304 |
/** @var $wpdb wpdb */
|
1305 |
global $wpdb, $gmCore, $gmDB;
|
1306 |
|
1307 |
+
check_ajax_referer("GmediaGallery");
|
1308 |
|
1309 |
// check for correct capability
|
1310 |
if(!current_user_can('gmedia_library')){
|
1404 |
}
|
1405 |
|
1406 |
// if nonce is not correct it returns -1
|
1407 |
+
check_ajax_referer('GmediaGallery');
|
1408 |
|
1409 |
// start from the default path
|
1410 |
$root = trailingslashit(ABSPATH);
|
1534 |
nocache_headers();
|
1535 |
|
1536 |
// if nonce is not correct it returns -1
|
1537 |
+
check_ajax_referer('gmedia_upload', '_wpnonce_upload');
|
1538 |
if(!current_user_can('gmedia_upload')){
|
1539 |
wp_die(__('You do not have permission to upload files in Gmedia Library.'));
|
1540 |
}
|
1606 |
//send_origin_headers();
|
1607 |
nocache_headers();
|
1608 |
|
1609 |
+
check_admin_referer('gmedia_import', '_wpnonce_import');
|
1610 |
if(!current_user_can('gmedia_import')){
|
1611 |
wp_die(__('You do not have permission to upload files.'));
|
1612 |
}
|
1659 |
$gmuid = basename($filepath);
|
1660 |
if(in_array($gmuid, $gmedias)){
|
1661 |
$fileinfo = $gmCore->fileinfo($gmuid, false);
|
1662 |
+
if(!(('image' == $fileinfo['dirname']) && !is_file($fileinfo['filepath']))){
|
1663 |
unset($files[ $i ]);
|
1664 |
}
|
1665 |
}
|
1833 |
function gmedia_share_page(){
|
1834 |
global $gmCore, $user_ID;
|
1835 |
// if nonce is not correct it returns -1
|
1836 |
+
check_ajax_referer('gmedia_share', '_wpnonce_share');
|
1837 |
|
1838 |
$sharelink = $gmCore->_post('sharelink', '');
|
1839 |
$email = $gmCore->_post('email', '');
|
1901 |
add_action('wp_ajax_gmedia_add_custom_field', 'gmedia_add_custom_field');
|
1902 |
function gmedia_add_custom_field(){
|
1903 |
global $gmDB, $user_ID, $gmCore;
|
1904 |
+
check_ajax_referer('gmedia_custom_field', '_wpnonce_custom_field');
|
1905 |
|
1906 |
$meta_type = 'gmedia';
|
1907 |
|
1946 |
add_action('wp_ajax_gmedia_delete_custom_field', 'gmedia_delete_custom_field');
|
1947 |
function gmedia_delete_custom_field(){
|
1948 |
global $gmDB, $user_ID, $gmCore;
|
1949 |
+
check_ajax_referer('gmedia_custom_field', '_wpnonce_custom_field');
|
1950 |
|
1951 |
$meta_type = 'gmedia';
|
1952 |
|
1988 |
add_action('wp_ajax_gmedia_term_add_custom_field', 'gmedia_term_add_custom_field');
|
1989 |
function gmedia_term_add_custom_field(){
|
1990 |
global $gmDB, $user_ID, $gmCore;
|
1991 |
+
check_ajax_referer('gmedia_custom_field', '_wpnonce_custom_field');
|
1992 |
|
1993 |
$meta_type = 'gmedia_term';
|
1994 |
|
2035 |
add_action('wp_ajax_gmedia_term_delete_custom_field', 'gmedia_term_delete_custom_field');
|
2036 |
function gmedia_term_delete_custom_field(){
|
2037 |
global $gmDB, $user_ID, $gmCore;
|
2038 |
+
check_ajax_referer('gmedia_custom_field', '_wpnonce_custom_field');
|
2039 |
|
2040 |
$meta_type = 'gmedia_term';
|
2041 |
|
2080 |
add_action('wp_ajax_gmedia_term_sortorder', 'gmedia_term_sortorder');
|
2081 |
function gmedia_term_sortorder(){
|
2082 |
global $gmDB, $user_ID, $gmCore;
|
2083 |
+
check_ajax_referer('gmedia_terms', '_wpnonce_terms');
|
2084 |
|
2085 |
$term_id = $gmCore->_post('term_id');
|
2086 |
$idx0 = (int)$gmCore->_post('idx0');
|
2095 |
}
|
2096 |
|
2097 |
if(!$term_id || !($term_id = $gmDB->term_exists($term_id))){
|
2098 |
+
wp_send_json(array('error' => array('code' => 101, 'message' => __('A term with the id provided does not exists', 'grand-media')), 'id' => $term_id));
|
2099 |
}
|
2100 |
$term = $gmDB->get_term($term_id);
|
2101 |
if(((int)$term->global != (int)$user_ID) && !current_user_can('gmedia_edit_others_media')){
|
2151 |
function gmedia_hash_files(){
|
2152 |
global $wpdb, $gmCore, $gmDB;
|
2153 |
|
2154 |
+
check_ajax_referer('gmedia_ajax_long_operations', '_wpnonce_ajax_long_operations');
|
2155 |
|
2156 |
$all_count = wp_cache_get('gmedia_count_all');
|
2157 |
if(false === $all_count){
|
2181 |
|
2182 |
foreach($unhashed as $item){
|
2183 |
$fileinfo = $gmCore->fileinfo($item->gmuid, false);
|
2184 |
+
$filepath = is_file($fileinfo['filepath_original'])? $fileinfo['filepath_original'] : $fileinfo['filepath'];
|
2185 |
+
$hash_file = hash_file('md5', $filepath);
|
2186 |
$gmDB->update_metadata($meta_type = 'gmedia', $item->ID, $meta_key = '_hash', $hash_file);
|
2187 |
+
$file_size = filesize($filepath);
|
2188 |
$gmDB->update_metadata($meta_type = 'gmedia', $item->ID, $meta_key = '_size', $file_size);
|
2189 |
}
|
2190 |
|
2197 |
function gmedia_recreate_images(){
|
2198 |
global $gmCore;
|
2199 |
|
2200 |
+
check_ajax_referer('gmedia_ajax_long_operations', '_wpnonce_ajax_long_operations');
|
2201 |
|
2202 |
$gmid = 0;
|
2203 |
$ajax_operations = get_option('gmedia_ajax_long_operations', array());
|
admin/assets/css/gmedia.admin.css
CHANGED
@@ -55,6 +55,7 @@ select.disabled {pointer-events:none;}
|
|
55 |
position: fixed;
|
56 |
z-index: 999999;
|
57 |
max-width: 220px;
|
|
|
58 |
}
|
59 |
#gmedia-data-helper:before{
|
60 |
border: solid;
|
@@ -280,13 +281,11 @@ body.gmedia-blank .panel-absoluteHeader .panel-heading,
|
|
280 |
}
|
281 |
div#gm-list-table {
|
282 |
font-size:13px;
|
283 |
-
}
|
284 |
-
.GrandMedia_Albums_edit div#gm-list-table {
|
285 |
display:block;
|
286 |
display:flex;
|
287 |
flex-wrap:wrap;
|
288 |
}
|
289 |
-
|
290 |
display:block;
|
291 |
content:'';
|
292 |
float:left;
|
@@ -395,9 +394,13 @@ label.cb_media-object-gallery {
|
|
395 |
padding:12px 12px 10px;
|
396 |
border:4px solid #ffffff;
|
397 |
background-color:#f7f7f7;
|
398 |
-
min-width:
|
399 |
max-width:340px;
|
400 |
border-radius:14px;
|
|
|
|
|
|
|
|
|
401 |
}
|
402 |
.display-as-grid .gm-item-cell.ui-highlight-placeholder {margin-bottom:0;background-color:#2c7c91;}
|
403 |
.edit-gmedia .gmedia-actions { margin:10px; }
|
@@ -609,6 +612,7 @@ label.cb_media-object-gallery {
|
|
609 |
}
|
610 |
.media-title {
|
611 |
font-size:22px;
|
|
|
612 |
}
|
613 |
.media-caption:empty { display:none; }
|
614 |
.media-caption.in-library {
|
@@ -802,7 +806,7 @@ a.trash-icon:hover { color:#843534; }
|
|
802 |
width:auto;
|
803 |
background-color:#ffffff;
|
804 |
}
|
805 |
-
.term-list-item .term_name { margin-right:
|
806 |
.term-list-item .no-checkbox .term_name { margin-right:5px; font-size:16px;}
|
807 |
.term-list-item .term_info_author {
|
808 |
font-size:80%;
|
@@ -1190,15 +1194,16 @@ body.gmedia_library .panel {
|
|
1190 |
|
1191 |
.edit_gmedia_item .modal-header {display:none;}
|
1192 |
.edit_gmedia_item .modal-body {padding:0;}
|
1193 |
-
.edit_gmedia_item iframe {
|
1194 |
|
1195 |
.select_gmedia .modal-body,
|
1196 |
.select_gmedia_image .modal-body {padding:0;}
|
1197 |
.select_gmedia iframe,
|
1198 |
-
.select_gmedia_image iframe {
|
|
|
1199 |
|
1200 |
.checked_thumb {margin-top:-7px;text-align:center;}
|
1201 |
-
.checked_thumb img {max-height:
|
1202 |
|
1203 |
input.sharelink[readonly] { cursor:text; }
|
1204 |
fieldset.gmediacustomstuff { margin:0 0 10px; padding:.35em .625em .4em; position:relative; border:1px solid silver }
|
55 |
position: fixed;
|
56 |
z-index: 999999;
|
57 |
max-width: 220px;
|
58 |
+
word-wrap:break-word;
|
59 |
}
|
60 |
#gmedia-data-helper:before{
|
61 |
border: solid;
|
281 |
}
|
282 |
div#gm-list-table {
|
283 |
font-size:13px;
|
|
|
|
|
284 |
display:block;
|
285 |
display:flex;
|
286 |
flex-wrap:wrap;
|
287 |
}
|
288 |
+
div#gm-list-table::before {
|
289 |
display:block;
|
290 |
content:'';
|
291 |
float:left;
|
394 |
padding:12px 12px 10px;
|
395 |
border:4px solid #ffffff;
|
396 |
background-color:#f7f7f7;
|
397 |
+
min-width:195px;
|
398 |
max-width:340px;
|
399 |
border-radius:14px;
|
400 |
+
flex: 1 1 195px;
|
401 |
+
}
|
402 |
+
.display-as-grid .gm-item-cell-blank {
|
403 |
+
flex: 1 1 195px;
|
404 |
}
|
405 |
.display-as-grid .gm-item-cell.ui-highlight-placeholder {margin-bottom:0;background-color:#2c7c91;}
|
406 |
.edit-gmedia .gmedia-actions { margin:10px; }
|
612 |
}
|
613 |
.media-title {
|
614 |
font-size:22px;
|
615 |
+
word-wrap:break-word;
|
616 |
}
|
617 |
.media-caption:empty { display:none; }
|
618 |
.media-caption.in-library {
|
806 |
width:auto;
|
807 |
background-color:#ffffff;
|
808 |
}
|
809 |
+
.term-list-item .term_name { margin-right:80px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:22px; display:inline-block; line-height:100%; }
|
810 |
.term-list-item .no-checkbox .term_name { margin-right:5px; font-size:16px;}
|
811 |
.term-list-item .term_info_author {
|
812 |
font-size:80%;
|
1194 |
|
1195 |
.edit_gmedia_item .modal-header {display:none;}
|
1196 |
.edit_gmedia_item .modal-body {padding:0;}
|
1197 |
+
.edit_gmedia_item iframe {max-height:calc(100vh - 110px);}
|
1198 |
|
1199 |
.select_gmedia .modal-body,
|
1200 |
.select_gmedia_image .modal-body {padding:0;}
|
1201 |
.select_gmedia iframe,
|
1202 |
+
.select_gmedia_image iframe {max-height:calc(100vh - 160px);}
|
1203 |
+
.no-transition {transition:none !important; -webkit-transition:none !important;}
|
1204 |
|
1205 |
.checked_thumb {margin-top:-7px;text-align:center;}
|
1206 |
+
.checked_thumb img {max-height:55px;width:auto;height:auto;}
|
1207 |
|
1208 |
input.sharelink[readonly] { cursor:text; }
|
1209 |
fieldset.gmediacustomstuff { margin:0 0 10px; padding:.35em .625em .4em; position:relative; border:1px solid silver }
|
admin/assets/css/gmedia.metabox.css
CHANGED
@@ -1,263 +1,55 @@
|
|
1 |
@charset "utf-8";
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
}
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
border-bottom-color:#2e6286;
|
11 |
-
border-radius:0 0 4px 4px;
|
12 |
-
box-sizing:border-box;
|
13 |
-
}
|
14 |
div#gmedia-MetaBox div#gmedia-wraper { min-width:100%; max-width:100%; }
|
15 |
-
body > div#gmedia-wraper { box-shadow:0 2px 3px #
|
16 |
body > div#gmedia-wraper:before { content:''; position:absolute; z-index:-1; left:20px; top:20px; width:100%; height:100%; }
|
17 |
-
div#gmedia-wraper div#gmedia-source,
|
18 |
-
div#gmedia-wraper
|
19 |
-
|
20 |
-
}
|
21 |
-
div#gmedia-wraper * {
|
22 |
-
margin:0;
|
23 |
-
padding:0;
|
24 |
-
font-size:11px;
|
25 |
-
line-height:15px;
|
26 |
-
text-decoration:none;
|
27 |
-
}
|
28 |
-
div#gmedia-message {
|
29 |
-
background:#a1a1a1 url(../img/metabox.png) 0 -25px;
|
30 |
-
position:relative;
|
31 |
-
z-index:20;
|
32 |
-
border-bottom:1px solid #ccc;
|
33 |
-
padding:0 6px 0 8px;
|
34 |
-
}
|
35 |
div#gmedia-message span { display:block; }
|
36 |
div#gmedia-message .info-init { color:blue; }
|
37 |
div#gmedia-message .info-textarea { color:red; }
|
38 |
-
#gmedia-source .title-bar .gm-add-button {
|
39 |
-
position:absolute;
|
40 |
-
display:block;
|
41 |
-
right:5px; top:5px;
|
42 |
-
line-height:100%;
|
43 |
-
height:auto;
|
44 |
-
padding:2px 4px;
|
45 |
-
}
|
46 |
div#gmedia-wraper.ui-draggable .title-bar { cursor:move; }
|
47 |
-
div#gmedia-galleries {
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
}
|
54 |
-
div#gmedia-galleries .
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
}
|
64 |
-
div#gmedia-galleries
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
}
|
69 |
-
div#gmedia-galleries
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
}
|
80 |
-
|
81 |
-
|
82 |
-
}
|
83 |
-
div#gmedia-galleries ul#gmedia-galleries-list .emptydb {
|
84 |
-
font-size:120%;
|
85 |
-
line-height:40px;
|
86 |
-
text-align:center;
|
87 |
-
}
|
88 |
-
div#gmedia-galleries ul#gmedia-galleries-list .emptydb a {
|
89 |
-
font-size:100%;
|
90 |
-
}
|
91 |
-
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li {
|
92 |
-
margin:0 6px 5px;
|
93 |
-
padding:2px;
|
94 |
-
border:1px solid #bbb;
|
95 |
-
position:relative;
|
96 |
-
background:#fff;
|
97 |
-
border-radius:3px;
|
98 |
-
box-shadow:0 0 4px #ccc;
|
99 |
-
transition-property:border-color;
|
100 |
-
transition-duration:.33s;
|
101 |
-
height:38px;
|
102 |
-
}
|
103 |
-
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li.gmedia-selected {
|
104 |
-
border:1px solid #f18f00;
|
105 |
-
transition-property:border-color;
|
106 |
-
transition-duration:.33s;
|
107 |
-
}
|
108 |
-
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li p.gmedia-gallery-title {
|
109 |
-
padding-right:6px;
|
110 |
-
display:block;
|
111 |
-
overflow:hidden;
|
112 |
-
}
|
113 |
-
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li p.gmedia-gallery-title span {
|
114 |
-
display:inline-block;
|
115 |
-
vertical-align:top;
|
116 |
-
margin-right:7px;
|
117 |
-
white-space:nowrap;
|
118 |
-
}
|
119 |
-
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li p.gmedia-gallery-title span.gmedia-gallery-preview {
|
120 |
-
line-height:0;
|
121 |
-
height:43px;
|
122 |
-
overflow:hidden;
|
123 |
-
}
|
124 |
-
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li p.gmedia-gallery-title span.gmedia-gallery-preview img {
|
125 |
-
width:50px;
|
126 |
-
height:auto;
|
127 |
-
}
|
128 |
-
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li p.gmedia-gallery-source {
|
129 |
-
position:absolute;
|
130 |
-
left:59px;
|
131 |
-
bottom:5px;
|
132 |
-
right:1px;
|
133 |
-
z-index:1;
|
134 |
-
}
|
135 |
-
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li p.gmedia-gallery-source span.gmedia-gallery-module {
|
136 |
-
color:#999;
|
137 |
-
position:absolute;
|
138 |
-
left:0;
|
139 |
-
bottom:0;
|
140 |
-
font-size:9px;
|
141 |
-
height:12px;
|
142 |
-
}
|
143 |
-
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li .gmedia-gallery-gear {
|
144 |
-
color:#666;
|
145 |
-
display:block;
|
146 |
-
overflow:hidden;
|
147 |
-
font-size:9px;
|
148 |
-
z-index:4;
|
149 |
-
text-indent:-100em;
|
150 |
-
cursor:pointer;
|
151 |
-
position:absolute;
|
152 |
-
right:0;
|
153 |
-
top:1px;
|
154 |
-
width:16px;
|
155 |
-
height:16px;
|
156 |
-
background:url(../img/metabox.png) 0 -258px no-repeat;
|
157 |
-
}
|
158 |
-
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li .gmedia-selector {
|
159 |
-
z-index:2;
|
160 |
-
position:absolute;
|
161 |
-
left:0;
|
162 |
-
top:0;
|
163 |
-
width:100%;
|
164 |
-
height:100%;
|
165 |
-
display:none;
|
166 |
-
background:url(../img/clicked.png) 100% 0 no-repeat;
|
167 |
-
}
|
168 |
-
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li.gmedia-selected .gmedia-selector {
|
169 |
-
display:block;
|
170 |
-
}
|
171 |
-
div#gmedia-galleries ul#gmedia-galleries-list li.gmedia-gallery-li:hover {
|
172 |
-
border-color:#777;
|
173 |
-
}
|
174 |
-
div#gmedia-galleries ul#gmedia-galleries-list li.gmedia-gallery-li.gmedia-selected:hover {
|
175 |
-
border-color:#f18f00;
|
176 |
-
}
|
177 |
-
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li .gmedia-insert {
|
178 |
-
z-index:2;
|
179 |
-
position:absolute;
|
180 |
-
left:0;
|
181 |
-
top:0;
|
182 |
-
width:100%;
|
183 |
-
height:100%;
|
184 |
-
visibility:hidden;
|
185 |
-
}
|
186 |
-
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li .gmedia-insert:after {
|
187 |
-
content:'';
|
188 |
-
z-index:2;
|
189 |
-
position:absolute;
|
190 |
-
left:0;
|
191 |
-
top:0;
|
192 |
-
width:100%;
|
193 |
-
height:100%;
|
194 |
-
}
|
195 |
-
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li:hover .gmedia-insert {
|
196 |
-
visibility:visible;
|
197 |
-
}
|
198 |
-
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li .gmedia-insert div {
|
199 |
-
position:absolute;
|
200 |
-
left:0;
|
201 |
-
top:0;
|
202 |
-
right:0;
|
203 |
-
bottom:0;
|
204 |
-
text-align:center;
|
205 |
-
font:bold 15px Arial;
|
206 |
-
color:#fff;
|
207 |
-
text-shadow:0 0 8px #000;
|
208 |
-
line-height:100%;
|
209 |
-
vertical-align:middle;
|
210 |
-
background:rgba(0, 0, 0, 0.2);
|
211 |
-
filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#4c000000', endColorstr='#4c000000');
|
212 |
-
}
|
213 |
-
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li .gmedia-insert div img {
|
214 |
-
height:50%;
|
215 |
-
width:1px;
|
216 |
-
vertical-align:bottom;
|
217 |
-
}
|
218 |
-
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li .gmedia-insert div.gmedia-insert-button {
|
219 |
-
display:block;
|
220 |
-
}
|
221 |
-
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li .gmedia-insert div.gmedia-remove-button {
|
222 |
-
display:none;
|
223 |
-
}
|
224 |
-
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li.gmedia-selected .gmedia-insert div.gmedia-insert-button {
|
225 |
-
display:none;
|
226 |
-
}
|
227 |
-
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li.gmedia-selected .gmedia-insert div.gmedia-remove-button {
|
228 |
-
display:block;
|
229 |
-
}
|
230 |
-
div#gmedia-galleries .ui-resizable-s {
|
231 |
-
left:0;
|
232 |
-
bottom:0;
|
233 |
-
height:10px;
|
234 |
-
width:100%;
|
235 |
-
background:#2e6286 url(../img/social-footer.png) 50% -243px no-repeat;
|
236 |
-
border-radius:0 0 2px 2px;
|
237 |
-
box-shadow:2px 0 0 #2e6286;
|
238 |
-
margin-left:-1px;
|
239 |
-
}
|
240 |
-
#gmedia-wraper #gmedia-social {
|
241 |
-
z-index:3;
|
242 |
-
background:#2e6286;
|
243 |
-
padding:5px 0;
|
244 |
-
position:absolute;
|
245 |
-
bottom:10px;
|
246 |
-
width:100%;
|
247 |
-
box-shadow:2px 0 0 #2e6286;
|
248 |
-
margin-left:-1px;
|
249 |
-
}
|
250 |
-
#gmedia-wraper #gmedia-social p {
|
251 |
-
padding:0 0 0 19px;
|
252 |
-
margin:0 auto;
|
253 |
-
font-size:11px;
|
254 |
-
color:#fff;
|
255 |
-
font-weight:bold;
|
256 |
-
width:176px;
|
257 |
-
background:transparent url(../img/social-footer.png) -7px -196px no-repeat;
|
258 |
-
}
|
259 |
-
#gmedia-wraper #gmedia-social p a {
|
260 |
-
color:#fff;
|
261 |
-
text-decoration:none;
|
262 |
-
}
|
263 |
-
.ui-dialog.gmedia-tool-dialog .ui-dialog-content { overflow:hidden !important; }
|
1 |
@charset "utf-8";
|
2 |
+
.inside #gmedia-wraper { box-sizing:border-box; }
|
3 |
+
.inside #gmedia-wraper .form-group { padding:7px 0; }
|
4 |
+
.inside #gmedia-wraper .form-group label { display:block; font-weight:bold; margin-bottom:4px; }
|
5 |
+
.inside #gmedia-wraper .form-group input { display:block; width:100%; padding: }
|
6 |
+
.inside #gmedia-wraper .form-group select { display:block; width:100%; }
|
7 |
+
/*
|
8 |
+
div#gmedia-MetaBox .inside { margin:0; padding:0; }
|
9 |
+
div#gmedia-wraper { background:#f9f9f9; position:relative; border:1px solid #cccccc; border-bottom-color:#2e6286; border-radius:0 0 4px 4px; box-sizing:border-box; }
|
|
|
|
|
|
|
|
|
10 |
div#gmedia-MetaBox div#gmedia-wraper { min-width:100%; max-width:100%; }
|
11 |
+
body > div#gmedia-wraper { box-shadow:0 2px 3px #222222; }
|
12 |
body > div#gmedia-wraper:before { content:''; position:absolute; z-index:-1; left:20px; top:20px; width:100%; height:100%; }
|
13 |
+
div#gmedia-wraper div#gmedia-source, div#gmedia-wraper div#gmedia-source .pane { border-radius:0 0 4px 4px; }
|
14 |
+
div#gmedia-wraper * { margin:0; padding:0; font-size:11px; line-height:15px; text-decoration:none; }
|
15 |
+
div#gmedia-message { background:#a1a1a1 url(../img/metabox.png) 0 -25px; position:relative; z-index:20; border-bottom:1px solid #cccccc; padding:0 6px 0 8px; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
div#gmedia-message span { display:block; }
|
17 |
div#gmedia-message .info-init { color:blue; }
|
18 |
div#gmedia-message .info-textarea { color:red; }
|
19 |
+
#gmedia-source .title-bar .gm-add-button { position:absolute; display:block; right:5px; top:5px; line-height:100%; height:auto; padding:2px 4px; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
div#gmedia-wraper.ui-draggable .title-bar { cursor:move; }
|
21 |
+
div#gmedia-galleries { height:227px; position:relative; z-index:1; background:#f9f9f9; border-radius:0 0 4px 4px; }
|
22 |
+
div#gmedia-galleries .title-bar { position:relative; padding:0 7px; background:#a1a1a1 url(../img/metabox.png) repeat-x 0 -25px; text-shadow:0 1px 0 rgba(255, 255, 255, 0.4); height:25px; line-height:27px; border-top:1px solid rgba(250, 250, 250, 0.8); border-bottom:1px solid rgba(24, 24, 24, 0.2); }
|
23 |
+
div#gmedia-galleries .title-bar span.gmedia-galleries-title { position:relative; display:block; margin-top:7px; }
|
24 |
+
div#gmedia-galleries div#gmedia-galleries-wrap { box-shadow:0 0 6px #999999 inset; overflow:hidden; overflow-y:scroll; position:absolute; left:0; top:27px; bottom:35px; right:0; z-index:1; }
|
25 |
+
div#gmedia-galleries ul#gmedia-galleries-list { padding:5px 0 0; }
|
26 |
+
div#gmedia-galleries ul#gmedia-galleries-list .emptydb { font-size:120%; line-height:40px; text-align:center; }
|
27 |
+
div#gmedia-galleries ul#gmedia-galleries-list .emptydb a { font-size:100%; }
|
28 |
+
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li { margin:0 6px 5px; padding:2px; border:1px solid #bbbbbb; position:relative; background:#ffffff; border-radius:3px; box-shadow:0 0 4px #cccccc; transition-property:border-color; transition-duration:.33s; height:38px; }
|
29 |
+
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li.gmedia-selected { border:1px solid #f18f00; transition-property:border-color; transition-duration:.33s; }
|
30 |
+
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li p.gmedia-gallery-title { padding-right:6px; display:block; overflow:hidden; }
|
31 |
+
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li p.gmedia-gallery-title span { display:inline-block; vertical-align:top; margin-right:7px; white-space:nowrap; }
|
32 |
+
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li p.gmedia-gallery-title span.gmedia-gallery-preview { line-height:0; height:43px; overflow:hidden; }
|
33 |
+
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li p.gmedia-gallery-title span.gmedia-gallery-preview img { width:50px; height:auto; }
|
34 |
+
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li p.gmedia-gallery-source { position:absolute; left:59px; bottom:5px; right:1px; z-index:1; }
|
35 |
+
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li p.gmedia-gallery-source span.gmedia-gallery-module { color:#999999; position:absolute; left:0; bottom:0; font-size:9px; height:12px; }
|
36 |
+
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li .gmedia-gallery-gear { color:#666666; display:block; overflow:hidden; font-size:9px; z-index:4; text-indent:-100em; cursor:pointer; position:absolute; right:0; top:1px; width:16px; height:16px; background:url(../img/metabox.png) 0 -258px no-repeat; }
|
37 |
+
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li .gmedia-selector { z-index:2; position:absolute; left:0; top:0; width:100%; height:100%; display:none; background:url(../img/clicked.png) 100% 0 no-repeat; }
|
38 |
+
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li.gmedia-selected .gmedia-selector { display:block; }
|
39 |
+
div#gmedia-galleries ul#gmedia-galleries-list li.gmedia-gallery-li:hover { border-color:#777777; }
|
40 |
+
div#gmedia-galleries ul#gmedia-galleries-list li.gmedia-gallery-li.gmedia-selected:hover { border-color:#f18f00; }
|
41 |
+
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li .gmedia-insert { z-index:2; position:absolute; left:0; top:0; width:100%; height:100%; visibility:hidden; }
|
42 |
+
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li .gmedia-insert:after { content:''; z-index:2; position:absolute; left:0; top:0; width:100%; height:100%; }
|
43 |
+
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li:hover .gmedia-insert { visibility:visible; }
|
44 |
+
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li .gmedia-insert div { position:absolute; left:0; top:0; right:0; bottom:0; text-align:center; font:bold 15px Arial; color:#ffffff; text-shadow:0 0 8px #000000; line-height:100%; vertical-align:middle; background:rgba(0, 0, 0, 0.2); filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#4c000000', endColorstr='#4c000000'); }
|
45 |
+
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li .gmedia-insert div img { height:50%; width:1px; vertical-align:bottom; }
|
46 |
+
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li .gmedia-insert div.gmedia-insert-button { display:block; }
|
47 |
+
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li .gmedia-insert div.gmedia-remove-button { display:none; }
|
48 |
+
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li.gmedia-selected .gmedia-insert div.gmedia-insert-button { display:none; }
|
49 |
+
div#gmedia-galleries ul#gmedia-galleries-list .gmedia-gallery-li.gmedia-selected .gmedia-insert div.gmedia-remove-button { display:block; }
|
50 |
+
div#gmedia-galleries .ui-resizable-s { left:0; bottom:0; height:10px; width:100%; background:#2e6286 url(../img/social-footer.png) 50% -243px no-repeat; border-radius:0 0 2px 2px; box-shadow:2px 0 0 #2e6286; margin-left:-1px; }
|
51 |
+
#gmedia-wraper #gmedia-social { z-index:3; background:#2e6286; padding:5px 0; position:absolute; bottom:10px; width:100%; box-shadow:2px 0 0 #2e6286; margin-left:-1px; }
|
52 |
+
#gmedia-wraper #gmedia-social p { padding:0 0 0 19px; margin:0 auto; font-size:11px; color:#ffffff; font-weight:bold; width:176px; background:transparent url(../img/social-footer.png) -7px -196px no-repeat; }
|
53 |
+
#gmedia-wraper #gmedia-social p a { color:#ffffff; text-decoration:none; }
|
54 |
+
.ui-dialog.gmedia-tool-dialog .ui-dialog-content { overflow:hidden !important; }
|
55 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/assets/img/image.png
ADDED
Binary file
|
admin/assets/js/gmedia.admin.js
CHANGED
@@ -16,7 +16,7 @@ var GmediaLibrary = {
|
|
16 |
jQuery('.gm-play', this).show();
|
17 |
jQuery('.gm-pause', this).hide();
|
18 |
|
19 |
-
GmediaLibrary.waveplayer(data);
|
20 |
}
|
21 |
});
|
22 |
gmedia_DOM.on('click', '.gm-waveform', function() {
|
@@ -30,9 +30,9 @@ var GmediaLibrary = {
|
|
30 |
if(data.peaks) {
|
31 |
//window.gm_wavesurfer[data.id].play();
|
32 |
} else {
|
33 |
-
window.gm_wavesurfer[data.id].on('ready', function() {
|
34 |
-
jQuery('.gm-play', parent).
|
35 |
-
jQuery('.gm-pause', parent).
|
36 |
jQuery('.spinner', parent).removeClass('is-active');
|
37 |
var peaks = window.gm_wavesurfer[data.id].exportPCM(1800, 10000, true);
|
38 |
var post_data = {
|
@@ -41,7 +41,7 @@ var GmediaLibrary = {
|
|
41 |
peaks: peaks,
|
42 |
_wpnonce: jQuery('#_wpnonce').val()
|
43 |
};
|
44 |
-
jQuery.post(ajaxurl, post_data, function(
|
45 |
var data_peaks = window.gm_wavesurfer[data.id].exportPCM(450, 10000, true);
|
46 |
parent.attr('data-peaks', data_peaks);
|
47 |
});
|
@@ -49,9 +49,16 @@ var GmediaLibrary = {
|
|
49 |
}
|
50 |
});
|
51 |
gmedia_DOM.on('click', '.gm-play, .gm-pause', function() {
|
52 |
-
var parent = jQuery(this).parent()
|
53 |
-
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
});
|
56 |
|
57 |
var resize;
|
@@ -74,12 +81,15 @@ var GmediaLibrary = {
|
|
74 |
}
|
75 |
|
76 |
if(jQuery('body').hasClass('gmedia_library')) {
|
77 |
-
jQuery(
|
78 |
-
|
|
|
|
|
|
|
79 |
});
|
80 |
var refresh = !jQuery('body').is('.GrandMedia_select_single, .GrandMedia_select_multiple');
|
81 |
var observer = new MutationObserver(function(mutations) {
|
82 |
-
|
83 |
if(refresh) {
|
84 |
jQuery('#previewModal', window.parent.document).attr('data-refresh', 'true');
|
85 |
}
|
@@ -94,28 +104,47 @@ var GmediaLibrary = {
|
|
94 |
}
|
95 |
|
96 |
},
|
97 |
-
waveplayer: function(data) {
|
98 |
window.gm_wavesurfer[data.id] = Object.create(WaveSurfer);
|
99 |
window.gm_wavesurfer[data.id].init({
|
100 |
container: '#' + data.id,
|
101 |
waveColor: '#428bca',
|
102 |
progressColor: '#31708f',
|
|
|
|
|
103 |
height: 60,
|
104 |
-
|
|
|
105 |
});
|
106 |
// Play on audio load
|
107 |
var parent = jQuery(window.gm_wavesurfer[data.id].container).parent();
|
108 |
|
109 |
if(!parent.hasClass('ws-loaded')) {
|
110 |
-
|
111 |
-
|
112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
} else {
|
114 |
window.gm_wavesurfer[data.id].play();
|
115 |
}
|
116 |
|
117 |
-
jQuery(window.gm_wavesurfer[data.id].container).on('click', function() {
|
118 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
});
|
120 |
|
121 |
window.gm_wavesurfer[data.id].on('play', function() {
|
@@ -504,7 +533,7 @@ var GmediaTerms = {
|
|
504 |
action: 'gmedia_tag_edit',
|
505 |
tag_id: inp.data('tag_id'),
|
506 |
tag_name: new_tag_name,
|
507 |
-
|
508 |
};
|
509 |
jQuery.post(ajaxurl, post_data, function(data, textStatus, jqXHR) {
|
510 |
console.log(data);
|
@@ -972,7 +1001,7 @@ var GmediaFunction = {
|
|
972 |
});
|
973 |
});
|
974 |
|
975 |
-
|
976 |
e.preventDefault();
|
977 |
var initiator = jQuery(this),
|
978 |
data = initiator.data(),
|
@@ -1041,6 +1070,26 @@ var GmediaFunction = {
|
|
1041 |
jQuery('#previewModal').modal('hide');
|
1042 |
});
|
1043 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1044 |
jQuery(document).on('click.gmedia', '#previewModal .assign_gmedia_term .btn-primary', function() {
|
1045 |
jQuery('.panel-heading .spinner').addClass('is-active');
|
1046 |
var url = window.location.href,
|
@@ -1087,7 +1136,7 @@ var GmediaFunction = {
|
|
1087 |
|
1088 |
if(postlink) {
|
1089 |
jQuery('.sharelink_post', modal_div).show();
|
1090 |
-
jQuery('.sharelink_post input', modal_div).val(postlink);
|
1091 |
jQuery('.sharelink_post a', modal_div).attr('href', postlink);
|
1092 |
} else {
|
1093 |
jQuery('.sharelink_post', modal_div).hide();
|
@@ -1096,7 +1145,7 @@ var GmediaFunction = {
|
|
1096 |
}
|
1097 |
if(cloudlink) {
|
1098 |
jQuery('.sharelink_page', modal_div).show();
|
1099 |
-
jQuery('.sharelink_page input', modal_div).val(cloudlink);
|
1100 |
jQuery('.sharelink_page a', modal_div).attr('href', cloudlink);
|
1101 |
if(cloudlink_checked) {
|
1102 |
jQuery('.sharelink_page input[type="radio"]', modal_div).prop('checked', true);
|
@@ -1204,7 +1253,7 @@ var GmediaFunction = {
|
|
1204 |
var meta_type = jQuery(this).closest('fieldset').attr('data-metatype');
|
1205 |
post_data.action = meta_type + '_delete_custom_field';
|
1206 |
post_data.ID = jQuery(this).closest('form').attr('data-id');
|
1207 |
-
post_data.
|
1208 |
jQuery.post(ajaxurl, post_data, function(data, textStatus, jqXHR) {
|
1209 |
jQuery('body').removeClass('gmedia-busy');
|
1210 |
//noinspection JSUnresolvedVariable
|
@@ -1476,7 +1525,9 @@ function GmediaInit(){
|
|
1476 |
jQuery(this).removeAttr('title');
|
1477 |
}
|
1478 |
}).on('mousemove', '[title]', function(e) {
|
1479 |
-
helper
|
|
|
|
|
1480 |
}).on('mouseleave', '[title]', function(e) {
|
1481 |
jQuery('#gmedia-data-helper').remove();
|
1482 |
helper = null;
|
@@ -1536,6 +1587,23 @@ function getStorage() {
|
|
1536 |
};
|
1537 |
}
|
1538 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1539 |
/*
|
1540 |
function gmHashCode(str){
|
1541 |
var l = str.length,
|
16 |
jQuery('.gm-play', this).show();
|
17 |
jQuery('.gm-pause', this).hide();
|
18 |
|
19 |
+
GmediaLibrary.waveplayer(data, true);
|
20 |
}
|
21 |
});
|
22 |
gmedia_DOM.on('click', '.gm-waveform', function() {
|
30 |
if(data.peaks) {
|
31 |
//window.gm_wavesurfer[data.id].play();
|
32 |
} else {
|
33 |
+
window.gm_wavesurfer[data.id].on('waveform-ready', function() {
|
34 |
+
jQuery('.gm-play', parent).hide();
|
35 |
+
jQuery('.gm-pause', parent).show();
|
36 |
jQuery('.spinner', parent).removeClass('is-active');
|
37 |
var peaks = window.gm_wavesurfer[data.id].exportPCM(1800, 10000, true);
|
38 |
var post_data = {
|
41 |
peaks: peaks,
|
42 |
_wpnonce: jQuery('#_wpnonce').val()
|
43 |
};
|
44 |
+
jQuery.post(ajaxurl, post_data, function(return_data, textStatus, jqXHR) {
|
45 |
var data_peaks = window.gm_wavesurfer[data.id].exportPCM(450, 10000, true);
|
46 |
parent.attr('data-peaks', data_peaks);
|
47 |
});
|
49 |
}
|
50 |
});
|
51 |
gmedia_DOM.on('click', '.gm-play, .gm-pause', function() {
|
52 |
+
var parent = jQuery(this).parent();
|
53 |
+
var data = parent.data();
|
54 |
+
if(!parent.hasClass('ws-loaded')) {
|
55 |
+
parent.addClass('ws-loaded');
|
56 |
+
window.gm_wavesurfer[data.id].load(data.file, data.peaks);
|
57 |
+
window.gm_wavesurfer[data.id].toggleInteraction();
|
58 |
+
window.gm_wavesurfer[data.id].play();
|
59 |
+
} else {
|
60 |
+
window.gm_wavesurfer[data.id].playPause();
|
61 |
+
}
|
62 |
});
|
63 |
|
64 |
var resize;
|
81 |
}
|
82 |
|
83 |
if(jQuery('body').hasClass('gmedia_library')) {
|
84 |
+
var previewFrame = jQuery('#previewFrame', window.parent.document);
|
85 |
+
jQuery(window).on('load.gmedia', function(){
|
86 |
+
setTimeout(function(){
|
87 |
+
previewFrame.animate({'height': getDocHeight('gmedia_iframe_content') + 3}, 200);
|
88 |
+
}, 10);
|
89 |
});
|
90 |
var refresh = !jQuery('body').is('.GrandMedia_select_single, .GrandMedia_select_multiple');
|
91 |
var observer = new MutationObserver(function(mutations) {
|
92 |
+
previewFrame.height(getDocHeight('gmedia_iframe_content') + 3);
|
93 |
if(refresh) {
|
94 |
jQuery('#previewModal', window.parent.document).attr('data-refresh', 'true');
|
95 |
}
|
104 |
}
|
105 |
|
106 |
},
|
107 |
+
waveplayer: function(data, draw) {
|
108 |
window.gm_wavesurfer[data.id] = Object.create(WaveSurfer);
|
109 |
window.gm_wavesurfer[data.id].init({
|
110 |
container: '#' + data.id,
|
111 |
waveColor: '#428bca',
|
112 |
progressColor: '#31708f',
|
113 |
+
backend: 'MediaElement',
|
114 |
+
renderer: 'Canvas',
|
115 |
height: 60,
|
116 |
+
interact: false,
|
117 |
+
barWidth: 0
|
118 |
});
|
119 |
// Play on audio load
|
120 |
var parent = jQuery(window.gm_wavesurfer[data.id].container).parent();
|
121 |
|
122 |
if(!parent.hasClass('ws-loaded')) {
|
123 |
+
if(draw) {
|
124 |
+
window.gm_wavesurfer[data.id].backend.setPeaks(data.peaks);
|
125 |
+
window.gm_wavesurfer[data.id].drawBuffer();
|
126 |
+
} else {
|
127 |
+
parent.addClass('ws-loaded');
|
128 |
+
window.gm_wavesurfer[data.id].load(data.file, data.peaks);
|
129 |
+
window.gm_wavesurfer[data.id].toggleInteraction();
|
130 |
+
window.gm_wavesurfer[data.id].play();
|
131 |
+
}
|
132 |
} else {
|
133 |
window.gm_wavesurfer[data.id].play();
|
134 |
}
|
135 |
|
136 |
+
jQuery(window.gm_wavesurfer[data.id].container).on('click', function(e) {
|
137 |
+
if(!parent.hasClass('ws-loaded')) {
|
138 |
+
parent.addClass('ws-loaded');
|
139 |
+
window.gm_wavesurfer[data.id].load(data.file, data.peaks);
|
140 |
+
window.gm_wavesurfer[data.id].toggleInteraction();
|
141 |
+
window.gm_wavesurfer[data.id].play();
|
142 |
+
}
|
143 |
+
if(window.gm_wavesurfer[data.id].isPlaying()) {
|
144 |
+
window.gm_wavesurfer[data.id].backend.media.currentTime = 0;
|
145 |
+
} else{
|
146 |
+
window.gm_wavesurfer[data.id].play();
|
147 |
+
}
|
148 |
});
|
149 |
|
150 |
window.gm_wavesurfer[data.id].on('play', function() {
|
533 |
action: 'gmedia_tag_edit',
|
534 |
tag_id: inp.data('tag_id'),
|
535 |
tag_name: new_tag_name,
|
536 |
+
_wpnonce_terms: jQuery('#_wpnonce_terms').val()
|
537 |
};
|
538 |
jQuery.post(ajaxurl, post_data, function(data, textStatus, jqXHR) {
|
539 |
console.log(data);
|
1001 |
});
|
1002 |
});
|
1003 |
|
1004 |
+
jQuery(document).on('click.gmedia', 'a.preview-modal', function(e) {
|
1005 |
e.preventDefault();
|
1006 |
var initiator = jQuery(this),
|
1007 |
data = initiator.data(),
|
1070 |
jQuery('#previewModal').modal('hide');
|
1071 |
});
|
1072 |
|
1073 |
+
jQuery(document).on('click.gmedia', '#previewModal .select_gmedia:not(.assign_gmedia_term) .btn-primary', function() {
|
1074 |
+
var field = jQuery('.previewModal_initiator').closest('.form-group').find('.form-control');
|
1075 |
+
var valData = field.val().split(',');
|
1076 |
+
var storedData = getStorage();
|
1077 |
+
storedData = storedData.get('gmedia_library:frame').split('.');
|
1078 |
+
valData = jQuery.grep(valData, function(e) {
|
1079 |
+
return e.trim();
|
1080 |
+
});
|
1081 |
+
jQuery.each(storedData, function(i, id) {
|
1082 |
+
if(!id) {
|
1083 |
+
return true;
|
1084 |
+
}
|
1085 |
+
if(jQuery.inArray(id, valData) === -1) {
|
1086 |
+
valData.push(id);
|
1087 |
+
}
|
1088 |
+
});
|
1089 |
+
field.val(valData.join(','));
|
1090 |
+
jQuery('#previewModal').modal('hide');
|
1091 |
+
});
|
1092 |
+
|
1093 |
jQuery(document).on('click.gmedia', '#previewModal .assign_gmedia_term .btn-primary', function() {
|
1094 |
jQuery('.panel-heading .spinner').addClass('is-active');
|
1095 |
var url = window.location.href,
|
1136 |
|
1137 |
if(postlink) {
|
1138 |
jQuery('.sharelink_post', modal_div).show();
|
1139 |
+
jQuery('.sharelink_post input[type="text"]', modal_div).val(postlink);
|
1140 |
jQuery('.sharelink_post a', modal_div).attr('href', postlink);
|
1141 |
} else {
|
1142 |
jQuery('.sharelink_post', modal_div).hide();
|
1145 |
}
|
1146 |
if(cloudlink) {
|
1147 |
jQuery('.sharelink_page', modal_div).show();
|
1148 |
+
jQuery('.sharelink_page input[type="text"]', modal_div).val(cloudlink);
|
1149 |
jQuery('.sharelink_page a', modal_div).attr('href', cloudlink);
|
1150 |
if(cloudlink_checked) {
|
1151 |
jQuery('.sharelink_page input[type="radio"]', modal_div).prop('checked', true);
|
1253 |
var meta_type = jQuery(this).closest('fieldset').attr('data-metatype');
|
1254 |
post_data.action = meta_type + '_delete_custom_field';
|
1255 |
post_data.ID = jQuery(this).closest('form').attr('data-id');
|
1256 |
+
post_data._wpnonce_custom_field = jQuery('#_wpnonce_custom_field').val();
|
1257 |
jQuery.post(ajaxurl, post_data, function(data, textStatus, jqXHR) {
|
1258 |
jQuery('body').removeClass('gmedia-busy');
|
1259 |
//noinspection JSUnresolvedVariable
|
1525 |
jQuery(this).removeAttr('title');
|
1526 |
}
|
1527 |
}).on('mousemove', '[title]', function(e) {
|
1528 |
+
if(helper) {
|
1529 |
+
helper.css({left: e.clientX - helper_width - 25, top: e.clientY + 25});
|
1530 |
+
}
|
1531 |
}).on('mouseleave', '[title]', function(e) {
|
1532 |
jQuery('#gmedia-data-helper').remove();
|
1533 |
helper = null;
|
1587 |
};
|
1588 |
}
|
1589 |
|
1590 |
+
function getDocHeight(id){
|
1591 |
+
var H;
|
1592 |
+
if(id){
|
1593 |
+
H = Math.max(
|
1594 |
+
jQuery('#' + id).height(),
|
1595 |
+
document.getElementById(id).clientHeight
|
1596 |
+
);
|
1597 |
+
} else {
|
1598 |
+
H = Math.max(
|
1599 |
+
jQuery(document).height(),
|
1600 |
+
jQuery(window).height(),
|
1601 |
+
document.documentElement.clientHeight
|
1602 |
+
);
|
1603 |
+
}
|
1604 |
+
|
1605 |
+
return H;
|
1606 |
+
};
|
1607 |
/*
|
1608 |
function gmHashCode(str){
|
1609 |
var l = str.length,
|
admin/pages/addmedia/tpl/import.php
CHANGED
@@ -23,7 +23,7 @@ $import_tab = array();
|
|
23 |
<form class="row" id="import_form" name="import_form" target="import_window" action="<?php echo admin_url('admin-ajax.php'); ?>" method="POST" accept-charset="utf-8" style="padding:20px 0 10px;">
|
24 |
<div class="col-md-4">
|
25 |
<fieldset id="import_params" class="import-params">
|
26 |
-
<?php wp_nonce_field('
|
27 |
<input type="hidden" name="action" value="gmedia_import_handler"/>
|
28 |
<input type="hidden" id="import-action" name="import" value=""/>
|
29 |
|
@@ -68,7 +68,7 @@ $import_tab = array();
|
|
68 |
/* <![CDATA[ */
|
69 |
jQuery(document).ready(function() {
|
70 |
jQuery("#file_browser").fileTree({
|
71 |
-
script: ajaxurl + "?action=gmedia_ftp_browser&
|
72 |
root: '/',
|
73 |
loadMessage: "<?php _e('loading...', 'grand-media'); ?>"
|
74 |
}, function(path) {
|
23 |
<form class="row" id="import_form" name="import_form" target="import_window" action="<?php echo admin_url('admin-ajax.php'); ?>" method="POST" accept-charset="utf-8" style="padding:20px 0 10px;">
|
24 |
<div class="col-md-4">
|
25 |
<fieldset id="import_params" class="import-params">
|
26 |
+
<?php wp_nonce_field('gmedia_import', '_wpnonce_import'); ?>
|
27 |
<input type="hidden" name="action" value="gmedia_import_handler"/>
|
28 |
<input type="hidden" id="import-action" name="import" value=""/>
|
29 |
|
68 |
/* <![CDATA[ */
|
69 |
jQuery(document).ready(function() {
|
70 |
jQuery("#file_browser").fileTree({
|
71 |
+
script: ajaxurl + "?action=gmedia_ftp_browser&_wpnonce=<?php echo wp_create_nonce( 'GmediaGallery' ) ;?>",
|
72 |
root: '/',
|
73 |
loadMessage: "<?php _e('loading...', 'grand-media'); ?>"
|
74 |
}, function(path) {
|
admin/pages/addmedia/tpl/panel-heading.php
CHANGED
@@ -8,11 +8,21 @@ if(!defined('ABSPATH')) {
|
|
8 |
* @var $url
|
9 |
* @var $import
|
10 |
*/
|
|
|
11 |
$extra_tools = ($gmProcessor->gmediablank || (defined('GMEDIA_IFRAME') && GMEDIA_IFRAME))? false : true;
|
12 |
?>
|
13 |
<div class="panel-heading clearfix">
|
14 |
-
<?php if($extra_tools) {
|
|
|
|
|
15 |
<div class="btn-toolbar pull-left" style="white-space:nowrap;">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
<div class="btn-group">
|
17 |
<a class="btn btn<?php echo !$import? '-primary active' : '-default'; ?>" href="<?php echo gm_get_admin_url(array(), array('import'), $url); ?>"><?php _e('Upload Files', 'grand-media'); ?></a>
|
18 |
<?php if(gm_user_can('import')) { ?>
|
8 |
* @var $url
|
9 |
* @var $import
|
10 |
*/
|
11 |
+
global $gmCore, $gmProcessor;
|
12 |
$extra_tools = ($gmProcessor->gmediablank || (defined('GMEDIA_IFRAME') && GMEDIA_IFRAME))? false : true;
|
13 |
?>
|
14 |
<div class="panel-heading clearfix">
|
15 |
+
<?php if($extra_tools) {
|
16 |
+
$refurl = strpos(wp_get_referer(), "edit_term")? wp_get_referer() : false;
|
17 |
+
?>
|
18 |
<div class="btn-toolbar pull-left" style="white-space:nowrap;">
|
19 |
+
<?php if($refurl){
|
20 |
+
$referer = $gmCore->get_admin_url(array(), array(), $refurl);
|
21 |
+
?>
|
22 |
+
<a class="btn btn-default pull-left" style="margin-right:20px;" href="<?php echo $referer; ?>"><?php _e('Go Back', 'grand-media'); ?></a>
|
23 |
+
<?php
|
24 |
+
} ?>
|
25 |
+
|
26 |
<div class="btn-group">
|
27 |
<a class="btn btn<?php echo !$import? '-primary active' : '-default'; ?>" href="<?php echo gm_get_admin_url(array(), array('import'), $url); ?>"><?php _e('Upload Files', 'grand-media'); ?></a>
|
28 |
<?php if(gm_user_can('import')) { ?>
|
admin/pages/addmedia/tpl/upload.php
CHANGED
@@ -95,7 +95,7 @@ $gm_terms = array();
|
|
95 |
<?php } else{ ?>
|
96 |
multipart: true,
|
97 |
<?php } ?>
|
98 |
-
multipart_params: {action: 'gmedia_upload_handler',
|
99 |
<?php if('true' == $screen_options['uploader_chunking'] && ('html4' != $screen_options['uploader_runtime'])){ ?>
|
100 |
max_file_size: '2000Mb',
|
101 |
chunk_size: <?php echo min($maxchunksize, $screen_options['uploader_chunk_size']*1024*1024); ?>,
|
@@ -143,7 +143,7 @@ $gm_terms = array();
|
|
143 |
var response = jQuery.parseJSON(info.response);
|
144 |
if(response && response.error) {
|
145 |
file.status = plupload.FAILED;
|
146 |
-
jQuery('<div></div>').addClass('alert alert-danger alert-dismissable').html(closebtn + '<strong>' + response.id + ':</strong> ' + response.error.message).appendTo('#
|
147 |
console.log('[FileUploaded] ', response.error);
|
148 |
}
|
149 |
});
|
@@ -153,10 +153,11 @@ $gm_terms = array();
|
|
153 |
});
|
154 |
uploader.bind('Error', function(up, args) {
|
155 |
console.log('[Error] ', args);
|
156 |
-
jQuery('<div></div>').addClass('alert alert-danger alert-dismissable').html(closebtn + '<strong>' + args.file.name + ':</strong> ' + args.message + ' ' + args.status).appendTo('#
|
157 |
});
|
158 |
uploader.bind('UploadComplete', function(up, files) {
|
159 |
console.log('[UploadComplete]', files);
|
|
|
160 |
$('#total-progress-info .progress-bar').css('width', '0').attr('aria-valuenow', '0');
|
161 |
});
|
162 |
|
95 |
<?php } else{ ?>
|
96 |
multipart: true,
|
97 |
<?php } ?>
|
98 |
+
multipart_params: {action: 'gmedia_upload_handler', _wpnonce_upload: '<?php echo wp_create_nonce('gmedia_upload'); ?>', params: ''},
|
99 |
<?php if('true' == $screen_options['uploader_chunking'] && ('html4' != $screen_options['uploader_runtime'])){ ?>
|
100 |
max_file_size: '2000Mb',
|
101 |
chunk_size: <?php echo min($maxchunksize, $screen_options['uploader_chunk_size']*1024*1024); ?>,
|
143 |
var response = jQuery.parseJSON(info.response);
|
144 |
if(response && response.error) {
|
145 |
file.status = plupload.FAILED;
|
146 |
+
jQuery('<div></div>').addClass('alert alert-danger alert-dismissable').html(closebtn + '<strong>' + response.id + ':</strong> ' + response.error.message).appendTo('#gm-message');
|
147 |
console.log('[FileUploaded] ', response.error);
|
148 |
}
|
149 |
});
|
153 |
});
|
154 |
uploader.bind('Error', function(up, args) {
|
155 |
console.log('[Error] ', args);
|
156 |
+
jQuery('<div></div>').addClass('alert alert-danger alert-dismissable').html(closebtn + '<strong>' + args.file.name + ':</strong> ' + args.message + ' ' + args.status).appendTo('#gm-message');
|
157 |
});
|
158 |
uploader.bind('UploadComplete', function(up, files) {
|
159 |
console.log('[UploadComplete]', files);
|
160 |
+
$('<div></div>').addClass('alert alert-success alert-dismissable').html(closebtn + "<?php esc_attr_e(__('Upload finished', 'grand-media')); ?>").appendTo('#gm-message');
|
161 |
$('#total-progress-info .progress-bar').css('width', '0').attr('aria-valuenow', '0');
|
162 |
});
|
163 |
|
admin/pages/galleries/edit-gallery.php
CHANGED
@@ -40,9 +40,6 @@ $global_preset = array();
|
|
40 |
$gmedia_filter = gmedia_gallery_query_data($term->meta['_query']);
|
41 |
|
42 |
/**
|
43 |
-
* @var $place
|
44 |
-
* @var $module_name
|
45 |
-
* @var $module_url
|
46 |
* @var $module_path
|
47 |
*/
|
48 |
if($term->module['name']){
|
@@ -76,7 +73,7 @@ if($term->module['name']){
|
|
76 |
* @var $default_options
|
77 |
* @var $options_tree
|
78 |
*/
|
79 |
-
if(
|
80 |
/** @noinspection PhpIncludeInspection */
|
81 |
include($module_path . '/index.php');
|
82 |
/** @noinspection PhpIncludeInspection */
|
@@ -89,13 +86,13 @@ if($term->module['name']){
|
|
89 |
$default_options = $gmCore->array_replace_recursive($default_options, $default_preset);
|
90 |
}
|
91 |
} else{
|
92 |
-
$alert[] = sprintf(__('Module `%s` is broken. Choose another module from the list.'), $
|
93 |
}
|
94 |
} else{
|
95 |
-
$alert[] = sprintf(__('Can\'t get module with name `%s`. Choose module from the list.'), $
|
96 |
}
|
97 |
} else{
|
98 |
-
$alert[] =
|
99 |
}
|
100 |
|
101 |
if(!empty($alert)){
|
@@ -137,3 +134,18 @@ do_action('gmedia_gallery_after_panel');
|
|
137 |
include(dirname(__FILE__) . "/tpl/choose-module.php");
|
138 |
include(GMEDIA_ABSPATH . 'admin/tpl/modal-share.php');
|
139 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
$gmedia_filter = gmedia_gallery_query_data($term->meta['_query']);
|
41 |
|
42 |
/**
|
|
|
|
|
|
|
43 |
* @var $module_path
|
44 |
*/
|
45 |
if($term->module['name']){
|
73 |
* @var $default_options
|
74 |
* @var $options_tree
|
75 |
*/
|
76 |
+
if(is_file($module_path . '/index.php') && is_file($module_path . '/settings.php')){
|
77 |
/** @noinspection PhpIncludeInspection */
|
78 |
include($module_path . '/index.php');
|
79 |
/** @noinspection PhpIncludeInspection */
|
86 |
$default_options = $gmCore->array_replace_recursive($default_options, $default_preset);
|
87 |
}
|
88 |
} else{
|
89 |
+
$alert[] = sprintf(__('Module `%s` is broken. Choose another module from the list.'), $term->module['name']);
|
90 |
}
|
91 |
} else{
|
92 |
+
$alert[] = sprintf(__('Can\'t get module with name `%s`. Choose module from the list.'), $term->module['name']);
|
93 |
}
|
94 |
} else{
|
95 |
+
$alert[] = __('Module is not selected for this gallery. Choose module from the list.');
|
96 |
}
|
97 |
|
98 |
if(!empty($alert)){
|
134 |
include(dirname(__FILE__) . "/tpl/choose-module.php");
|
135 |
include(GMEDIA_ABSPATH . 'admin/tpl/modal-share.php');
|
136 |
?>
|
137 |
+
<div class="modal fade gmedia-modal" id="previewModal" tabindex="-1" role="dialog" aria-hidden="true">
|
138 |
+
<div class="modal-dialog">
|
139 |
+
<div class="modal-content">
|
140 |
+
<div class="modal-header">
|
141 |
+
<div class="btn-toolbar pull-right" style="margin-top:-4px;">
|
142 |
+
<button type="button" class="btn btn-primary"><?php _e('Submit', 'grand-media'); ?></button>
|
143 |
+
<button type="button" class="btn btn-default" data-dismiss="modal"><?php _e('Close', 'grand-media'); ?></button>
|
144 |
+
</div>
|
145 |
+
<h4 class="modal-title"></h4>
|
146 |
+
</div>
|
147 |
+
<div class="modal-body"></div>
|
148 |
+
</div>
|
149 |
+
</div>
|
150 |
+
</div>
|
151 |
+
|
admin/pages/galleries/functions.php
CHANGED
@@ -25,7 +25,7 @@ function gmedia_gallery_actions($item) {
|
|
25 |
|
26 |
$trash_icon = '<span class="glyphicon glyphicon-trash"></span>';
|
27 |
if($item->allow_delete) {
|
28 |
-
$actions['delete'] = '<a class="trash-icon" title="' . __('Delete', 'grand-media') . '" href="' . wp_nonce_url(add_query_arg(array('do_gmedia_terms' => 'delete', 'ids' => $item->term_id), $gmProcessor->url), 'gmedia_delete') . '" data-confirm="' . __("You are about to permanently delete the selected items.\n\r'Cancel' to stop, 'OK' to delete.", "grand-media") . '">' . $trash_icon . '</a>';
|
29 |
} else {
|
30 |
$actions['delete'] = "<span class='action-inactive'>$trash_icon</span>";
|
31 |
}
|
25 |
|
26 |
$trash_icon = '<span class="glyphicon glyphicon-trash"></span>';
|
27 |
if($item->allow_delete) {
|
28 |
+
$actions['delete'] = '<a class="trash-icon" title="' . __('Delete', 'grand-media') . '" href="' . wp_nonce_url(add_query_arg(array('do_gmedia_terms' => 'delete', 'ids' => $item->term_id), $gmProcessor->url), 'gmedia_delete', '_wpnonce_delete') . '" data-confirm="' . __("You are about to permanently delete the selected items.\n\r'Cancel' to stop, 'OK' to delete.", "grand-media") . '">' . $trash_icon . '</a>';
|
29 |
} else {
|
30 |
$actions['delete'] = "<span class='action-inactive'>$trash_icon</span>";
|
31 |
}
|
admin/pages/galleries/galleries.php
CHANGED
@@ -56,7 +56,7 @@ $gmedia_modules = get_gmedia_modules(false);
|
|
56 |
include(GMEDIA_ABSPATH . 'admin/pages/terms/tpl/no-items.php');
|
57 |
}
|
58 |
wp_original_referer_field(true, 'previous');
|
59 |
-
wp_nonce_field('
|
60 |
?>
|
61 |
</form>
|
62 |
<?php
|
56 |
include(GMEDIA_ABSPATH . 'admin/pages/terms/tpl/no-items.php');
|
57 |
}
|
58 |
wp_original_referer_field(true, 'previous');
|
59 |
+
wp_nonce_field('gmedia_terms', '_wpnonce_terms');
|
60 |
?>
|
61 |
</form>
|
62 |
<?php
|
admin/pages/galleries/tpl/choose-module.php
CHANGED
@@ -1,38 +1,40 @@
|
|
1 |
<?php
|
2 |
// don't load directly
|
3 |
-
if(!defined('ABSPATH'))
|
4 |
die('-1');
|
5 |
}
|
6 |
|
7 |
/**
|
8 |
* @var $gmedia_modules
|
|
|
9 |
*/
|
10 |
|
|
|
11 |
?>
|
12 |
<div class="modal fade gmedia-modal" id="chooseModuleModal" tabindex="-1" role="dialog" aria-hidden="true">
|
13 |
<div class="modal-dialog">
|
14 |
<div class="modal-content">
|
15 |
<div class="modal-header">
|
16 |
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
17 |
-
<h4 class="modal-title"><?php _e('Choose Module for Gallery'); ?></h4>
|
18 |
</div>
|
19 |
<div class="modal-body linkblock">
|
20 |
<?php
|
21 |
-
if
|
22 |
-
foreach
|
23 |
/**
|
24 |
* @var $module_name
|
25 |
* @var $module_url
|
26 |
* @var $module_path
|
27 |
*/
|
28 |
extract($m);
|
29 |
-
if
|
30 |
continue;
|
31 |
}
|
32 |
$module_info = array();
|
33 |
/** @noinspection PhpIncludeInspection */
|
34 |
include($module_path . '/index.php');
|
35 |
-
if
|
36 |
continue;
|
37 |
}
|
38 |
$mclass = ' module-' . $module_info['type'] . ' module-' . $module_info['status'];
|
@@ -52,7 +54,7 @@ if(!defined('ABSPATH')) {
|
|
52 |
</div>
|
53 |
<?php
|
54 |
}
|
55 |
-
} else
|
56 |
_e('No installed modules', 'grand-media');
|
57 |
}
|
58 |
?>
|
@@ -64,3 +66,61 @@ if(!defined('ABSPATH')) {
|
|
64 |
</div>
|
65 |
</div>
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
// don't load directly
|
3 |
+
if(!defined('ABSPATH')){
|
4 |
die('-1');
|
5 |
}
|
6 |
|
7 |
/**
|
8 |
* @var $gmedia_modules
|
9 |
+
* @var $gmedia_url
|
10 |
*/
|
11 |
|
12 |
+
global $gmCore, $gmDB, $gmGallery;
|
13 |
?>
|
14 |
<div class="modal fade gmedia-modal" id="chooseModuleModal" tabindex="-1" role="dialog" aria-hidden="true">
|
15 |
<div class="modal-dialog">
|
16 |
<div class="modal-content">
|
17 |
<div class="modal-header">
|
18 |
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
19 |
+
<h4 class="modal-title"><?php _e('Choose Module for Gallery', 'grand-media'); ?></h4>
|
20 |
</div>
|
21 |
<div class="modal-body linkblock">
|
22 |
<?php
|
23 |
+
if(!empty($gmedia_modules['in'])){
|
24 |
+
foreach($gmedia_modules['in'] as $m){
|
25 |
/**
|
26 |
* @var $module_name
|
27 |
* @var $module_url
|
28 |
* @var $module_path
|
29 |
*/
|
30 |
extract($m);
|
31 |
+
if(!is_file($module_path . '/index.php')){
|
32 |
continue;
|
33 |
}
|
34 |
$module_info = array();
|
35 |
/** @noinspection PhpIncludeInspection */
|
36 |
include($module_path . '/index.php');
|
37 |
+
if(empty($module_info)){
|
38 |
continue;
|
39 |
}
|
40 |
$mclass = ' module-' . $module_info['type'] . ' module-' . $module_info['status'];
|
54 |
</div>
|
55 |
<?php
|
56 |
}
|
57 |
+
} else{
|
58 |
_e('No installed modules', 'grand-media');
|
59 |
}
|
60 |
?>
|
66 |
</div>
|
67 |
</div>
|
68 |
|
69 |
+
<div class="modal fade gmedia-modal" id="changeModuleModal" tabindex="-1" role="dialog" aria-hidden="true">
|
70 |
+
<div class="modal-dialog">
|
71 |
+
<form class="modal-content" autocomplete="off" method="post" action="<?php echo $gmCore->get_admin_url(array(), array(), $gmedia_url); ?>">
|
72 |
+
<div class="modal-header">
|
73 |
+
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
74 |
+
<h4 class="modal-title"><?php _e('Change Module/Preset for Galleries', 'grand-media'); ?></h4>
|
75 |
+
</div>
|
76 |
+
<div class="modal-body">
|
77 |
+
<?php
|
78 |
+
if(!empty($gmedia_modules['in'])){
|
79 |
+
?>
|
80 |
+
<div class="form-group">
|
81 |
+
<label><?php _e('Change Module/Preset for Galleries', 'grand-media') ?>:</label>
|
82 |
+
<select class="form-control input-sm" name="gmedia_gallery_module">
|
83 |
+
<?php
|
84 |
+
echo '<option value="">' . __('Choose Module/Preset') . '</option>';
|
85 |
+
foreach($gmedia_modules['in'] as $mfold => $module){
|
86 |
+
echo '<optgroup label="' . esc_attr($module['title']) . '">';
|
87 |
+
$presets = $gmDB->get_terms('gmedia_module', array('status' => $mfold));
|
88 |
+
$option = array();
|
89 |
+
$option[] = '<option value="' . esc_attr($mfold) . '">' . $module['title'] . ' - ' . __('Default Settings') . '</option>';
|
90 |
+
foreach($presets as $preset){
|
91 |
+
if(!(int)$preset->global && '[' . $mfold . ']' === $preset->name){
|
92 |
+
continue;
|
93 |
+
}
|
94 |
+
$by_author = '';
|
95 |
+
if((int)$preset->global){
|
96 |
+
$by_author = ' [' . get_the_author_meta('display_name', $preset->global) . ']';
|
97 |
+
}
|
98 |
+
if('[' . $mfold . ']' === $preset->name){
|
99 |
+
$option[] = '<option value="' . $preset->term_id . '">' . $module['title'] . $by_author . ' - ' . __('Default Settings') . '</option>';
|
100 |
+
} else{
|
101 |
+
$preset_name = str_replace('[' . $mfold . '] ', '', $preset->name);
|
102 |
+
$option[] = '<option value="' . $preset->term_id . '">' . $module['title'] . $by_author . ' - ' . $preset_name . '</option>';
|
103 |
+
}
|
104 |
+
}
|
105 |
+
echo implode('', $option);
|
106 |
+
echo '</optgroup>';
|
107 |
+
} ?>
|
108 |
+
</select>
|
109 |
+
|
110 |
+
<p class="help-block"><?php _e('Chosen module will be applied for selected galleries.', 'grand-media'); ?></p>
|
111 |
+
</div>
|
112 |
+
<?php
|
113 |
+
wp_nonce_field( 'gmedia_gallery_module', '_wpnonce_gallery_module' );
|
114 |
+
wp_referer_field();
|
115 |
+
} else{
|
116 |
+
_e('No installed modules', 'grand-media');
|
117 |
+
}
|
118 |
+
?>
|
119 |
+
</div>
|
120 |
+
<div class="modal-footer">
|
121 |
+
<button type="submit" class="btn btn-primary"><?php _e( 'Apply', 'grand-media' ); ?></button>
|
122 |
+
<button type="button" class="btn btn-default" data-dismiss="modal"><?php _e('Cancel', 'grand-media'); ?></button>
|
123 |
+
</div>
|
124 |
+
</form>
|
125 |
+
</div>
|
126 |
+
</div>
|
admin/pages/galleries/tpl/galleries-panel-heading.php
CHANGED
@@ -60,10 +60,13 @@ if(!defined('ABSPATH')){
|
|
60 |
?>
|
61 |
<ul class="dropdown-menu" role="menu">
|
62 |
<li class="dropdown-header <?php echo $rel_selected_hide; ?>"><span><?php _e("Select items to see more actions", "grand-media"); ?></span></li>
|
|
|
|
|
|
|
63 |
<li class="<?php echo $rel_selected_show . (gm_user_can('terms_delete')? '' : ' disabled'); ?>">
|
64 |
<a href="<?php echo wp_nonce_url($gmCore->get_admin_url(array('do_gmedia_terms' => 'delete',
|
65 |
'ids' => 'selected'
|
66 |
-
), array('filter')), 'gmedia_delete') ?>" class="gmedia-delete" data-confirm="<?php _e("You are about to permanently delete the selected items.\n\r'Cancel' to stop, 'OK' to delete.", "grand-media"); ?>"><?php _e('Delete Selected Items', 'grand-media'); ?></a>
|
67 |
</li>
|
68 |
<?php do_action('gmedia_galleries_action_list'); ?>
|
69 |
</ul>
|
60 |
?>
|
61 |
<ul class="dropdown-menu" role="menu">
|
62 |
<li class="dropdown-header <?php echo $rel_selected_hide; ?>"><span><?php _e("Select items to see more actions", "grand-media"); ?></span></li>
|
63 |
+
<li class="<?php echo $rel_selected_show; ?>">
|
64 |
+
<a href="#changeModuleModal" data-toggle="modal"><?php _e('Change Module/Preset for Galleries', 'grand-media'); ?></a>
|
65 |
+
</li>
|
66 |
<li class="<?php echo $rel_selected_show . (gm_user_can('terms_delete')? '' : ' disabled'); ?>">
|
67 |
<a href="<?php echo wp_nonce_url($gmCore->get_admin_url(array('do_gmedia_terms' => 'delete',
|
68 |
'ids' => 'selected'
|
69 |
+
), array('filter')), 'gmedia_delete', '_wpnonce_delete') ?>" class="gmedia-delete" data-confirm="<?php _e("You are about to permanently delete the selected items.\n\r'Cancel' to stop, 'OK' to delete.", "grand-media"); ?>"><?php _e('Delete Selected Items', 'grand-media'); ?></a>
|
70 |
</li>
|
71 |
<?php do_action('gmedia_galleries_action_list'); ?>
|
72 |
</ul>
|
admin/pages/galleries/tpl/gallery-edit-item.php
CHANGED
@@ -112,21 +112,12 @@ if(!defined('ABSPATH')){
|
|
112 |
}
|
113 |
$params['iframe'] = 1;
|
114 |
?>
|
115 |
-
<p><b><?php _e('GmediaCloud page URL for current gallery:'); ?></b>
|
116 |
-
|
117 |
-
$gmedia_hashid = gmedia_hash_id_encode($term_id, 'gallery');
|
118 |
-
$gallery_link_default = add_query_arg(array("$endpoint" => $gmedia_hashid, 't' => 'g'), home_url('index.php'));
|
119 |
-
if(get_option('permalink_structure')){
|
120 |
-
$gallery_link = home_url(urlencode($endpoint) . '/g/' . $gmedia_hashid);
|
121 |
-
} else{
|
122 |
-
$gallery_link = $gallery_link_default;
|
123 |
-
} ?>
|
124 |
-
<br/><a target="_blank" href="<?php echo $gallery_link; ?>"><?php echo $gallery_link; ?></a>
|
125 |
</p>
|
126 |
-
<?php if($term->
|
127 |
<p><b><?php _e('Gmedia Post URL for current gallery:'); ?></b>
|
128 |
-
<?php $post_link
|
129 |
-
<br/><a target="_blank" href="<?php echo $post_link; ?>"><?php echo $post_link; ?></a>
|
130 |
</p>
|
131 |
<?php } ?>
|
132 |
<div class="help-block">
|
@@ -210,6 +201,7 @@ if(!defined('ABSPATH')){
|
|
210 |
<h5><?php _e('Module Settings', 'grand-media'); ?></h5>
|
211 |
</div>
|
212 |
<?php
|
|
|
213 |
include(GMEDIA_ABSPATH . 'admin/pages/galleries/tpl/module-settings.php');
|
214 |
?>
|
215 |
<?php if(!empty($alert)){ ?>
|
112 |
}
|
113 |
$params['iframe'] = 1;
|
114 |
?>
|
115 |
+
<p><b><?php _e('GmediaCloud page URL for current gallery:'); ?></b>
|
116 |
+
<br/><a target="_blank" href="<?php echo $term->cloud_link; ?>"><?php echo $term->cloud_link; ?></a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
</p>
|
118 |
+
<?php if($term->post_link){ ?>
|
119 |
<p><b><?php _e('Gmedia Post URL for current gallery:'); ?></b>
|
120 |
+
<br/><a target="_blank" href="<?php echo $term->post_link; ?>"><?php echo $term->post_link; ?></a>
|
|
|
121 |
</p>
|
122 |
<?php } ?>
|
123 |
<div class="help-block">
|
201 |
<h5><?php _e('Module Settings', 'grand-media'); ?></h5>
|
202 |
</div>
|
203 |
<?php
|
204 |
+
$gallery_link_default = $gmCore->gmcloudlink($term->term_id, $term->taxterm, true);
|
205 |
include(GMEDIA_ABSPATH . 'admin/pages/galleries/tpl/module-settings.php');
|
206 |
?>
|
207 |
<?php if(!empty($alert)){ ?>
|
admin/pages/galleries/tpl/gallery-panel-heading.php
CHANGED
@@ -34,7 +34,7 @@ $referer = remove_query_arg(array('edit_term', 'gmedia_module'), $refurl);
|
|
34 |
|
35 |
echo '<li' . ($term->allow_delete? '' : ' class="disabled"') . '><a href="' . wp_nonce_url(gm_get_admin_url(array('do_gmedia_terms' => 'delete',
|
36 |
'ids' => $term->term_id
|
37 |
-
), array('edit_term'), $gmProcessor->url), 'gmedia_delete') . '" data-confirm="' . __("You are about to permanently delete the selected items.\n\r'Cancel' to stop, 'OK' to delete.", "grand-media") . '">' . __('Delete', 'grand-media') . '</a></li>';
|
38 |
?>
|
39 |
</ul>
|
40 |
</div>
|
34 |
|
35 |
echo '<li' . ($term->allow_delete? '' : ' class="disabled"') . '><a href="' . wp_nonce_url(gm_get_admin_url(array('do_gmedia_terms' => 'delete',
|
36 |
'ids' => $term->term_id
|
37 |
+
), array('edit_term'), $gmProcessor->url), 'gmedia_delete', '_wpnonce_delete') . '" data-confirm="' . __("You are about to permanently delete the selected items.\n\r'Cancel' to stop, 'OK' to delete.", "grand-media") . '">' . __('Delete', 'grand-media') . '</a></li>';
|
38 |
?>
|
39 |
</ul>
|
40 |
</div>
|
admin/pages/galleries/tpl/modal-build-query.php
CHANGED
@@ -17,6 +17,7 @@ global $user_ID, $gmDB, $gmCore
|
|
17 |
<div class="modal-content">
|
18 |
<div class="modal-header">
|
19 |
<div class="pull-right" style="margin-top:-4px;">
|
|
|
20 |
<button type="button" class="btn btn-primary buildquerysubmit"><?php _e('Build Query', 'grand-media'); ?></button>
|
21 |
<button type="button" class="btn btn-default" data-dismiss="modal"><?php _e('Close', 'grand-media'); ?></button>
|
22 |
</div>
|
@@ -62,7 +63,7 @@ global $user_ID, $gmDB, $gmCore
|
|
62 |
|
63 |
<div class="row">
|
64 |
<div class="col-xs-8">
|
65 |
-
<input id="query_album__" name="album__in" data-include="album__in" data-exclude="album__not_in" class="form-control input-sm" value="<?php echo implode(',', $query_gmedia_albums) ?>" placeholder="<?php esc_attr_e(__('Any Album...', 'grand-media')); ?>"/>
|
66 |
</div>
|
67 |
<div class="col-xs-4">
|
68 |
<div class="checkbox"><label><input class="query_switch" data-target="query_album__" type="checkbox"<?php echo (empty($query_data['album__in']) && !empty($query_data['album__not_in']))? ' checked="checked"' : ''; ?> /> <?php _e('Exclude selected Albums', 'grand-media'); ?></label></div>
|
@@ -84,15 +85,15 @@ global $user_ID, $gmDB, $gmCore
|
|
84 |
<div class="row">
|
85 |
<div class="col-xs-4">
|
86 |
<label><?php _e('[IN] Categories', 'grand-media'); ?></label>
|
87 |
-
<input name="category__in" class="form-control input-sm combobox_gmedia_category" value="<?php echo implode(',', wp_parse_id_list($query_data['category__in'])); ?>" placeholder="<?php esc_attr_e(__('Either of chosen Categories...', 'grand-media')); ?>"/>
|
88 |
</div>
|
89 |
<div class="col-xs-4">
|
90 |
<label><?php _e('[AND] Categories', 'grand-media'); ?></label>
|
91 |
-
<input name="category__and" class="form-control input-sm combobox_gmedia_category" value="<?php echo implode(',', wp_parse_id_list($query_data['category__and'])); ?>" placeholder="<?php esc_attr_e(__('Have all chosen Categories...', 'grand-media')); ?>"/>
|
92 |
</div>
|
93 |
<div class="col-xs-4">
|
94 |
<label><?php _e('[NOT IN] Categories', 'grand-media'); ?></label>
|
95 |
-
<input name="category__not_in" class="form-control input-sm combobox_gmedia_category" value="<?php echo implode(',', wp_parse_id_list($query_data['category__not_in'])); ?>" placeholder="<?php esc_attr_e(__('Exclude Categories...', 'grand-media')); ?>"/>
|
96 |
</div>
|
97 |
</div>
|
98 |
</div>
|
@@ -105,15 +106,15 @@ global $user_ID, $gmDB, $gmCore
|
|
105 |
<div class="row">
|
106 |
<div class="col-xs-4">
|
107 |
<label><?php _e('[IN] Tags', 'grand-media'); ?> </label>
|
108 |
-
<input name="tag__in" class="form-control input-sm combobox_gmedia_tag" value="<?php echo implode(',', wp_parse_id_list($query_data['tag__in'])); ?>" placeholder="<?php esc_attr_e(__('Either of chosen Tags...', 'grand-media')); ?>"/>
|
109 |
</div>
|
110 |
<div class="col-xs-4">
|
111 |
<label><?php _e('[AND] Tags', 'grand-media'); ?> </label>
|
112 |
-
<input name="tag__and" class="form-control input-sm combobox_gmedia_tag" value="<?php echo implode(',', wp_parse_id_list($query_data['tag__and'])); ?>" placeholder="<?php esc_attr_e(__('Have all chosen Tags...', 'grand-media')); ?>"/>
|
113 |
</div>
|
114 |
<div class="col-xs-4">
|
115 |
<label><?php _e('[NOT IN] Tags', 'grand-media'); ?> </label>
|
116 |
-
<input name="tag__not_in" class="form-control input-sm combobox_gmedia_tag" value="<?php echo implode(',', wp_parse_id_list($query_data['tag__not_in'])); ?>" placeholder="<?php esc_attr_e(__('Exclude Tags...', 'grand-media')); ?>"/>
|
117 |
</div>
|
118 |
</div>
|
119 |
</div>
|
@@ -126,7 +127,7 @@ global $user_ID, $gmDB, $gmCore
|
|
126 |
<div class="col-xs-4">
|
127 |
<select name="terms_relation" class="form-control input-sm">
|
128 |
<option <?php selected($query_data['terms_relation'], ''); ?> value=""><?php _e('Default (AND)'); ?></option>
|
129 |
-
<option <?php selected($query_data['terms_relation'], 'AND'); ?> value=""><?php _e('AND'); ?></option>
|
130 |
<option <?php selected($query_data['terms_relation'], 'OR'); ?> value="OR"><?php _e('OR'); ?></option>
|
131 |
</select>
|
132 |
</div>
|
@@ -150,7 +151,13 @@ global $user_ID, $gmDB, $gmCore
|
|
150 |
<div class="form-group">
|
151 |
<div class="row">
|
152 |
<div class="col-xs-8">
|
153 |
-
<div class="pull-right"
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
<label><?php _e('Gmedia IDs <small class="text-muted">separated by comma</small>', 'grand-media'); ?> </label>
|
155 |
</div>
|
156 |
</div>
|
@@ -185,7 +192,7 @@ global $user_ID, $gmDB, $gmCore
|
|
185 |
);
|
186 |
$mime_type_val = is_array($query_data['mime_type'])? implode(',', $query_data['mime_type']) : str_replace(', ', ',', $query_data['mime_type']);
|
187 |
?>
|
188 |
-
<input name="mime_type" class="form-control input-sm gmedia-combobox" data-options='<?php echo json_encode($mime_types); ?>' value="<?php esc_attr_e($mime_type_val); ?>" placeholder="<?php esc_attr_e(__('All types...', 'grand-media')); ?>"/>
|
189 |
</div>
|
190 |
<div class="col-xs-4">
|
191 |
<label><?php _e('Authors', 'grand-media'); ?></label>
|
@@ -212,7 +219,7 @@ global $user_ID, $gmDB, $gmCore
|
|
212 |
$query_authors = $query_data['author__not_in'];
|
213 |
}
|
214 |
?>
|
215 |
-
<input id="query_author__" name="author__in" data-include="author__in" data-exclude="author__not_in" class="form-control input-sm gmedia-combobox" data-options='<?php echo str_replace("'", "\'", json_encode($_users)); ?>' value="<?php echo implode(',', wp_parse_id_list($query_authors)); ?>" placeholder="<?php esc_attr_e(__('All authors...', 'grand-media')); ?>"/>
|
216 |
<?php } else { ?>
|
217 |
<input type="text" readonly="readonly" name="author__in" class="form-control input-sm" value="<?php the_author_meta('display_name', $user_ID); ?>"/>
|
218 |
<?php } ?>
|
@@ -262,7 +269,7 @@ global $user_ID, $gmDB, $gmCore
|
|
262 |
<label><?php _e('Compare Operator', 'grand-media'); ?></label>
|
263 |
<select class="form-control input-sm" name="meta_query[<?php echo $i; ?>][compare]">
|
264 |
<option <?php selected($q['compare'], ''); ?> value=""><?php _e('Default', 'grand-media'); ?> (=)</option>
|
265 |
-
<option <?php selected($q['compare'], '='); ?> value="">=</option>
|
266 |
<option <?php selected($q['compare'], '!='); ?> value="!=">!=</option>
|
267 |
<option <?php selected($q['compare'], '>'); ?> value=">">></option>
|
268 |
<option <?php selected($q['compare'], '>='); ?> value=">=">>=</option>
|
@@ -284,7 +291,7 @@ global $user_ID, $gmDB, $gmCore
|
|
284 |
<label><?php _e('Meta Type', 'grand-media'); ?></label>
|
285 |
<select class="form-control input-sm" name="meta_query[<?php echo $i; ?>][type]">
|
286 |
<option <?php selected($q['type'], ''); ?> value=""><?php _e('Default', 'grand-media'); ?> (CHAR)</option>
|
287 |
-
<option <?php selected($q['type'], 'CHAR'); ?> value="">CHAR</option>
|
288 |
<option <?php selected($q['type'], 'NUMERIC'); ?> value="NUMERIC">NUMERIC</option>
|
289 |
<option <?php selected($q['type'], 'DECIMAL'); ?> value="DECIMAL">DECIMAL</option>
|
290 |
<option <?php selected($q['type'], 'DATE'); ?> value="DATE">DATE</option>
|
@@ -305,7 +312,7 @@ global $user_ID, $gmDB, $gmCore
|
|
305 |
<label><?php _e('Order', 'grand-media'); ?></label>
|
306 |
<select class="form-control input-sm" name="order">
|
307 |
<option <?php selected($query_data['order'], ''); ?> value=""><?php _e('Default (DESC)', 'grand-media'); ?></option>
|
308 |
-
<option <?php selected($query_data['order'], 'DESC'); ?> value=""><?php _e('DESC', 'grand-media'); ?></option>
|
309 |
<option <?php selected($query_data['order'], 'ASC'); ?> value="ASC"><?php _e('ASC', 'grand-media'); ?></option>
|
310 |
</select>
|
311 |
<span class="help-block"><?php _e('Ascending or Descending order', 'grand-media'); ?></span>
|
@@ -314,7 +321,7 @@ global $user_ID, $gmDB, $gmCore
|
|
314 |
<label><?php _e('Order by', 'grand-media'); ?></label>
|
315 |
<select class="form-control input-sm" name="orderby">
|
316 |
<option <?php selected($query_data['orderby'], ''); ?> value=""><?php _e('Default (ID)', 'grand-media'); ?></option>
|
317 |
-
<option <?php selected($query_data['orderby'], 'id'); ?> value=""><?php _e('ID', 'grand-media'); ?></option>
|
318 |
<option <?php selected($query_data['orderby'], 'title'); ?> value="title"><?php _e('Title', 'grand-media'); ?></option>
|
319 |
<option <?php selected($query_data['orderby'], 'gmuid'); ?> value="gmuid"><?php _e('Filename', 'grand-media'); ?></option>
|
320 |
<option <?php selected($query_data['orderby'], 'author'); ?> value="author"><?php _e('Author', 'grand-media'); ?></option>
|
@@ -362,23 +369,27 @@ global $user_ID, $gmDB, $gmCore
|
|
362 |
var count = '';
|
363 |
var status = '';
|
364 |
var author = '';
|
365 |
-
|
|
|
366 |
count = '(' + escape(item.count) + ')';
|
367 |
status = (typeof item.status != 'undefined' && ('publish' != item.status))? ' [' + item.status + '] ' : '';
|
368 |
author = ' ' + item.by_author;
|
|
|
369 |
}
|
370 |
-
return '<div>' + escape(item.name) + ' <small>' + count + status + author + '</small></div>';
|
371 |
},
|
372 |
option: function(item, escape) {
|
373 |
var count = '';
|
374 |
var status = '';
|
375 |
var author = '';
|
376 |
-
|
|
|
377 |
count = '(' + escape(item.count) + ')';
|
378 |
status = (typeof item.status != 'undefined' && ('publish' != item.status))? ' [' + item.status + '] ' : '';
|
379 |
author = ' ' + item.by_author;
|
|
|
380 |
}
|
381 |
-
return '<div>' + escape(item.name) + ' <small>' + count + status + author + '</small></div>';
|
382 |
}
|
383 |
}
|
384 |
|
@@ -395,20 +406,24 @@ global $user_ID, $gmDB, $gmCore
|
|
395 |
render: {
|
396 |
item: function(item, escape) {
|
397 |
var count = '';
|
398 |
-
|
|
|
399 |
count = ' <small>(' + escape(item.count) + ')</small>';
|
|
|
400 |
}
|
401 |
-
return '<div>' + escape(item.name) + count + '</div>';
|
402 |
},
|
403 |
option: function(item, escape) {
|
404 |
if(('category__and' == this.$input[0].name) && !item.term_id) {
|
405 |
return '';
|
406 |
}
|
407 |
var count = '';
|
408 |
-
|
|
|
409 |
count = ' <small>(' + escape(item.count) + ')</small>';
|
|
|
410 |
}
|
411 |
-
return '<div>' + escape(item.name) + count + '</div>';
|
412 |
}
|
413 |
}
|
414 |
|
@@ -437,10 +452,10 @@ global $user_ID, $gmDB, $gmCore
|
|
437 |
searchField: ['name'],
|
438 |
render: {
|
439 |
item: function(item, escape) {
|
440 |
-
return '<div>' + escape(item.name) + ' <small>(' + escape(item.count) + ')</small></div>';
|
441 |
},
|
442 |
option: function(item, escape) {
|
443 |
-
return '<div>' + escape(item.name) + ' <small>(' + escape(item.count) + ')</small></div>';
|
444 |
}
|
445 |
}
|
446 |
|
@@ -482,7 +497,7 @@ global $user_ID, $gmDB, $gmCore
|
|
482 |
var field = $('#query_gmedia__');
|
483 |
var valData = field.val().split(',');
|
484 |
var storedData = getStorage();
|
485 |
-
storedData = storedData.get('
|
486 |
valData = $.grep(valData, function(e) {
|
487 |
return e;
|
488 |
});
|
@@ -496,10 +511,21 @@ global $user_ID, $gmDB, $gmCore
|
|
496 |
});
|
497 |
field.val(valData.join(','));
|
498 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
499 |
});
|
500 |
|
501 |
</script>
|
502 |
<div class="modal-footer">
|
|
|
503 |
<button type="button" class="btn btn-primary buildquerysubmit"><?php _e('Build Query', 'grand-media'); ?></button>
|
504 |
<button type="button" class="btn btn-default" data-dismiss="modal"><?php _e('Close', 'grand-media'); ?></button>
|
505 |
</div>
|
17 |
<div class="modal-content">
|
18 |
<div class="modal-header">
|
19 |
<div class="pull-right" style="margin-top:-4px;">
|
20 |
+
<button type="button" class="btn btn-default buildqueryreset"><?php _e('Reset', 'grand-media'); ?></button>
|
21 |
<button type="button" class="btn btn-primary buildquerysubmit"><?php _e('Build Query', 'grand-media'); ?></button>
|
22 |
<button type="button" class="btn btn-default" data-dismiss="modal"><?php _e('Close', 'grand-media'); ?></button>
|
23 |
</div>
|
63 |
|
64 |
<div class="row">
|
65 |
<div class="col-xs-8">
|
66 |
+
<input id="query_album__" name="album__in" data-include="album__in" data-exclude="album__not_in" class="form-control gm-selectize input-sm" value="<?php echo implode(',', $query_gmedia_albums) ?>" placeholder="<?php esc_attr_e(__('Any Album...', 'grand-media')); ?>"/>
|
67 |
</div>
|
68 |
<div class="col-xs-4">
|
69 |
<div class="checkbox"><label><input class="query_switch" data-target="query_album__" type="checkbox"<?php echo (empty($query_data['album__in']) && !empty($query_data['album__not_in']))? ' checked="checked"' : ''; ?> /> <?php _e('Exclude selected Albums', 'grand-media'); ?></label></div>
|
85 |
<div class="row">
|
86 |
<div class="col-xs-4">
|
87 |
<label><?php _e('[IN] Categories', 'grand-media'); ?></label>
|
88 |
+
<input name="category__in" class="form-control input-sm gm-selectize combobox_gmedia_category" value="<?php echo implode(',', wp_parse_id_list($query_data['category__in'])); ?>" placeholder="<?php esc_attr_e(__('Either of chosen Categories...', 'grand-media')); ?>"/>
|
89 |
</div>
|
90 |
<div class="col-xs-4">
|
91 |
<label><?php _e('[AND] Categories', 'grand-media'); ?></label>
|
92 |
+
<input name="category__and" class="form-control input-sm gm-selectize combobox_gmedia_category" value="<?php echo implode(',', wp_parse_id_list($query_data['category__and'])); ?>" placeholder="<?php esc_attr_e(__('Have all chosen Categories...', 'grand-media')); ?>"/>
|
93 |
</div>
|
94 |
<div class="col-xs-4">
|
95 |
<label><?php _e('[NOT IN] Categories', 'grand-media'); ?></label>
|
96 |
+
<input name="category__not_in" class="form-control input-sm gm-selectize combobox_gmedia_category" value="<?php echo implode(',', wp_parse_id_list($query_data['category__not_in'])); ?>" placeholder="<?php esc_attr_e(__('Exclude Categories...', 'grand-media')); ?>"/>
|
97 |
</div>
|
98 |
</div>
|
99 |
</div>
|
106 |
<div class="row">
|
107 |
<div class="col-xs-4">
|
108 |
<label><?php _e('[IN] Tags', 'grand-media'); ?> </label>
|
109 |
+
<input name="tag__in" class="form-control input-sm gm-selectize combobox_gmedia_tag" value="<?php echo implode(',', wp_parse_id_list($query_data['tag__in'])); ?>" placeholder="<?php esc_attr_e(__('Either of chosen Tags...', 'grand-media')); ?>"/>
|
110 |
</div>
|
111 |
<div class="col-xs-4">
|
112 |
<label><?php _e('[AND] Tags', 'grand-media'); ?> </label>
|
113 |
+
<input name="tag__and" class="form-control input-sm gm-selectize combobox_gmedia_tag" value="<?php echo implode(',', wp_parse_id_list($query_data['tag__and'])); ?>" placeholder="<?php esc_attr_e(__('Have all chosen Tags...', 'grand-media')); ?>"/>
|
114 |
</div>
|
115 |
<div class="col-xs-4">
|
116 |
<label><?php _e('[NOT IN] Tags', 'grand-media'); ?> </label>
|
117 |
+
<input name="tag__not_in" class="form-control input-sm gm-selectize combobox_gmedia_tag" value="<?php echo implode(',', wp_parse_id_list($query_data['tag__not_in'])); ?>" placeholder="<?php esc_attr_e(__('Exclude Tags...', 'grand-media')); ?>"/>
|
118 |
</div>
|
119 |
</div>
|
120 |
</div>
|
127 |
<div class="col-xs-4">
|
128 |
<select name="terms_relation" class="form-control input-sm">
|
129 |
<option <?php selected($query_data['terms_relation'], ''); ?> value=""><?php _e('Default (AND)'); ?></option>
|
130 |
+
<option <?php selected($query_data['terms_relation'], 'AND'); ?> value="AND"><?php _e('AND'); ?></option>
|
131 |
<option <?php selected($query_data['terms_relation'], 'OR'); ?> value="OR"><?php _e('OR'); ?></option>
|
132 |
</select>
|
133 |
</div>
|
151 |
<div class="form-group">
|
152 |
<div class="row">
|
153 |
<div class="col-xs-8">
|
154 |
+
<div class="pull-right">
|
155 |
+
<a id="_use_lib_selected" title="<?php _e('Select Media', 'grand-media'); ?>" href="<?php echo $gmCore->get_admin_url(array('page' => 'GrandMedia',
|
156 |
+
'mode' => 'select_multiple',
|
157 |
+
'gmediablank' => 'library',
|
158 |
+
'filter' => 'image'
|
159 |
+
), array(), true); ?>" class="label label-primary preview-modal" data-target="#previewModal" data-width="1200" data-height="500" data-cls="select_gmedia"><?php _e('Select in Library', 'grand-media'); ?></a>
|
160 |
+
</div>
|
161 |
<label><?php _e('Gmedia IDs <small class="text-muted">separated by comma</small>', 'grand-media'); ?> </label>
|
162 |
</div>
|
163 |
</div>
|
192 |
);
|
193 |
$mime_type_val = is_array($query_data['mime_type'])? implode(',', $query_data['mime_type']) : str_replace(', ', ',', $query_data['mime_type']);
|
194 |
?>
|
195 |
+
<input name="mime_type" class="form-control input-sm gm-selectize gmedia-combobox" data-options='<?php echo json_encode($mime_types); ?>' value="<?php esc_attr_e($mime_type_val); ?>" placeholder="<?php esc_attr_e(__('All types...', 'grand-media')); ?>"/>
|
196 |
</div>
|
197 |
<div class="col-xs-4">
|
198 |
<label><?php _e('Authors', 'grand-media'); ?></label>
|
219 |
$query_authors = $query_data['author__not_in'];
|
220 |
}
|
221 |
?>
|
222 |
+
<input id="query_author__" name="author__in" data-include="author__in" data-exclude="author__not_in" class="form-control input-sm gm-selectize gmedia-combobox" data-options='<?php echo str_replace("'", "\'", json_encode($_users)); ?>' value="<?php echo implode(',', wp_parse_id_list($query_authors)); ?>" placeholder="<?php esc_attr_e(__('All authors...', 'grand-media')); ?>"/>
|
223 |
<?php } else { ?>
|
224 |
<input type="text" readonly="readonly" name="author__in" class="form-control input-sm" value="<?php the_author_meta('display_name', $user_ID); ?>"/>
|
225 |
<?php } ?>
|
269 |
<label><?php _e('Compare Operator', 'grand-media'); ?></label>
|
270 |
<select class="form-control input-sm" name="meta_query[<?php echo $i; ?>][compare]">
|
271 |
<option <?php selected($q['compare'], ''); ?> value=""><?php _e('Default', 'grand-media'); ?> (=)</option>
|
272 |
+
<option <?php selected($q['compare'], '='); ?> value="=">=</option>
|
273 |
<option <?php selected($q['compare'], '!='); ?> value="!=">!=</option>
|
274 |
<option <?php selected($q['compare'], '>'); ?> value=">">></option>
|
275 |
<option <?php selected($q['compare'], '>='); ?> value=">=">>=</option>
|
291 |
<label><?php _e('Meta Type', 'grand-media'); ?></label>
|
292 |
<select class="form-control input-sm" name="meta_query[<?php echo $i; ?>][type]">
|
293 |
<option <?php selected($q['type'], ''); ?> value=""><?php _e('Default', 'grand-media'); ?> (CHAR)</option>
|
294 |
+
<option <?php selected($q['type'], 'CHAR'); ?> value="CHAR">CHAR</option>
|
295 |
<option <?php selected($q['type'], 'NUMERIC'); ?> value="NUMERIC">NUMERIC</option>
|
296 |
<option <?php selected($q['type'], 'DECIMAL'); ?> value="DECIMAL">DECIMAL</option>
|
297 |
<option <?php selected($q['type'], 'DATE'); ?> value="DATE">DATE</option>
|
312 |
<label><?php _e('Order', 'grand-media'); ?></label>
|
313 |
<select class="form-control input-sm" name="order">
|
314 |
<option <?php selected($query_data['order'], ''); ?> value=""><?php _e('Default (DESC)', 'grand-media'); ?></option>
|
315 |
+
<option <?php selected($query_data['order'], 'DESC'); ?> value="DESC"><?php _e('DESC', 'grand-media'); ?></option>
|
316 |
<option <?php selected($query_data['order'], 'ASC'); ?> value="ASC"><?php _e('ASC', 'grand-media'); ?></option>
|
317 |
</select>
|
318 |
<span class="help-block"><?php _e('Ascending or Descending order', 'grand-media'); ?></span>
|
321 |
<label><?php _e('Order by', 'grand-media'); ?></label>
|
322 |
<select class="form-control input-sm" name="orderby">
|
323 |
<option <?php selected($query_data['orderby'], ''); ?> value=""><?php _e('Default (ID)', 'grand-media'); ?></option>
|
324 |
+
<option <?php selected($query_data['orderby'], 'id'); ?> value="ID"><?php _e('ID', 'grand-media'); ?></option>
|
325 |
<option <?php selected($query_data['orderby'], 'title'); ?> value="title"><?php _e('Title', 'grand-media'); ?></option>
|
326 |
<option <?php selected($query_data['orderby'], 'gmuid'); ?> value="gmuid"><?php _e('Filename', 'grand-media'); ?></option>
|
327 |
<option <?php selected($query_data['orderby'], 'author'); ?> value="author"><?php _e('Author', 'grand-media'); ?></option>
|
369 |
var count = '';
|
370 |
var status = '';
|
371 |
var author = '';
|
372 |
+
var term_id = '';
|
373 |
+
if(parseInt(item.term_id)) {
|
374 |
count = '(' + escape(item.count) + ')';
|
375 |
status = (typeof item.status != 'undefined' && ('publish' != item.status))? ' [' + item.status + '] ' : '';
|
376 |
author = ' ' + item.by_author;
|
377 |
+
term_id = '[' + item.term_id + '] ';
|
378 |
}
|
379 |
+
return '<div>' + term_id + escape(item.name) + ' <small>' + count + status + author + '</small></div>';
|
380 |
},
|
381 |
option: function(item, escape) {
|
382 |
var count = '';
|
383 |
var status = '';
|
384 |
var author = '';
|
385 |
+
var term_id = '';
|
386 |
+
if(parseInt(item.term_id)) {
|
387 |
count = '(' + escape(item.count) + ')';
|
388 |
status = (typeof item.status != 'undefined' && ('publish' != item.status))? ' [' + item.status + '] ' : '';
|
389 |
author = ' ' + item.by_author;
|
390 |
+
term_id = '[' + item.term_id + '] ';
|
391 |
}
|
392 |
+
return '<div>[' + item.term_id + '] ' + escape(item.name) + ' <small>' + count + status + author + '</small></div>';
|
393 |
}
|
394 |
}
|
395 |
|
406 |
render: {
|
407 |
item: function(item, escape) {
|
408 |
var count = '';
|
409 |
+
var term_id = '';
|
410 |
+
if(parseInt(item.term_id)) {
|
411 |
count = ' <small>(' + escape(item.count) + ')</small>';
|
412 |
+
term_id = '[' + item.term_id + '] ';
|
413 |
}
|
414 |
+
return '<div>' + term_id + escape(item.name) + count + '</div>';
|
415 |
},
|
416 |
option: function(item, escape) {
|
417 |
if(('category__and' == this.$input[0].name) && !item.term_id) {
|
418 |
return '';
|
419 |
}
|
420 |
var count = '';
|
421 |
+
var term_id = '';
|
422 |
+
if(parseInt(item.term_id)) {
|
423 |
count = ' <small>(' + escape(item.count) + ')</small>';
|
424 |
+
term_id = '[' + item.term_id + '] ';
|
425 |
}
|
426 |
+
return '<div>' + term_id + escape(item.name) + count + '</div>';
|
427 |
}
|
428 |
}
|
429 |
|
452 |
searchField: ['name'],
|
453 |
render: {
|
454 |
item: function(item, escape) {
|
455 |
+
return '<div>[' + item.term_id + '] ' + escape(item.name) + ' <small>(' + escape(item.count) + ')</small></div>';
|
456 |
},
|
457 |
option: function(item, escape) {
|
458 |
+
return '<div>[' + item.term_id + '] ' + escape(item.name) + ' <small>(' + escape(item.count) + ')</small></div>';
|
459 |
}
|
460 |
}
|
461 |
|
497 |
var field = $('#query_gmedia__');
|
498 |
var valData = field.val().split(',');
|
499 |
var storedData = getStorage();
|
500 |
+
storedData = storedData.get('gmedia_library').split('.');
|
501 |
valData = $.grep(valData, function(e) {
|
502 |
return e;
|
503 |
});
|
511 |
});
|
512 |
field.val(valData.join(','));
|
513 |
});
|
514 |
+
|
515 |
+
$('.buildqueryreset').on('click', function() {
|
516 |
+
$('input.gm-selectize, select.gm-selectize', '#buildQuery').each(function(){
|
517 |
+
this.selectize.clear();
|
518 |
+
});
|
519 |
+
$('input[type="text"], select', '#buildQuery').each(function(){
|
520 |
+
$(this).val('');
|
521 |
+
});
|
522 |
+
$('input[type="checkbox"]', '#buildQuery').prop('checked', false);
|
523 |
+
});
|
524 |
});
|
525 |
|
526 |
</script>
|
527 |
<div class="modal-footer">
|
528 |
+
<button type="button" class="btn btn-default buildqueryreset"><?php _e('Reset', 'grand-media'); ?></button>
|
529 |
<button type="button" class="btn btn-primary buildquerysubmit"><?php _e('Build Query', 'grand-media'); ?></button>
|
530 |
<button type="button" class="btn btn-default" data-dismiss="modal"><?php _e('Close', 'grand-media'); ?></button>
|
531 |
</div>
|
admin/pages/galleries/tpl/module-settings.php
CHANGED
@@ -42,6 +42,7 @@ global $gmGallery;
|
|
42 |
<div class="col-lg-7">
|
43 |
<?php if($term_id || isset($preset_module)){
|
44 |
$bgcolor = empty($gmGallery->options['preview_bgcolor'])? 'ffffff' : $gmGallery->options['preview_bgcolor'];
|
|
|
45 |
?>
|
46 |
<div class="clearfix">
|
47 |
<div class="form-group pull-right" style="margin:-10px 0 5px 0;"><input type="text" data-type="color" class="form-control input-sm" id="preview_color" name="preview_bgcolor" value="<?php echo $bgcolor; ?>" placeholder="ffffff" size="7"/></div>
|
42 |
<div class="col-lg-7">
|
43 |
<?php if($term_id || isset($preset_module)){
|
44 |
$bgcolor = empty($gmGallery->options['preview_bgcolor'])? 'ffffff' : $gmGallery->options['preview_bgcolor'];
|
45 |
+
$params['is_admin_preview'] = 1;
|
46 |
?>
|
47 |
<div class="clearfix">
|
48 |
<div class="form-group pull-right" style="margin:-10px 0 5px 0;"><input type="text" data-type="color" class="form-control input-sm" id="preview_color" name="preview_bgcolor" value="<?php echo $bgcolor; ?>" placeholder="ffffff" size="7"/></div>
|
admin/pages/library/functions.php
CHANGED
@@ -3,10 +3,11 @@
|
|
3 |
function gmedia_item_thumbnail($item){
|
4 |
global $gmCore;
|
5 |
|
6 |
-
$
|
|
|
7 |
|
8 |
-
if(isset($
|
9 |
-
$thumb .= '<img class="gmedia-typethumb" src="' . $
|
10 |
}
|
11 |
|
12 |
return $thumb;
|
@@ -51,20 +52,20 @@ function gmedia_item_actions($item){
|
|
51 |
if((gm_user_can('delete_media') && ((int)$item->author == get_current_user_id())) || gm_user_can('delete_others_media')){
|
52 |
$delete = '<a class="text-danger" href="' . wp_nonce_url(gm_get_admin_url(array('do_gmedia' => 'delete',
|
53 |
'ids' => $item->ID
|
54 |
-
)), 'gmedia_delete') . '" data-confirm="' . sprintf(__("You are about to permanently delete %s file.\n\r'Cancel' to stop, 'OK' to delete.", "grand-media"), $item->gmuid) . '" title="' . __('Delete', 'grand-media') . '">' . $delete_icon . '</a>';
|
55 |
|
56 |
if($gmCore->_get('showmore')){
|
57 |
$erase_icon = '<span class="glyphicon glyphicon-erase"></span>';
|
58 |
$db_delete = '<a class="text-danger" href="' . wp_nonce_url(gm_get_admin_url(array('do_gmedia' => 'delete__save_original',
|
59 |
'ids' => $item->ID
|
60 |
-
)), 'gmedia_delete') . '" data-confirm="' . sprintf(__("You are about to delete record from DB for %s file.\n\r'Cancel' to stop, 'OK' to delete.", "grand-media"), $item->gmuid) . '" title="' . __('Delete DB record (leave file on the server)', 'grand-media') . '">' . $erase_icon . '</a>';
|
61 |
}
|
62 |
} else{
|
63 |
$delete = "<span class='action-inactive'>$delete_icon</span>";
|
64 |
}
|
65 |
}
|
66 |
|
67 |
-
if('image' == $item->type){
|
68 |
$edit_image_icon = '<span class="glyphicon glyphicon-adjust"></span>';
|
69 |
if((gm_user_can('edit_media') && ((int)$item->author == get_current_user_id())) || gm_user_can('edit_others_media')){
|
70 |
$edit_image = '<a href="' . add_query_arg(array('page' => 'GrandMedia', 'gmediablank' => 'image_editor', 'id' => $item->ID), $gmProcessor->url) . '" data-target="#gmeditModal" class="gmedit-modal" id="gmimageedit' . $item->ID . '" title="' . __('Edit Image', 'grand-media') . '">' . $edit_image_icon . '</a>';
|
@@ -84,7 +85,7 @@ function gmedia_item_actions($item){
|
|
84 |
}
|
85 |
|
86 |
$duplicate_icon = '<span class="glyphicon glyphicon-duplicate"></span>';
|
87 |
-
$duplicate = '<a href="' . wp_nonce_url(gm_get_admin_url(array('do_gmedia' => 'duplicate', 'ids' => $item->ID)), 'gmedia_action') . '" title="' . __('Duplicate', 'grand-media') . '">' . $duplicate_icon . '</a>';
|
88 |
|
89 |
$actions = compact('share', 'edit_data', 'edit_image', 'show', 'info', 'duplicate', 'delete', 'db_delete');
|
90 |
|
3 |
function gmedia_item_thumbnail($item){
|
4 |
global $gmCore;
|
5 |
|
6 |
+
$images = $gmCore->gm_get_media_image($item, 'all');
|
7 |
+
$thumb = '<img class="gmedia-thumb" src="' . $images['thumb'] . '" alt=""/>';
|
8 |
|
9 |
+
if(isset($images['icon'])){
|
10 |
+
$thumb .= '<img class="gmedia-typethumb" src="' . $images['icon'] . '" alt=""/>';
|
11 |
}
|
12 |
|
13 |
return $thumb;
|
52 |
if((gm_user_can('delete_media') && ((int)$item->author == get_current_user_id())) || gm_user_can('delete_others_media')){
|
53 |
$delete = '<a class="text-danger" href="' . wp_nonce_url(gm_get_admin_url(array('do_gmedia' => 'delete',
|
54 |
'ids' => $item->ID
|
55 |
+
)), 'gmedia_delete', '_wpnonce_delete') . '" data-confirm="' . sprintf(__("You are about to permanently delete %s file.\n\r'Cancel' to stop, 'OK' to delete.", "grand-media"), $item->gmuid) . '" title="' . __('Delete', 'grand-media') . '">' . $delete_icon . '</a>';
|
56 |
|
57 |
if($gmCore->_get('showmore')){
|
58 |
$erase_icon = '<span class="glyphicon glyphicon-erase"></span>';
|
59 |
$db_delete = '<a class="text-danger" href="' . wp_nonce_url(gm_get_admin_url(array('do_gmedia' => 'delete__save_original',
|
60 |
'ids' => $item->ID
|
61 |
+
)), 'gmedia_delete', '_wpnonce_delete') . '" data-confirm="' . sprintf(__("You are about to delete record from DB for %s file.\n\r'Cancel' to stop, 'OK' to delete.", "grand-media"), $item->gmuid) . '" title="' . __('Delete DB record (leave file on the server)', 'grand-media') . '">' . $erase_icon . '</a>';
|
62 |
}
|
63 |
} else{
|
64 |
$delete = "<span class='action-inactive'>$delete_icon</span>";
|
65 |
}
|
66 |
}
|
67 |
|
68 |
+
if('image' == $item->type && $item->editor){
|
69 |
$edit_image_icon = '<span class="glyphicon glyphicon-adjust"></span>';
|
70 |
if((gm_user_can('edit_media') && ((int)$item->author == get_current_user_id())) || gm_user_can('edit_others_media')){
|
71 |
$edit_image = '<a href="' . add_query_arg(array('page' => 'GrandMedia', 'gmediablank' => 'image_editor', 'id' => $item->ID), $gmProcessor->url) . '" data-target="#gmeditModal" class="gmedit-modal" id="gmimageedit' . $item->ID . '" title="' . __('Edit Image', 'grand-media') . '">' . $edit_image_icon . '</a>';
|
85 |
}
|
86 |
|
87 |
$duplicate_icon = '<span class="glyphicon glyphicon-duplicate"></span>';
|
88 |
+
$duplicate = '<a href="' . wp_nonce_url(gm_get_admin_url(array('do_gmedia' => 'duplicate', 'ids' => $item->ID)), 'gmedia_action', '_wpnonce_action') . '" title="' . __('Duplicate', 'grand-media') . '">' . $duplicate_icon . '</a>';
|
89 |
|
90 |
$actions = compact('share', 'edit_data', 'edit_image', 'show', 'info', 'duplicate', 'delete', 'db_delete');
|
91 |
|
admin/pages/library/library.php
CHANGED
@@ -27,6 +27,10 @@ $openPage = $gmDB->openPage;
|
|
27 |
$perPages = $gmDB->perPages;
|
28 |
$idx0 = $perPages * ($openPage - 1);
|
29 |
|
|
|
|
|
|
|
|
|
30 |
if($_get_filter && ($_get_filter != 'selected')){
|
31 |
unset($gmDB->filter['mime_type']);
|
32 |
unset($gmedia_filter['mime_type']);
|
@@ -92,6 +96,9 @@ if($gmProcessorLibrary->mode) {
|
|
92 |
|
93 |
include(dirname(__FILE__) . "/tpl/{$display_mode_gmedia}-item.php");
|
94 |
}
|
|
|
|
|
|
|
95 |
} elseif(gm_user_can('edit_media')) {
|
96 |
$gm_category_terms = $gmDB->get_terms('gmedia_category', array('fields' => 'names'));
|
97 |
$gm_tag_terms = $gmDB->get_terms('gmedia_tag', array('fields' => 'names'));
|
27 |
$perPages = $gmDB->perPages;
|
28 |
$idx0 = $perPages * ($openPage - 1);
|
29 |
|
30 |
+
if(isset($gmedia_filter['author__in']) && !gm_user_can('show_others_media')){
|
31 |
+
unset($gmDB->filter['author__in']);
|
32 |
+
unset($gmedia_filter['author__in']);
|
33 |
+
}
|
34 |
if($_get_filter && ($_get_filter != 'selected')){
|
35 |
unset($gmDB->filter['mime_type']);
|
36 |
unset($gmedia_filter['mime_type']);
|
96 |
|
97 |
include(dirname(__FILE__) . "/tpl/{$display_mode_gmedia}-item.php");
|
98 |
}
|
99 |
+
if('grid' == $display_mode_gmedia){
|
100 |
+
echo '<div class="gm-item-cell-blank"></div><div class="gm-item-cell-blank"></div><div class="gm-item-cell-blank"></div><div class="gm-item-cell-blank"></div><div class="gm-item-cell-blank"></div><div class="gm-item-cell-blank"></div>';
|
101 |
+
}
|
102 |
} elseif(gm_user_can('edit_media')) {
|
103 |
$gm_category_terms = $gmDB->get_terms('gmedia_category', array('fields' => 'names'));
|
104 |
$gm_tag_terms = $gmDB->get_terms('gmedia_tag', array('fields' => 'names'));
|
admin/pages/library/tpl/edit-item.php
CHANGED
@@ -51,13 +51,13 @@ if(!defined('ABSPATH')){
|
|
51 |
<label><?php _e('Description', 'grand-media'); ?></label>
|
52 |
<?php if(('false' != $gmedia_user_options['library_edit_quicktags']) || ($gmProcessor->gmediablank && (1 == $resultPerPage))){
|
53 |
wp_editor(esc_textarea($item->description), "gm{$item->ID}_description", array('editor_class' => 'form-control input-sm',
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
));
|
62 |
} else{
|
63 |
echo "<textarea id='gm{$item->ID}_description' class='form-control input-sm' name='description' cols='20' rows='4' style='height:174px'>" . esc_textarea($item->description) . '</textarea>';
|
@@ -208,7 +208,7 @@ if(!defined('ABSPATH')){
|
|
208 |
}
|
209 |
?>
|
210 |
</div>
|
211 |
-
<?php if('image' != $item->type){ ?>
|
212 |
<div class="form-group">
|
213 |
<label><?php _e('Custom Cover', 'grand-media');
|
214 |
echo ' <small>(' . __('media image ID', 'grand-media') . ')</small>'; ?></label>
|
@@ -235,15 +235,22 @@ if(!defined('ABSPATH')){
|
|
235 |
<?php } ?>
|
236 |
<p class="media-meta">
|
237 |
<span class="label label-default"><?php _e('ID', 'grand-media') ?>:</span> <strong><?php echo $item->ID; ?></strong>
|
|
|
238 |
<br/><span class="label label-default"><?php _e('Type', 'grand-media'); ?>:</span> <?php echo $item->mime_type; ?>
|
239 |
-
<?php if(('image' == $item->type) && !empty($item->meta['_metadata'])){ ?>
|
240 |
<br/><span class="label label-default"><?php _e('Dimensions', 'grand-media'); ?>:</span>
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
<a href="<?php echo $item->url; ?>"
|
248 |
data-target="#previewModal"
|
249 |
data-width="<?php echo $item->meta['_metadata'][0]['web']['width']; ?>"
|
@@ -256,7 +263,9 @@ if(!defined('ABSPATH')){
|
|
256 |
data-height="<?php echo $item->meta['_metadata'][0]['thumb']['height']; ?>"
|
257 |
class="preview-modal"
|
258 |
title="<?php _e('Thumbnail', 'grand-media'); ?>"><?php echo $item->meta['_metadata'][0]['thumb']['width'] . '×' . $item->meta['_metadata'][0]['thumb']['height']; ?></a>
|
259 |
-
<br/><span class="label label-default"><?php _e('File Size', 'grand-media') ?>:</span> <?php
|
|
|
|
|
260 |
<?php } else{ ?>
|
261 |
<br/><span class="label label-default"><?php _e('File Size', 'grand-media') ?>:</span> <?php echo $gmCore->filesize($item->path); ?>
|
262 |
<?php } ?>
|
51 |
<label><?php _e('Description', 'grand-media'); ?></label>
|
52 |
<?php if(('false' != $gmedia_user_options['library_edit_quicktags']) || ($gmProcessor->gmediablank && (1 == $resultPerPage))){
|
53 |
wp_editor(esc_textarea($item->description), "gm{$item->ID}_description", array('editor_class' => 'form-control input-sm',
|
54 |
+
'editor_height' => 140,
|
55 |
+
'wpautop' => false,
|
56 |
+
'media_buttons' => false,
|
57 |
+
'textarea_name' => 'description',
|
58 |
+
'textarea_rows' => '4',
|
59 |
+
'tinymce' => false,
|
60 |
+
'quicktags' => array('buttons' => apply_filters('gmedia_editor_quicktags', 'strong,em,link,ul,li,close'))
|
61 |
));
|
62 |
} else{
|
63 |
echo "<textarea id='gm{$item->ID}_description' class='form-control input-sm' name='description' cols='20' rows='4' style='height:174px'>" . esc_textarea($item->description) . '</textarea>';
|
208 |
}
|
209 |
?>
|
210 |
</div>
|
211 |
+
<?php if('image' != $item->type || ('image' == $item->type && !$item->editor)){ ?>
|
212 |
<div class="form-group">
|
213 |
<label><?php _e('Custom Cover', 'grand-media');
|
214 |
echo ' <small>(' . __('media image ID', 'grand-media') . ')</small>'; ?></label>
|
235 |
<?php } ?>
|
236 |
<p class="media-meta">
|
237 |
<span class="label label-default"><?php _e('ID', 'grand-media') ?>:</span> <strong><?php echo $item->ID; ?></strong>
|
238 |
+
<br/><span class="label label-default"><?php _e('Post ID', 'grand-media') ?>:</span> <strong><?php echo $item->post_id; ?></strong>
|
239 |
<br/><span class="label label-default"><?php _e('Type', 'grand-media'); ?>:</span> <?php echo $item->mime_type; ?>
|
240 |
+
<?php if(('image' == $item->type) && $item->editor && !empty($item->meta['_metadata'])){ ?>
|
241 |
<br/><span class="label label-default"><?php _e('Dimensions', 'grand-media'); ?>:</span>
|
242 |
+
<?php
|
243 |
+
$is_file_original = (bool) $item->path_original;
|
244 |
+
if($is_file_original){ ?>
|
245 |
+
<a href="<?php echo $item->url_original; ?>"
|
246 |
+
data-target="#previewModal"
|
247 |
+
data-width="<?php echo $item->meta['_metadata'][0]['original']['width']; ?>"
|
248 |
+
data-height="<?php echo $item->meta['_metadata'][0]['original']['height']; ?>"
|
249 |
+
class="preview-modal"
|
250 |
+
title="<?php _e('Original', 'grand-media'); ?>"><?php echo $item->meta['_metadata'][0]['original']['width'] . '×' . $item->meta['_metadata'][0]['original']['height']; ?></a>,
|
251 |
+
<?php } else{ ?>
|
252 |
+
<span title="<?php _e('Original', 'grand-media'); ?>"><?php echo $item->meta['_metadata'][0]['original']['width'] . '×' . $item->meta['_metadata'][0]['original']['height']; ?></span>,
|
253 |
+
<?php } ?>
|
254 |
<a href="<?php echo $item->url; ?>"
|
255 |
data-target="#previewModal"
|
256 |
data-width="<?php echo $item->meta['_metadata'][0]['web']['width']; ?>"
|
263 |
data-height="<?php echo $item->meta['_metadata'][0]['thumb']['height']; ?>"
|
264 |
class="preview-modal"
|
265 |
title="<?php _e('Thumbnail', 'grand-media'); ?>"><?php echo $item->meta['_metadata'][0]['thumb']['width'] . '×' . $item->meta['_metadata'][0]['thumb']['height']; ?></a>
|
266 |
+
<br/><span class="label label-default"><?php _e('File Size', 'grand-media') ?>:</span> <?php
|
267 |
+
echo ($is_file_original? $gmCore->filesize($item->path_original) : '—') . ', ';
|
268 |
+
echo $gmCore->filesize($item->path) . ', ' . $gmCore->filesize($item->path_thumb); ?>
|
269 |
<?php } else{ ?>
|
270 |
<br/><span class="label label-default"><?php _e('File Size', 'grand-media') ?>:</span> <?php echo $gmCore->filesize($item->path); ?>
|
271 |
<?php } ?>
|
admin/pages/library/tpl/list-item.php
CHANGED
@@ -116,15 +116,21 @@ if(!defined('ABSPATH')) {
|
|
116 |
</p>
|
117 |
<p class="media-meta">
|
118 |
<span class="label label-default"><?php _e('Type', 'grand-media'); ?>:</span> <?php echo $item->mime_type; ?>
|
119 |
-
<?php if(('image' == $item->type) && !empty($item->meta['_metadata'])) {
|
120 |
?>
|
121 |
<br/><span class="label label-default"><?php _e('Dimensions', 'grand-media'); ?>:</span>
|
|
|
|
|
|
|
122 |
<a href="<?php echo $item->url_original; ?>"
|
123 |
data-target="#previewModal"
|
124 |
data-width="<?php echo $item->meta['_metadata'][0]['original']['width']; ?>"
|
125 |
data-height="<?php echo $item->meta['_metadata'][0]['original']['height']; ?>"
|
126 |
class="preview-modal"
|
127 |
title="<?php _e('Original', 'grand-media'); ?>"><?php echo $item->meta['_metadata'][0]['original']['width'] . '×' . $item->meta['_metadata'][0]['original']['height']; ?></a>,
|
|
|
|
|
|
|
128 |
<a href="<?php echo $item->url; ?>"
|
129 |
data-target="#previewModal"
|
130 |
data-width="<?php echo $item->meta['_metadata'][0]['web']['width']; ?>"
|
116 |
</p>
|
117 |
<p class="media-meta">
|
118 |
<span class="label label-default"><?php _e('Type', 'grand-media'); ?>:</span> <?php echo $item->mime_type; ?>
|
119 |
+
<?php if(('image' == $item->type) && $item->editor && !empty($item->meta['_metadata'])) {
|
120 |
?>
|
121 |
<br/><span class="label label-default"><?php _e('Dimensions', 'grand-media'); ?>:</span>
|
122 |
+
<?php
|
123 |
+
$is_file_original = (bool)$item->path_original;
|
124 |
+
if($is_file_original){ ?>
|
125 |
<a href="<?php echo $item->url_original; ?>"
|
126 |
data-target="#previewModal"
|
127 |
data-width="<?php echo $item->meta['_metadata'][0]['original']['width']; ?>"
|
128 |
data-height="<?php echo $item->meta['_metadata'][0]['original']['height']; ?>"
|
129 |
class="preview-modal"
|
130 |
title="<?php _e('Original', 'grand-media'); ?>"><?php echo $item->meta['_metadata'][0]['original']['width'] . '×' . $item->meta['_metadata'][0]['original']['height']; ?></a>,
|
131 |
+
<?php } else{ ?>
|
132 |
+
<span title="<?php _e('Original', 'grand-media'); ?>"><?php echo $item->meta['_metadata'][0]['original']['width'] . '×' . $item->meta['_metadata'][0]['original']['height']; ?></span>,
|
133 |
+
<?php } ?>
|
134 |
<a href="<?php echo $item->url; ?>"
|
135 |
data-target="#previewModal"
|
136 |
data-width="<?php echo $item->meta['_metadata'][0]['web']['width']; ?>"
|
admin/pages/library/tpl/panel-heading.php
CHANGED
@@ -156,7 +156,7 @@ if(!defined('ABSPATH')){
|
|
156 |
<a href="#libModal" data-modal="assign_album" data-action="gmedia_get_modal" data-ckey="<?php echo GmediaProcessor_Library::$cookie_key; ?>" class="gmedia-modal"><?php _e('Move to Album...', 'grand-media'); ?></a>
|
157 |
</li>
|
158 |
<li class="<?php echo $rel_selected_show . (gm_user_can('terms')? '' : ' disabled'); ?>">
|
159 |
-
<a href="<?php echo wp_nonce_url(gm_get_admin_url(array('do_gmedia' => 'unassign_album')), 'gmedia_action') ?>" data-confirm="<?php _e("You are about to remove the selected items from assigned albums.\n\r'Cancel' to stop, 'OK' to delete.", "grand-media"); ?>"><?php _e('Remove from Album', 'grand-media'); ?></a>
|
160 |
</li>
|
161 |
<li class="<?php echo $rel_selected_show . (gm_user_can('terms')? '' : ' disabled'); ?>">
|
162 |
<a href="#libModal" data-modal="assign_category" data-action="gmedia_get_modal" data-ckey="<?php echo GmediaProcessor_Library::$cookie_key; ?>" class="gmedia-modal"><?php _e('Assign Categories...', 'grand-media'); ?></a>
|
@@ -172,16 +172,16 @@ if(!defined('ABSPATH')){
|
|
172 |
<li class="<?php echo $rel_selected_show . (gm_user_can('delete_media')? '' : ' disabled'); ?>">
|
173 |
<a href="<?php echo wp_nonce_url(gm_get_admin_url(array('do_gmedia' => 'delete',
|
174 |
'ids' => 'selected'
|
175 |
-
), array('filter')), 'gmedia_delete') ?>" class="gmedia-delete" data-confirm="<?php _e("You are about to permanently delete the selected items.\n\r'Cancel' to stop, 'OK' to delete.", "grand-media"); ?>"><?php _e('Delete Selected Items', 'grand-media'); ?></a>
|
176 |
</li>
|
177 |
|
178 |
<?php if(!$gmProcessor->gmediablank){ ?>
|
179 |
<li class="divider <?php echo $rel_selected_show; ?>"></li>
|
180 |
<li class="<?php echo $rel_selected_show . (gm_user_can('edit_media')? '' : ' disabled'); ?>">
|
181 |
-
<a href="<?php echo wp_nonce_url(gm_get_admin_url(array('do_gmedia' => 'recreate'), array()), 'gmedia_action') ?>" class="gmedia-update"><?php _e('Re-create Images (heavy process)', 'grand-media'); ?></a>
|
182 |
</li>
|
183 |
<li class="<?php echo $rel_selected_show . (gm_user_can('edit_media')? '' : ' disabled'); ?>">
|
184 |
-
<a href="<?php echo wp_nonce_url(gm_get_admin_url(array('do_gmedia' => 'update_meta'), array()), 'gmedia_action') ?>" class="gmedia-update"><?php _e('Update Metadata in Database', 'grand-media'); ?></a>
|
185 |
</li>
|
186 |
|
187 |
<li class="divider"></li>
|
156 |
<a href="#libModal" data-modal="assign_album" data-action="gmedia_get_modal" data-ckey="<?php echo GmediaProcessor_Library::$cookie_key; ?>" class="gmedia-modal"><?php _e('Move to Album...', 'grand-media'); ?></a>
|
157 |
</li>
|
158 |
<li class="<?php echo $rel_selected_show . (gm_user_can('terms')? '' : ' disabled'); ?>">
|
159 |
+
<a href="<?php echo wp_nonce_url(gm_get_admin_url(array('do_gmedia' => 'unassign_album')), 'gmedia_action', '_wpnonce_action') ?>" data-confirm="<?php _e("You are about to remove the selected items from assigned albums.\n\r'Cancel' to stop, 'OK' to delete.", "grand-media"); ?>"><?php _e('Remove from Album', 'grand-media'); ?></a>
|
160 |
</li>
|
161 |
<li class="<?php echo $rel_selected_show . (gm_user_can('terms')? '' : ' disabled'); ?>">
|
162 |
<a href="#libModal" data-modal="assign_category" data-action="gmedia_get_modal" data-ckey="<?php echo GmediaProcessor_Library::$cookie_key; ?>" class="gmedia-modal"><?php _e('Assign Categories...', 'grand-media'); ?></a>
|
172 |
<li class="<?php echo $rel_selected_show . (gm_user_can('delete_media')? '' : ' disabled'); ?>">
|
173 |
<a href="<?php echo wp_nonce_url(gm_get_admin_url(array('do_gmedia' => 'delete',
|
174 |
'ids' => 'selected'
|
175 |
+
), array('filter')), 'gmedia_delete', '_wpnonce_delete') ?>" class="gmedia-delete" data-confirm="<?php _e("You are about to permanently delete the selected items.\n\r'Cancel' to stop, 'OK' to delete.", "grand-media"); ?>"><?php _e('Delete Selected Items', 'grand-media'); ?></a>
|
176 |
</li>
|
177 |
|
178 |
<?php if(!$gmProcessor->gmediablank){ ?>
|
179 |
<li class="divider <?php echo $rel_selected_show; ?>"></li>
|
180 |
<li class="<?php echo $rel_selected_show . (gm_user_can('edit_media')? '' : ' disabled'); ?>">
|
181 |
+
<a href="<?php echo wp_nonce_url(gm_get_admin_url(array('do_gmedia' => 'recreate'), array()), 'gmedia_action', '_wpnonce_action') ?>" class="gmedia-update"><?php _e('Re-create Images (heavy process)', 'grand-media'); ?></a>
|
182 |
</li>
|
183 |
<li class="<?php echo $rel_selected_show . (gm_user_can('edit_media')? '' : ' disabled'); ?>">
|
184 |
+
<a href="<?php echo wp_nonce_url(gm_get_admin_url(array('do_gmedia' => 'update_meta'), array()), 'gmedia_action', '_wpnonce_action') ?>" class="gmedia-update"><?php _e('Update Metadata in Database', 'grand-media'); ?></a>
|
185 |
</li>
|
186 |
|
187 |
<li class="divider"></li>
|
admin/pages/modules/edit-preset.php
CHANGED
@@ -40,7 +40,7 @@ if ( isset( $gmedia_modules['in'][ $term->module['name'] ] ) ) {
|
|
40 |
* @var $default_options
|
41 |
*/
|
42 |
extract( $gmedia_modules['in'][ $term->module['name'] ] );
|
43 |
-
if (
|
44 |
/** @noinspection PhpIncludeInspection */
|
45 |
include( $module_path . '/index.php' );
|
46 |
/** @noinspection PhpIncludeInspection */
|
40 |
* @var $default_options
|
41 |
*/
|
42 |
extract( $gmedia_modules['in'][ $term->module['name'] ] );
|
43 |
+
if ( is_file( $module_path . '/index.php' ) && is_file( $module_path . '/settings.php' ) ) {
|
44 |
/** @noinspection PhpIncludeInspection */
|
45 |
include( $module_path . '/index.php' );
|
46 |
/** @noinspection PhpIncludeInspection */
|
admin/pages/modules/functions.php
CHANGED
@@ -19,7 +19,7 @@ function gmedia_module_action_buttons($module){
|
|
19 |
$buttons['update'] = '<a class="btn btn-warning module_install" data-module="' . $module['module_name'] . '" data-loading-text="' . __('Loading...', 'grand-media') . '" href="' . esc_url($module['download']) . '">' . __('Update Module', 'grand-media') . " (v{$module['update']})</a>";
|
20 |
}
|
21 |
if(('upload' == $module['place']) && gm_user_can('module_manage')){
|
22 |
-
$buttons['delete'] = '<a class="btn btn-danger" href="' . wp_nonce_url($gmCore->get_admin_url(array('delete_module' => $module['module_name']), array(), $gmProcessor->url), 'gmedia_module_delete') . '">' . __('Delete Module', 'grand-media') . '</a>';
|
23 |
}
|
24 |
if(!empty($module['download'])){
|
25 |
$buttons['download'] = '<a class="btn btn-link" href="' . $module['download'] . '" download="true">' . __('Download module ZIP', 'grand-media') . '</a>';
|
@@ -60,7 +60,7 @@ function gmedia_module_preset_more_data(&$item){
|
|
60 |
$item->module = $gmCore->get_module_path($item->status);
|
61 |
|
62 |
$module_info = array('type' => '—');
|
63 |
-
if(
|
64 |
include($item->module['path'] . '/index.php');
|
65 |
|
66 |
$item->module['info'] = $module_info;
|
19 |
$buttons['update'] = '<a class="btn btn-warning module_install" data-module="' . $module['module_name'] . '" data-loading-text="' . __('Loading...', 'grand-media') . '" href="' . esc_url($module['download']) . '">' . __('Update Module', 'grand-media') . " (v{$module['update']})</a>";
|
20 |
}
|
21 |
if(('upload' == $module['place']) && gm_user_can('module_manage')){
|
22 |
+
$buttons['delete'] = '<a class="btn btn-danger" href="' . wp_nonce_url($gmCore->get_admin_url(array('delete_module' => $module['module_name']), array(), $gmProcessor->url), 'gmedia_module_delete', '_wpnonce_module_delete') . '">' . __('Delete Module', 'grand-media') . '</a>';
|
23 |
}
|
24 |
if(!empty($module['download'])){
|
25 |
$buttons['download'] = '<a class="btn btn-link" href="' . $module['download'] . '" download="true">' . __('Download module ZIP', 'grand-media') . '</a>';
|
60 |
$item->module = $gmCore->get_module_path($item->status);
|
61 |
|
62 |
$module_info = array('type' => '—');
|
63 |
+
if(is_file($item->module['path'] . '/index.php')){
|
64 |
include($item->module['path'] . '/index.php');
|
65 |
|
66 |
$item->module['info'] = $module_info;
|
admin/pages/modules/modules.php
CHANGED
@@ -54,7 +54,8 @@ if(isset($modules['error'])){
|
|
54 |
<div class="panel-body" id="gmedia-msg-panel"></div>
|
55 |
<div class="panel-body">
|
56 |
<?php
|
57 |
-
|
|
|
58 |
foreach($modules['out'] as $module){
|
59 |
$module['mclass'] = ' module-' . $module['type'] . ' module-' . $module['status'];
|
60 |
$module['screenshot_url'] = $out_dirpath . '/' . $module['name'] . '.png';
|
54 |
<div class="panel-body" id="gmedia-msg-panel"></div>
|
55 |
<div class="panel-body">
|
56 |
<?php
|
57 |
+
//$out_dirpath = dirname($gmGallery->options['modules_xml']);
|
58 |
+
$out_dirpath = 'https://codeasily.com/gmedia_modules';
|
59 |
foreach($modules['out'] as $module){
|
60 |
$module['mclass'] = ' module-' . $module['type'] . ' module-' . $module['status'];
|
61 |
$module['screenshot_url'] = $out_dirpath . '/' . $module['name'] . '.png';
|
admin/pages/modules/tpl/modal-modulezip.php
CHANGED
@@ -13,11 +13,11 @@ if(!defined('ABSPATH')) {
|
|
13 |
<form class="modal-content" method="post" enctype="multipart/form-data" action="<?php echo $gmedia_url; ?>">
|
14 |
<div class="modal-header">
|
15 |
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
16 |
-
<h4 class="modal-title"><?php _e('Install a
|
17 |
</div>
|
18 |
<div class="modal-body">
|
19 |
<p class="install-help"><?php _e('If you have a module in a .zip format, you may install it by uploading it here.'); ?></p>
|
20 |
-
<?php wp_nonce_field('
|
21 |
<label class="screen-reader-text" for="modulezip"><?php _e('Module zip file'); ?></label>
|
22 |
<input type="file" id="modulezip" name="modulezip"/>
|
23 |
</div>
|
13 |
<form class="modal-content" method="post" enctype="multipart/form-data" action="<?php echo $gmedia_url; ?>">
|
14 |
<div class="modal-header">
|
15 |
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
16 |
+
<h4 class="modal-title"><?php _e('Install a module in .zip format'); ?></h4>
|
17 |
</div>
|
18 |
<div class="modal-body">
|
19 |
<p class="install-help"><?php _e('If you have a module in a .zip format, you may install it by uploading it here.'); ?></p>
|
20 |
+
<?php wp_nonce_field('gmedia_module', '_wpnonce_module'); ?>
|
21 |
<label class="screen-reader-text" for="modulezip"><?php _e('Module zip file'); ?></label>
|
22 |
<input type="file" id="modulezip" name="modulezip"/>
|
23 |
</div>
|
admin/pages/settings/settings.php
CHANGED
@@ -25,7 +25,7 @@ $lk = isset($gmGallery->options['license_key'])? $gmGallery->options['license_k
|
|
25 |
</div>
|
26 |
</div>
|
27 |
<?php
|
28 |
-
wp_nonce_field('
|
29 |
?>
|
30 |
</div>
|
31 |
<div class="panel-body" id="gmedia-msg-panel"></div>
|
25 |
</div>
|
26 |
</div>
|
27 |
<?php
|
28 |
+
wp_nonce_field('gmedia_settings', '_wpnonce_settings');
|
29 |
?>
|
30 |
</div>
|
31 |
<div class="panel-body" id="gmedia-msg-panel"></div>
|
admin/pages/settings/tpl/common.php
CHANGED
@@ -19,6 +19,14 @@ if(!defined('ABSPATH')){
|
|
19 |
<option value="none" <?php selected($gmGallery->options['uninstall_dropdata'], 'none'); ?>><?php _e('Do not delete database and uploaded files', 'grand-media'); ?></option>
|
20 |
</select>
|
21 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
<div class="form-group row">
|
23 |
<div class="col-xs-6">
|
24 |
<label><?php _e('In Tags order gmedia', 'grand-media'); ?></label>
|
19 |
<option value="none" <?php selected($gmGallery->options['uninstall_dropdata'], 'none'); ?>><?php _e('Do not delete database and uploaded files', 'grand-media'); ?></option>
|
20 |
</select>
|
21 |
</div>
|
22 |
+
<div class="form-group">
|
23 |
+
<label><?php _e('Delete original images', 'grand-media') ?>:</label>
|
24 |
+
<div class="checkbox" style="margin:0;">
|
25 |
+
<input type="hidden" name="set[delete_originals]" value="0"/>
|
26 |
+
<label><input type="checkbox" name="set[delete_originals]" value="1" <?php checked($gmGallery->options['delete_originals'], '1'); ?> /> <?php _e('Do not keep original images on the server', 'grand-media'); ?> </label>
|
27 |
+
</div>
|
28 |
+
<p class="help-block"><?php _e('Warning: You can\'t undo this operation. Checking this option you agree to delete original images. You will not be able: restore images after modification in the Image Editor; re-create web-optimized images; ...', 'grand-media'); ?></p>
|
29 |
+
</div>
|
30 |
<div class="form-group row">
|
31 |
<div class="col-xs-6">
|
32 |
<label><?php _e('In Tags order gmedia', 'grand-media'); ?></label>
|
admin/pages/settings/tpl/permalinks.php
CHANGED
@@ -84,6 +84,42 @@ if(!defined('ABSPATH')) {
|
|
84 |
<label><input type="checkbox" name="set[gmedia_gallery_exclude_from_search]" value="1" <?php checked($gmGallery->options['gmedia_gallery_exclude_from_search'], '1'); ?> /> <?php _e('Exclude Gmedia Galleries from WordPress search results on the Frontend', 'grand-media'); ?> </label>
|
85 |
</div>
|
86 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
</fieldset>
|
88 |
|
89 |
<fieldset id="gmedia_settings_cloud" class="tab-pane">
|
84 |
<label><input type="checkbox" name="set[gmedia_gallery_exclude_from_search]" value="1" <?php checked($gmGallery->options['gmedia_gallery_exclude_from_search'], '1'); ?> /> <?php _e('Exclude Gmedia Galleries from WordPress search results on the Frontend', 'grand-media'); ?> </label>
|
85 |
</div>
|
86 |
</div>
|
87 |
+
|
88 |
+
<hr />
|
89 |
+
<h4><?php _e('Gmedia Tags & Categories', 'grand-media'); ?></h4>
|
90 |
+
<div class="form-group">
|
91 |
+
<div class="checkbox" style="margin:0;">
|
92 |
+
<input type="hidden" name="set[wp_term_related_gmedia]" value="0"/>
|
93 |
+
<label><input type="checkbox" name="set[wp_term_related_gmedia]" value="1" <?php checked($gmGallery->options['wp_term_related_gmedia'], '1'); ?> /> <?php _e('Show Related Media from Gmedia library for Wordpress native tags & categories', 'grand-media'); ?> </label>
|
94 |
+
</div>
|
95 |
+
</div>
|
96 |
+
<div class="form-group">
|
97 |
+
<div class="checkbox" style="margin:0;">
|
98 |
+
<input type="hidden" name="set[wp_post_related_gmedia]" value="0"/>
|
99 |
+
<label><input type="checkbox" name="set[wp_post_related_gmedia]" value="1" <?php checked($gmGallery->options['wp_post_related_gmedia'], '1'); ?> /> <?php _e('Show Related Media from Gmedia library for Wordpress Posts based on tags', 'grand-media'); ?> </label>
|
100 |
+
</div>
|
101 |
+
</div>
|
102 |
+
|
103 |
+
<hr />
|
104 |
+
<h4><?php _e('Choose what to show on Author Profile pages', 'grand-media'); ?></h4>
|
105 |
+
<div class="form-group">
|
106 |
+
<div class="checkbox" style="margin:0;">
|
107 |
+
<input type="hidden" name="set[wp_author_related_gmedia]" value="0"/>
|
108 |
+
<label><input type="checkbox" name="set[wp_author_related_gmedia]" value="1" <?php checked($gmGallery->options['wp_author_related_gmedia'], '1'); ?> /> <?php _e('Gmedia Posts (media items from Gmedia Libary)', 'grand-media'); ?> </label>
|
109 |
+
</div>
|
110 |
+
</div>
|
111 |
+
<div class="form-group">
|
112 |
+
<div class="checkbox" style="margin:0;">
|
113 |
+
<input type="hidden" name="set[wp_author_related_gmedia_album]" value="0"/>
|
114 |
+
<label><input type="checkbox" name="set[wp_author_related_gmedia_album]" value="1" <?php checked($gmGallery->options['wp_author_related_gmedia_album'], '1'); ?> /> <?php _e('Gmedia Albums', 'grand-media'); ?> </label>
|
115 |
+
</div>
|
116 |
+
</div>
|
117 |
+
<div class="form-group">
|
118 |
+
<div class="checkbox" style="margin:0;">
|
119 |
+
<input type="hidden" name="set[wp_author_related_gmedia_gallery]" value="0"/>
|
120 |
+
<label><input type="checkbox" name="set[wp_author_related_gmedia_gallery]" value="1" <?php checked($gmGallery->options['wp_author_related_gmedia_gallery'], '1'); ?> /> <?php _e('Gmedia Galleries', 'grand-media'); ?> </label>
|
121 |
+
</div>
|
122 |
+
</div>
|
123 |
</fieldset>
|
124 |
|
125 |
<fieldset id="gmedia_settings_cloud" class="tab-pane">
|
admin/pages/terms/functions.php
CHANGED
@@ -78,7 +78,7 @@ function gmedia_term_item_actions($item){
|
|
78 |
|
79 |
$trash_icon = '<span class="glyphicon glyphicon-trash"></span>';
|
80 |
if($item->allow_delete){
|
81 |
-
$actions['delete'] = '<a class="trash-icon" title="' . __('Delete', 'grand-media') . '" href="' . wp_nonce_url(add_query_arg(array('do_gmedia_terms' => 'delete', 'ids' => $item->term_id), $gmProcessor->url), 'gmedia_delete') . '" data-confirm="' . __("You are about to permanently delete the selected items.\n\r'Cancel' to stop, 'OK' to delete.", "grand-media") . '">' . $trash_icon . '</a>';
|
82 |
} else{
|
83 |
$actions['delete'] = "<span class='action-inactive'>$trash_icon</span>";
|
84 |
}
|
@@ -120,8 +120,10 @@ function gmedia_term_album_after_panel($term){
|
|
120 |
|
121 |
$atts = 'class="gmedia_term__in"';
|
122 |
if(isset($term->meta['_orderby'][0]) && ('custom' == $term->meta['_orderby'][0])){
|
123 |
-
$atts .= ' id="gm-sortable" data-term_id="' . $term->term_id . '" data-action="gmedia_term_sortorder" data-
|
124 |
add_action('before_gmedia_filter_message', 'before_gmedia_filter_message');
|
|
|
|
|
125 |
}
|
126 |
echo "<div {$atts}>";
|
127 |
echo $gmCore->alert('success', $gmProcessor->msg);
|
@@ -138,6 +140,9 @@ function before_gmedia_filter_message(){
|
|
138 |
echo '<div class="custom-message alert alert-warning">' . __("Drag'n'drop functionality disabled. Reset filters to enable drag'n'drop.", 'grand-media') . '</div>';
|
139 |
}
|
140 |
}
|
|
|
|
|
|
|
141 |
|
142 |
add_action('gmedia_term_category_after_panel', 'gmedia_term_category_after_panel');
|
143 |
function gmedia_term_category_after_panel($term){
|
78 |
|
79 |
$trash_icon = '<span class="glyphicon glyphicon-trash"></span>';
|
80 |
if($item->allow_delete){
|
81 |
+
$actions['delete'] = '<a class="trash-icon" title="' . __('Delete', 'grand-media') . '" href="' . wp_nonce_url(add_query_arg(array('do_gmedia_terms' => 'delete', 'ids' => $item->term_id), $gmProcessor->url), 'gmedia_delete', '_wpnonce_delete') . '" data-confirm="' . __("You are about to permanently delete the selected items.\n\r'Cancel' to stop, 'OK' to delete.", "grand-media") . '">' . $trash_icon . '</a>';
|
82 |
} else{
|
83 |
$actions['delete'] = "<span class='action-inactive'>$trash_icon</span>";
|
84 |
}
|
120 |
|
121 |
$atts = 'class="gmedia_term__in"';
|
122 |
if(isset($term->meta['_orderby'][0]) && ('custom' == $term->meta['_orderby'][0])){
|
123 |
+
$atts .= ' id="gm-sortable" data-term_id="' . $term->term_id . '" data-action="gmedia_term_sortorder" data-_wpnonce_terms="' . wp_create_nonce('gmedia_terms') . '"';
|
124 |
add_action('before_gmedia_filter_message', 'before_gmedia_filter_message');
|
125 |
+
} else {
|
126 |
+
add_action('before_gmedia_filter_message', 'before_gmedia_filter_message2');
|
127 |
}
|
128 |
echo "<div {$atts}>";
|
129 |
echo $gmCore->alert('success', $gmProcessor->msg);
|
140 |
echo '<div class="custom-message alert alert-warning">' . __("Drag'n'drop functionality disabled. Reset filters to enable drag'n'drop.", 'grand-media') . '</div>';
|
141 |
}
|
142 |
}
|
143 |
+
function before_gmedia_filter_message2(){
|
144 |
+
echo '<div class="custom-message alert alert-info">' . __("To enable drag'n'drop to reorder functionality for items you must update album's `Order gmedia` field to `Custom Order`.", 'grand-media') . '</div>';
|
145 |
+
}
|
146 |
|
147 |
add_action('gmedia_term_category_after_panel', 'gmedia_term_category_after_panel');
|
148 |
function gmedia_term_category_after_panel($term){
|
admin/pages/terms/terms.php
CHANGED
@@ -55,7 +55,7 @@ $gmedia_terms_pager = $gmDB->query_pager();
|
|
55 |
include(dirname(__FILE__) . '/tpl/no-items.php');
|
56 |
}
|
57 |
wp_original_referer_field(true, 'previous');
|
58 |
-
wp_nonce_field('
|
59 |
?>
|
60 |
</form>
|
61 |
<?php
|
55 |
include(dirname(__FILE__) . '/tpl/no-items.php');
|
56 |
}
|
57 |
wp_original_referer_field(true, 'previous');
|
58 |
+
wp_nonce_field('gmedia_terms', '_wpnonce_terms');
|
59 |
?>
|
60 |
</form>
|
61 |
<?php
|
admin/pages/terms/tpl/album-create-item.php
CHANGED
@@ -119,7 +119,7 @@ $gmedia_url = $gmProcessor->url;
|
|
119 |
<label> </label>
|
120 |
<?php
|
121 |
wp_original_referer_field(true, 'previous');
|
122 |
-
wp_nonce_field('
|
123 |
?>
|
124 |
<input type="hidden" name="term[taxonomy]" value="gmedia_album"/>
|
125 |
<button style="display:block" type="submit" class="btn btn-primary btn-sm" name="gmedia_album_save"><?php _e('Add New Album', 'grand-media'); ?></button>
|
119 |
<label> </label>
|
120 |
<?php
|
121 |
wp_original_referer_field(true, 'previous');
|
122 |
+
wp_nonce_field('gmedia_terms', '_wpnonce_terms');
|
123 |
?>
|
124 |
<input type="hidden" name="term[taxonomy]" value="gmedia_album"/>
|
125 |
<button style="display:block" type="submit" class="btn btn-primary btn-sm" name="gmedia_album_save"><?php _e('Add New Album', 'grand-media'); ?></button>
|
admin/pages/terms/tpl/album-edit-item.php
CHANGED
@@ -7,9 +7,9 @@ if(!defined('ABSPATH')){
|
|
7 |
/**
|
8 |
* Edit Album Form
|
9 |
*/
|
10 |
-
$_orderby =
|
11 |
-
$_order =
|
12 |
-
$_module_preset =
|
13 |
?>
|
14 |
<form method="post" id="gmedia-edit-term" name="gmEditTerm" class="panel-body" data-id="<?php echo $term->term_id; ?>" action="<?php echo gm_get_admin_url(); ?>">
|
15 |
<h4 style="margin-top:0;">
|
@@ -57,7 +57,7 @@ $_module_preset = isset($term->meta['_module_preset'][0])? $term->meta['_module_
|
|
57 |
</div>
|
58 |
<div class="text-right">
|
59 |
<?php
|
60 |
-
wp_nonce_field('
|
61 |
wp_referer_field();
|
62 |
?>
|
63 |
<input type="hidden" name="term[term_id]" value="<?php echo $term->term_id; ?>"/>
|
@@ -194,7 +194,7 @@ $_module_preset = isset($term->meta['_module_preset'][0])? $term->meta['_module_
|
|
194 |
<input type="hidden" name="status_global" value="0">
|
195 |
<input type="hidden" name="cookie_key" value="gmedia_library:frame">
|
196 |
<input type="hidden" name="assign_album"/>
|
197 |
-
<?php wp_nonce_field('gmedia_action'); ?>
|
198 |
</form>
|
199 |
|
200 |
<div class="modal fade gmedia-modal" id="newCustomFieldModal" tabindex="-1" role="dialog" aria-hidden="true">
|
@@ -207,7 +207,7 @@ $_module_preset = isset($term->meta['_module_preset'][0])? $term->meta['_module_
|
|
207 |
<form class="modal-body" method="post" id="newCustomFieldForm">
|
208 |
<?php
|
209 |
echo $gmCore->meta_form($meta_type = 'gmedia_term');
|
210 |
-
wp_nonce_field('gmedia_custom_field', '
|
211 |
wp_referer_field();
|
212 |
?>
|
213 |
<input type="hidden" name="action" value="gmedia_term_add_custom_field"/>
|
7 |
/**
|
8 |
* Edit Album Form
|
9 |
*/
|
10 |
+
$_orderby = !empty($term->meta['_orderby'][0])? $term->meta['_orderby'][0] : $gmGallery->options['in_album_orderby'];
|
11 |
+
$_order = !empty($term->meta['_order'][0])? $term->meta['_order'][0] : $gmGallery->options['in_album_order'];
|
12 |
+
$_module_preset = !empty($term->meta['_module_preset'][0])? $term->meta['_module_preset'][0] : '';
|
13 |
?>
|
14 |
<form method="post" id="gmedia-edit-term" name="gmEditTerm" class="panel-body" data-id="<?php echo $term->term_id; ?>" action="<?php echo gm_get_admin_url(); ?>">
|
15 |
<h4 style="margin-top:0;">
|
57 |
</div>
|
58 |
<div class="text-right">
|
59 |
<?php
|
60 |
+
wp_nonce_field('gmedia_terms', '_wpnonce_terms');
|
61 |
wp_referer_field();
|
62 |
?>
|
63 |
<input type="hidden" name="term[term_id]" value="<?php echo $term->term_id; ?>"/>
|
194 |
<input type="hidden" name="status_global" value="0">
|
195 |
<input type="hidden" name="cookie_key" value="gmedia_library:frame">
|
196 |
<input type="hidden" name="assign_album"/>
|
197 |
+
<?php wp_nonce_field('gmedia_action', '_wpnonce_action'); ?>
|
198 |
</form>
|
199 |
|
200 |
<div class="modal fade gmedia-modal" id="newCustomFieldModal" tabindex="-1" role="dialog" aria-hidden="true">
|
207 |
<form class="modal-body" method="post" id="newCustomFieldForm">
|
208 |
<?php
|
209 |
echo $gmCore->meta_form($meta_type = 'gmedia_term');
|
210 |
+
wp_nonce_field('gmedia_custom_field', '_wpnonce_custom_field');
|
211 |
wp_referer_field();
|
212 |
?>
|
213 |
<input type="hidden" name="action" value="gmedia_term_add_custom_field"/>
|
admin/pages/terms/tpl/category-create-item.php
CHANGED
@@ -102,7 +102,7 @@ $_order = $gmGallery->options['in_category_order'];
|
|
102 |
<label> </label>
|
103 |
<?php
|
104 |
wp_original_referer_field(true, 'previous');
|
105 |
-
wp_nonce_field('
|
106 |
?>
|
107 |
<input type="hidden" name="term[taxonomy]" value="gmedia_category"/>
|
108 |
<button style="display:block" type="submit" class="btn btn-primary btn-sm" name="gmedia_category_save"><?php _e('Add New Category', 'grand-media'); ?></button>
|
102 |
<label> </label>
|
103 |
<?php
|
104 |
wp_original_referer_field(true, 'previous');
|
105 |
+
wp_nonce_field('gmedia_terms', '_wpnonce_terms');
|
106 |
?>
|
107 |
<input type="hidden" name="term[taxonomy]" value="gmedia_category"/>
|
108 |
<button style="display:block" type="submit" class="btn btn-primary btn-sm" name="gmedia_category_save"><?php _e('Add New Category', 'grand-media'); ?></button>
|
admin/pages/terms/tpl/category-edit-item.php
CHANGED
@@ -6,9 +6,9 @@ if(!defined('ABSPATH')){
|
|
6 |
/**
|
7 |
* Edit Category Form
|
8 |
*/
|
9 |
-
$_orderby =
|
10 |
-
$_order =
|
11 |
-
$_module_preset =
|
12 |
?>
|
13 |
<form method="post" id="gmedia-edit-term" name="gmEditTerm" class="panel-body" data-id="<?php echo $term->term_id; ?>" action="<?php echo gm_get_admin_url(); ?>">
|
14 |
<h4 style="margin-top:0;">
|
@@ -38,7 +38,7 @@ $_module_preset = isset($term->meta['_module_preset'][0])? $term->meta['_module_
|
|
38 |
</div>
|
39 |
<div class="text-right">
|
40 |
<?php
|
41 |
-
wp_nonce_field('
|
42 |
wp_referer_field();
|
43 |
?>
|
44 |
<input type="hidden" name="term[term_id]" value="<?php echo $term->term_id; ?>"/>
|
@@ -145,7 +145,7 @@ $_module_preset = isset($term->meta['_module_preset'][0])? $term->meta['_module_
|
|
145 |
<input type="hidden" name="cat_names" value="<?php esc_attr_e($term->name); ?>">
|
146 |
<input type="hidden" name="cookie_key" value="gmedia_library:frame">
|
147 |
<input type="hidden" name="assign_category"/>
|
148 |
-
<?php wp_nonce_field('gmedia_action'); ?>
|
149 |
</form>
|
150 |
|
151 |
<div class="modal fade gmedia-modal" id="newCustomFieldModal" tabindex="-1" role="dialog" aria-hidden="true">
|
@@ -158,7 +158,7 @@ $_module_preset = isset($term->meta['_module_preset'][0])? $term->meta['_module_
|
|
158 |
<form class="modal-body" method="post" id="newCustomFieldForm">
|
159 |
<?php
|
160 |
echo $gmCore->meta_form($meta_type = 'gmedia_term');
|
161 |
-
wp_nonce_field('gmedia_custom_field', '
|
162 |
wp_referer_field();
|
163 |
?>
|
164 |
<input type="hidden" name="action" value="gmedia_term_add_custom_field"/>
|
6 |
/**
|
7 |
* Edit Category Form
|
8 |
*/
|
9 |
+
$_orderby = !empty($term->meta['_orderby'][0])? $term->meta['_orderby'][0] : $gmGallery->options['in_category_orderby'];
|
10 |
+
$_order = !empty($term->meta['_order'][0])? $term->meta['_order'][0] : $gmGallery->options['in_category_order'];
|
11 |
+
$_module_preset = !empty($term->meta['_module_preset'][0])? $term->meta['_module_preset'][0] : '';
|
12 |
?>
|
13 |
<form method="post" id="gmedia-edit-term" name="gmEditTerm" class="panel-body" data-id="<?php echo $term->term_id; ?>" action="<?php echo gm_get_admin_url(); ?>">
|
14 |
<h4 style="margin-top:0;">
|
38 |
</div>
|
39 |
<div class="text-right">
|
40 |
<?php
|
41 |
+
wp_nonce_field('gmedia_terms', '_wpnonce_terms');
|
42 |
wp_referer_field();
|
43 |
?>
|
44 |
<input type="hidden" name="term[term_id]" value="<?php echo $term->term_id; ?>"/>
|
145 |
<input type="hidden" name="cat_names" value="<?php esc_attr_e($term->name); ?>">
|
146 |
<input type="hidden" name="cookie_key" value="gmedia_library:frame">
|
147 |
<input type="hidden" name="assign_category"/>
|
148 |
+
<?php wp_nonce_field('gmedia_action', '_wpnonce_action'); ?>
|
149 |
</form>
|
150 |
|
151 |
<div class="modal fade gmedia-modal" id="newCustomFieldModal" tabindex="-1" role="dialog" aria-hidden="true">
|
158 |
<form class="modal-body" method="post" id="newCustomFieldForm">
|
159 |
<?php
|
160 |
echo $gmCore->meta_form($meta_type = 'gmedia_term');
|
161 |
+
wp_nonce_field('gmedia_custom_field', '_wpnonce_custom_field');
|
162 |
wp_referer_field();
|
163 |
?>
|
164 |
<input type="hidden" name="action" value="gmedia_term_add_custom_field"/>
|
admin/pages/terms/tpl/tag-create-item.php
CHANGED
@@ -21,7 +21,7 @@ $gmedia_url = $gmProcessor->url;
|
|
21 |
<div class="col-xs-3" style="padding-top:24px;">
|
22 |
<?php
|
23 |
wp_original_referer_field(true, 'previous');
|
24 |
-
wp_nonce_field('
|
25 |
?>
|
26 |
<input type="hidden" name="term[taxonomy]" value="gmedia_tag"/>
|
27 |
<button type="submit" class="btn btn-primary btn-sm" name="gmedia_tag_add"><?php _e('Add New Tags', 'grand-media'); ?></button>
|
21 |
<div class="col-xs-3" style="padding-top:24px;">
|
22 |
<?php
|
23 |
wp_original_referer_field(true, 'previous');
|
24 |
+
wp_nonce_field('gmedia_terms', '_wpnonce_terms');
|
25 |
?>
|
26 |
<input type="hidden" name="term[taxonomy]" value="gmedia_tag"/>
|
27 |
<button type="submit" class="btn btn-primary btn-sm" name="gmedia_tag_add"><?php _e('Add New Tags', 'grand-media'); ?></button>
|
admin/pages/terms/tpl/term-panel-heading.php
CHANGED
@@ -36,7 +36,7 @@ $referer = remove_query_arg(array('edit_term'), $refurl);
|
|
36 |
|
37 |
echo '<li' . ($term->allow_delete? '' : ' class="disabled"') . '><a href="' . wp_nonce_url(gm_get_admin_url(array('do_gmedia_terms' => 'delete',
|
38 |
'ids' => $term->term_id
|
39 |
-
), array('edit_term'), $gmProcessor->url), 'gmedia_delete') . '" data-confirm="' . __("You are about to permanently delete the selected items.\n\r'Cancel' to stop, 'OK' to delete.", "grand-media") . '">' . __('Delete', 'grand-media') . '</a></li>';
|
40 |
?>
|
41 |
</ul>
|
42 |
</div>
|
36 |
|
37 |
echo '<li' . ($term->allow_delete? '' : ' class="disabled"') . '><a href="' . wp_nonce_url(gm_get_admin_url(array('do_gmedia_terms' => 'delete',
|
38 |
'ids' => $term->term_id
|
39 |
+
), array('edit_term'), $gmProcessor->url), 'gmedia_delete', '_wpnonce_delete') . '" data-confirm="' . __("You are about to permanently delete the selected items.\n\r'Cancel' to stop, 'OK' to delete.", "grand-media") . '">' . __('Delete', 'grand-media') . '</a></li>';
|
40 |
?>
|
41 |
</ul>
|
42 |
</div>
|
admin/pages/terms/tpl/terms-panel-heading.php
CHANGED
@@ -58,7 +58,7 @@ if(!defined('ABSPATH')){
|
|
58 |
<li class="<?php echo $rel_selected_show . (gm_user_can('terms_delete')? '' : ' disabled'); ?>">
|
59 |
<a href="<?php echo wp_nonce_url($gmCore->get_admin_url(array('do_gmedia_terms' => 'delete',
|
60 |
'ids' => 'selected'
|
61 |
-
), array('filter')), 'gmedia_delete') ?>" class="gmedia-delete" data-confirm="<?php _e("You are about to permanently delete the selected items.\n\r'Cancel' to stop, 'OK' to delete.", "grand-media"); ?>"><?php _e('Delete Selected Items', 'grand-media'); ?></a>
|
62 |
</li>
|
63 |
<?php do_action('gmedia_terms_action_list'); ?>
|
64 |
</ul>
|
58 |
<li class="<?php echo $rel_selected_show . (gm_user_can('terms_delete')? '' : ' disabled'); ?>">
|
59 |
<a href="<?php echo wp_nonce_url($gmCore->get_admin_url(array('do_gmedia_terms' => 'delete',
|
60 |
'ids' => 'selected'
|
61 |
+
), array('filter')), 'gmedia_delete', '_wpnonce_delete') ?>" class="gmedia-delete" data-confirm="<?php _e("You are about to permanently delete the selected items.\n\r'Cancel' to stop, 'OK' to delete.", "grand-media"); ?>"><?php _e('Delete Selected Items', 'grand-media'); ?></a>
|
62 |
</li>
|
63 |
<?php do_action('gmedia_terms_action_list'); ?>
|
64 |
</ul>
|
admin/processor/class.processor.galleries.php
CHANGED
@@ -15,8 +15,6 @@ class GmediaProcessor_Galleries extends GmediaProcessor{
|
|
15 |
* GmediaProcessor_Library constructor.
|
16 |
*/
|
17 |
public function __construct(){
|
18 |
-
global $user_ID;
|
19 |
-
|
20 |
$this->taxonomy = 'gmedia_gallery';
|
21 |
self::$cookie_key = 'gmedia_terms:gallery';
|
22 |
$this->selected_items = parent::selected_items(self::$cookie_key);
|
@@ -85,6 +83,32 @@ class GmediaProcessor_Galleries extends GmediaProcessor{
|
|
85 |
wp_redirect($location);
|
86 |
exit;
|
87 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
if(isset($_POST['gmedia_gallery_save'])){
|
89 |
check_admin_referer('GmediaGallery');
|
90 |
|
@@ -115,7 +139,7 @@ class GmediaProcessor_Galleries extends GmediaProcessor{
|
|
115 |
}
|
116 |
$taxonomy = 'gmedia_gallery';
|
117 |
if($edit_gallery && !$gmDB->term_exists($edit_gallery)){
|
118 |
-
$this->error[] = __('A term with the id provided
|
119 |
$edit_gallery = false;
|
120 |
}
|
121 |
if(($term_id = $gmDB->term_exists($term['name'], $taxonomy, $term['global']))){
|
@@ -140,7 +164,7 @@ class GmediaProcessor_Galleries extends GmediaProcessor{
|
|
140 |
$module_settings = $gmCore->_post('module', array());
|
141 |
$module_path = $gmCore->get_module_path($term['module']);
|
142 |
$default_options = array();
|
143 |
-
if(
|
144 |
/** @noinspection PhpIncludeInspection */
|
145 |
include($module_path['path'] . '/settings.php');
|
146 |
} else{
|
@@ -158,7 +182,7 @@ class GmediaProcessor_Galleries extends GmediaProcessor{
|
|
158 |
$gmDB->update_metadata('gmedia_term', $term_id, $key, $value);
|
159 |
}
|
160 |
if($edit_gallery){
|
161 |
-
$this->msg[] = sprintf(__('Gallery #%d
|
162 |
} else{
|
163 |
$location = add_query_arg(array('edit_term' => $term_id, 'message' => 'save'), $this->url);
|
164 |
set_transient('gmedia_new_gallery_id', $term_id, 60);
|
@@ -171,7 +195,7 @@ class GmediaProcessor_Galleries extends GmediaProcessor{
|
|
171 |
$gmedia_new_gallery_id = get_transient('gmedia_new_gallery_id');
|
172 |
if(false !== $gmedia_new_gallery_id){
|
173 |
delete_transient('gmedia_new_gallery_id');
|
174 |
-
$this->msg[] = sprintf(__('Gallery #%d
|
175 |
}
|
176 |
}
|
177 |
|
@@ -186,7 +210,7 @@ class GmediaProcessor_Galleries extends GmediaProcessor{
|
|
186 |
$edit_gallery = (int)$gmCore->_get('edit_term');
|
187 |
do{
|
188 |
if(!$gmDB->term_exists($edit_gallery)){
|
189 |
-
$this->error[] = __('A term with the id provided
|
190 |
break;
|
191 |
}
|
192 |
if(!$gmCore->caps['gmedia_edit_others_media']){
|
@@ -203,7 +227,7 @@ class GmediaProcessor_Galleries extends GmediaProcessor{
|
|
203 |
/**
|
204 |
* @var $default_options
|
205 |
*/
|
206 |
-
if(
|
207 |
/** @noinspection PhpIncludeInspection */
|
208 |
include($module_path['path'] . '/settings.php');
|
209 |
$preset = $gmDB->get_term('[' . $gallery_module . ']', array('taxonomy' => 'gmedia_module', 'global' => '0'));
|
@@ -244,7 +268,7 @@ class GmediaProcessor_Galleries extends GmediaProcessor{
|
|
244 |
$module_settings = $gmCore->_post('module', array());
|
245 |
$module_path = $gmCore->get_module_path($term['module']);
|
246 |
$default_options = array();
|
247 |
-
if(
|
248 |
/** @noinspection PhpIncludeInspection */
|
249 |
include($module_path['path'] . '/settings.php');
|
250 |
} else{
|
@@ -282,7 +306,7 @@ class GmediaProcessor_Galleries extends GmediaProcessor{
|
|
282 |
$this->error[] = $term_id->get_error_message();
|
283 |
break;
|
284 |
} else{
|
285 |
-
$this->msg[] = sprintf(__('Preset `%s`
|
286 |
}
|
287 |
|
288 |
} while(0);
|
@@ -290,7 +314,7 @@ class GmediaProcessor_Galleries extends GmediaProcessor{
|
|
290 |
|
291 |
$do_gmedia_terms = $gmCore->_get('do_gmedia_terms');
|
292 |
if('delete' == $do_gmedia_terms){
|
293 |
-
check_admin_referer('gmedia_delete');
|
294 |
$taxonomy = 'gmedia_gallery';
|
295 |
$ids = $gmCore->_get('ids', 'selected');
|
296 |
$selected_items = ('selected' == $ids)? $this->selected_items : wp_parse_id_list($ids);
|
@@ -313,7 +337,7 @@ class GmediaProcessor_Galleries extends GmediaProcessor{
|
|
313 |
}
|
314 |
}
|
315 |
if($count){
|
316 |
-
$this->msg[] = sprintf(__('%d item(s) deleted
|
317 |
}
|
318 |
setcookie(self::$cookie_key, '', time() - 3600);
|
319 |
unset($_COOKIE[ self::$cookie_key ]);
|
@@ -327,7 +351,14 @@ class GmediaProcessor_Galleries extends GmediaProcessor{
|
|
327 |
}
|
328 |
}
|
329 |
if($do_gmedia_terms){
|
330 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
$location = add_query_arg('did_gmedia_terms', $do_gmedia_terms, $location);
|
332 |
wp_redirect($location);
|
333 |
exit;
|
15 |
* GmediaProcessor_Library constructor.
|
16 |
*/
|
17 |
public function __construct(){
|
|
|
|
|
18 |
$this->taxonomy = 'gmedia_gallery';
|
19 |
self::$cookie_key = 'gmedia_terms:gallery';
|
20 |
$this->selected_items = parent::selected_items(self::$cookie_key);
|
83 |
wp_redirect($location);
|
84 |
exit;
|
85 |
}
|
86 |
+
if(isset($_POST['gmedia_gallery_module']) && '' !== $_POST['gmedia_gallery_module']){
|
87 |
+
check_admin_referer('gmedia_gallery_module', '_wpnonce_gallery_module');
|
88 |
+
$taxonomy = 'gmedia_gallery';
|
89 |
+
$ids = $gmCore->_get('ids', 'selected');
|
90 |
+
$selected_items = ('selected' == $ids)? $this->selected_items : wp_parse_id_list($ids);
|
91 |
+
if(!$gmCore->caps['gmedia_delete_others_media']){
|
92 |
+
$_selected_items = $gmDB->get_terms($taxonomy, array('fields' => 'ids', 'global' => $user_ID, 'include' => $selected_items));
|
93 |
+
if(count($_selected_items) < count($selected_items)){
|
94 |
+
$this->error[] = __('You are not allowed to delete others media', 'grand-media');
|
95 |
+
}
|
96 |
+
$selected_items = $_selected_items;
|
97 |
+
}
|
98 |
+
if(($count = count($selected_items))){
|
99 |
+
$preset = $gmCore->getModulePreset($_POST['gmedia_gallery_module']);
|
100 |
+
$gallery_meta = array('_edited' => gmdate('Y-m-d H:i:s'),
|
101 |
+
'_module' => $preset['module'],
|
102 |
+
'_settings' => $preset['settings']
|
103 |
+
);
|
104 |
+
foreach($selected_items as $term_id){
|
105 |
+
foreach($gallery_meta as $key => $value){
|
106 |
+
$gmDB->update_metadata('gmedia_term', $term_id, $key, $value);
|
107 |
+
}
|
108 |
+
}
|
109 |
+
$this->msg[] = sprintf(__('Preset "%s" of module "%s" was applied to %d galleries', 'grand-media'), $preset['name'], $preset['module'], $count);
|
110 |
+
}
|
111 |
+
}
|
112 |
if(isset($_POST['gmedia_gallery_save'])){
|
113 |
check_admin_referer('GmediaGallery');
|
114 |
|
139 |
}
|
140 |
$taxonomy = 'gmedia_gallery';
|
141 |
if($edit_gallery && !$gmDB->term_exists($edit_gallery)){
|
142 |
+
$this->error[] = __('A term with the id provided does not exists', 'grand-media');
|
143 |
$edit_gallery = false;
|
144 |
}
|
145 |
if(($term_id = $gmDB->term_exists($term['name'], $taxonomy, $term['global']))){
|
164 |
$module_settings = $gmCore->_post('module', array());
|
165 |
$module_path = $gmCore->get_module_path($term['module']);
|
166 |
$default_options = array();
|
167 |
+
if(is_file($module_path['path'] . '/settings.php')){
|
168 |
/** @noinspection PhpIncludeInspection */
|
169 |
include($module_path['path'] . '/settings.php');
|
170 |
} else{
|
182 |
$gmDB->update_metadata('gmedia_term', $term_id, $key, $value);
|
183 |
}
|
184 |
if($edit_gallery){
|
185 |
+
$this->msg[] = sprintf(__('Gallery #%d successfully saved', 'grand-media'), $term_id);
|
186 |
} else{
|
187 |
$location = add_query_arg(array('edit_term' => $term_id, 'message' => 'save'), $this->url);
|
188 |
set_transient('gmedia_new_gallery_id', $term_id, 60);
|
195 |
$gmedia_new_gallery_id = get_transient('gmedia_new_gallery_id');
|
196 |
if(false !== $gmedia_new_gallery_id){
|
197 |
delete_transient('gmedia_new_gallery_id');
|
198 |
+
$this->msg[] = sprintf(__('Gallery #%d successfully saved', 'grand-media'), $term_id);
|
199 |
}
|
200 |
}
|
201 |
|
210 |
$edit_gallery = (int)$gmCore->_get('edit_term');
|
211 |
do{
|
212 |
if(!$gmDB->term_exists($edit_gallery)){
|
213 |
+
$this->error[] = __('A term with the id provided does not exists', 'grand-media');
|
214 |
break;
|
215 |
}
|
216 |
if(!$gmCore->caps['gmedia_edit_others_media']){
|
227 |
/**
|
228 |
* @var $default_options
|
229 |
*/
|
230 |
+
if(is_file($module_path['path'] . '/settings.php')){
|
231 |
/** @noinspection PhpIncludeInspection */
|
232 |
include($module_path['path'] . '/settings.php');
|
233 |
$preset = $gmDB->get_term('[' . $gallery_module . ']', array('taxonomy' => 'gmedia_module', 'global' => '0'));
|
268 |
$module_settings = $gmCore->_post('module', array());
|
269 |
$module_path = $gmCore->get_module_path($term['module']);
|
270 |
$default_options = array();
|
271 |
+
if(is_file($module_path['path'] . '/settings.php')){
|
272 |
/** @noinspection PhpIncludeInspection */
|
273 |
include($module_path['path'] . '/settings.php');
|
274 |
} else{
|
306 |
$this->error[] = $term_id->get_error_message();
|
307 |
break;
|
308 |
} else{
|
309 |
+
$this->msg[] = sprintf(__('Preset `%s` successfully saved', 'grand-media'), $preset_name);
|
310 |
}
|
311 |
|
312 |
} while(0);
|
314 |
|
315 |
$do_gmedia_terms = $gmCore->_get('do_gmedia_terms');
|
316 |
if('delete' == $do_gmedia_terms){
|
317 |
+
check_admin_referer('gmedia_delete', '_wpnonce_delete');
|
318 |
$taxonomy = 'gmedia_gallery';
|
319 |
$ids = $gmCore->_get('ids', 'selected');
|
320 |
$selected_items = ('selected' == $ids)? $this->selected_items : wp_parse_id_list($ids);
|
337 |
}
|
338 |
}
|
339 |
if($count){
|
340 |
+
$this->msg[] = sprintf(__('%d item(s) deleted successfully', 'grand-media'), $count);
|
341 |
}
|
342 |
setcookie(self::$cookie_key, '', time() - 3600);
|
343 |
unset($_COOKIE[ self::$cookie_key ]);
|
351 |
}
|
352 |
}
|
353 |
if($do_gmedia_terms){
|
354 |
+
$_wpnonce = array();
|
355 |
+
foreach ($_GET as $key => $value) {
|
356 |
+
if (strpos($key, '_wpnonce') !== false) {
|
357 |
+
$_wpnonce[$key] = $value;
|
358 |
+
}
|
359 |
+
}
|
360 |
+
$remove_args = array_merge(array('do_gmedia_terms', 'ids'), $_wpnonce);
|
361 |
+
$location = remove_query_arg($remove_args);
|
362 |
$location = add_query_arg('did_gmedia_terms', $do_gmedia_terms, $location);
|
363 |
wp_redirect($location);
|
364 |
exit;
|
admin/processor/class.processor.library.php
CHANGED
@@ -302,7 +302,7 @@ class GmediaProcessor_Library extends GmediaProcessor{
|
|
302 |
|
303 |
|
304 |
if(isset($_POST['quick_gallery'])){
|
305 |
-
check_admin_referer('gmedia_action');
|
306 |
do{
|
307 |
if(!$gmCore->caps['gmedia_gallery_manage']){
|
308 |
$this->error[] = __('You are not allowed to manage galleries', 'grand-media');
|
@@ -343,7 +343,7 @@ class GmediaProcessor_Library extends GmediaProcessor{
|
|
343 |
foreach($gallery_meta as $key => $value){
|
344 |
$gmDB->update_metadata('gmedia_term', $term_id, $key, $value);
|
345 |
}
|
346 |
-
$this->msg[] = sprintf(__('Gallery "%s"
|
347 |
} while(0);
|
348 |
}
|
349 |
|
@@ -378,7 +378,7 @@ class GmediaProcessor_Library extends GmediaProcessor{
|
|
378 |
$do_gmedia = $gmCore->_get('do_gmedia');
|
379 |
if(!empty($this->selected_items) || isset($_POST['cookie_key'])){
|
380 |
if(isset($_POST['assign_album'])){
|
381 |
-
check_admin_referer('gmedia_action');
|
382 |
if($gmCore->caps['gmedia_terms']){
|
383 |
$cookie_key = $gmCore->_post('cookie_key', self::$cookie_key);
|
384 |
$ids = $this->selected_items($cookie_key);
|
@@ -439,7 +439,7 @@ class GmediaProcessor_Library extends GmediaProcessor{
|
|
439 |
}
|
440 |
}
|
441 |
if(isset($_POST['assign_category'])){
|
442 |
-
check_admin_referer('gmedia_action');
|
443 |
if($gmCore->caps['gmedia_terms']){
|
444 |
$cookie_key = $gmCore->_post('cookie_key', self::$cookie_key);
|
445 |
$ids = $this->selected_items($cookie_key);
|
@@ -474,7 +474,7 @@ class GmediaProcessor_Library extends GmediaProcessor{
|
|
474 |
}
|
475 |
}
|
476 |
if(isset($_POST['unassign_category'])){
|
477 |
-
check_admin_referer('gmedia_action');
|
478 |
if(($term = $gmCore->_post('category_id')) && $gmCore->caps['gmedia_terms']){
|
479 |
$cookie_key = $gmCore->_post('cookie_key', self::$cookie_key);
|
480 |
$ids = $this->selected_items($cookie_key);
|
@@ -507,7 +507,7 @@ class GmediaProcessor_Library extends GmediaProcessor{
|
|
507 |
}
|
508 |
}
|
509 |
if(isset($_POST['add_tags'])){
|
510 |
-
check_admin_referer('gmedia_action');
|
511 |
if(!$gmCore->caps['gmedia_terms']){
|
512 |
$this->error[] = __('You are not allowed to assign terms', 'grand-media');
|
513 |
} else{
|
@@ -553,7 +553,7 @@ class GmediaProcessor_Library extends GmediaProcessor{
|
|
553 |
}
|
554 |
}
|
555 |
if(isset($_POST['delete_tags'])){
|
556 |
-
check_admin_referer('gmedia_action');
|
557 |
if(($term = $gmCore->_post('tag_id')) && $gmCore->caps['gmedia_terms']){
|
558 |
$cookie_key = $gmCore->_post('cookie_key', self::$cookie_key);
|
559 |
$ids = $this->selected_items($cookie_key);
|
@@ -586,7 +586,7 @@ class GmediaProcessor_Library extends GmediaProcessor{
|
|
586 |
}
|
587 |
}
|
588 |
if(isset($_POST['batch_edit'])){
|
589 |
-
check_admin_referer('gmedia_action');
|
590 |
if($gmCore->caps['gmedia_edit_media']){
|
591 |
$cookie_key = $gmCore->_post('cookie_key', self::$cookie_key);
|
592 |
$ids = $this->selected_items($cookie_key);
|
@@ -620,6 +620,9 @@ class GmediaProcessor_Library extends GmediaProcessor{
|
|
620 |
foreach($selected_items as $item){
|
621 |
$id = (int)$item;
|
622 |
$gmedia = $gmDB->get_gmedia($id, ARRAY_A);
|
|
|
|
|
|
|
623 |
$item_author = (int)$gmedia['author'];
|
624 |
|
625 |
if('custom' == $b_filename && ($gmCore->caps['gmedia_delete_others_media'] || ($item_author == $user_ID))){
|
@@ -648,7 +651,9 @@ class GmediaProcessor_Library extends GmediaProcessor{
|
|
648 |
require_once(ABSPATH . 'wp-admin/includes/image.php');
|
649 |
|
650 |
if(file_is_displayable_image($fileinfo['dirpath'] . '/' . $gmedia['gmuid'])){
|
651 |
-
|
|
|
|
|
652 |
@rename($fileinfo['dirpath_thumb'] . '/' . $gmedia['gmuid'], $fileinfo['filepath_thumb']);
|
653 |
}
|
654 |
}
|
@@ -668,7 +673,7 @@ class GmediaProcessor_Library extends GmediaProcessor{
|
|
668 |
$title = pathinfo($gmedia['gmuid'], PATHINFO_FILENAME);
|
669 |
$batch_data['title'] = str_replace('_', ' ', $title);
|
670 |
if($gmGallery->options['name2title_capitalize']){
|
671 |
-
$batch_data['title'] =
|
672 |
}
|
673 |
break;
|
674 |
case 'custom':
|
@@ -709,7 +714,8 @@ class GmediaProcessor_Library extends GmediaProcessor{
|
|
709 |
break;
|
710 |
case 'self':
|
711 |
$fileinfo = $gmCore->fileinfo($gmedia['gmuid'], false);
|
712 |
-
$
|
|
|
713 |
break;
|
714 |
case 'custom':
|
715 |
$link_custom = $gmCore->_post('batch_link_custom');
|
@@ -728,7 +734,7 @@ class GmediaProcessor_Library extends GmediaProcessor{
|
|
728 |
|
729 |
$i ++;
|
730 |
}
|
731 |
-
$this->msg[] = sprintf(__('%d item(s) updated
|
732 |
|
733 |
$this->clear_selected_items($cookie_key);
|
734 |
$this->selected_items = $this->selected_items(self::$cookie_key);
|
@@ -740,7 +746,7 @@ class GmediaProcessor_Library extends GmediaProcessor{
|
|
740 |
|
741 |
if($do_gmedia){
|
742 |
if('unassign_album' == $do_gmedia){
|
743 |
-
check_admin_referer('gmedia_action');
|
744 |
if($gmCore->caps['gmedia_terms']){
|
745 |
$cookie_key = $gmCore->_post('cookie_key', self::$cookie_key);
|
746 |
$ids = $this->selected_items($cookie_key);
|
@@ -768,7 +774,7 @@ class GmediaProcessor_Library extends GmediaProcessor{
|
|
768 |
}
|
769 |
}
|
770 |
if('update_meta' == $do_gmedia){
|
771 |
-
check_admin_referer('gmedia_action');
|
772 |
if($gmCore->caps['gmedia_edit_media']){
|
773 |
$cookie_key = $gmCore->_post('cookie_key', self::$cookie_key);
|
774 |
$selected_items = $this->selected_items($cookie_key);
|
@@ -785,7 +791,7 @@ class GmediaProcessor_Library extends GmediaProcessor{
|
|
785 |
$gmDB->update_metadata($meta_type = 'gmedia', $id, $meta_key = '_gps', $media_metadata['image_meta']['GPS']);
|
786 |
}
|
787 |
}
|
788 |
-
$this->msg[] = sprintf(__('%d item(s) updated
|
789 |
set_transient('gmedia_action_msg', $this->msg, 30);
|
790 |
}
|
791 |
$this->clear_selected_items($cookie_key);
|
@@ -796,7 +802,7 @@ class GmediaProcessor_Library extends GmediaProcessor{
|
|
796 |
}
|
797 |
}
|
798 |
if('recreate' == $do_gmedia){
|
799 |
-
check_admin_referer('gmedia_action');
|
800 |
if($gmCore->caps['gmedia_edit_media']){
|
801 |
$cookie_key = $gmCore->_post('cookie_key', self::$cookie_key);
|
802 |
$selected_items = $this->selected_items($cookie_key);
|
@@ -828,7 +834,7 @@ class GmediaProcessor_Library extends GmediaProcessor{
|
|
828 |
}
|
829 |
}
|
830 |
if('duplicate' == $do_gmedia){
|
831 |
-
check_admin_referer('gmedia_action');
|
832 |
if($gmCore->caps['gmedia_upload'] || $gmCore->caps['gmedia_import']){
|
833 |
$ids = $gmCore->_get('ids', 'selected');
|
834 |
$cookie_key = $gmCore->_post('cookie_key', self::$cookie_key);
|
@@ -838,7 +844,7 @@ class GmediaProcessor_Library extends GmediaProcessor{
|
|
838 |
foreach($selected_items as $gmid){
|
839 |
$gmCore->duplicate_gmedia($gmid);
|
840 |
}
|
841 |
-
$this->msg[] = sprintf(__('%d item duplicated
|
842 |
set_transient('gmedia_action_msg', $this->msg, 30);
|
843 |
}
|
844 |
}
|
@@ -849,7 +855,7 @@ class GmediaProcessor_Library extends GmediaProcessor{
|
|
849 |
}
|
850 |
|
851 |
if('delete' == $do_gmedia || 'delete__save_original' == $do_gmedia){
|
852 |
-
check_admin_referer('gmedia_delete');
|
853 |
if($gmCore->caps['gmedia_delete_media']){
|
854 |
$ids = $gmCore->_get('ids', 'selected');
|
855 |
$cookie_key = $gmCore->_post('cookie_key', self::$cookie_key);
|
@@ -872,9 +878,9 @@ class GmediaProcessor_Library extends GmediaProcessor{
|
|
872 |
}
|
873 |
if($count){
|
874 |
if($delete_original_file){
|
875 |
-
$this->msg[] = sprintf(__('%d item(s) deleted
|
876 |
} else{
|
877 |
-
$this->msg[] = sprintf(__('%d record(s) deleted from database
|
878 |
}
|
879 |
}
|
880 |
$this->selected_items = array_diff($this->selected_items, $selected_items);
|
@@ -917,7 +923,14 @@ class GmediaProcessor_Library extends GmediaProcessor{
|
|
917 |
}
|
918 |
}
|
919 |
if($do_gmedia){
|
920 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
921 |
$location = add_query_arg('did_gmedia', $do_gmedia, $location);
|
922 |
wp_redirect($location);
|
923 |
exit;
|
302 |
|
303 |
|
304 |
if(isset($_POST['quick_gallery'])){
|
305 |
+
check_admin_referer('gmedia_action', '_wpnonce_action');
|
306 |
do{
|
307 |
if(!$gmCore->caps['gmedia_gallery_manage']){
|
308 |
$this->error[] = __('You are not allowed to manage galleries', 'grand-media');
|
343 |
foreach($gallery_meta as $key => $value){
|
344 |
$gmDB->update_metadata('gmedia_term', $term_id, $key, $value);
|
345 |
}
|
346 |
+
$this->msg[] = sprintf(__('Gallery "%s" successfully saved. Shortcode: [gmedia id=%d]', 'grand-media'), esc_attr($gallery['name']), $term_id);
|
347 |
} while(0);
|
348 |
}
|
349 |
|
378 |
$do_gmedia = $gmCore->_get('do_gmedia');
|
379 |
if(!empty($this->selected_items) || isset($_POST['cookie_key'])){
|
380 |
if(isset($_POST['assign_album'])){
|
381 |
+
check_admin_referer('gmedia_action', '_wpnonce_action');
|
382 |
if($gmCore->caps['gmedia_terms']){
|
383 |
$cookie_key = $gmCore->_post('cookie_key', self::$cookie_key);
|
384 |
$ids = $this->selected_items($cookie_key);
|
439 |
}
|
440 |
}
|
441 |
if(isset($_POST['assign_category'])){
|
442 |
+
check_admin_referer('gmedia_action', '_wpnonce_action');
|
443 |
if($gmCore->caps['gmedia_terms']){
|
444 |
$cookie_key = $gmCore->_post('cookie_key', self::$cookie_key);
|
445 |
$ids = $this->selected_items($cookie_key);
|
474 |
}
|
475 |
}
|
476 |
if(isset($_POST['unassign_category'])){
|
477 |
+
check_admin_referer('gmedia_action', '_wpnonce_action');
|
478 |
if(($term = $gmCore->_post('category_id')) && $gmCore->caps['gmedia_terms']){
|
479 |
$cookie_key = $gmCore->_post('cookie_key', self::$cookie_key);
|
480 |
$ids = $this->selected_items($cookie_key);
|
507 |
}
|
508 |
}
|
509 |
if(isset($_POST['add_tags'])){
|
510 |
+
check_admin_referer('gmedia_action', '_wpnonce_action');
|
511 |
if(!$gmCore->caps['gmedia_terms']){
|
512 |
$this->error[] = __('You are not allowed to assign terms', 'grand-media');
|
513 |
} else{
|
553 |
}
|
554 |
}
|
555 |
if(isset($_POST['delete_tags'])){
|
556 |
+
check_admin_referer('gmedia_action', '_wpnonce_action');
|
557 |
if(($term = $gmCore->_post('tag_id')) && $gmCore->caps['gmedia_terms']){
|
558 |
$cookie_key = $gmCore->_post('cookie_key', self::$cookie_key);
|
559 |
$ids = $this->selected_items($cookie_key);
|
586 |
}
|
587 |
}
|
588 |
if(isset($_POST['batch_edit'])){
|
589 |
+
check_admin_referer('gmedia_action', '_wpnonce_action');
|
590 |
if($gmCore->caps['gmedia_edit_media']){
|
591 |
$cookie_key = $gmCore->_post('cookie_key', self::$cookie_key);
|
592 |
$ids = $this->selected_items($cookie_key);
|
620 |
foreach($selected_items as $item){
|
621 |
$id = (int)$item;
|
622 |
$gmedia = $gmDB->get_gmedia($id, ARRAY_A);
|
623 |
+
if(!$gmedia){
|
624 |
+
continue;
|
625 |
+
}
|
626 |
$item_author = (int)$gmedia['author'];
|
627 |
|
628 |
if('custom' == $b_filename && ($gmCore->caps['gmedia_delete_others_media'] || ($item_author == $user_ID))){
|
651 |
require_once(ABSPATH . 'wp-admin/includes/image.php');
|
652 |
|
653 |
if(file_is_displayable_image($fileinfo['dirpath'] . '/' . $gmedia['gmuid'])){
|
654 |
+
if(is_file($fileinfo['dirpath_original'] . '/' . $gmedia['gmuid'])){
|
655 |
+
@rename($fileinfo['dirpath_original'] . '/' . $gmedia['gmuid'], $fileinfo['filepath_original']);
|
656 |
+
}
|
657 |
@rename($fileinfo['dirpath_thumb'] . '/' . $gmedia['gmuid'], $fileinfo['filepath_thumb']);
|
658 |
}
|
659 |
}
|
673 |
$title = pathinfo($gmedia['gmuid'], PATHINFO_FILENAME);
|
674 |
$batch_data['title'] = str_replace('_', ' ', $title);
|
675 |
if($gmGallery->options['name2title_capitalize']){
|
676 |
+
$batch_data['title'] = $gmCore->mb_ucwords_utf8($batch_data['title']);
|
677 |
}
|
678 |
break;
|
679 |
case 'custom':
|
714 |
break;
|
715 |
case 'self':
|
716 |
$fileinfo = $gmCore->fileinfo($gmedia['gmuid'], false);
|
717 |
+
$fileurl = is_file($fileinfo['filepath_original'])? $fileinfo['fileurl_original'] : $fileinfo['fileurl'];
|
718 |
+
$batch_data['link'] = $fileurl;
|
719 |
break;
|
720 |
case 'custom':
|
721 |
$link_custom = $gmCore->_post('batch_link_custom');
|
734 |
|
735 |
$i ++;
|
736 |
}
|
737 |
+
$this->msg[] = sprintf(__('%d item(s) updated successfully', 'grand-media'), $count);
|
738 |
|
739 |
$this->clear_selected_items($cookie_key);
|
740 |
$this->selected_items = $this->selected_items(self::$cookie_key);
|
746 |
|
747 |
if($do_gmedia){
|
748 |
if('unassign_album' == $do_gmedia){
|
749 |
+
check_admin_referer('gmedia_action', '_wpnonce_action');
|
750 |
if($gmCore->caps['gmedia_terms']){
|
751 |
$cookie_key = $gmCore->_post('cookie_key', self::$cookie_key);
|
752 |
$ids = $this->selected_items($cookie_key);
|
774 |
}
|
775 |
}
|
776 |
if('update_meta' == $do_gmedia){
|
777 |
+
check_admin_referer('gmedia_action', '_wpnonce_action');
|
778 |
if($gmCore->caps['gmedia_edit_media']){
|
779 |
$cookie_key = $gmCore->_post('cookie_key', self::$cookie_key);
|
780 |
$selected_items = $this->selected_items($cookie_key);
|
791 |
$gmDB->update_metadata($meta_type = 'gmedia', $id, $meta_key = '_gps', $media_metadata['image_meta']['GPS']);
|
792 |
}
|
793 |
}
|
794 |
+
$this->msg[] = sprintf(__('%d item(s) updated successfully', 'grand-media'), $count);
|
795 |
set_transient('gmedia_action_msg', $this->msg, 30);
|
796 |
}
|
797 |
$this->clear_selected_items($cookie_key);
|
802 |
}
|
803 |
}
|
804 |
if('recreate' == $do_gmedia){
|
805 |
+
check_admin_referer('gmedia_action', '_wpnonce_action');
|
806 |
if($gmCore->caps['gmedia_edit_media']){
|
807 |
$cookie_key = $gmCore->_post('cookie_key', self::$cookie_key);
|
808 |
$selected_items = $this->selected_items($cookie_key);
|
834 |
}
|
835 |
}
|
836 |
if('duplicate' == $do_gmedia){
|
837 |
+
check_admin_referer('gmedia_action', '_wpnonce_action');
|
838 |
if($gmCore->caps['gmedia_upload'] || $gmCore->caps['gmedia_import']){
|
839 |
$ids = $gmCore->_get('ids', 'selected');
|
840 |
$cookie_key = $gmCore->_post('cookie_key', self::$cookie_key);
|
844 |
foreach($selected_items as $gmid){
|
845 |
$gmCore->duplicate_gmedia($gmid);
|
846 |
}
|
847 |
+
$this->msg[] = sprintf(__('%d item was duplicated', 'grand-media'), $count);
|
848 |
set_transient('gmedia_action_msg', $this->msg, 30);
|
849 |
}
|
850 |
}
|
855 |
}
|
856 |
|
857 |
if('delete' == $do_gmedia || 'delete__save_original' == $do_gmedia){
|
858 |
+
check_admin_referer('gmedia_delete', '_wpnonce_delete');
|
859 |
if($gmCore->caps['gmedia_delete_media']){
|
860 |
$ids = $gmCore->_get('ids', 'selected');
|
861 |
$cookie_key = $gmCore->_post('cookie_key', self::$cookie_key);
|
878 |
}
|
879 |
if($count){
|
880 |
if($delete_original_file){
|
881 |
+
$this->msg[] = sprintf(__('%d item(s) deleted successfully', 'grand-media'), $count);
|
882 |
} else{
|
883 |
+
$this->msg[] = sprintf(__('%d record(s) deleted from database successfully. Original file(s) safe', 'grand-media'), $count);
|
884 |
}
|
885 |
}
|
886 |
$this->selected_items = array_diff($this->selected_items, $selected_items);
|
923 |
}
|
924 |
}
|
925 |
if($do_gmedia){
|
926 |
+
$_wpnonce = array();
|
927 |
+
foreach ($_GET as $key => $value) {
|
928 |
+
if (strpos($key, '_wpnonce') !== false) {
|
929 |
+
$_wpnonce[$key] = $value;
|
930 |
+
}
|
931 |
+
}
|
932 |
+
$remove_args = array_merge(array('do_gmedia', 'ids'), $_wpnonce);
|
933 |
+
$location = remove_query_arg($remove_args);
|
934 |
$location = add_query_arg('did_gmedia', $do_gmedia, $location);
|
935 |
wp_redirect($location);
|
936 |
exit;
|
admin/processor/class.processor.modules.php
CHANGED
@@ -65,7 +65,7 @@ class GmediaProcessor_Modules extends GmediaProcessor{
|
|
65 |
$term['name'] = '[' . $term['module'] . '] ' . $term['name'];
|
66 |
|
67 |
if($edit_preset && !$gmDB->term_exists($edit_preset)){
|
68 |
-
$this->error[] = __('A term with the id provided
|
69 |
$edit_preset = false;
|
70 |
}
|
71 |
if(($term_id = $gmDB->term_exists($term['name'], $taxonomy, $term['global']))){
|
@@ -80,7 +80,7 @@ class GmediaProcessor_Modules extends GmediaProcessor{
|
|
80 |
$module_settings = $gmCore->_post('module', array());
|
81 |
$module_path = $gmCore->get_module_path($term['module']);
|
82 |
$default_options = array();
|
83 |
-
if(
|
84 |
/** @noinspection PhpIncludeInspection */
|
85 |
include($module_path['path'] . '/settings.php');
|
86 |
} else{
|
@@ -101,7 +101,7 @@ class GmediaProcessor_Modules extends GmediaProcessor{
|
|
101 |
}
|
102 |
|
103 |
if($edit_preset){
|
104 |
-
$this->msg[] = sprintf(__('Preset #%d
|
105 |
} else{
|
106 |
$location = add_query_arg(array('preset' => $term_id, 'message' => 'save'), $this->url);
|
107 |
set_transient('gmedia_new_preset_id', $term_id, 60);
|
@@ -114,13 +114,13 @@ class GmediaProcessor_Modules extends GmediaProcessor{
|
|
114 |
$gmedia_new_preset_id = get_transient('gmedia_new_preset_id');
|
115 |
if(false !== $gmedia_new_preset_id){
|
116 |
delete_transient('gmedia_new_preset_id');
|
117 |
-
$this->msg[] = sprintf(__('Preset #%d
|
118 |
}
|
119 |
}
|
120 |
|
121 |
if(isset($_FILES['modulezip']['tmp_name'])){
|
122 |
if(!empty($_FILES['modulezip']['tmp_name'])){
|
123 |
-
check_admin_referer('
|
124 |
if(!current_user_can('manage_options')){
|
125 |
wp_die(__('You are not allowed to install module ZIP', 'grand-media'));
|
126 |
}
|
@@ -143,7 +143,7 @@ class GmediaProcessor_Modules extends GmediaProcessor{
|
|
143 |
|
144 |
// Move the file to the modules dir
|
145 |
if(false === @move_uploaded_file($_FILES['modulezip']['tmp_name'], $to_folder . $filename)){
|
146 |
-
$this->error[] = sprintf(__('The uploaded file could not be moved to %s', '
|
147 |
} else{
|
148 |
global $wp_filesystem;
|
149 |
// Is a filesystem accessor setup?
|
@@ -152,9 +152,9 @@ class GmediaProcessor_Modules extends GmediaProcessor{
|
|
152 |
WP_Filesystem();
|
153 |
}
|
154 |
if(!is_object($wp_filesystem)){
|
155 |
-
$result = new WP_Error('fs_unavailable', __('Could not access filesystem.', '
|
156 |
} elseif($wp_filesystem->errors->get_error_code()){
|
157 |
-
$result = new WP_Error('fs_error', __('Filesystem error', '
|
158 |
} else{
|
159 |
$maybe_folder_dir = basename($_FILES['modulezip']['name'], '.zip');
|
160 |
$maybe_folder_dir = sanitize_file_name($maybe_folder_dir);
|
@@ -168,7 +168,7 @@ class GmediaProcessor_Modules extends GmediaProcessor{
|
|
168 |
if(is_wp_error($result)){
|
169 |
$this->error[] = $result->get_error_message();
|
170 |
} else{
|
171 |
-
$this->msg[] = sprintf(__("The `%s` file unzipped to module's directory", '
|
172 |
}
|
173 |
}
|
174 |
} else{
|
@@ -177,14 +177,14 @@ class GmediaProcessor_Modules extends GmediaProcessor{
|
|
177 |
}
|
178 |
|
179 |
if(isset($_GET['delete_module'])){
|
180 |
-
if($gmCore->_get('
|
181 |
$mfold = preg_replace('/[^a-z0-9_-]+/i', '_', $_GET['delete_module']);
|
182 |
$mpath = "{$gmCore->upload['path']}/{$gmGallery->options['folder']['module']}/{$mfold}";
|
183 |
if($mfold && file_exists($mpath)){
|
184 |
-
check_admin_referer('gmedia_module_delete');
|
185 |
$gmCore->delete_folder($mpath);
|
186 |
-
$location = remove_query_arg(array('
|
187 |
-
set_transient('gmedia_module_deleted', sprintf(__("The `%s` module folder was deleted", '
|
188 |
wp_redirect($location);
|
189 |
}
|
190 |
} elseif(false !== ($message = get_transient('gmedia_module_deleted'))){
|
65 |
$term['name'] = '[' . $term['module'] . '] ' . $term['name'];
|
66 |
|
67 |
if($edit_preset && !$gmDB->term_exists($edit_preset)){
|
68 |
+
$this->error[] = __('A term with the id provided does not exists', 'grand-media');
|
69 |
$edit_preset = false;
|
70 |
}
|
71 |
if(($term_id = $gmDB->term_exists($term['name'], $taxonomy, $term['global']))){
|
80 |
$module_settings = $gmCore->_post('module', array());
|
81 |
$module_path = $gmCore->get_module_path($term['module']);
|
82 |
$default_options = array();
|
83 |
+
if(is_file($module_path['path'] . '/settings.php')){
|
84 |
/** @noinspection PhpIncludeInspection */
|
85 |
include($module_path['path'] . '/settings.php');
|
86 |
} else{
|
101 |
}
|
102 |
|
103 |
if($edit_preset){
|
104 |
+
$this->msg[] = sprintf(__('Preset #%d successfully saved', 'grand-media'), $term_id);
|
105 |
} else{
|
106 |
$location = add_query_arg(array('preset' => $term_id, 'message' => 'save'), $this->url);
|
107 |
set_transient('gmedia_new_preset_id', $term_id, 60);
|
114 |
$gmedia_new_preset_id = get_transient('gmedia_new_preset_id');
|
115 |
if(false !== $gmedia_new_preset_id){
|
116 |
delete_transient('gmedia_new_preset_id');
|
117 |
+
$this->msg[] = sprintf(__('Preset #%d successfully saved', 'grand-media'), $term_id);
|
118 |
}
|
119 |
}
|
120 |
|
121 |
if(isset($_FILES['modulezip']['tmp_name'])){
|
122 |
if(!empty($_FILES['modulezip']['tmp_name'])){
|
123 |
+
check_admin_referer('gmedia_module', '_wpnonce_module');
|
124 |
if(!current_user_can('manage_options')){
|
125 |
wp_die(__('You are not allowed to install module ZIP', 'grand-media'));
|
126 |
}
|
143 |
|
144 |
// Move the file to the modules dir
|
145 |
if(false === @move_uploaded_file($_FILES['modulezip']['tmp_name'], $to_folder . $filename)){
|
146 |
+
$this->error[] = sprintf(__('The uploaded file could not be moved to %s', 'grand-media'), $to_folder . $filename);
|
147 |
} else{
|
148 |
global $wp_filesystem;
|
149 |
// Is a filesystem accessor setup?
|
152 |
WP_Filesystem();
|
153 |
}
|
154 |
if(!is_object($wp_filesystem)){
|
155 |
+
$result = new WP_Error('fs_unavailable', __('Could not access filesystem.', 'grand-media'));
|
156 |
} elseif($wp_filesystem->errors->get_error_code()){
|
157 |
+
$result = new WP_Error('fs_error', __('Filesystem error', 'grand-media'), $wp_filesystem->errors);
|
158 |
} else{
|
159 |
$maybe_folder_dir = basename($_FILES['modulezip']['name'], '.zip');
|
160 |
$maybe_folder_dir = sanitize_file_name($maybe_folder_dir);
|
168 |
if(is_wp_error($result)){
|
169 |
$this->error[] = $result->get_error_message();
|
170 |
} else{
|
171 |
+
$this->msg[] = sprintf(__("The `%s` file unzipped to module's directory", 'grand-media'), $filename);
|
172 |
}
|
173 |
}
|
174 |
} else{
|
177 |
}
|
178 |
|
179 |
if(isset($_GET['delete_module'])){
|
180 |
+
if($gmCore->_get('_wpnonce_module_delete')){
|
181 |
$mfold = preg_replace('/[^a-z0-9_-]+/i', '_', $_GET['delete_module']);
|
182 |
$mpath = "{$gmCore->upload['path']}/{$gmGallery->options['folder']['module']}/{$mfold}";
|
183 |
if($mfold && file_exists($mpath)){
|
184 |
+
check_admin_referer('gmedia_module_delete', '_wpnonce_module_delete');
|
185 |
$gmCore->delete_folder($mpath);
|
186 |
+
$location = remove_query_arg(array('_wpnonce_module_delete'));
|
187 |
+
set_transient('gmedia_module_deleted', sprintf(__("The `%s` module folder was deleted", 'grand-media'), $mpath), 60);
|
188 |
wp_redirect($location);
|
189 |
}
|
190 |
} elseif(false !== ($message = get_transient('gmedia_module_deleted'))){
|
admin/processor/class.processor.settings.php
CHANGED
@@ -14,7 +14,7 @@ class GmediaProcessor_Settings extends GmediaProcessor{
|
|
14 |
}
|
15 |
$lk_check = isset($_POST['license-key-activate']);
|
16 |
if(isset($_POST['gmedia_settings_save'])){
|
17 |
-
check_admin_referer('
|
18 |
|
19 |
$set = $gmCore->_post('set', array());
|
20 |
|
@@ -33,8 +33,17 @@ class GmediaProcessor_Settings extends GmediaProcessor{
|
|
33 |
if(empty($set['endpoint'])){
|
34 |
$set['endpoint'] = 'gmedia';
|
35 |
}
|
36 |
-
if(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
$flush_rewrite_rules = true;
|
|
|
38 |
}
|
39 |
|
40 |
foreach($set as $key => $val){
|
@@ -96,6 +105,24 @@ class GmediaProcessor_Settings extends GmediaProcessor{
|
|
96 |
}
|
97 |
}
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
update_option('gmediaOptions', $gmGallery->options);
|
100 |
if(isset($_POST['GmediaHashID_salt'])){
|
101 |
update_option('GmediaHashID_salt', (string)$_POST['GmediaHashID_salt']);
|
@@ -107,7 +134,7 @@ class GmediaProcessor_Settings extends GmediaProcessor{
|
|
107 |
}
|
108 |
|
109 |
if($lk_check){
|
110 |
-
check_admin_referer('
|
111 |
$license_key = $gmCore->_post('set');
|
112 |
if(!empty($license_key['purchase_key'])){
|
113 |
global $wp_version;
|
@@ -153,7 +180,7 @@ class GmediaProcessor_Settings extends GmediaProcessor{
|
|
153 |
}
|
154 |
|
155 |
if(isset($_POST['gmedia_settings_reset'])){
|
156 |
-
check_admin_referer('
|
157 |
include_once(GMEDIA_ABSPATH . 'config/setup.php');
|
158 |
$_temp_options = $gmGallery->options;
|
159 |
$gmGallery->options = gmedia_default_options();
|
14 |
}
|
15 |
$lk_check = isset($_POST['license-key-activate']);
|
16 |
if(isset($_POST['gmedia_settings_save'])){
|
17 |
+
check_admin_referer('gmedia_settings', '_wpnonce_settings');
|
18 |
|
19 |
$set = $gmCore->_post('set', array());
|
20 |
|
33 |
if(empty($set['endpoint'])){
|
34 |
$set['endpoint'] = 'gmedia';
|
35 |
}
|
36 |
+
if(
|
37 |
+
$set['endpoint'] !== $gmGallery->options['endpoint']
|
38 |
+
|| $set['gmedia_post_slug'] !== $gmGallery->options['gmedia_post_slug']
|
39 |
+
|| $set['gmedia_album_post_slug'] !== $gmGallery->options['gmedia_album_post_slug']
|
40 |
+
|| $set['gmedia_gallery_post_slug'] !== $gmGallery->options['gmedia_gallery_post_slug']
|
41 |
+
|| $set['gmedia_has_archive'] !== $gmGallery->options['gmedia_has_archive']
|
42 |
+
|| $set['gmedia_album_has_archive'] !== $gmGallery->options['gmedia_album_has_archive']
|
43 |
+
|| $set['gmedia_gallery_has_archive'] !== $gmGallery->options['gmedia_gallery_has_archive']
|
44 |
+
){
|
45 |
$flush_rewrite_rules = true;
|
46 |
+
$set['flush_rewrite_rules'] = true;
|
47 |
}
|
48 |
|
49 |
foreach($set as $key => $val){
|
105 |
}
|
106 |
}
|
107 |
|
108 |
+
if(isset($set['delete_originals']) && (int)$set['delete_originals']){
|
109 |
+
// if (($handle = opendir($gmCore->upload['path'] . '/' . $gmGallery->options['folder']['image_original']))) {
|
110 |
+
// while (false !== ($file = readdir($handle))) {
|
111 |
+
// // do something with the file
|
112 |
+
// // note that '.' and '..' is returned even
|
113 |
+
// @unlink($file);
|
114 |
+
// }
|
115 |
+
// closedir($handle);
|
116 |
+
// }
|
117 |
+
$files = glob( $gmCore->upload['path'] . '/' . $gmGallery->options['folder']['image_original'] . '/*', GLOB_NOSORT);
|
118 |
+
if(!empty($files)){
|
119 |
+
foreach($files as $file){
|
120 |
+
@unlink($file);
|
121 |
+
}
|
122 |
+
}
|
123 |
+
|
124 |
+
}
|
125 |
+
|
126 |
update_option('gmediaOptions', $gmGallery->options);
|
127 |
if(isset($_POST['GmediaHashID_salt'])){
|
128 |
update_option('GmediaHashID_salt', (string)$_POST['GmediaHashID_salt']);
|
134 |
}
|
135 |
|
136 |
if($lk_check){
|
137 |
+
check_admin_referer('gmedia_settings', '_wpnonce_settings');
|
138 |
$license_key = $gmCore->_post('set');
|
139 |
if(!empty($license_key['purchase_key'])){
|
140 |
global $wp_version;
|
180 |
}
|
181 |
|
182 |
if(isset($_POST['gmedia_settings_reset'])){
|
183 |
+
check_admin_referer('gmedia_settings', '_wpnonce_settings');
|
184 |
include_once(GMEDIA_ABSPATH . 'config/setup.php');
|
185 |
$_temp_options = $gmGallery->options;
|
186 |
$gmGallery->options = gmedia_default_options();
|
admin/processor/class.processor.terms.php
CHANGED
@@ -104,7 +104,7 @@ class GmediaProcessor_Terms extends GmediaProcessor{
|
|
104 |
}
|
105 |
|
106 |
if(isset($_POST['gmedia_album_save'])){
|
107 |
-
check_admin_referer('
|
108 |
$edit_term = (int)$gmCore->_get('edit_term');
|
109 |
do{
|
110 |
if(!$gmCore->caps['gmedia_album_manage']){
|
@@ -126,7 +126,7 @@ class GmediaProcessor_Terms extends GmediaProcessor{
|
|
126 |
}
|
127 |
$taxonomy = 'gmedia_album';
|
128 |
if($edit_term && !$gmDB->term_exists($edit_term)){
|
129 |
-
$this->error[] = __('A term with the id provided
|
130 |
$edit_term = false;
|
131 |
}
|
132 |
if(($term_id = $gmDB->term_exists($term['name'], $taxonomy, $term['global']))){
|
@@ -153,11 +153,11 @@ class GmediaProcessor_Terms extends GmediaProcessor{
|
|
153 |
$gmDB->update_term_sortorder($term_id);
|
154 |
}
|
155 |
|
156 |
-
$this->msg[] = sprintf(__('Album `%s`
|
157 |
|
158 |
} while(0);
|
159 |
} elseif(isset($_POST['gmedia_category_save'])){
|
160 |
-
check_admin_referer('
|
161 |
$edit_term = (int)$gmCore->_get('edit_term');
|
162 |
do{
|
163 |
if(!$gmCore->caps['gmedia_category_manage']){
|
@@ -179,7 +179,7 @@ class GmediaProcessor_Terms extends GmediaProcessor{
|
|
179 |
}
|
180 |
$taxonomy = 'gmedia_category';
|
181 |
if($edit_term && !$gmDB->term_exists($edit_term)){
|
182 |
-
$this->error[] = __('A term with the id provided
|
183 |
$edit_term = false;
|
184 |
}
|
185 |
if(($term_id = $gmDB->term_exists($term['name'], $taxonomy))){
|
@@ -202,12 +202,12 @@ class GmediaProcessor_Terms extends GmediaProcessor{
|
|
202 |
break;
|
203 |
}
|
204 |
|
205 |
-
$this->msg[] = sprintf(__('Category `%s`
|
206 |
|
207 |
} while(0);
|
208 |
} elseif(isset($_POST['gmedia_tag_add'])){
|
209 |
if($gmCore->caps['gmedia_tag_manage']){
|
210 |
-
check_admin_referer('
|
211 |
$term = $gmCore->_post('term');
|
212 |
$terms = array_filter(array_map('trim', explode(',', $term['name'])));
|
213 |
$terms_added = 0;
|
@@ -223,7 +223,7 @@ class GmediaProcessor_Terms extends GmediaProcessor{
|
|
223 |
if(is_wp_error($term_id)){
|
224 |
$this->error[] = $term_id->get_error_message();
|
225 |
} else{
|
226 |
-
$this->msg['tag_add'] = sprintf(__('%d of %d tags
|
227 |
}
|
228 |
} else{
|
229 |
$this->error['tag_add'] = __('Some of provided tags are already exists', 'grand-media');
|
@@ -236,7 +236,7 @@ class GmediaProcessor_Terms extends GmediaProcessor{
|
|
236 |
|
237 |
$do_gmedia_terms = $gmCore->_get('do_gmedia_terms');
|
238 |
if('delete' == $do_gmedia_terms){
|
239 |
-
check_admin_referer('gmedia_delete');
|
240 |
if($gmCore->caps['gmedia_terms_delete']){
|
241 |
$ids = $gmCore->_get('ids', 'selected');
|
242 |
$selected_items = ('selected' == $ids)? $this->selected_items : wp_parse_id_list($ids);
|
@@ -261,7 +261,7 @@ class GmediaProcessor_Terms extends GmediaProcessor{
|
|
261 |
}
|
262 |
}
|
263 |
if($count){
|
264 |
-
$this->msg[] = sprintf(__('%d item(s) deleted
|
265 |
}
|
266 |
setcookie(self::$cookie_key, '', time() - 3600);
|
267 |
unset($_COOKIE[ self::$cookie_key ]);
|
@@ -278,7 +278,14 @@ class GmediaProcessor_Terms extends GmediaProcessor{
|
|
278 |
}
|
279 |
}
|
280 |
if($do_gmedia_terms){
|
281 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
$location = add_query_arg('did_gmedia_terms', $do_gmedia_terms, $location);
|
283 |
wp_redirect($location);
|
284 |
exit;
|
104 |
}
|
105 |
|
106 |
if(isset($_POST['gmedia_album_save'])){
|
107 |
+
check_admin_referer('gmedia_terms', '_wpnonce_terms');
|
108 |
$edit_term = (int)$gmCore->_get('edit_term');
|
109 |
do{
|
110 |
if(!$gmCore->caps['gmedia_album_manage']){
|
126 |
}
|
127 |
$taxonomy = 'gmedia_album';
|
128 |
if($edit_term && !$gmDB->term_exists($edit_term)){
|
129 |
+
$this->error[] = __('A term with the id provided does not exists', 'grand-media');
|
130 |
$edit_term = false;
|
131 |
}
|
132 |
if(($term_id = $gmDB->term_exists($term['name'], $taxonomy, $term['global']))){
|
153 |
$gmDB->update_term_sortorder($term_id);
|
154 |
}
|
155 |
|
156 |
+
$this->msg[] = sprintf(__('Album `%s` successfully saved', 'grand-media'), $term['name']);
|
157 |
|
158 |
} while(0);
|
159 |
} elseif(isset($_POST['gmedia_category_save'])){
|
160 |
+
check_admin_referer('gmedia_terms', '_wpnonce_terms');
|
161 |
$edit_term = (int)$gmCore->_get('edit_term');
|
162 |
do{
|
163 |
if(!$gmCore->caps['gmedia_category_manage']){
|
179 |
}
|
180 |
$taxonomy = 'gmedia_category';
|
181 |
if($edit_term && !$gmDB->term_exists($edit_term)){
|
182 |
+
$this->error[] = __('A term with the id provided does not exists', 'grand-media');
|
183 |
$edit_term = false;
|
184 |
}
|
185 |
if(($term_id = $gmDB->term_exists($term['name'], $taxonomy))){
|
202 |
break;
|
203 |
}
|
204 |
|
205 |
+
$this->msg[] = sprintf(__('Category `%s` successfully saved', 'grand-media'), $term['name']);
|
206 |
|
207 |
} while(0);
|
208 |
} elseif(isset($_POST['gmedia_tag_add'])){
|
209 |
if($gmCore->caps['gmedia_tag_manage']){
|
210 |
+
check_admin_referer('gmedia_terms', '_wpnonce_terms');
|
211 |
$term = $gmCore->_post('term');
|
212 |
$terms = array_filter(array_map('trim', explode(',', $term['name'])));
|
213 |
$terms_added = 0;
|
223 |
if(is_wp_error($term_id)){
|
224 |
$this->error[] = $term_id->get_error_message();
|
225 |
} else{
|
226 |
+
$this->msg['tag_add'] = sprintf(__('%d of %d tags successfully added', 'grand-media'), ++ $terms_added, $terms_qty);
|
227 |
}
|
228 |
} else{
|
229 |
$this->error['tag_add'] = __('Some of provided tags are already exists', 'grand-media');
|
236 |
|
237 |
$do_gmedia_terms = $gmCore->_get('do_gmedia_terms');
|
238 |
if('delete' == $do_gmedia_terms){
|
239 |
+
check_admin_referer('gmedia_delete', '_wpnonce_delete');
|
240 |
if($gmCore->caps['gmedia_terms_delete']){
|
241 |
$ids = $gmCore->_get('ids', 'selected');
|
242 |
$selected_items = ('selected' == $ids)? $this->selected_items : wp_parse_id_list($ids);
|
261 |
}
|
262 |
}
|
263 |
if($count){
|
264 |
+
$this->msg[] = sprintf(__('%d item(s) deleted successfully', 'grand-media'), $count);
|
265 |
}
|
266 |
setcookie(self::$cookie_key, '', time() - 3600);
|
267 |
unset($_COOKIE[ self::$cookie_key ]);
|
278 |
}
|
279 |
}
|
280 |
if($do_gmedia_terms){
|
281 |
+
$_wpnonce = array();
|
282 |
+
foreach ($_GET as $key => $value) {
|
283 |
+
if (strpos($key, '_wpnonce') !== false) {
|
284 |
+
$_wpnonce[$key] = $value;
|
285 |
+
}
|
286 |
+
}
|
287 |
+
$remove_args = array_merge(array('do_gmedia_terms', 'ids'), $_wpnonce);
|
288 |
+
$location = remove_query_arg($remove_args);
|
289 |
$location = add_query_arg('did_gmedia_terms', $do_gmedia_terms, $location);
|
290 |
wp_redirect($location);
|
291 |
exit;
|
admin/tpl/comments.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Gmedia Comments
|
4 |
*/
|
5 |
-
if(!defined('ABSPATH'))
|
6 |
exit;
|
7 |
} // Exit if accessed directly
|
8 |
|
@@ -15,15 +15,15 @@ global $gmDB, $gmCore, $gmGallery, $post;
|
|
15 |
|
16 |
$gmedia_id = $gmCore->_get('gmedia_id');
|
17 |
$gmedia_term_id = $gmCore->_get('gmedia_term_id');
|
18 |
-
if($gmedia_id)
|
19 |
-
$gmedia
|
20 |
gmedia_item_more_data($gmedia);
|
21 |
$post_id = $gmedia->post_id;
|
22 |
-
} elseif($gmedia_term_id)
|
23 |
$gmedia_term = $gmDB->get_term($gmedia_term_id);
|
24 |
gmedia_term_item_more_data($gmedia_term);
|
25 |
$post_id = $gmedia_term->post_id;
|
26 |
-
} else
|
27 |
die('-1');
|
28 |
}
|
29 |
|
@@ -31,17 +31,18 @@ $post = get_post($post_id);
|
|
31 |
?>
|
32 |
<div id="commentsdiv" style="padding:1px 0;">
|
33 |
<style type="text/css" scoped>
|
34 |
-
#commentsdiv {padding-top:1px;}
|
35 |
-
#commentsdiv > .thumbnail {float:left; margin:0 10px 10px;}
|
36 |
-
#commentsdiv > .thumbnail img.gmedia-thumb {max-height:72px;}
|
37 |
-
#commentsdiv > h4 {margin-left:10px;}
|
38 |
-
#commentsdiv .fixed .column-author {width:20%;}
|
|
|
39 |
</style>
|
40 |
<?php
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
if($gmedia_id)
|
45 |
<span class="thumbnail">
|
46 |
<?php echo gmedia_item_thumbnail($gmedia); ?>
|
47 |
</span>
|
@@ -56,7 +57,12 @@ $post = get_post($post_id);
|
|
56 |
<script type="text/javascript">
|
57 |
//<![CDATA[
|
58 |
jQuery(document).ready(function($) {
|
59 |
-
$(
|
|
|
|
|
|
|
|
|
|
|
60 |
});
|
61 |
//]]>
|
62 |
</script>
|
2 |
/**
|
3 |
* Gmedia Comments
|
4 |
*/
|
5 |
+
if(!defined('ABSPATH')){
|
6 |
exit;
|
7 |
} // Exit if accessed directly
|
8 |
|
15 |
|
16 |
$gmedia_id = $gmCore->_get('gmedia_id');
|
17 |
$gmedia_term_id = $gmCore->_get('gmedia_term_id');
|
18 |
+
if($gmedia_id){
|
19 |
+
$gmedia = $gmDB->get_gmedia($gmedia_id);
|
20 |
gmedia_item_more_data($gmedia);
|
21 |
$post_id = $gmedia->post_id;
|
22 |
+
} elseif($gmedia_term_id){
|
23 |
$gmedia_term = $gmDB->get_term($gmedia_term_id);
|
24 |
gmedia_term_item_more_data($gmedia_term);
|
25 |
$post_id = $gmedia_term->post_id;
|
26 |
+
} else{
|
27 |
die('-1');
|
28 |
}
|
29 |
|
31 |
?>
|
32 |
<div id="commentsdiv" style="padding:1px 0;">
|
33 |
<style type="text/css" scoped>
|
34 |
+
#commentsdiv { padding-top:1px; }
|
35 |
+
#commentsdiv > .thumbnail { float:left; margin:0 10px 10px; }
|
36 |
+
#commentsdiv > .thumbnail img.gmedia-thumb { max-height:72px; }
|
37 |
+
#commentsdiv > h4 { margin-left:10px; }
|
38 |
+
#commentsdiv .fixed .column-author { width:20%; }
|
39 |
+
#commentsdiv .row-actions .edit { display:none; }
|
40 |
</style>
|
41 |
<?php
|
42 |
+
if(current_user_can('edit_posts')){
|
43 |
+
printf('<a target="_blank" href="%s" class="pull-right">%s</a>', esc_url(add_query_arg(array('p' => $post_id), admin_url('edit-comments.php'))), __('Open in new tab'));
|
44 |
+
}
|
45 |
+
if($gmedia_id){ ?>
|
46 |
<span class="thumbnail">
|
47 |
<?php echo gmedia_item_thumbnail($gmedia); ?>
|
48 |
</span>
|
57 |
<script type="text/javascript">
|
58 |
//<![CDATA[
|
59 |
jQuery(document).ready(function($) {
|
60 |
+
$('table.comments-box').css('display', '');
|
61 |
+
// $('table.comments-box').on('click', '.row-actions .edit a', function(e) {
|
62 |
+
// e.preventDefault();
|
63 |
+
// window.open($(this).attr('href'), '_blank');
|
64 |
+
// return false;
|
65 |
+
// });
|
66 |
});
|
67 |
//]]>
|
68 |
</script>
|
admin/tpl/modal-customfield.php
CHANGED
@@ -14,7 +14,7 @@ if ( isset( $customfield_meta_type ) && $customfield_meta_type ) { ?>
|
|
14 |
<form class="modal-body" method="post" id="newCustomFieldForm">
|
15 |
<?php
|
16 |
echo $gmCore->meta_form( $customfield_meta_type );
|
17 |
-
wp_nonce_field( 'gmedia_custom_field', '
|
18 |
wp_referer_field();
|
19 |
?>
|
20 |
<input type="hidden" name="action" value="<?php echo $customfield_meta_type; ?>_add_custom_field"/>
|
14 |
<form class="modal-body" method="post" id="newCustomFieldForm">
|
15 |
<?php
|
16 |
echo $gmCore->meta_form( $customfield_meta_type );
|
17 |
+
wp_nonce_field( 'gmedia_custom_field', '_wpnonce_custom_field' );
|
18 |
wp_referer_field();
|
19 |
?>
|
20 |
<input type="hidden" name="action" value="<?php echo $customfield_meta_type; ?>_add_custom_field"/>
|
admin/tpl/modal-share.php
CHANGED
@@ -8,7 +8,7 @@ if(!defined('ABSPATH')) {
|
|
8 |
<div class="modal-content">
|
9 |
<div class="modal-header">
|
10 |
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
11 |
-
<h4 class="modal-title"><?php _e('
|
12 |
</div>
|
13 |
<form class="modal-body" method="post" id="shareForm">
|
14 |
<div class="form-group sharelink_post">
|
@@ -41,7 +41,7 @@ if(!defined('ABSPATH')) {
|
|
41 |
<textarea style="margin-top:4px;" name="message" cols="20" rows="3" class="form-control" placeholder="<?php _e('Message (optional)', 'grand-media'); ?>"></textarea>
|
42 |
</div>
|
43 |
<input type="hidden" name="action" value="gmedia_share_page"/>
|
44 |
-
<?php wp_nonce_field('
|
45 |
</form>
|
46 |
<div class="modal-footer">
|
47 |
<button type="button" class="btn btn-primary sharebutton" disabled="disabled"><?php _e('Send', 'grand-media'); ?></button>
|
8 |
<div class="modal-content">
|
9 |
<div class="modal-header">
|
10 |
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
11 |
+
<h4 class="modal-title"><?php _e('Gmedia Share'); ?></h4>
|
12 |
</div>
|
13 |
<form class="modal-body" method="post" id="shareForm">
|
14 |
<div class="form-group sharelink_post">
|
41 |
<textarea style="margin-top:4px;" name="message" cols="20" rows="3" class="form-control" placeholder="<?php _e('Message (optional)', 'grand-media'); ?>"></textarea>
|
42 |
</div>
|
43 |
<input type="hidden" name="action" value="gmedia_share_page"/>
|
44 |
+
<?php wp_nonce_field('gmedia_share', '_wpnonce_share'); ?>
|
45 |
</form>
|
46 |
<div class="modal-footer">
|
47 |
<button type="button" class="btn btn-primary sharebutton" disabled="disabled"><?php _e('Send', 'grand-media'); ?></button>
|
admin/tpl/search-form.php
CHANGED
@@ -11,7 +11,10 @@ global $gmCore;
|
|
11 |
<form class="form-inline gmedia-search-form" role="search" method="get">
|
12 |
<div class="form-group">
|
13 |
<?php foreach($_GET as $key => $value){
|
14 |
-
if(!in_array($key, array('doing_wp_cron', '
|
|
|
|
|
|
|
15 |
if(is_array($value)){
|
16 |
$value = implode(',', $value);
|
17 |
}
|
11 |
<form class="form-inline gmedia-search-form" role="search" method="get">
|
12 |
<div class="form-group">
|
13 |
<?php foreach($_GET as $key => $value){
|
14 |
+
if(!in_array($key, array('doing_wp_cron', 'do_gmedia', 'did_gmedia', 'do_gmedia_terms', 'did_gmedia_terms', 'ids', 's'))){
|
15 |
+
if(strpos($key, '_wpnonce') !== false){
|
16 |
+
continue;
|
17 |
+
}
|
18 |
if(is_array($value)){
|
19 |
$value = implode(',', $value);
|
20 |
}
|
app/access.php
CHANGED
@@ -21,22 +21,14 @@ $gmapp_version = isset($_GET['gmappversion'])? $_GET['gmappversion'] : 1;
|
|
21 |
|
22 |
$out = array();
|
23 |
|
24 |
-
$gmedia_options = get_option('gmediaOptions');
|
25 |
-
if(empty($gmedia_options['mobile_app'])){
|
26 |
-
$out['error'] = array('code' => 'app_inactive', 'message' => 'Service not enabled/activated for this site');
|
27 |
-
header('Content-Type: application/json; charset=' . get_option('blog_charset'), true);
|
28 |
-
echo json_encode($out);
|
29 |
-
die();
|
30 |
-
}
|
31 |
-
|
32 |
-
|
33 |
if(isset($_FILES['userfile']['name'])){
|
34 |
$globaldata = isset($_POST['account'])? $_POST['account'] : false;
|
35 |
if($globaldata){
|
36 |
$globaldata = stripslashes($globaldata);
|
37 |
}
|
38 |
} else{
|
39 |
-
|
|
|
40 |
}
|
41 |
|
42 |
if($globaldata){
|
@@ -51,7 +43,15 @@ if($globaldata){
|
|
51 |
gmedia_ios_app_counters($json->counter);
|
52 |
}
|
53 |
|
|
|
54 |
if(isset($json->cookie) && !empty($json->cookie)){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
$user_id = $gmAuth->validate_auth_cookie($json->cookie);
|
56 |
if($user_id){
|
57 |
$user = wp_set_current_user($user_id);
|
@@ -76,6 +76,13 @@ if($globaldata){
|
|
76 |
$out['error'] = array('code' => 'wrongcookie', 'message' => 'Not Valid User');
|
77 |
}
|
78 |
} elseif(isset($json->login)){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
$out = gmedia_ios_app_login($json);
|
80 |
if(!isset($out['error'])){
|
81 |
$user = wp_set_current_user($out['user']['id']);
|
@@ -109,7 +116,10 @@ if($globaldata){
|
|
109 |
} elseif(isset($json->library_terms)){
|
110 |
$args = (array)$json->library_terms;
|
111 |
if(isset($args['taxonomy'])){
|
112 |
-
|
|
|
|
|
|
|
113 |
}
|
114 |
} else{
|
115 |
$out = gmedia_ios_app_library_data();
|
@@ -156,9 +166,9 @@ function gmedia_ios_app_login($json){
|
|
156 |
break;
|
157 |
}
|
158 |
|
159 |
-
$args = array('username'
|
160 |
-
'password'
|
161 |
-
'
|
162 |
);
|
163 |
$out = $gmAuth->generate_auth_cookie($args);
|
164 |
|
@@ -181,9 +191,9 @@ function gmedia_ios_app_library_data($data = array('site', 'authors', 'filter',
|
|
181 |
}
|
182 |
|
183 |
if(version_compare('3', $gmapp_version, '<=')){
|
184 |
-
$logic
|
185 |
if(version_compare('3.1', $gmapp_version, '<')){
|
186 |
-
$logic
|
187 |
}
|
188 |
$terms_per_page = 40;
|
189 |
} else{
|
@@ -494,6 +504,18 @@ function gmedia_ios_app_term_data_extend(&$term, $share_link_base, $logic = 0, $
|
|
494 |
$term->cap = (4 == $cap)? 4 : 0;
|
495 |
}
|
496 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
497 |
/**
|
498 |
* @param $action
|
499 |
* @param $data
|
@@ -509,7 +531,7 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
|
|
509 |
if(version_compare('3', $gmapp_version, '<=')){
|
510 |
$logic = 2;
|
511 |
if(version_compare('3.1', $gmapp_version, '<')){
|
512 |
-
$logic
|
513 |
}
|
514 |
} else{
|
515 |
$logic = 1;
|
@@ -519,7 +541,9 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
|
|
519 |
$error_info = array();
|
520 |
$alert = array();
|
521 |
$alert_info = array();
|
522 |
-
|
|
|
|
|
523 |
switch($action){
|
524 |
case 'do_library':
|
525 |
|
@@ -546,7 +570,38 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
|
|
546 |
$file_name = $_FILES['userfile']['name'];
|
547 |
$file_tmp = $_FILES['userfile']['tmp_name'];
|
548 |
} else{
|
549 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
550 |
break;
|
551 |
}
|
552 |
|
@@ -562,7 +617,7 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
|
|
562 |
if(empty($gmedia['albums'])){
|
563 |
$gmedia['terms']['gmedia_album'] = '';
|
564 |
} else{
|
565 |
-
$alb = isset($gmedia['albums'][0]
|
566 |
$gmedia['terms']['gmedia_album'] = $alb;
|
567 |
}
|
568 |
if(empty($gmedia['categories'])){
|
@@ -570,7 +625,7 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
|
|
570 |
} else{
|
571 |
$categories = array();
|
572 |
foreach($gmedia['categories'] as $category){
|
573 |
-
$categories[] = isset($category
|
574 |
}
|
575 |
$gmedia['terms']['gmedia_category'] = implode(',', $categories);
|
576 |
}
|
@@ -579,7 +634,7 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
|
|
579 |
} else{
|
580 |
$tags = array();
|
581 |
foreach($gmedia['tags'] as $tag){
|
582 |
-
$tags[] = isset($tag
|
583 |
}
|
584 |
$gmedia['terms']['gmedia_tag'] = implode(',', $tags);
|
585 |
}
|
@@ -626,10 +681,10 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
|
|
626 |
if(empty($gmedia['albums'])){
|
627 |
$gmedia['terms']['gmedia_album'] = '';
|
628 |
} else{
|
629 |
-
if(isset($gmedia['albums'][0]
|
630 |
-
$gmedia['terms']['gmedia_album'] = $gmedia['albums'][0]
|
631 |
} elseif(current_user_can('gmedia_album_manage')){
|
632 |
-
$gmedia['terms']['gmedia_album'] = $gmedia['albums'][0]
|
633 |
}
|
634 |
}
|
635 |
if(empty($gmedia['categories'])){
|
@@ -637,10 +692,10 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
|
|
637 |
} else{
|
638 |
$categories = array();
|
639 |
foreach($gmedia['categories'] as $category){
|
640 |
-
if(isset($category
|
641 |
-
$categories[] = $category
|
642 |
} elseif(current_user_can('gmedia_category_manage')){
|
643 |
-
$categories[] = $category
|
644 |
}
|
645 |
}
|
646 |
$gmedia['terms']['gmedia_category'] = $categories;
|
@@ -650,10 +705,10 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
|
|
650 |
} else{
|
651 |
$tags = array();
|
652 |
foreach($gmedia['tags'] as $tag){
|
653 |
-
if(isset($tag
|
654 |
-
$tags[] = $tag
|
655 |
} elseif(current_user_can('gmedia_tag_manage')){
|
656 |
-
$tags[] = $tag
|
657 |
}
|
658 |
}
|
659 |
$gmedia['terms']['gmedia_tag'] = $tags;
|
@@ -808,21 +863,21 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
|
|
808 |
$error[] = __('You are not allowed to edit media', 'grand-media');
|
809 |
break;
|
810 |
}
|
811 |
-
$cover = (int)
|
812 |
$count = count($data['selected']);
|
813 |
foreach($data['selected'] as $item){
|
814 |
$gm_item = $gmDB->get_gmedia($item);
|
815 |
if(!$gm_item || ($user_ID != $gm_item->author && !current_user_can('gmedia_edit_others_media'))){
|
816 |
-
$count--;
|
817 |
continue;
|
818 |
}
|
819 |
if('image' == substr($gm_item->mime_type, 0, 5)){
|
820 |
-
$count--;
|
821 |
continue;
|
822 |
}
|
823 |
if($cover){
|
824 |
$gmDB->update_metadata('gmedia', $gm_item->ID, '_cover', $cover);
|
825 |
-
} else
|
826 |
$gmDB->delete_metadata('gmedia', $gm_item->ID, '_cover');
|
827 |
}
|
828 |
}
|
@@ -874,7 +929,7 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
|
|
874 |
}
|
875 |
}
|
876 |
if($count){
|
877 |
-
$alert[] = sprintf(__('%d items deleted
|
878 |
}
|
879 |
break;
|
880 |
}
|
@@ -894,26 +949,27 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
|
|
894 |
$filter = $filter? gmedia_ios_app_library_data(array('filter')) : array();
|
895 |
|
896 |
$mime_type = ($logic > 2)? array('image', 'audio') : 'image';
|
897 |
-
$args
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
);
|
909 |
|
910 |
$terms_ids_query = array();
|
911 |
if(!empty($data['tag__in'])){
|
|
|
912 |
if(empty($data['category__in']) && empty($data['album__in'])){
|
913 |
$args['orderby'] = $gmGallery->options['in_tag_orderby'];
|
914 |
$args['order'] = $gmGallery->options['in_tag_order'];
|
915 |
}
|
916 |
-
$terms_ids_query = array_merge($terms_ids_query, $
|
917 |
}
|
918 |
if(!empty($data['category__in'])){
|
919 |
$cat_ids = wp_parse_id_list($data['category__in']);
|
@@ -1002,7 +1058,8 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
|
|
1002 |
'current_page' => $gmDB->openPage,
|
1003 |
'items_count' => $gmDB->resultPerPage,
|
1004 |
'total_count' => $gmDB->totalResult,
|
1005 |
-
'count' => count($all_gmedias_ids)
|
|
|
1006 |
));
|
1007 |
foreach($gmedias as $i => $item){
|
1008 |
|
@@ -1074,13 +1131,17 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
|
|
1074 |
}
|
1075 |
$gmedias[ $i ]->categories = $categories;
|
1076 |
|
1077 |
-
$gmedias[ $i ]->meta
|
1078 |
-
|
1079 |
-
|
1080 |
);
|
1081 |
-
$gmedias[ $i ]->meta['thumb']['link']
|
1082 |
-
$gmedias[ $i ]->meta['web']['link']
|
1083 |
-
|
|
|
|
|
|
|
|
|
1084 |
|
1085 |
if(isset($_metadata['image_meta'])){
|
1086 |
$gmedias[ $i ]->meta['data'] = $_metadata['image_meta'];
|
@@ -1092,14 +1153,18 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
|
|
1092 |
if(!empty($meta['_cover'][0])){
|
1093 |
$cover_gmedia = $gmDB->get_gmedia($meta['_cover'][0]);
|
1094 |
if($cover_gmedia){
|
1095 |
-
$cover_metadata
|
1096 |
-
$gmedias[ $i ]->meta
|
1097 |
-
|
1098 |
-
|
1099 |
);
|
1100 |
-
$gmedias[ $i ]->meta['thumb']['link']
|
1101 |
-
$gmedias[ $i ]->meta['web']['link']
|
1102 |
-
|
|
|
|
|
|
|
|
|
1103 |
}
|
1104 |
}
|
1105 |
unset($meta['_cover']);
|
@@ -1149,8 +1214,15 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
|
|
1149 |
}
|
1150 |
|
1151 |
$item_name = $item->title? $item->title : pathinfo($item->gmuid, PATHINFO_FILENAME);
|
1152 |
-
$
|
1153 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1154 |
if(1 === $logic && 'publish' == $item->status){
|
1155 |
$gmedias[ $i ]->status = 'public';
|
1156 |
}
|
@@ -1189,7 +1261,7 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
|
|
1189 |
}
|
1190 |
}
|
1191 |
if($count){
|
1192 |
-
$alert[] = sprintf(__('%d items deleted
|
1193 |
}
|
1194 |
}
|
1195 |
$out = gmedia_ios_app_library_data(array('filter', $taxonomy));
|
@@ -1223,7 +1295,7 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
|
|
1223 |
$term['status'] = 'publish';
|
1224 |
}
|
1225 |
if($edit_term && !$gmDB->term_exists($edit_term, $taxonomy)){
|
1226 |
-
$error[] = __('A term with the id provided
|
1227 |
$edit_term = false;
|
1228 |
}
|
1229 |
$term_author = isset($term['global'])? $term['global'] : false;
|
@@ -1271,7 +1343,7 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
|
|
1271 |
$gmDB->update_metadata('gmedia_term', $term_id, $key, $value);
|
1272 |
}
|
1273 |
|
1274 |
-
$alert[] = sprintf(__('Album `%s`
|
1275 |
|
1276 |
} while(0);
|
1277 |
if(1 < $logic && $edit_term && $term_id){
|
@@ -1309,7 +1381,7 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
|
|
1309 |
$error[] = $term_id->get_error_message();
|
1310 |
$term_id = 0;
|
1311 |
} else{
|
1312 |
-
$alert[] = sprintf(__("Category %d
|
1313 |
$alert_info['terms'][ $term_id ] = $term['name'];
|
1314 |
if(1 < $logic){
|
1315 |
$args['include'][] = $term_id;
|
@@ -1335,7 +1407,7 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
|
|
1335 |
$error_info['terms'][ $term_id ] = $term['name'];
|
1336 |
}
|
1337 |
} else{
|
1338 |
-
$error[] = __("A term with the id provided
|
1339 |
}
|
1340 |
} else{
|
1341 |
$error[] = __("Term name can't be only digits or empty", 'grand-media');
|
@@ -1355,7 +1427,7 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
|
|
1355 |
$error[] = $term_id->get_error_message();
|
1356 |
$term_id = 0;
|
1357 |
} else{
|
1358 |
-
$alert['category_add'] = sprintf(__('%d of %d categories
|
1359 |
$alert_info['terms'][ $term_id ] = $term_name;
|
1360 |
}
|
1361 |
} else{
|
@@ -1398,7 +1470,7 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
|
|
1398 |
$error[] = $term_id->get_error_message();
|
1399 |
$term_id = 0;
|
1400 |
} else{
|
1401 |
-
$alert[] = sprintf(__("Tag %d
|
1402 |
$alert_info['terms'][ $term_id ] = $term['name'];
|
1403 |
}
|
1404 |
} else{
|
@@ -1406,7 +1478,7 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
|
|
1406 |
$error_info['terms'][ $term_id ] = $term['name'];
|
1407 |
}
|
1408 |
} else{
|
1409 |
-
$error[] = __("A term with the id provided
|
1410 |
}
|
1411 |
} else{
|
1412 |
$error[] = __("Term name can't be only digits or empty", 'grand-media');
|
@@ -1426,7 +1498,7 @@ function gmedia_ios_app_processor($action, $data, $filter = true){
|
|
1426 |
$error[] = $term_id->get_error_message();
|
1427 |
$term_id = 0;
|
1428 |
} else{
|
1429 |
-
$alert['tag_add'] = sprintf(__('%d of %d tags
|
1430 |
$alert_info['terms'][ $term_id ] = $term_name;
|
1431 |
}
|
1432 |
} else{
|
21 |
|
22 |
$out = array();
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
if(isset($_FILES['userfile']['name'])){
|
25 |
$globaldata = isset($_POST['account'])? $_POST['account'] : false;
|
26 |
if($globaldata){
|
27 |
$globaldata = stripslashes($globaldata);
|
28 |
}
|
29 |
} else{
|
30 |
+
//$globaldata = isset($GLOBALS['HTTP_RAW_POST_DATA'])? $GLOBALS['HTTP_RAW_POST_DATA'] : false;
|
31 |
+
$globaldata = file_get_contents("php://input");
|
32 |
}
|
33 |
|
34 |
if($globaldata){
|
43 |
gmedia_ios_app_counters($json->counter);
|
44 |
}
|
45 |
|
46 |
+
$gmedia_options = get_option('gmediaOptions');
|
47 |
if(isset($json->cookie) && !empty($json->cookie)){
|
48 |
+
if(empty($gmedia_options['mobile_app'])){
|
49 |
+
$out['error'] = array('code' => 'app_inactive', 'message' => 'Service not enabled/activated for this site');
|
50 |
+
header('Content-Type: application/json; charset=' . get_option('blog_charset'), true);
|
51 |
+
echo json_encode($out);
|
52 |
+
die();
|
53 |
+
}
|
54 |
+
|
55 |
$user_id = $gmAuth->validate_auth_cookie($json->cookie);
|
56 |
if($user_id){
|
57 |
$user = wp_set_current_user($user_id);
|
76 |
$out['error'] = array('code' => 'wrongcookie', 'message' => 'Not Valid User');
|
77 |
}
|
78 |
} elseif(isset($json->login)){
|
79 |
+
if(empty($gmedia_options['mobile_app'])){
|
80 |
+
$out['error'] = array('code' => 'app_inactive', 'message' => 'Service not enabled/activated for this site');
|
81 |
+
header('Content-Type: application/json; charset=' . get_option('blog_charset'), true);
|
82 |
+
echo json_encode($out);
|
83 |
+
die();
|
84 |
+
}
|
85 |
+
|
86 |
$out = gmedia_ios_app_login($json);
|
87 |
if(!isset($out['error'])){
|
88 |
$user = wp_set_current_user($out['user']['id']);
|
116 |
} elseif(isset($json->library_terms)){
|
117 |
$args = (array)$json->library_terms;
|
118 |
if(isset($args['taxonomy'])){
|
119 |
+
if(!is_array($args['taxonomy'])){
|
120 |
+
$args['taxonomy'] = array($args['taxonomy']);
|
121 |
+
}
|
122 |
+
$out = gmedia_ios_app_library_data((array)$args['taxonomy'], $args);
|
123 |
}
|
124 |
} else{
|
125 |
$out = gmedia_ios_app_library_data();
|
166 |
break;
|
167 |
}
|
168 |
|
169 |
+
$args = array('username' => $json->login,
|
170 |
+
'password' => $json->password,
|
171 |
+
'_wpnonce_auth_app' => wp_create_nonce('gmedia_auth_app')
|
172 |
);
|
173 |
$out = $gmAuth->generate_auth_cookie($args);
|
174 |
|
191 |
}
|
192 |
|
193 |
if(version_compare('3', $gmapp_version, '<=')){
|
194 |
+
$logic = 2;
|
195 |
if(version_compare('3.1', $gmapp_version, '<')){
|
196 |
+
$logic = 3;
|
197 |
}
|
198 |
$terms_per_page = 40;
|
199 |
} else{
|
504 |
$term->cap = (4 == $cap)? 4 : 0;
|
505 |
}
|
506 |
|
507 |
+
function gmedia_object_to_array($obj) {
|
508 |
+
if(is_object($obj)) $obj = (array) $obj;
|
509 |
+
if(is_array($obj)) {
|
510 |
+
$new = array();
|
511 |
+
foreach($obj as $key => $val) {
|
512 |
+
$new[$key] = gmedia_object_to_array($val);
|
513 |
+
}
|
514 |
+
}
|
515 |
+
else $new = $obj;
|
516 |
+
return $new;
|
517 |
+
}
|
518 |
+
|
519 |
/**
|
520 |
* @param $action
|
521 |
* @param $data
|
531 |
if(version_compare('3', $gmapp_version, '<=')){
|
532 |
$logic = 2;
|
533 |
if(version_compare('3.1', $gmapp_version, '<')){
|
534 |
+
$logic = 3;
|
535 |
}
|
536 |
} else{
|
537 |
$logic = 1;
|
541 |
$error_info = array();
|
542 |
$alert = array();
|
543 |
$alert_info = array();
|
544 |
+
|
545 |
+
$data = gmedia_object_to_array($data);
|
546 |
+
|
547 |
switch($action){
|
548 |
case 'do_library':
|
549 |
|
570 |
$file_name = $_FILES['userfile']['name'];
|
571 |
$file_tmp = $_FILES['userfile']['tmp_name'];
|
572 |
} else{
|
573 |
+
switch($_FILES['userfile']['error']){
|
574 |
+
case 0: {
|
575 |
+
//no error; possible file attack!
|
576 |
+
$error[] = __("There was a problem with your upload.", 'grand-media');
|
577 |
+
break;
|
578 |
+
}
|
579 |
+
case 1: {
|
580 |
+
//uploaded file exceeds the upload_max_filesize directive in php.ini
|
581 |
+
$error[] = __("Uploaded file exceeds the upload_max_filesize directive in php.ini", 'grand-media');
|
582 |
+
break;
|
583 |
+
}
|
584 |
+
case 2: {
|
585 |
+
//uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form
|
586 |
+
$error[] = __("Uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the form", 'grand-media');
|
587 |
+
break;
|
588 |
+
}
|
589 |
+
case 3: {
|
590 |
+
//uploaded file was only partially uploaded
|
591 |
+
$error[] = __("The file you are trying upload was only partially uploaded.", 'grand-media');
|
592 |
+
break;
|
593 |
+
}
|
594 |
+
case 4: {
|
595 |
+
//no file was uploaded
|
596 |
+
$error[] = __("You must select an image for upload.", 'grand-media');
|
597 |
+
break;
|
598 |
+
}
|
599 |
+
default: {
|
600 |
+
//a default error, just in case! :)
|
601 |
+
$error[] = __("There was a problem with your upload.", 'grand-media');
|
602 |
+
break;
|
603 |
+
}
|
604 |
+
}
|
605 |
break;
|
606 |
}
|
607 |
|
617 |
if(empty($gmedia['albums'])){
|
618 |
$gmedia['terms']['gmedia_album'] = '';
|
619 |
} else{
|
620 |
+
$alb = isset($gmedia['albums'][0]['term_id'])? $gmedia['albums'][0]['term_id'] : $gmedia['albums'][0]['name'];
|
621 |
$gmedia['terms']['gmedia_album'] = $alb;
|
622 |
}
|
623 |
if(empty($gmedia['categories'])){
|
625 |
} else{
|
626 |
$categories = array();
|
627 |
foreach($gmedia['categories'] as $category){
|
628 |
+
$categories[] = isset($category['term_id'])? $category['term_id'] : $category['name'];
|
629 |
}
|
630 |
$gmedia['terms']['gmedia_category'] = implode(',', $categories);
|
631 |
}
|
634 |
} else{
|
635 |
$tags = array();
|
636 |
foreach($gmedia['tags'] as $tag){
|
637 |
+
$tags[] = isset($tag['term_id'])? $tag['term_id'] : $tag['name'];
|
638 |
}
|
639 |
$gmedia['terms']['gmedia_tag'] = implode(',', $tags);
|
640 |
}
|
681 |
if(empty($gmedia['albums'])){
|
682 |
$gmedia['terms']['gmedia_album'] = '';
|
683 |
} else{
|
684 |
+
if(isset($gmedia['albums'][0]['term_id'])){
|
685 |
+
$gmedia['terms']['gmedia_album'] = $gmedia['albums'][0]['term_id'];
|
686 |
} elseif(current_user_can('gmedia_album_manage')){
|
687 |
+
$gmedia['terms']['gmedia_album'] = $gmedia['albums'][0]['name'];
|
688 |
}
|
689 |
}
|
690 |
if(empty($gmedia['categories'])){
|
692 |
} else{
|
693 |
$categories = array();
|
694 |
foreach($gmedia['categories'] as $category){
|
695 |
+
if(isset($category['term_id'])){
|
696 |
+
$categories[] = $category['term_id'];
|
697 |
} elseif(current_user_can('gmedia_category_manage')){
|
698 |
+
$categories[] = $category['name'];
|
699 |
}
|
700 |
}
|
701 |
$gmedia['terms']['gmedia_category'] = $categories;
|
705 |
} else{
|
706 |
$tags = array();
|
707 |
foreach($gmedia['tags'] as $tag){
|
708 |
+
if(isset($tag['term_id'])){
|
709 |
+
$tags[] = $tag['term_id'];
|
710 |
} elseif(current_user_can('gmedia_tag_manage')){
|
711 |
+
$tags[] = $tag['name'];
|
712 |
}
|
713 |
}
|
714 |
$gmedia['terms']['gmedia_tag'] = $tags;
|
863 |
$error[] = __('You are not allowed to edit media', 'grand-media');
|
864 |
break;
|
865 |
}
|
866 |
+
$cover = (int)$data['add_cover'];
|
867 |
$count = count($data['selected']);
|
868 |
foreach($data['selected'] as $item){
|
869 |
$gm_item = $gmDB->get_gmedia($item);
|
870 |
if(!$gm_item || ($user_ID != $gm_item->author && !current_user_can('gmedia_edit_others_media'))){
|
871 |
+
$count --;
|
872 |
continue;
|
873 |
}
|
874 |
if('image' == substr($gm_item->mime_type, 0, 5)){
|
875 |
+
$count --;
|
876 |
continue;
|
877 |
}
|
878 |
if($cover){
|
879 |
$gmDB->update_metadata('gmedia', $gm_item->ID, '_cover', $cover);
|
880 |
+
} else{
|
881 |
$gmDB->delete_metadata('gmedia', $gm_item->ID, '_cover');
|
882 |
}
|
883 |
}
|
929 |
}
|
930 |
}
|
931 |
if($count){
|
932 |
+
$alert[] = sprintf(__('%d items deleted successfully', 'grand-media'), $count);
|
933 |
}
|
934 |
break;
|
935 |
}
|
949 |
$filter = $filter? gmedia_ios_app_library_data(array('filter')) : array();
|
950 |
|
951 |
$mime_type = ($logic > 2)? array('image', 'audio') : 'image';
|
952 |
+
$args = array('mime_type' => $mime_type,
|
953 |
+
'orderby' => 'ID',
|
954 |
+
'order' => 'DESC',
|
955 |
+
'per_page' => 100,
|
956 |
+
'page' => 1,
|
957 |
+
'tag__in' => null,
|
958 |
+
'category__in' => null,
|
959 |
+
'album__in' => null,
|
960 |
+
'gmedia__in' => null,
|
961 |
+
'author' => 0,
|
962 |
+
'status' => null
|
963 |
);
|
964 |
|
965 |
$terms_ids_query = array();
|
966 |
if(!empty($data['tag__in'])){
|
967 |
+
$tag_ids = wp_parse_id_list($data['tag__in']);
|
968 |
if(empty($data['category__in']) && empty($data['album__in'])){
|
969 |
$args['orderby'] = $gmGallery->options['in_tag_orderby'];
|
970 |
$args['order'] = $gmGallery->options['in_tag_order'];
|
971 |
}
|
972 |
+
$terms_ids_query = array_merge($terms_ids_query, $tag_ids);
|
973 |
}
|
974 |
if(!empty($data['category__in'])){
|
975 |
$cat_ids = wp_parse_id_list($data['category__in']);
|
1058 |
'current_page' => $gmDB->openPage,
|
1059 |
'items_count' => $gmDB->resultPerPage,
|
1060 |
'total_count' => $gmDB->totalResult,
|
1061 |
+
'count' => count($all_gmedias_ids),
|
1062 |
+
//'args' => $data
|
1063 |
));
|
1064 |
foreach($gmedias as $i => $item){
|
1065 |
|
1131 |
}
|
1132 |
$gmedias[ $i ]->categories = $categories;
|
1133 |
|
1134 |
+
$gmedias[ $i ]->meta = array('thumb' => $_metadata['thumb'],
|
1135 |
+
'web' => $_metadata['web'],
|
1136 |
+
'original' => $_metadata['original']
|
1137 |
);
|
1138 |
+
$gmedias[ $i ]->meta['thumb']['link'] = "{$gmCore->upload['url']}/{$gmGallery->options['folder']['image_thumb']}/{$item->gmuid}";
|
1139 |
+
$gmedias[ $i ]->meta['web']['link'] = "{$gmCore->upload['url']}/{$gmGallery->options['folder']['image']}/{$item->gmuid}";
|
1140 |
+
if(is_file("{$gmCore->upload['path']}/{$gmGallery->options['folder']['image_original']}/{$item->gmuid}")){
|
1141 |
+
$gmedias[ $i ]->meta['original']['link'] = "{$gmCore->upload['url']}/{$gmGallery->options['folder']['image_original']}/{$item->gmuid}";
|
1142 |
+
} else{
|
1143 |
+
$gmedias[ $i ]->meta['original']['link'] = '';
|
1144 |
+
}
|
1145 |
|
1146 |
if(isset($_metadata['image_meta'])){
|
1147 |
$gmedias[ $i ]->meta['data'] = $_metadata['image_meta'];
|
1153 |
if(!empty($meta['_cover'][0])){
|
1154 |
$cover_gmedia = $gmDB->get_gmedia($meta['_cover'][0]);
|
1155 |
if($cover_gmedia){
|
1156 |
+
$cover_metadata = $gmDB->get_metadata('gmedia', $cover_gmedia->ID, '_metadata', true);
|
1157 |
+
$gmedias[ $i ]->meta = array('thumb' => $cover_metadata['thumb'],
|
1158 |
+
'web' => $cover_metadata['web'],
|
1159 |
+
'original' => $cover_metadata['original']
|
1160 |
);
|
1161 |
+
$gmedias[ $i ]->meta['thumb']['link'] = "{$gmCore->upload['url']}/{$gmGallery->options['folder']['image_thumb']}/{$cover_gmedia->gmuid}";
|
1162 |
+
$gmedias[ $i ]->meta['web']['link'] = "{$gmCore->upload['url']}/{$gmGallery->options['folder']['image']}/{$cover_gmedia->gmuid}";
|
1163 |
+
if(is_file("{$gmCore->upload['path']}/{$gmGallery->options['folder']['image_original']}/{$cover_gmedia->gmuid}")){
|
1164 |
+
$gmedias[ $i ]->meta['original']['link'] = "{$gmCore->upload['url']}/{$gmGallery->options['folder']['image_original']}/{$cover_gmedia->gmuid}";
|
1165 |
+
} else{
|
1166 |
+
$gmedias[ $i ]->meta['original']['link'] = '';
|
1167 |
+
}
|
1168 |
}
|
1169 |
}
|
1170 |
unset($meta['_cover']);
|
1214 |
}
|
1215 |
|
1216 |
$item_name = $item->title? $item->title : pathinfo($item->gmuid, PATHINFO_FILENAME);
|
1217 |
+
if(!empty($gmedias[ $i ]->post_id)){
|
1218 |
+
$gmedias[ $i ]->sharelink = get_permalink($gmedias[ $i ]->post_id);
|
1219 |
+
} else{
|
1220 |
+
$gmedia_hashid = gmedia_hash_id_encode($item->ID, 'single');
|
1221 |
+
$gmedias[ $i ]->sharelink = str_replace(array('$1', '$2'), array(
|
1222 |
+
urlencode($gmedia_hashid),
|
1223 |
+
's'
|
1224 |
+
), $share_link_base);
|
1225 |
+
}
|
1226 |
if(1 === $logic && 'publish' == $item->status){
|
1227 |
$gmedias[ $i ]->status = 'public';
|
1228 |
}
|
1261 |
}
|
1262 |
}
|
1263 |
if($count){
|
1264 |
+
$alert[] = sprintf(__('%d items deleted successfully', 'grand-media'), $count);
|
1265 |
}
|
1266 |
}
|
1267 |
$out = gmedia_ios_app_library_data(array('filter', $taxonomy));
|
1295 |
$term['status'] = 'publish';
|
1296 |
}
|
1297 |
if($edit_term && !$gmDB->term_exists($edit_term, $taxonomy)){
|
1298 |
+
$error[] = __('A term with the id provided does not exists', 'grand-media');
|
1299 |
$edit_term = false;
|
1300 |
}
|
1301 |
$term_author = isset($term['global'])? $term['global'] : false;
|
1343 |
$gmDB->update_metadata('gmedia_term', $term_id, $key, $value);
|
1344 |
}
|
1345 |
|
1346 |
+
$alert[] = sprintf(__('Album `%s` successfully saved', 'grand-media'), $term['name']);
|
1347 |
|
1348 |
} while(0);
|
1349 |
if(1 < $logic && $edit_term && $term_id){
|
1381 |
$error[] = $term_id->get_error_message();
|
1382 |
$term_id = 0;
|
1383 |
} else{
|
1384 |
+
$alert[] = sprintf(__("Category %d successfully updated", 'grand-media'), $term_id);
|
1385 |
$alert_info['terms'][ $term_id ] = $term['name'];
|
1386 |
if(1 < $logic){
|
1387 |
$args['include'][] = $term_id;
|
1407 |
$error_info['terms'][ $term_id ] = $term['name'];
|
1408 |
}
|
1409 |
} else{
|
1410 |
+
$error[] = __("A term with the id provided does not exists", 'grand-media');
|
1411 |
}
|
1412 |
} else{
|
1413 |
$error[] = __("Term name can't be only digits or empty", 'grand-media');
|
1427 |
$error[] = $term_id->get_error_message();
|
1428 |
$term_id = 0;
|
1429 |
} else{
|
1430 |
+
$alert['category_add'] = sprintf(__('%d of %d categories successfully added', 'grand-media'), ++ $terms_added, $terms_qty);
|
1431 |
$alert_info['terms'][ $term_id ] = $term_name;
|
1432 |
}
|
1433 |
} else{
|
1470 |
$error[] = $term_id->get_error_message();
|
1471 |
$term_id = 0;
|
1472 |
} else{
|
1473 |
+
$alert[] = sprintf(__("Tag %d successfully updated", 'grand-media'), $term_id);
|
1474 |
$alert_info['terms'][ $term_id ] = $term['name'];
|
1475 |
}
|
1476 |
} else{
|
1478 |
$error_info['terms'][ $term_id ] = $term['name'];
|
1479 |
}
|
1480 |
} else{
|
1481 |
+
$error[] = __("A term with the id provided does not exists", 'grand-media');
|
1482 |
}
|
1483 |
} else{
|
1484 |
$error[] = __("Term name can't be only digits or empty", 'grand-media');
|
1498 |
$error[] = $term_id->get_error_message();
|
1499 |
$term_id = 0;
|
1500 |
} else{
|
1501 |
+
$alert['tag_add'] = sprintf(__('%d of %d tags successfully added', 'grand-media'), ++ $terms_added, $terms_qty);
|
1502 |
$alert_info['terms'][ $term_id ] = $term_name;
|
1503 |
}
|
1504 |
} else{
|
app/inc/json.auth.php
CHANGED
@@ -33,14 +33,14 @@ class Gmedia_JSON_API_Auth_Controller
|
|
33 |
{
|
34 |
|
35 |
/**
|
36 |
-
* @var $
|
37 |
* @var $username
|
38 |
* @var $password
|
39 |
*
|
40 |
*/
|
41 |
extract($args);
|
42 |
|
43 |
-
if (! wp_verify_nonce($
|
44 |
return array('error' => array('code' => 'nononce', 'message' => "Something goes wrong (nonce error)... try again."));
|
45 |
}
|
46 |
|
33 |
{
|
34 |
|
35 |
/**
|
36 |
+
* @var $_wpnonce_auth_app
|
37 |
* @var $username
|
38 |
* @var $password
|
39 |
*
|
40 |
*/
|
41 |
extract($args);
|
42 |
|
43 |
+
if (! wp_verify_nonce($_wpnonce_auth_app, 'gmedia_auth_app')) {
|
44 |
return array('error' => array('code' => 'nononce', 'message' => "Something goes wrong (nonce error)... try again."));
|
45 |
}
|
46 |
|
assets/gmedia.global.front.js
CHANGED
@@ -2,4 +2,17 @@
|
|
2 |
* gmedia Globals
|
3 |
* @var GmediaGallery
|
4 |
*/
|
5 |
-
var ajaxurl = GmediaGallery.ajaxurl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
* gmedia Globals
|
3 |
* @var GmediaGallery
|
4 |
*/
|
5 |
+
var ajaxurl = GmediaGallery.ajaxurl;
|
6 |
+
jQuery(function($) {
|
7 |
+
$('style.gmedia_assets_style_import').appendTo('head');
|
8 |
+
$('style.gmedia_module_style_import').appendTo('head');
|
9 |
+
|
10 |
+
$('script.gm_script2html').each(function(){
|
11 |
+
var html = $(this).html();
|
12 |
+
$(this).replaceWith(html);
|
13 |
+
});
|
14 |
+
|
15 |
+
setTimeout(function(){
|
16 |
+
$('a[download]').off('click');
|
17 |
+
}, 50);
|
18 |
+
});
|
assets/mag-popup/jquery.magnific-popup.js
ADDED
@@ -0,0 +1,1860 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*! Magnific Popup - v1.1.0 - 2016-02-20
|
2 |
+
* http://dimsemenov.com/plugins/magnific-popup/
|
3 |
+
* Copyright (c) 2016 Dmitry Semenov; */
|
4 |
+
;(function (factory) {
|
5 |
+
if (typeof define === 'function' && define.amd) {
|
6 |
+
// AMD. Register as an anonymous module.
|
7 |
+
define(['jquery'], factory);
|
8 |
+
} else if (typeof exports === 'object') {
|
9 |
+
// Node/CommonJS
|
10 |
+
factory(require('jquery'));
|
11 |
+
} else {
|
12 |
+
// Browser globals
|
13 |
+
factory(window.jQuery || window.Zepto);
|
14 |
+
}
|
15 |
+
}(function($) {
|
16 |
+
|
17 |
+
/*>>core*/
|
18 |
+
/**
|
19 |
+
*
|
20 |
+
* Magnific Popup Core JS file
|
21 |
+
*
|
22 |
+
*/
|
23 |
+
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Private static constants
|
27 |
+
*/
|
28 |
+
var CLOSE_EVENT = 'Close',
|
29 |
+
BEFORE_CLOSE_EVENT = 'BeforeClose',
|
30 |
+
AFTER_CLOSE_EVENT = 'AfterClose',
|
31 |
+
BEFORE_APPEND_EVENT = 'BeforeAppend',
|
32 |
+
MARKUP_PARSE_EVENT = 'MarkupParse',
|
33 |
+
OPEN_EVENT = 'Open',
|
34 |
+
CHANGE_EVENT = 'Change',
|
35 |
+
NS = 'mfp',
|
36 |
+
EVENT_NS = '.' + NS,
|
37 |
+
READY_CLASS = 'mfp-ready',
|
38 |
+
REMOVING_CLASS = 'mfp-removing',
|
39 |
+
PREVENT_CLOSE_CLASS = 'mfp-prevent-close';
|
40 |
+
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Private vars
|
44 |
+
*/
|
45 |
+
/*jshint -W079 */
|
46 |
+
var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this'
|
47 |
+
MagnificPopup = function(){},
|
48 |
+
_isJQ = !!(window.jQuery),
|
49 |
+
_prevStatus,
|
50 |
+
_window = $(window),
|
51 |
+
_document,
|
52 |
+
_prevContentType,
|
53 |
+
_wrapClasses,
|
54 |
+
_currPopupType;
|
55 |
+
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Private functions
|
59 |
+
*/
|
60 |
+
var _mfpOn = function(name, f) {
|
61 |
+
mfp.ev.on(NS + name + EVENT_NS, f);
|
62 |
+
},
|
63 |
+
_getEl = function(className, appendTo, html, raw) {
|
64 |
+
var el = document.createElement('div');
|
65 |
+
el.className = 'mfp-'+className;
|
66 |
+
if(html) {
|
67 |
+
el.innerHTML = html;
|
68 |
+
}
|
69 |
+
if(!raw) {
|
70 |
+
el = $(el);
|
71 |
+
if(appendTo) {
|
72 |
+
el.appendTo(appendTo);
|
73 |
+
}
|
74 |
+
} else if(appendTo) {
|
75 |
+
appendTo.appendChild(el);
|
76 |
+
}
|
77 |
+
return el;
|
78 |
+
},
|
79 |
+
_mfpTrigger = function(e, data) {
|
80 |
+
mfp.ev.triggerHandler(NS + e, data);
|
81 |
+
|
82 |
+
if(mfp.st.callbacks) {
|
83 |
+
// converts "mfpEventName" to "eventName" callback and triggers it if it's present
|
84 |
+
e = e.charAt(0).toLowerCase() + e.slice(1);
|
85 |
+
if(mfp.st.callbacks[e]) {
|
86 |
+
mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]);
|
87 |
+
}
|
88 |
+
}
|
89 |
+
},
|
90 |
+
_getCloseBtn = function(type) {
|
91 |
+
if(type !== _currPopupType || !mfp.currTemplate.closeBtn) {
|
92 |
+
mfp.currTemplate.closeBtn = $( mfp.st.closeMarkup.replace('%title%', mfp.st.tClose ) );
|
93 |
+
_currPopupType = type;
|
94 |
+
}
|
95 |
+
return mfp.currTemplate.closeBtn;
|
96 |
+
},
|
97 |
+
// Initialize Magnific Popup only when called at least once
|
98 |
+
_checkInstance = function() {
|
99 |
+
if(!$.magnificPopup.instance) {
|
100 |
+
/*jshint -W020 */
|
101 |
+
mfp = new MagnificPopup();
|
102 |
+
mfp.init();
|
103 |
+
$.magnificPopup.instance = mfp;
|
104 |
+
}
|
105 |
+
},
|
106 |
+
// CSS transition detection, http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr
|
107 |
+
supportsTransitions = function() {
|
108 |
+
var s = document.createElement('p').style, // 's' for style. better to create an element if body yet to exist
|
109 |
+
v = ['ms','O','Moz','Webkit']; // 'v' for vendor
|
110 |
+
|
111 |
+
if( s['transition'] !== undefined ) {
|
112 |
+
return true;
|
113 |
+
}
|
114 |
+
|
115 |
+
while( v.length ) {
|
116 |
+
if( v.pop() + 'Transition' in s ) {
|
117 |
+
return true;
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
return false;
|
122 |
+
};
|
123 |
+
|
124 |
+
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Public functions
|
128 |
+
*/
|
129 |
+
MagnificPopup.prototype = {
|
130 |
+
|
131 |
+
constructor: MagnificPopup,
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Initializes Magnific Popup plugin.
|
135 |
+
* This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed
|
136 |
+
*/
|
137 |
+
init: function() {
|
138 |
+
var appVersion = navigator.appVersion;
|
139 |
+
mfp.isLowIE = mfp.isIE8 = document.all && !document.addEventListener;
|
140 |
+
mfp.isAndroid = (/android/gi).test(appVersion);
|
141 |
+
mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion);
|
142 |
+
mfp.supportsTransition = supportsTransitions();
|
143 |
+
|
144 |
+
// We disable fixed positioned lightbox on devices that don't handle it nicely.
|
145 |
+
// If you know a better way of detecting this - let me know.
|
146 |
+
mfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) );
|
147 |
+
_document = $(document);
|
148 |
+
|
149 |
+
mfp.popupsCache = {};
|
150 |
+
},
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Opens popup
|
154 |
+
* @param data [description]
|
155 |
+
*/
|
156 |
+
open: function(data) {
|
157 |
+
|
158 |
+
var i;
|
159 |
+
|
160 |
+
if(data.isObj === false) {
|
161 |
+
// convert jQuery collection to array to avoid conflicts later
|
162 |
+
mfp.items = data.items.toArray();
|
163 |
+
|
164 |
+
mfp.index = 0;
|
165 |
+
var items = data.items,
|
166 |
+
item;
|
167 |
+
for(i = 0; i < items.length; i++) {
|
168 |
+
item = items[i];
|
169 |
+
if(item.parsed) {
|
170 |
+
item = item.el[0];
|
171 |
+
}
|
172 |
+
if(item === data.el[0]) {
|
173 |
+
mfp.index = i;
|
174 |
+
break;
|
175 |
+
}
|
176 |
+
}
|
177 |
+
} else {
|
178 |
+
mfp.items = $.isArray(data.items) ? data.items : [data.items];
|
179 |
+
mfp.index = data.index || 0;
|
180 |
+
}
|
181 |
+
|
182 |
+
// if popup is already opened - we just update the content
|
183 |
+
if(mfp.isOpen) {
|
184 |
+
mfp.updateItemHTML();
|
185 |
+
return;
|
186 |
+
}
|
187 |
+
|
188 |
+
mfp.types = [];
|
189 |
+
_wrapClasses = '';
|
190 |
+
if(data.mainEl && data.mainEl.length) {
|
191 |
+
mfp.ev = data.mainEl.eq(0);
|
192 |
+
} else {
|
193 |
+
mfp.ev = _document;
|
194 |
+
}
|
195 |
+
|
196 |
+
if(data.key) {
|
197 |
+
if(!mfp.popupsCache[data.key]) {
|
198 |
+
mfp.popupsCache[data.key] = {};
|
199 |
+
}
|
200 |
+
mfp.currTemplate = mfp.popupsCache[data.key];
|
201 |
+
} else {
|
202 |
+
mfp.currTemplate = {};
|
203 |
+
}
|
204 |
+
|
205 |
+
|
206 |
+
|
207 |
+
mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data );
|
208 |
+
mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos;
|
209 |
+
|
210 |
+
if(mfp.st.modal) {
|
211 |
+
mfp.st.closeOnContentClick = false;
|
212 |
+
mfp.st.closeOnBgClick = false;
|
213 |
+
mfp.st.showCloseBtn = false;
|
214 |
+
mfp.st.enableEscapeKey = false;
|
215 |
+
}
|
216 |
+
|
217 |
+
|
218 |
+
// Building markup
|
219 |
+
// main containers are created only once
|
220 |
+
if(!mfp.bgOverlay) {
|
221 |
+
|
222 |
+
// Dark overlay
|
223 |
+
mfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS, function() {
|
224 |
+
mfp.close();
|
225 |
+
});
|
226 |
+
|
227 |
+
mfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click'+EVENT_NS, function(e) {
|
228 |
+
if(mfp._checkIfClose(e.target)) {
|
229 |
+
mfp.close();
|
230 |
+
}
|
231 |
+
});
|
232 |
+
|
233 |
+
mfp.container = _getEl('container', mfp.wrap);
|
234 |
+
}
|
235 |
+
|
236 |
+
mfp.contentContainer = _getEl('content');
|
237 |
+
if(mfp.st.preloader) {
|
238 |
+
mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading);
|
239 |
+
}
|
240 |
+
|
241 |
+
|
242 |
+
// Initializing modules
|
243 |
+
var modules = $.magnificPopup.modules;
|
244 |
+
for(i = 0; i < modules.length; i++) {
|
245 |
+
var n = modules[i];
|
246 |
+
n = n.charAt(0).toUpperCase() + n.slice(1);
|
247 |
+
mfp['init'+n].call(mfp);
|
248 |
+
}
|
249 |
+
_mfpTrigger('BeforeOpen');
|
250 |
+
|
251 |
+
|
252 |
+
if(mfp.st.showCloseBtn) {
|
253 |
+
// Close button
|
254 |
+
if(!mfp.st.closeBtnInside) {
|
255 |
+
mfp.wrap.append( _getCloseBtn() );
|
256 |
+
} else {
|
257 |
+
_mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) {
|
258 |
+
values.close_replaceWith = _getCloseBtn(item.type);
|
259 |
+
});
|
260 |
+
_wrapClasses += ' mfp-close-btn-in';
|
261 |
+
}
|
262 |
+
}
|
263 |
+
|
264 |
+
if(mfp.st.alignTop) {
|
265 |
+
_wrapClasses += ' mfp-align-top';
|
266 |
+
}
|
267 |
+
|
268 |
+
|
269 |
+
|
270 |
+
if(mfp.fixedContentPos) {
|
271 |
+
mfp.wrap.css({
|
272 |
+
overflow: mfp.st.overflowY,
|
273 |
+
overflowX: 'hidden',
|
274 |
+
overflowY: mfp.st.overflowY
|
275 |
+
});
|
276 |
+
} else {
|
277 |
+
mfp.wrap.css({
|
278 |
+
top: _window.scrollTop(),
|
279 |
+
position: 'absolute'
|
280 |
+
});
|
281 |
+
}
|
282 |
+
if( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) ) {
|
283 |
+
mfp.bgOverlay.css({
|
284 |
+
height: _document.height(),
|
285 |
+
position: 'absolute'
|
286 |
+
});
|
287 |
+
}
|
288 |
+
|
289 |
+
|
290 |
+
|
291 |
+
if(mfp.st.enableEscapeKey) {
|
292 |
+
// Close on ESC key
|
293 |
+
_document.on('keyup' + EVENT_NS, function(e) {
|
294 |
+
if(e.keyCode === 27) {
|
295 |
+
mfp.close();
|
296 |
+
}
|
297 |
+
});
|
298 |
+
}
|
299 |
+
|
300 |
+
_window.on('resize' + EVENT_NS, function() {
|
301 |
+
mfp.updateSize();
|
302 |
+
});
|
303 |
+
|
304 |
+
|
305 |
+
if(!mfp.st.closeOnContentClick) {
|
306 |
+
_wrapClasses += ' mfp-auto-cursor';
|
307 |
+
}
|
308 |
+
|
309 |
+
if(_wrapClasses)
|
310 |
+
mfp.wrap.addClass(_wrapClasses);
|
311 |
+
|
312 |
+
|
313 |
+
// this triggers recalculation of layout, so we get it once to not to trigger twice
|
314 |
+
var windowHeight = mfp.wH = _window.height();
|
315 |
+
|
316 |
+
|
317 |
+
var windowStyles = {};
|
318 |
+
|
319 |
+
if( mfp.fixedContentPos ) {
|
320 |
+
if(mfp._hasScrollBar(windowHeight)){
|
321 |
+
var s = mfp._getScrollbarSize();
|
322 |
+
if(s) {
|
323 |
+
windowStyles.marginRight = s;
|
324 |
+
}
|
325 |
+
}
|
326 |
+
}
|
327 |
+
|
328 |
+
if(mfp.fixedContentPos) {
|
329 |
+
if(!mfp.isIE7) {
|
330 |
+
windowStyles.overflow = 'hidden';
|
331 |
+
} else {
|
332 |
+
// ie7 double-scroll bug
|
333 |
+
$('body, html').css('overflow', 'hidden');
|
334 |
+
}
|
335 |
+
}
|
336 |
+
|
337 |
+
|
338 |
+
|
339 |
+
var classesToadd = mfp.st.mainClass;
|
340 |
+
if(mfp.isIE7) {
|
341 |
+
classesToadd += ' mfp-ie7';
|
342 |
+
}
|
343 |
+
if(classesToadd) {
|
344 |
+
mfp._addClassToMFP( classesToadd );
|
345 |
+
}
|
346 |
+
|
347 |
+
// add content
|
348 |
+
mfp.updateItemHTML();
|
349 |
+
|
350 |
+
_mfpTrigger('BuildControls');
|
351 |
+
|
352 |
+
// remove scrollbar, add margin e.t.c
|
353 |
+
$('html').css(windowStyles);
|
354 |
+
|
355 |
+
// add everything to DOM
|
356 |
+
mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || $(document.body) );
|
357 |
+
|
358 |
+
// Save last focused element
|
359 |
+
mfp._lastFocusedEl = document.activeElement;
|
360 |
+
|
361 |
+
// Wait for next cycle to allow CSS transition
|
362 |
+
setTimeout(function() {
|
363 |
+
|
364 |
+
if(mfp.content) {
|
365 |
+
mfp._addClassToMFP(READY_CLASS);
|
366 |
+
mfp._setFocus();
|
367 |
+
} else {
|
368 |
+
// if content is not defined (not loaded e.t.c) we add class only for BG
|
369 |
+
mfp.bgOverlay.addClass(READY_CLASS);
|
370 |
+
}
|
371 |
+
|
372 |
+
// Trap the focus in popup
|
373 |
+
_document.on('focusin' + EVENT_NS, mfp._onFocusIn);
|
374 |
+
|
375 |
+
}, 16);
|
376 |
+
|
377 |
+
mfp.isOpen = true;
|
378 |
+
mfp.updateSize(windowHeight);
|
379 |
+
_mfpTrigger(OPEN_EVENT);
|
380 |
+
|
381 |
+
return data;
|
382 |
+
},
|
383 |
+
|
384 |
+
/**
|
385 |
+
* Closes the popup
|
386 |
+
*/
|
387 |
+
close: function() {
|
388 |
+
if(!mfp.isOpen) return;
|
389 |
+
_mfpTrigger(BEFORE_CLOSE_EVENT);
|
390 |
+
|
391 |
+
mfp.isOpen = false;
|
392 |
+
// for CSS3 animation
|
393 |
+
if(mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition ) {
|
394 |
+
mfp._addClassToMFP(REMOVING_CLASS);
|
395 |
+
setTimeout(function() {
|
396 |
+
mfp._close();
|
397 |
+
}, mfp.st.removalDelay);
|
398 |
+
} else {
|
399 |
+
mfp._close();
|
400 |
+
}
|
401 |
+
},
|
402 |
+
|
403 |
+
/**
|
404 |
+
* Helper for close() function
|
405 |
+
*/
|
406 |
+
_close: function() {
|
407 |
+
_mfpTrigger(CLOSE_EVENT);
|
408 |
+
|
409 |
+
var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' ';
|
410 |
+
|
411 |
+
mfp.bgOverlay.detach();
|
412 |
+
mfp.wrap.detach();
|
413 |
+
mfp.container.empty();
|
414 |
+
|
415 |
+
if(mfp.st.mainClass) {
|
416 |
+
classesToRemove += mfp.st.mainClass + ' ';
|
417 |
+
}
|
418 |
+
|
419 |
+
mfp._removeClassFromMFP(classesToRemove);
|
420 |
+
|
421 |
+
if(mfp.fixedContentPos) {
|
422 |
+
var windowStyles = {marginRight: ''};
|
423 |
+
if(mfp.isIE7) {
|
424 |
+
$('body, html').css('overflow', '');
|
425 |
+
} else {
|
426 |
+
windowStyles.overflow = '';
|
427 |
+
}
|
428 |
+
$('html').css(windowStyles);
|
429 |
+
}
|
430 |
+
|
431 |
+
_document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS);
|
432 |
+
mfp.ev.off(EVENT_NS);
|
433 |
+
|
434 |
+
// clean up DOM elements that aren't removed
|
435 |
+
mfp.wrap.attr('class', 'mfp-wrap').removeAttr('style');
|
436 |
+
mfp.bgOverlay.attr('class', 'mfp-bg');
|
437 |
+
mfp.container.attr('class', 'mfp-container');
|
438 |
+
|
439 |
+
// remove close button from target element
|
440 |
+
if(mfp.st.showCloseBtn &&
|
441 |
+
(!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) {
|
442 |
+
if(mfp.currTemplate.closeBtn)
|
443 |
+
mfp.currTemplate.closeBtn.detach();
|
444 |
+
}
|
445 |
+
|
446 |
+
|
447 |
+
if(mfp.st.autoFocusLast && mfp._lastFocusedEl) {
|
448 |
+
$(mfp._lastFocusedEl).focus(); // put tab focus back
|
449 |
+
}
|
450 |
+
mfp.currItem = null;
|
451 |
+
mfp.content = null;
|
452 |
+
mfp.currTemplate = null;
|
453 |
+
mfp.prevHeight = 0;
|
454 |
+
|
455 |
+
_mfpTrigger(AFTER_CLOSE_EVENT);
|
456 |
+
},
|
457 |
+
|
458 |
+
updateSize: function(winHeight) {
|
459 |
+
|
460 |
+
if(mfp.isIOS) {
|
461 |
+
// fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2
|
462 |
+
var zoomLevel = document.documentElement.clientWidth / window.innerWidth;
|
463 |
+
var height = window.innerHeight * zoomLevel;
|
464 |
+
mfp.wrap.css('height', height);
|
465 |
+
mfp.wH = height;
|
466 |
+
} else {
|
467 |
+
mfp.wH = winHeight || _window.height();
|
468 |
+
}
|
469 |
+
// Fixes #84: popup incorrectly positioned with position:relative on body
|
470 |
+
if(!mfp.fixedContentPos) {
|
471 |
+
mfp.wrap.css('height', mfp.wH);
|
472 |
+
}
|
473 |
+
|
474 |
+
_mfpTrigger('Resize');
|
475 |
+
|
476 |
+
},
|
477 |
+
|
478 |
+
/**
|
479 |
+
* Set content of popup based on current index
|
480 |
+
*/
|
481 |
+
updateItemHTML: function() {
|
482 |
+
var item = mfp.items[mfp.index];
|
483 |
+
|
484 |
+
// Detach and perform modifications
|
485 |
+
mfp.contentContainer.detach();
|
486 |
+
|
487 |
+
if(mfp.content)
|
488 |
+
mfp.content.detach();
|
489 |
+
|
490 |
+
if(!item.parsed) {
|
491 |
+
item = mfp.parseEl( mfp.index );
|
492 |
+
}
|
493 |
+
|
494 |
+
var type = item.type;
|
495 |
+
|
496 |
+
_mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]);
|
497 |
+
// BeforeChange event works like so:
|
498 |
+
// _mfpOn('BeforeChange', function(e, prevType, newType) { });
|
499 |
+
|
500 |
+
mfp.currItem = item;
|
501 |
+
|
502 |
+
if(!mfp.currTemplate[type]) {
|
503 |
+
var markup = mfp.st[type] ? mfp.st[type].markup : false;
|
504 |
+
|
505 |
+
// allows to modify markup
|
506 |
+
_mfpTrigger('FirstMarkupParse', markup);
|
507 |
+
|
508 |
+
if(markup) {
|
509 |
+
mfp.currTemplate[type] = $(markup);
|
510 |
+
} else {
|
511 |
+
// if there is no markup found we just define that template is parsed
|
512 |
+
mfp.currTemplate[type] = true;
|
513 |
+
}
|
514 |
+
}
|
515 |
+
|
516 |
+
if(_prevContentType && _prevContentType !== item.type) {
|
517 |
+
mfp.container.removeClass('mfp-'+_prevContentType+'-holder');
|
518 |
+
}
|
519 |
+
|
520 |
+
var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]);
|
521 |
+
mfp.appendContent(newContent, type);
|
522 |
+
|
523 |
+
item.preloaded = true;
|
524 |
+
|
525 |
+
_mfpTrigger(CHANGE_EVENT, item);
|
526 |
+
_prevContentType = item.type;
|
527 |
+
|
528 |
+
// Append container back after its content changed
|
529 |
+
mfp.container.prepend(mfp.contentContainer);
|
530 |
+
|
531 |
+
_mfpTrigger('AfterChange');
|
532 |
+
},
|
533 |
+
|
534 |
+
|
535 |
+
/**
|
536 |
+
* Set HTML content of popup
|
537 |
+
*/
|
538 |
+
appendContent: function(newContent, type) {
|
539 |
+
mfp.content = newContent;
|
540 |
+
|
541 |
+
if(newContent) {
|
542 |
+
if(mfp.st.showCloseBtn && mfp.st.closeBtnInside &&
|
543 |
+
mfp.currTemplate[type] === true) {
|
544 |
+
// if there is no markup, we just append close button element inside
|
545 |
+
if(!mfp.content.find('.mfp-close').length) {
|
546 |
+
mfp.content.append(_getCloseBtn());
|
547 |
+
}
|
548 |
+
} else {
|
549 |
+
mfp.content = newContent;
|
550 |
+
}
|
551 |
+
} else {
|
552 |
+
mfp.content = '';
|
553 |
+
}
|
554 |
+
|
555 |
+
_mfpTrigger(BEFORE_APPEND_EVENT);
|
556 |
+
mfp.container.addClass('mfp-'+type+'-holder');
|
557 |
+
|
558 |
+
mfp.contentContainer.append(mfp.content);
|
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;
|
569 |
+
|
570 |
+
if(item.tagName) {
|
571 |
+
item = { el: $(item) };
|
572 |
+
} else {
|
573 |
+
type = item.type;
|
574 |
+
item = { data: item, src: item.src };
|
575 |
+
}
|
576 |
+
|
577 |
+
if(item.el) {
|
578 |
+
var types = mfp.types;
|
579 |
+
|
580 |
+
// check for 'mfp-TYPE' class
|
581 |
+
for(var i = 0; i < types.length; i++) {
|
582 |
+
if( item.el.hasClass('mfp-'+types[i]) ) {
|
583 |
+
type = types[i];
|
584 |
+
break;
|
585 |
+
}
|
586 |
+
}
|
587 |
+
|
588 |
+
item.src = item.el.attr('data-mfp-src');
|
589 |
+
if(!item.src) {
|
590 |
+
item.src = item.el.attr('href');
|
591 |
+
}
|
592 |
+
}
|
593 |
+
|
594 |
+
item.type = type || mfp.st.type || 'inline';
|
595 |
+
item.index = index;
|
596 |
+
item.parsed = true;
|
597 |
+
mfp.items[index] = item;
|
598 |
+
_mfpTrigger('ElementParse', item);
|
599 |
+
|
600 |
+
return mfp.items[index];
|
601 |
+
},
|
602 |
+
|
603 |
+
|
604 |
+
/**
|
605 |
+
* Initializes single popup or a group of popups
|
606 |
+
*/
|
607 |
+
addGroup: function(el, options) {
|
608 |
+
var eHandler = function(e) {
|
609 |
+
e.mfpEl = this;
|
610 |
+
mfp._openClick(e, el, options);
|
611 |
+
};
|
612 |
+
|
613 |
+
if(!options) {
|
614 |
+
options = {};
|
615 |
+
}
|
616 |
+
|
617 |
+
var eName = 'click.magnificPopup';
|
618 |
+
options.mainEl = el;
|
619 |
+
|
620 |
+
if(options.items) {
|
621 |
+
options.isObj = true;
|
622 |
+
el.off(eName).on(eName, eHandler);
|
623 |
+
} else {
|
624 |
+
options.isObj = false;
|
625 |
+
if(options.delegate) {
|
626 |
+
el.off(eName).on(eName, options.delegate , eHandler);
|
627 |
+
} else {
|
628 |
+
options.items = el;
|
629 |
+
el.off(eName).on(eName, eHandler);
|
630 |
+
}
|
631 |
+
}
|
632 |
+
},
|
633 |
+
_openClick: function(e, el, options) {
|
634 |
+
var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick;
|
635 |
+
|
636 |
+
|
637 |
+
if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey ) ) {
|
638 |
+
return;
|
639 |
+
}
|
640 |
+
|
641 |
+
var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn;
|
642 |
+
|
643 |
+
if(disableOn) {
|
644 |
+
if($.isFunction(disableOn)) {
|
645 |
+
if( !disableOn.call(mfp) ) {
|
646 |
+
return true;
|
647 |
+
}
|
648 |
+
} else { // else it's number
|
649 |
+
if( _window.width() < disableOn ) {
|
650 |
+
return true;
|
651 |
+
}
|
652 |
+
}
|
653 |
+
}
|
654 |
+
|
655 |
+
if(e.type) {
|
656 |
+
e.preventDefault();
|
657 |
+
|
658 |
+
// This will prevent popup from closing if element is inside and popup is already opened
|
659 |
+
if(mfp.isOpen) {
|
660 |
+
e.stopPropagation();
|
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 |
+
return true;
|
724 |
+
} else {
|
725 |
+
|
726 |
+
// We close the popup if click is on close button or on preloader. Or if there is no content.
|
727 |
+
if(!mfp.content || $(target).hasClass('mfp-close') || (mfp.preloader && target === mfp.preloader[0]) ) {
|
728 |
+
return true;
|
729 |
+
}
|
730 |
+
|
731 |
+
// if click is outside the content
|
732 |
+
if( (target !== mfp.content[0] && !$.contains(mfp.content[0], target)) ) {
|
733 |
+
if(closeOnBg) {
|
734 |
+
// last check, if the clicked element is in DOM, (in case it's removed onclick)
|
735 |
+
if( $.contains(document, target) ) {
|
736 |
+
return true;
|
737 |
+
}
|
738 |
+
}
|
739 |
+
} else if(closeOnContent) {
|
740 |
+
return true;
|
741 |
+
}
|
742 |
+
|
743 |
+
}
|
744 |
+
return false;
|
745 |
+
},
|
746 |
+
_addClassToMFP: function(cName) {
|
747 |
+
mfp.bgOverlay.addClass(cName);
|
748 |
+
mfp.wrap.addClass(cName);
|
749 |
+
},
|
750 |
+
_removeClassFromMFP: function(cName) {
|
751 |
+
this.bgOverlay.removeClass(cName);
|
752 |
+
mfp.wrap.removeClass(cName);
|
753 |
+
},
|
754 |
+
_hasScrollBar: function(winHeight) {
|
755 |
+
return ( (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) );
|
756 |
+
},
|
757 |
+
_setFocus: function() {
|
758 |
+
(mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus();
|
759 |
+
},
|
760 |
+
_onFocusIn: function(e) {
|
761 |
+
if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) {
|
762 |
+
mfp._setFocus();
|
763 |
+
return false;
|
764 |
+
}
|
765 |
+
},
|
766 |
+
_parseMarkup: function(template, values, item) {
|
767 |
+
var arr;
|
768 |
+
if(item.data) {
|
769 |
+
values = $.extend(item.data, values);
|
770 |
+
}
|
771 |
+
_mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item] );
|
772 |
+
|
773 |
+
$.each(values, function(key, value) {
|
774 |
+
if(value === undefined || value === false) {
|
775 |
+
return true;
|
776 |
+
}
|
777 |
+
arr = key.split('_');
|
778 |
+
if(arr.length > 1) {
|
779 |
+
var el = template.find(EVENT_NS + '-'+arr[0]);
|
780 |
+
|
781 |
+
if(el.length > 0) {
|
782 |
+
var attr = arr[1];
|
783 |
+
if(attr === 'replaceWith') {
|
784 |
+
if(el[0] !== value[0]) {
|
785 |
+
el.replaceWith(value);
|
786 |
+
}
|
787 |
+
} else if(attr === 'img') {
|
788 |
+
if(el.is('img')) {
|
789 |
+
el.attr('src', value);
|
790 |
+
} else {
|
791 |
+
el.replaceWith( $('<img>').attr('src', value).attr('class', el.attr('class')) );
|
792 |
+
}
|
793 |
+
} else {
|
794 |
+
el.attr(arr[1], value);
|
795 |
+
}
|
796 |
+
}
|
797 |
+
|
798 |
+
} else {
|
799 |
+
template.find(EVENT_NS + '-'+key).html(value);
|
800 |
+
}
|
801 |
+
});
|
802 |
+
},
|
803 |
+
|
804 |
+
_getScrollbarSize: function() {
|
805 |
+
// thx David
|
806 |
+
if(mfp.scrollbarSize === undefined) {
|
807 |
+
var scrollDiv = document.createElement("div");
|
808 |
+
scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;';
|
809 |
+
document.body.appendChild(scrollDiv);
|
810 |
+
mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;
|
811 |
+
document.body.removeChild(scrollDiv);
|
812 |
+
}
|
813 |
+
return mfp.scrollbarSize;
|
814 |
+
}
|
815 |
+
|
816 |
+
}; /* MagnificPopup core prototype end */
|
817 |
+
|
818 |
+
|
819 |
+
|
820 |
+
|
821 |
+
/**
|
822 |
+
* Public static functions
|
823 |
+
*/
|
824 |
+
$.magnificPopup = {
|
825 |
+
instance: null,
|
826 |
+
proto: MagnificPopup.prototype,
|
827 |
+
modules: [],
|
828 |
+
|
829 |
+
open: function(options, index) {
|
830 |
+
_checkInstance();
|
831 |
+
|
832 |
+
if(!options) {
|
833 |
+
options = {};
|
834 |
+
} else {
|
835 |
+
options = $.extend(true, {}, options);
|
836 |
+
}
|
837 |
+
|
838 |
+
options.isObj = true;
|
839 |
+
options.index = index || 0;
|
840 |
+
return this.instance.open(options);
|
841 |
+
},
|
842 |
+
|
843 |
+
close: function() {
|
844 |
+
return $.magnificPopup.instance && $.magnificPopup.instance.close();
|
845 |
+
},
|
846 |
+
|
847 |
+
registerModule: function(name, module) {
|
848 |
+
if(module.options) {
|
849 |
+
$.magnificPopup.defaults[name] = module.options;
|
850 |
+
}
|
851 |
+
$.extend(this.proto, module.proto);
|
852 |
+
this.modules.push(name);
|
853 |
+
},
|
854 |
+
|
855 |
+
defaults: {
|
856 |
+
|
857 |
+
// Info about options is in docs:
|
858 |
+
// http://dimsemenov.com/plugins/magnific-popup/documentation.html#options
|
859 |
+
|
860 |
+
disableOn: 0,
|
861 |
+
|
862 |
+
key: null,
|
863 |
+
|
864 |
+
midClick: false,
|
865 |
+
|
866 |
+
mainClass: '',
|
867 |
+
|
868 |
+
preloader: true,
|
869 |
+
|
870 |
+
focus: '', // CSS selector of input to focus after popup is opened
|
871 |
+
|
872 |
+
closeOnContentClick: false,
|
873 |
+
|
874 |
+
closeOnBgClick: true,
|
875 |
+
|
876 |
+
closeBtnInside: true,
|
877 |
+
|
878 |
+
showCloseBtn: true,
|
879 |
+
|
880 |
+
enableEscapeKey: true,
|
881 |
+
|
882 |
+
modal: false,
|
883 |
+
|
884 |
+
alignTop: false,
|
885 |
+
|
886 |
+
removalDelay: 0,
|
887 |
+
|
888 |
+
prependTo: null,
|
889 |
+
|
890 |
+
fixedContentPos: 'auto',
|
891 |
+
|
892 |
+
fixedBgPos: 'auto',
|
893 |
+
|
894 |
+
overflowY: 'auto',
|
895 |
+
|
896 |
+
closeMarkup: '<button title="%title%" type="button" class="mfp-close">×</button>',
|
897 |
+
|
898 |
+
tClose: 'Close (Esc)',
|
899 |
+
|
900 |
+
tLoading: 'Loading...',
|
901 |
+
|
902 |
+
autoFocusLast: true
|
903 |
+
|
904 |
+
}
|
905 |
+
};
|
906 |
+
|
907 |
+
|
908 |
+
|
909 |
+
$.fn.magnificPopup = function(options) {
|
910 |
+
_checkInstance();
|
911 |
+
|
912 |
+
var jqEl = $(this);
|
913 |
+
|
914 |
+
// We call some API method of first param is a string
|
915 |
+
if (typeof options === "string" ) {
|
916 |
+
|
917 |
+
if(options === 'open') {
|
918 |
+
var items,
|
919 |
+
itemOpts = _isJQ ? jqEl.data('magnificPopup') : jqEl[0].magnificPopup,
|
920 |
+
index = parseInt(arguments[1], 10) || 0;
|
921 |
+
|
922 |
+
if(itemOpts.items) {
|
923 |
+
items = itemOpts.items[index];
|
924 |
+
} else {
|
925 |
+
items = jqEl;
|
926 |
+
if(itemOpts.delegate) {
|
927 |
+
items = items.find(itemOpts.delegate);
|
928 |
+
}
|
929 |
+
items = items.eq( index );
|
930 |
+
}
|
931 |
+
mfp._openClick({mfpEl:items}, jqEl, itemOpts);
|
932 |
+
} else {
|
933 |
+
if(mfp.isOpen)
|
934 |
+
mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1));
|
935 |
+
}
|
936 |
+
|
937 |
+
} else {
|
938 |
+
// clone options obj
|
939 |
+
options = $.extend(true, {}, options);
|
940 |
+
|
941 |
+
/*
|
942 |
+
* As Zepto doesn't support .data() method for objects
|
943 |
+
* and it works only in normal browsers
|
944 |
+
* we assign "options" object directly to the DOM element. FTW!
|
945 |
+
*/
|
946 |
+
if(_isJQ) {
|
947 |
+
jqEl.data('magnificPopup', options);
|
948 |
+
} else {
|
949 |
+
jqEl[0].magnificPopup = options;
|
950 |
+
}
|
951 |
+
|
952 |
+
mfp.addGroup(jqEl, options);
|
953 |
+
|
954 |
+
}
|
955 |
+
return jqEl;
|
956 |
+
};
|
957 |
+
|
958 |
+
/*>>core*/
|
959 |
+
|
960 |
+
/*>>inline*/
|
961 |
+
|
962 |
+
var INLINE_NS = 'inline',
|
963 |
+
_hiddenClass,
|
964 |
+
_inlinePlaceholder,
|
965 |
+
_lastInlineElement,
|
966 |
+
_putInlineElementsBack = function() {
|
967 |
+
if(_lastInlineElement) {
|
968 |
+
_inlinePlaceholder.after( _lastInlineElement.addClass(_hiddenClass) ).detach();
|
969 |
+
_lastInlineElement = null;
|
970 |
+
}
|
971 |
+
};
|
972 |
+
|
973 |
+
$.magnificPopup.registerModule(INLINE_NS, {
|
974 |
+
options: {
|
975 |
+
hiddenClass: 'hide', // will be appended with `mfp-` prefix
|
976 |
+
markup: '',
|
977 |
+
tNotFound: 'Content not found'
|
978 |
+
},
|
979 |
+
proto: {
|
980 |
+
|
981 |
+
initInline: function() {
|
982 |
+
mfp.types.push(INLINE_NS);
|
983 |
+
|
984 |
+
_mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function() {
|
985 |
+
_putInlineElementsBack();
|
986 |
+
});
|
987 |
+
},
|
988 |
+
|
989 |
+
getInline: function(item, template) {
|
990 |
+
|
991 |
+
_putInlineElementsBack();
|
992 |
+
|
993 |
+
if(item.src) {
|
994 |
+
var inlineSt = mfp.st.inline,
|
995 |
+
el = $(item.src);
|
996 |
+
|
997 |
+
if(el.length) {
|
998 |
+
|
999 |
+
// If target element has parent - we replace it with placeholder and put it back after popup is closed
|
1000 |
+
var parent = el[0].parentNode;
|
1001 |
+
if(parent && parent.tagName) {
|
1002 |
+
if(!_inlinePlaceholder) {
|
1003 |
+
_hiddenClass = inlineSt.hiddenClass;
|
1004 |
+
_inlinePlaceholder = _getEl(_hiddenClass);
|
1005 |
+
_hiddenClass = 'mfp-'+_hiddenClass;
|
1006 |
+
}
|
1007 |
+
// replace target inline element with placeholder
|
1008 |
+
_lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass);
|
1009 |
+
}
|
1010 |
+
|
1011 |
+
mfp.updateStatus('ready');
|
1012 |
+
} else {
|
1013 |
+
mfp.updateStatus('error', inlineSt.tNotFound);
|
1014 |
+
el = $('<div>');
|
1015 |
+
}
|
1016 |
+
|
1017 |
+
item.inlineElement = el;
|
1018 |
+
return el;
|
1019 |
+
}
|
1020 |
+
|
1021 |
+
mfp.updateStatus('ready');
|
1022 |
+
mfp._parseMarkup(template, {}, item);
|
1023 |
+
return template;
|
1024 |
+
}
|
1025 |
+
}
|
1026 |
+
});
|
1027 |
+
|
1028 |
+
/*>>inline*/
|
1029 |
+
|
1030 |
+
/*>>ajax*/
|
1031 |
+
var AJAX_NS = 'ajax',
|
1032 |
+
_ajaxCur,
|
1033 |
+
_removeAjaxCursor = function() {
|
1034 |
+
if(_ajaxCur) {
|
1035 |
+
$(document.body).removeClass(_ajaxCur);
|
1036 |
+
}
|
1037 |
+
},
|
1038 |
+
_destroyAjaxRequest = function() {
|
1039 |
+
_removeAjaxCursor();
|
1040 |
+
if(mfp.req) {
|
1041 |
+
mfp.req.abort();
|
1042 |
+
}
|
1043 |
+
};
|
1044 |
+
|
1045 |
+
$.magnificPopup.registerModule(AJAX_NS, {
|
1046 |
+
|
1047 |
+
options: {
|
1048 |
+
settings: null,
|
1049 |
+
cursor: 'mfp-ajax-cur',
|
1050 |
+
tError: '<a href="%url%">The content</a> could not be loaded.'
|
1051 |
+
},
|
1052 |
+
|
1053 |
+
proto: {
|
1054 |
+
initAjax: function() {
|
1055 |
+
mfp.types.push(AJAX_NS);
|
1056 |
+
_ajaxCur = mfp.st.ajax.cursor;
|
1057 |
+
|
1058 |
+
_mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest);
|
1059 |
+
_mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest);
|
1060 |
+
},
|
1061 |
+
getAjax: function(item) {
|
1062 |
+
|
1063 |
+
if(_ajaxCur) {
|
1064 |
+
$(document.body).addClass(_ajaxCur);
|
1065 |
+
}
|
1066 |
+
|
1067 |
+
mfp.updateStatus('loading');
|
1068 |
+
|
1069 |
+
var opts = $.extend({
|
1070 |
+
url: item.src,
|
1071 |
+
success: function(data, textStatus, jqXHR) {
|
1072 |
+
var temp = {
|
1073 |
+
data:data,
|
1074 |
+
xhr:jqXHR
|
1075 |
+
};
|
1076 |
+
|
1077 |
+
_mfpTrigger('ParseAjax', temp);
|
1078 |
+
|
1079 |
+
mfp.appendContent( $(temp.data), AJAX_NS );
|
1080 |
+
|
1081 |
+
item.finished = true;
|
1082 |
+
|
1083 |
+
_removeAjaxCursor();
|
1084 |
+
|
1085 |
+
mfp._setFocus();
|
1086 |
+
|
1087 |
+
setTimeout(function() {
|
1088 |
+
mfp.wrap.addClass(READY_CLASS);
|
1089 |
+
}, 16);
|
1090 |
+
|
1091 |
+
mfp.updateStatus('ready');
|
1092 |
+
|
1093 |
+
_mfpTrigger('AjaxContentAdded');
|
1094 |
+
},
|
1095 |
+
error: function() {
|
1096 |
+
_removeAjaxCursor();
|
1097 |
+
item.finished = item.loadError = true;
|
1098 |
+
mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src));
|
1099 |
+
}
|
1100 |
+
}, mfp.st.ajax.settings);
|
1101 |
+
|
1102 |
+
mfp.req = $.ajax(opts);
|
1103 |
+
|
1104 |
+
return '';
|
1105 |
+
}
|
1106 |
+
}
|
1107 |
+
});
|
1108 |
+
|
1109 |
+
/*>>ajax*/
|
1110 |
+
|
1111 |
+
/*>>image*/
|
1112 |
+
var _imgInterval,
|
1113 |
+
_getTitle = function(item) {
|
1114 |
+
if(item.data && item.data.title !== undefined)
|
1115 |
+
return item.data.title;
|
1116 |
+
|
1117 |
+
var src = mfp.st.image.titleSrc;
|
1118 |
+
|
1119 |
+
if(src) {
|
1120 |
+
if($.isFunction(src)) {
|
1121 |
+
return src.call(mfp, item);
|
1122 |
+
} else if(item.el) {
|
1123 |
+
return item.el.attr(src) || '';
|
1124 |
+
}
|
1125 |
+
}
|
1126 |
+
return '';
|
1127 |
+
};
|
1128 |
+
|
1129 |
+
$.magnificPopup.registerModule('image', {
|
1130 |
+
|
1131 |
+
options: {
|
1132 |
+
markup: '<div class="mfp-figure">'+
|
1133 |
+
'<div class="mfp-close"></div>'+
|
1134 |
+
'<figure>'+
|
1135 |
+
'<div class="mfp-img"></div>'+
|
1136 |
+
'<figcaption>'+
|
1137 |
+
'<div class="mfp-bottom-bar">'+
|
1138 |
+
'<div class="mfp-title"></div>'+
|
1139 |
+
'<div class="mfp-counter"></div>'+
|
1140 |
+
'</div>'+
|
1141 |
+
'</figcaption>'+
|
1142 |
+
'</figure>'+
|
1143 |
+
'</div>',
|
1144 |
+
cursor: 'mfp-zoom-out-cur',
|
1145 |
+
titleSrc: 'title',
|
1146 |
+
verticalFit: true,
|
1147 |
+
tError: '<a href="%url%">The image</a> could not be loaded.'
|
1148 |
+
},
|
1149 |
+
|
1150 |
+
proto: {
|
1151 |
+
initImage: function() {
|
1152 |
+
var imgSt = mfp.st.image,
|
1153 |
+
ns = '.image';
|
1154 |
+
|
1155 |
+
mfp.types.push('image');
|
1156 |
+
|
1157 |
+
_mfpOn(OPEN_EVENT+ns, function() {
|
1158 |
+
if(mfp.currItem.type === 'image' && imgSt.cursor) {
|
1159 |
+
$(document.body).addClass(imgSt.cursor);
|
1160 |
+
}
|
1161 |
+
});
|
1162 |
+
|
1163 |
+
_mfpOn(CLOSE_EVENT+ns, function() {
|
1164 |
+
if(imgSt.cursor) {
|
1165 |
+
$(document.body).removeClass(imgSt.cursor);
|
1166 |
+
}
|
1167 |
+
_window.off('resize' + EVENT_NS);
|
1168 |
+
});
|
1169 |
+
|
1170 |
+
_mfpOn('Resize'+ns, mfp.resizeImage);
|
1171 |
+
if(mfp.isLowIE) {
|
1172 |
+
_mfpOn('AfterChange', mfp.resizeImage);
|
1173 |
+
}
|
1174 |
+
},
|
1175 |
+
resizeImage: function() {
|
1176 |
+
var item = mfp.currItem;
|
1177 |
+
if(!item || !item.img) return;
|
1178 |
+
|
1179 |
+
if(mfp.st.image.verticalFit) {
|
1180 |
+
var decr = 0;
|
1181 |
+
// fix box-sizing in ie7/8
|
1182 |
+
if(mfp.isLowIE) {
|
1183 |
+
decr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10);
|
1184 |
+
}
|
1185 |
+
item.img.css('max-height', mfp.wH-decr);
|
1186 |
+
}
|
1187 |
+
},
|
1188 |
+
_onImageHasSize: function(item) {
|
1189 |
+
if(item.img) {
|
1190 |
+
|
1191 |
+
item.hasSize = true;
|
1192 |
+
|
1193 |
+
if(_imgInterval) {
|
1194 |
+
clearInterval(_imgInterval);
|
1195 |
+
}
|
1196 |
+
|
1197 |
+
item.isCheckingImgSize = false;
|
1198 |
+
|
1199 |
+
_mfpTrigger('ImageHasSize', item);
|
1200 |
+
|
1201 |
+
if(item.imgHidden) {
|
1202 |
+
if(mfp.content)
|
1203 |
+
mfp.content.removeClass('mfp-loading');
|
1204 |
+
|
1205 |
+
item.imgHidden = false;
|
1206 |
+
}
|
1207 |
+
|
1208 |
+
}
|
1209 |
+
},
|
1210 |
+
|
1211 |
+
/**
|
1212 |
+
* Function that loops until the image has size to display elements that rely on it asap
|
1213 |
+
*/
|
1214 |
+
findImageSize: function(item) {
|
1215 |
+
|
1216 |
+
var counter = 0,
|
1217 |
+
img = item.img[0],
|
1218 |
+
mfpSetInterval = function(delay) {
|
1219 |
+
|
1220 |
+
if(_imgInterval) {
|
1221 |
+
clearInterval(_imgInterval);
|
1222 |
+
}
|
1223 |
+
// decelerating interval that checks for size of an image
|
1224 |
+
_imgInterval = setInterval(function() {
|
1225 |
+
if(img.naturalWidth > 0) {
|
1226 |
+
mfp._onImageHasSize(item);
|
1227 |
+
return;
|
1228 |
+
}
|
1229 |
+
|
1230 |
+
if(counter > 200) {
|
1231 |
+
clearInterval(_imgInterval);
|
1232 |
+
}
|
1233 |
+
|
1234 |
+
counter++;
|
1235 |
+
if(counter === 3) {
|
1236 |
+
mfpSetInterval(10);
|
1237 |
+
} else if(counter === 40) {
|
1238 |
+
mfpSetInterval(50);
|
1239 |
+
} else if(counter === 100) {
|
1240 |
+
mfpSetInterval(500);
|
1241 |
+
}
|
1242 |
+
}, delay);
|
1243 |
+
};
|
1244 |
+
|
1245 |
+
mfpSetInterval(1);
|
1246 |
+
},
|
1247 |
+
|
1248 |
+
getImage: function(item, template) {
|
1249 |
+
|
1250 |
+
var guard = 0,
|
1251 |
+
|
1252 |
+
// image load complete handler
|
1253 |
+
onLoadComplete = function() {
|
1254 |
+
if(item) {
|
1255 |
+
if (item.img[0].complete) {
|
1256 |
+
item.img.off('.mfploader');
|
1257 |
+
|
1258 |
+
if(item === mfp.currItem){
|
1259 |
+
mfp._onImageHasSize(item);
|
1260 |
+
|
1261 |
+
mfp.updateStatus('ready');
|
1262 |
+
}
|
1263 |
+
|
1264 |
+
item.hasSize = true;
|
1265 |
+
item.loaded = true;
|
1266 |
+
|
1267 |
+
_mfpTrigger('ImageLoadComplete');
|
1268 |
+
|
1269 |
+
}
|
1270 |
+
else {
|
1271 |
+
// if image complete check fails 200 times (20 sec), we assume that there was an error.
|
1272 |
+
guard++;
|
1273 |
+
if(guard < 200) {
|
1274 |
+
setTimeout(onLoadComplete,100);
|
1275 |
+
} else {
|
1276 |
+
onLoadError();
|
1277 |
+
}
|
1278 |
+
}
|
1279 |
+
}
|
1280 |
+
},
|
1281 |
+
|
1282 |
+
// image error handler
|
1283 |
+
onLoadError = function() {
|
1284 |
+
if(item) {
|
1285 |
+
item.img.off('.mfploader');
|
1286 |
+
if(item === mfp.currItem){
|
1287 |
+
mfp._onImageHasSize(item);
|
1288 |
+
mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
|
1289 |
+
}
|
1290 |
+
|
1291 |
+
item.hasSize = true;
|
1292 |
+
item.loaded = true;
|
1293 |
+
item.loadError = true;
|
1294 |
+
}
|
1295 |
+
},
|
1296 |
+
imgSt = mfp.st.image;
|
1297 |
+
|
1298 |
+
|
1299 |
+
var el = template.find('.mfp-img');
|
1300 |
+
if(el.length) {
|
1301 |
+
var img = document.createElement('img');
|
1302 |
+
img.className = 'mfp-img';
|
1303 |
+
if(item.el && item.el.find('img').length) {
|
1304 |
+
img.alt = item.el.find('img').attr('alt');
|
1305 |
+
}
|
1306 |
+
item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError);
|
1307 |
+
img.src = item.src;
|
1308 |
+
|
1309 |
+
// without clone() "error" event is not firing when IMG is replaced by new IMG
|
1310 |
+
// TODO: find a way to avoid such cloning
|
1311 |
+
if(el.is('img')) {
|
1312 |
+
item.img = item.img.clone();
|
1313 |
+
}
|
1314 |
+
|
1315 |
+
img = item.img[0];
|
1316 |
+
if(img.naturalWidth > 0) {
|
1317 |
+
item.hasSize = true;
|
1318 |
+
} else if(!img.width) {
|
1319 |
+
item.hasSize = false;
|
1320 |
+
}
|
1321 |
+
}
|
1322 |
+
|
1323 |
+
mfp._parseMarkup(template, {
|
1324 |
+
title: _getTitle(item),
|
1325 |
+
img_replaceWith: item.img
|
1326 |
+
}, item);
|
1327 |
+
|
1328 |
+
mfp.resizeImage();
|
1329 |
+
|
1330 |
+
if(item.hasSize) {
|
1331 |
+
if(_imgInterval) clearInterval(_imgInterval);
|
1332 |
+
|
1333 |
+
if(item.loadError) {
|
1334 |
+
template.addClass('mfp-loading');
|
1335 |
+
mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
|
1336 |
+
} else {
|
1337 |
+
template.removeClass('mfp-loading');
|
1338 |
+
mfp.updateStatus('ready');
|
1339 |
+
}
|
1340 |
+
return template;
|
1341 |
+
}
|
1342 |
+
|
1343 |
+
mfp.updateStatus('loading');
|
1344 |
+
item.loading = true;
|
1345 |
+
|
1346 |
+
if(!item.hasSize) {
|
1347 |
+
item.imgHidden = true;
|
1348 |
+
template.addClass('mfp-loading');
|
1349 |
+
mfp.findImageSize(item);
|
1350 |
+
}
|
1351 |
+
|
1352 |
+
return template;
|
1353 |
+
}
|
1354 |
+
}
|
1355 |
+
});
|
1356 |
+
|
1357 |
+
/*>>image*/
|
1358 |
+
|
1359 |
+
/*>>zoom*/
|
1360 |
+
var hasMozTransform,
|
1361 |
+
getHasMozTransform = function() {
|
1362 |
+
if(hasMozTransform === undefined) {
|
1363 |
+
hasMozTransform = document.createElement('p').style.MozTransform !== undefined;
|
1364 |
+
}
|
1365 |
+
return hasMozTransform;
|
1366 |
+
};
|
1367 |
+
|
1368 |
+
$.magnificPopup.registerModule('zoom', {
|
1369 |
+
|
1370 |
+
options: {
|
1371 |
+
enabled: false,
|
1372 |
+
easing: 'ease-in-out',
|
1373 |
+
duration: 300,
|
1374 |
+
opener: function(element) {
|
1375 |
+
return element.is('img') ? element : element.find('img');
|
1376 |
+
}
|
1377 |
+
},
|
1378 |
+
|
1379 |
+
proto: {
|
1380 |
+
|
1381 |
+
initZoom: function() {
|
1382 |
+
var zoomSt = mfp.st.zoom,
|
1383 |
+
ns = '.zoom',
|
1384 |
+
image;
|
1385 |
+
|
1386 |
+
if(!zoomSt.enabled || !mfp.supportsTransition) {
|
1387 |
+
return;
|
1388 |
+
}
|
1389 |
+
|
1390 |
+
var duration = zoomSt.duration,
|
1391 |
+
getElToAnimate = function(image) {
|
1392 |
+
var newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'),
|
1393 |
+
transition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing,
|
1394 |
+
cssObj = {
|
1395 |
+
position: 'fixed',
|
1396 |
+
zIndex: 9999,
|
1397 |
+
left: 0,
|
1398 |
+
top: 0,
|
1399 |
+
'-webkit-backface-visibility': 'hidden'
|
1400 |
+
},
|
1401 |
+
t = 'transition';
|
1402 |
+
|
1403 |
+
cssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition;
|
1404 |
+
|
1405 |
+
newImg.css(cssObj);
|
1406 |
+
return newImg;
|
1407 |
+
},
|
1408 |
+
showMainContent = function() {
|
1409 |
+
mfp.content.css('visibility', 'visible');
|
1410 |
+
},
|
1411 |
+
openTimeout,
|
1412 |
+
animatedImg;
|
1413 |
+
|
1414 |
+
_mfpOn('BuildControls'+ns, function() {
|
1415 |
+
if(mfp._allowZoom()) {
|
1416 |
+
|
1417 |
+
clearTimeout(openTimeout);
|
1418 |
+
mfp.content.css('visibility', 'hidden');
|
1419 |
+
|
1420 |
+
// Basically, all code below does is clones existing image, puts in on top of the current one and animated it
|
1421 |
+
|
1422 |
+
image = mfp._getItemToZoom();
|
1423 |
+
|
1424 |
+
if(!image) {
|
1425 |
+
showMainContent();
|
1426 |
+
return;
|
1427 |
+
}
|
1428 |
+
|
1429 |
+
animatedImg = getElToAnimate(image);
|
1430 |
+
|
1431 |
+
animatedImg.css( mfp._getOffset() );
|
1432 |
+
|
1433 |
+
mfp.wrap.append(animatedImg);
|
1434 |
+
|
1435 |
+
openTimeout = setTimeout(function() {
|
1436 |
+
animatedImg.css( mfp._getOffset( true ) );
|
1437 |
+
openTimeout = setTimeout(function() {
|
1438 |
+
|
1439 |
+
showMainContent();
|
1440 |
+
|
1441 |
+
setTimeout(function() {
|
1442 |
+
animatedImg.remove();
|
1443 |
+
image = animatedImg = null;
|
1444 |
+
_mfpTrigger('ZoomAnimationEnded');
|
1445 |
+
}, 16); // avoid blink when switching images
|
1446 |
+
|
1447 |
+
}, duration); // this timeout equals animation duration
|
1448 |
+
|
1449 |
+
}, 16); // by adding this timeout we avoid short glitch at the beginning of animation
|
1450 |
+
|
1451 |
+
|
1452 |
+
// Lots of timeouts...
|
1453 |
+
}
|
1454 |
+
});
|
1455 |
+
_mfpOn(BEFORE_CLOSE_EVENT+ns, function() {
|
1456 |
+
if(mfp._allowZoom()) {
|
1457 |
+
|
1458 |
+
clearTimeout(openTimeout);
|
1459 |
+
|
1460 |
+
mfp.st.removalDelay = duration;
|
1461 |
+
|
1462 |
+
if(!image) {
|
1463 |
+
image = mfp._getItemToZoom();
|
1464 |
+
if(!image) {
|
1465 |
+
return;
|
1466 |
+
}
|
1467 |
+
animatedImg = getElToAnimate(image);
|
1468 |
+
}
|
1469 |
+
|
1470 |
+
animatedImg.css( mfp._getOffset(true) );
|
1471 |
+
mfp.wrap.append(animatedImg);
|
1472 |
+
mfp.content.css('visibility', 'hidden');
|
1473 |
+
|
1474 |
+
setTimeout(function() {
|
1475 |
+
animatedImg.css( mfp._getOffset() );
|
1476 |
+
}, 16);
|
1477 |
+
}
|
1478 |
+
|
1479 |
+
});
|
1480 |
+
|
1481 |
+
_mfpOn(CLOSE_EVENT+ns, function() {
|
1482 |
+
if(mfp._allowZoom()) {
|
1483 |
+
showMainContent();
|
1484 |
+
if(animatedImg) {
|
1485 |
+
animatedImg.remove();
|
1486 |
+
}
|
1487 |
+
image = null;
|
1488 |
+
}
|
1489 |
+
});
|
1490 |
+
},
|
1491 |
+
|
1492 |
+
_allowZoom: function() {
|
1493 |
+
return mfp.currItem.type === 'image';
|
1494 |
+
},
|
1495 |
+
|
1496 |
+
_getItemToZoom: function() {
|
1497 |
+
if(mfp.currItem.hasSize) {
|
1498 |
+
return mfp.currItem.img;
|
1499 |
+
} else {
|
1500 |
+
return false;
|
1501 |
+
}
|
1502 |
+
},
|
1503 |
+
|
1504 |
+
// Get element postion relative to viewport
|
1505 |
+
_getOffset: function(isLarge) {
|
1506 |
+
var el;
|
1507 |
+
if(isLarge) {
|
1508 |
+
el = mfp.currItem.img;
|
1509 |
+
} else {
|
1510 |
+
el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem);
|
1511 |
+
}
|
1512 |
+
|
1513 |
+
var offset = el.offset();
|
1514 |
+
var paddingTop = parseInt(el.css('padding-top'),10);
|
1515 |
+
var paddingBottom = parseInt(el.css('padding-bottom'),10);
|
1516 |
+
offset.top -= ( $(window).scrollTop() - paddingTop );
|
1517 |
+
|
1518 |
+
|
1519 |
+
/*
|
1520 |
+
|
1521 |
+
Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa.
|
1522 |
+
|
1523 |
+
*/
|
1524 |
+
var obj = {
|
1525 |
+
width: el.width(),
|
1526 |
+
// fix Zepto height+padding issue
|
1527 |
+
height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop
|
1528 |
+
};
|
1529 |
+
|
1530 |
+
// I hate to do this, but there is no another option
|
1531 |
+
if( getHasMozTransform() ) {
|
1532 |
+
obj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)';
|
1533 |
+
} else {
|
1534 |
+
obj.left = offset.left;
|
1535 |
+
obj.top = offset.top;
|
1536 |
+
}
|
1537 |
+
return obj;
|
1538 |
+
}
|
1539 |
+
|
1540 |
+
}
|
1541 |
+
});
|
1542 |
+
|
1543 |
+
|
1544 |
+
|
1545 |
+
/*>>zoom*/
|
1546 |
+
|
1547 |
+
/*>>iframe*/
|
1548 |
+
|
1549 |
+
var IFRAME_NS = 'iframe',
|
1550 |
+
_emptyPage = '//about:blank',
|
1551 |
+
|
1552 |
+
_fixIframeBugs = function(isShowing) {
|
1553 |
+
if(mfp.currTemplate[IFRAME_NS]) {
|
1554 |
+
var el = mfp.currTemplate[IFRAME_NS].find('iframe');
|
1555 |
+
if(el.length) {
|
1556 |
+
// reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug
|
1557 |
+
if(!isShowing) {
|
1558 |
+
el[0].src = _emptyPage;
|
1559 |
+
}
|
1560 |
+
|
1561 |
+
// IE8 black screen bug fix
|
1562 |
+
if(mfp.isIE8) {
|
1563 |
+
el.css('display', isShowing ? 'block' : 'none');
|
1564 |
+
}
|
1565 |
+
}
|
1566 |
+
}
|
1567 |
+
};
|
1568 |
+
|
1569 |
+
$.magnificPopup.registerModule(IFRAME_NS, {
|
1570 |
+
|
1571 |
+
options: {
|
1572 |
+
markup: '<div class="mfp-iframe-scaler">'+
|
1573 |
+
'<div class="mfp-close"></div>'+
|
1574 |
+
'<iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe>'+
|
1575 |
+
'</div>',
|
1576 |
+
|
1577 |
+
srcAction: 'iframe_src',
|
1578 |
+
|
1579 |
+
// we don't care and support only one default type of URL by default
|
1580 |
+
patterns: {
|
1581 |
+
youtube: {
|
1582 |
+
index: 'youtube.com',
|
1583 |
+
id: 'v=',
|
1584 |
+
src: '//www.youtube.com/embed/%id%?autoplay=1'
|
1585 |
+
},
|
1586 |
+
vimeo: {
|
1587 |
+
index: 'vimeo.com/',
|
1588 |
+
id: '/',
|
1589 |
+
src: '//player.vimeo.com/video/%id%?autoplay=1'
|
1590 |
+
},
|
1591 |
+
gmaps: {
|
1592 |
+
index: '//maps.google.',
|
1593 |
+
src: '%id%&output=embed'
|
1594 |
+
}
|
1595 |
+
}
|
1596 |
+
},
|
1597 |
+
|
1598 |
+
proto: {
|
1599 |
+
initIframe: function() {
|
1600 |
+
mfp.types.push(IFRAME_NS);
|
1601 |
+
|
1602 |
+
_mfpOn('BeforeChange', function(e, prevType, newType) {
|
1603 |
+
if(prevType !== newType) {
|
1604 |
+
if(prevType === IFRAME_NS) {
|
1605 |
+
_fixIframeBugs(); // iframe if removed
|
1606 |
+
} else if(newType === IFRAME_NS) {
|
1607 |
+
_fixIframeBugs(true); // iframe is showing
|
1608 |
+
}
|
1609 |
+
}// else {
|
1610 |
+
// iframe source is switched, don't do anything
|
1611 |
+
//}
|
1612 |
+
});
|
1613 |
+
|
1614 |
+
_mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() {
|
1615 |
+
_fixIframeBugs();
|
1616 |
+
});
|
1617 |
+
},
|
1618 |
+
|
1619 |
+
getIframe: function(item, template) {
|
1620 |
+
var embedSrc = item.src;
|
1621 |
+
var iframeSt = mfp.st.iframe;
|
1622 |
+
|
1623 |
+
$.each(iframeSt.patterns, function() {
|
1624 |
+
if(embedSrc.indexOf( this.index ) > -1) {
|
1625 |
+
if(this.id) {
|
1626 |
+
if(typeof this.id === 'string') {
|
1627 |
+
embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length);
|
1628 |
+
} else {
|
1629 |
+
embedSrc = this.id.call( this, embedSrc );
|
1630 |
+
}
|
1631 |
+
}
|
1632 |
+
embedSrc = this.src.replace('%id%', embedSrc );
|
1633 |
+
return false; // break;
|
1634 |
+
}
|
1635 |
+
});
|
1636 |
+
|
1637 |
+
var dataObj = {};
|
1638 |
+
if(iframeSt.srcAction) {
|
1639 |
+
dataObj[iframeSt.srcAction] = embedSrc;
|
1640 |
+
}
|
1641 |
+
mfp._parseMarkup(template, dataObj, item);
|
1642 |
+
|
1643 |
+
mfp.updateStatus('ready');
|
1644 |
+
|
1645 |
+
return template;
|
1646 |
+
}
|
1647 |
+
}
|
1648 |
+
});
|
1649 |
+
|
1650 |
+
|
1651 |
+
|
1652 |
+
/*>>iframe*/
|
1653 |
+
|
1654 |
+
/*>>gallery*/
|
1655 |
+
/**
|
1656 |
+
* Get looped index depending on number of slides
|
1657 |
+
*/
|
1658 |
+
var _getLoopedId = function(index) {
|
1659 |
+
var numSlides = mfp.items.length;
|
1660 |
+
if(index > numSlides - 1) {
|
1661 |
+
return index - numSlides;
|
1662 |
+
} else if(index < 0) {
|
1663 |
+
return numSlides + index;
|
1664 |
+
}
|
1665 |
+
return index;
|
1666 |
+
},
|
1667 |
+
_replaceCurrTotal = function(text, curr, total) {
|
1668 |
+
return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total);
|
1669 |
+
};
|
1670 |
+
|
1671 |
+
$.magnificPopup.registerModule('gallery', {
|
1672 |
+
|
1673 |
+
options: {
|
1674 |
+
enabled: false,
|
1675 |
+
arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
|
1676 |
+
preload: [0,2],
|
1677 |
+
navigateByImgClick: true,
|
1678 |
+
arrows: true,
|
1679 |
+
|
1680 |
+
tPrev: 'Previous (Left arrow key)',
|
1681 |
+
tNext: 'Next (Right arrow key)',
|
1682 |
+
tCounter: '%curr% of %total%'
|
1683 |
+
},
|
1684 |
+
|
1685 |
+
proto: {
|
1686 |
+
initGallery: function() {
|
1687 |
+
|
1688 |
+
var gSt = mfp.st.gallery,
|
1689 |
+
ns = '.mfp-gallery';
|
1690 |
+
|
1691 |
+
mfp.direction = true; // true - next, false - prev
|
1692 |
+
|
1693 |
+
if(!gSt || !gSt.enabled ) return false;
|
1694 |
+
|
1695 |
+
_wrapClasses += ' mfp-gallery';
|
1696 |
+
|
1697 |
+
_mfpOn(OPEN_EVENT+ns, function() {
|
1698 |
+
|
1699 |
+
if(gSt.navigateByImgClick) {
|
1700 |
+
mfp.wrap.on('click'+ns, '.mfp-img', function() {
|
1701 |
+
if(mfp.items.length > 1) {
|
1702 |
+
mfp.next();
|
1703 |
+
return false;
|
1704 |
+
}
|
1705 |
+
});
|
1706 |
+
}
|
1707 |
+
|
1708 |
+
_document.on('keydown'+ns, function(e) {
|
1709 |
+
if (e.keyCode === 37) {
|
1710 |
+
mfp.prev();
|
1711 |
+
} else if (e.keyCode === 39) {
|
1712 |
+
mfp.next();
|
1713 |
+
}
|
1714 |
+
});
|
1715 |
+
});
|
1716 |
+
|
1717 |
+
_mfpOn('UpdateStatus'+ns, function(e, data) {
|
1718 |
+
if(data.text) {
|
1719 |
+
data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length);
|
1720 |
+
}
|
1721 |
+
});
|
1722 |
+
|
1723 |
+
_mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) {
|
1724 |
+
var l = mfp.items.length;
|
1725 |
+
values.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : '';
|
1726 |
+
});
|
1727 |
+
|
1728 |
+
_mfpOn('BuildControls' + ns, function() {
|
1729 |
+
if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) {
|
1730 |
+
var markup = gSt.arrowMarkup,
|
1731 |
+
arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),
|
1732 |
+
arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS);
|
1733 |
+
|
1734 |
+
arrowLeft.click(function() {
|
1735 |
+
mfp.prev();
|
1736 |
+
});
|
1737 |
+
arrowRight.click(function() {
|
1738 |
+
mfp.next();
|
1739 |
+
});
|
1740 |
+
|
1741 |
+
mfp.container.append(arrowLeft.add(arrowRight));
|
1742 |
+
}
|
1743 |
+
});
|
1744 |
+
|
1745 |
+
_mfpOn(CHANGE_EVENT+ns, function() {
|
1746 |
+
if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout);
|
1747 |
+
|
1748 |
+
mfp._preloadTimeout = setTimeout(function() {
|
1749 |
+
mfp.preloadNearbyImages();
|
1750 |
+
mfp._preloadTimeout = null;
|
1751 |
+
}, 16);
|
1752 |
+
});
|
1753 |
+
|
1754 |
+
|
1755 |
+
_mfpOn(CLOSE_EVENT+ns, function() {
|
1756 |
+
_document.off(ns);
|
1757 |
+
mfp.wrap.off('click'+ns);
|
1758 |
+
mfp.arrowRight = mfp.arrowLeft = null;
|
1759 |
+
});
|
1760 |
+
|
1761 |
+
},
|
1762 |
+
next: function() {
|
1763 |
+
mfp.direction = true;
|
1764 |
+
mfp.index = _getLoopedId(mfp.index + 1);
|
1765 |
+
mfp.updateItemHTML();
|
1766 |
+
},
|
1767 |
+
prev: function() {
|
1768 |
+
mfp.direction = false;
|
1769 |
+
mfp.index = _getLoopedId(mfp.index - 1);
|
1770 |
+
mfp.updateItemHTML();
|
1771 |
+
},
|
1772 |
+
goTo: function(newIndex) {
|
1773 |
+
mfp.direction = (newIndex >= mfp.index);
|
1774 |
+
mfp.index = newIndex;
|
1775 |
+
mfp.updateItemHTML();
|
1776 |
+
},
|
1777 |
+
preloadNearbyImages: function() {
|
1778 |
+
var p = mfp.st.gallery.preload,
|
1779 |
+
preloadBefore = Math.min(p[0], mfp.items.length),
|
1780 |
+
preloadAfter = Math.min(p[1], mfp.items.length),
|
1781 |
+
i;
|
1782 |
+
|
1783 |
+
for(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) {
|
1784 |
+
mfp._preloadItem(mfp.index+i);
|
1785 |
+
}
|
1786 |
+
for(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) {
|
1787 |
+
mfp._preloadItem(mfp.index-i);
|
1788 |
+
}
|
1789 |
+
},
|
1790 |
+
_preloadItem: function(index) {
|
1791 |
+
index = _getLoopedId(index);
|
1792 |
+
|
1793 |
+
if(mfp.items[index].preloaded) {
|
1794 |
+
return;
|
1795 |
+
}
|
1796 |
+
|
1797 |
+
var item = mfp.items[index];
|
1798 |
+
if(!item.parsed) {
|
1799 |
+
item = mfp.parseEl( index );
|
1800 |
+
}
|
1801 |
+
|
1802 |
+
_mfpTrigger('LazyLoad', item);
|
1803 |
+
|
1804 |
+
if(item.type === 'image') {
|
1805 |
+
item.img = $('<img class="mfp-img" />').on('load.mfploader', function() {
|
1806 |
+
item.hasSize = true;
|
1807 |
+
}).on('error.mfploader', function() {
|
1808 |
+
item.hasSize = true;
|
1809 |
+
item.loadError = true;
|
1810 |
+
_mfpTrigger('LazyLoadError', item);
|
1811 |
+
}).attr('src', item.src);
|
1812 |
+
}
|
1813 |
+
|
1814 |
+
|
1815 |
+
item.preloaded = true;
|
1816 |
+
}
|
1817 |
+
}
|
1818 |
+
});
|
1819 |
+
|
1820 |
+
/*>>gallery*/
|
1821 |
+
|
1822 |
+
/*>>retina*/
|
1823 |
+
|
1824 |
+
var RETINA_NS = 'retina';
|
1825 |
+
|
1826 |
+
$.magnificPopup.registerModule(RETINA_NS, {
|
1827 |
+
options: {
|
1828 |
+
replaceSrc: function(item) {
|
1829 |
+
return item.src.replace(/\.\w+$/, function(m) { return '@2x' + m; });
|
1830 |
+
},
|
1831 |
+
ratio: 1 // Function or number. Set to 1 to disable.
|
1832 |
+
},
|
1833 |
+
proto: {
|
1834 |
+
initRetina: function() {
|
1835 |
+
if(window.devicePixelRatio > 1) {
|
1836 |
+
|
1837 |
+
var st = mfp.st.retina,
|
1838 |
+
ratio = st.ratio;
|
1839 |
+
|
1840 |
+
ratio = !isNaN(ratio) ? ratio : ratio();
|
1841 |
+
|
1842 |
+
if(ratio > 1) {
|
1843 |
+
_mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item) {
|
1844 |
+
item.img.css({
|
1845 |
+
'max-width': item.img[0].naturalWidth / ratio,
|
1846 |
+
'width': '100%'
|
1847 |
+
});
|
1848 |
+
});
|
1849 |
+
_mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item) {
|
1850 |
+
item.src = st.replaceSrc(item, ratio);
|
1851 |
+
});
|
1852 |
+
}
|
1853 |
+
}
|
1854 |
+
|
1855 |
+
}
|
1856 |
+
}
|
1857 |
+
});
|
1858 |
+
|
1859 |
+
/*>>retina*/
|
1860 |
+
_checkInstance(); }));
|
assets/mag-popup/jquery.magnific-popup.min.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
/*! Magnific Popup - v1.0
|
2 |
-
|
3 |
-
|
4 |
-
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):window.jQuery||window.Zepto)}(function(a){var b,c,d,e,f,g,h="Close",i="BeforeClose",j="AfterClose",k="BeforeAppend",l="MarkupParse",m="Open",n="Change",o="mfp",p="."+o,q="mfp-ready",r="mfp-removing",s="mfp-prevent-close",t=function(){},u=!!window.jQuery,v=a(window),w=function(a,c){b.ev.on(o+a+p,c)},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(c,d){b.ev.triggerHandler(o+c,d),b.st.callbacks&&(c=c.charAt(0).toLowerCase()+c.slice(1),b.st.callbacks[c]&&b.st.callbacks[c].apply(b,a.isArray(d)?d:[d]))},z=function(c){return c===g&&b.currTemplate.closeBtn||(b.currTemplate.closeBtn=a(b.st.closeMarkup.replace("%title%",b.st.tClose)),g=c),b.currTemplate.closeBtn},A=function(){a.magnificPopup.instance||(b=new t,b.init(),a.magnificPopup.instance=b)},B=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(void 0!==a.transition)return!0;for(;b.length;)if(b.pop()+"Transition"in a)return!0;return!1};t.prototype={constructor:t,init:function(){var c=navigator.appVersion;b.isIE7=-1!==c.indexOf("MSIE 7."),b.isIE8=-1!==c.indexOf("MSIE 8."),b.isLowIE=b.isIE7||b.isIE8,b.isAndroid=/android/gi.test(c),b.isIOS=/iphone|ipad|ipod/gi.test(c),b.supportsTransition=B(),b.probablyMobile=b.isAndroid||b.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),d=a(document),b.popupsCache={}},open:function(c){var e;if(c.isObj===!1){b.items=c.items.toArray(),b.index=0;var g,h=c.items;for(e=0;e<h.length;e++)if(g=h[e],g.parsed&&(g=g.el[0]),g===c.el[0]){b.index=e;break}}else b.items=a.isArray(c.items)?c.items:[c.items],b.index=c.index||0;if(b.isOpen)return void b.updateItemHTML();b.types=[],f="",c.mainEl&&c.mainEl.length?b.ev=c.mainEl.eq(0):b.ev=d,c.key?(b.popupsCache[c.key]||(b.popupsCache[c.key]={}),b.currTemplate=b.popupsCache[c.key]):b.currTemplate={},b.st=a.extend(!0,{},a.magnificPopup.defaults,c),b.fixedContentPos="auto"===b.st.fixedContentPos?!b.probablyMobile:b.st.fixedContentPos,b.st.modal&&(b.st.closeOnContentClick=!1,b.st.closeOnBgClick=!1,b.st.showCloseBtn=!1,b.st.enableEscapeKey=!1),b.bgOverlay||(b.bgOverlay=x("bg").on("click"+p,function(){b.close()}),b.wrap=x("wrap").attr("tabindex",-1).on("click"+p,function(a){b._checkIfClose(a.target)&&b.close()}),b.container=x("container",b.wrap)),b.contentContainer=x("content"),b.st.preloader&&(b.preloader=x("preloader",b.container,b.st.tLoading));var i=a.magnificPopup.modules;for(e=0;e<i.length;e++){var j=i[e];j=j.charAt(0).toUpperCase()+j.slice(1),b["init"+j].call(b)}y("BeforeOpen"),b.st.showCloseBtn&&(b.st.closeBtnInside?(w(l,function(a,b,c,d){c.close_replaceWith=z(d.type)}),f+=" mfp-close-btn-in"):b.wrap.append(z())),b.st.alignTop&&(f+=" mfp-align-top"),b.fixedContentPos?b.wrap.css({overflow:b.st.overflowY,overflowX:"hidden",overflowY:b.st.overflowY}):b.wrap.css({top:v.scrollTop(),position:"absolute"}),(b.st.fixedBgPos===!1||"auto"===b.st.fixedBgPos&&!b.fixedContentPos)&&b.bgOverlay.css({height:d.height(),position:"absolute"}),b.st.enableEscapeKey&&d.on("keyup"+p,function(a){27===a.keyCode&&b.close()}),v.on("resize"+p,function(){b.updateSize()}),b.st.closeOnContentClick||(f+=" mfp-auto-cursor"),f&&b.wrap.addClass(f);var k=b.wH=v.height(),n={};if(b.fixedContentPos&&b._hasScrollBar(k)){var o=b._getScrollbarSize();o&&(n.marginRight=o)}b.fixedContentPos&&(b.isIE7?a("body, html").css("overflow","hidden"):n.overflow="hidden");var r=b.st.mainClass;return b.isIE7&&(r+=" mfp-ie7"),r&&b._addClassToMFP(r),b.updateItemHTML(),y("BuildControls"),a("html").css(n),b.bgOverlay.add(b.wrap).prependTo(b.st.prependTo||a(document.body)),b._lastFocusedEl=document.activeElement,setTimeout(function(){b.content?(b._addClassToMFP(q),b._setFocus()):b.bgOverlay.addClass(q),d.on("focusin"+p,b._onFocusIn)},16),b.isOpen=!0,b.updateSize(k),y(m),c},close:function(){b.isOpen&&(y(i),b.isOpen=!1,b.st.removalDelay&&!b.isLowIE&&b.supportsTransition?(b._addClassToMFP(r),setTimeout(function(){b._close()},b.st.removalDelay)):b._close())},_close:function(){y(h);var c=r+" "+q+" ";if(b.bgOverlay.detach(),b.wrap.detach(),b.container.empty(),b.st.mainClass&&(c+=b.st.mainClass+" "),b._removeClassFromMFP(c),b.fixedContentPos){var e={marginRight:""};b.isIE7?a("body, html").css("overflow",""):e.overflow="",a("html").css(e)}d.off("keyup"+p+" focusin"+p),b.ev.off(p),b.wrap.attr("class","mfp-wrap").removeAttr("style"),b.bgOverlay.attr("class","mfp-bg"),b.container.attr("class","mfp-container"),!b.st.showCloseBtn||b.st.closeBtnInside&&b.currTemplate[b.currItem.type]!==!0||b.currTemplate.closeBtn&&b.currTemplate.closeBtn.detach(),b.st.autoFocusLast&&b._lastFocusedEl&&a(b._lastFocusedEl).focus(),b.currItem=null,b.content=null,b.currTemplate=null,b.prevHeight=0,y(j)},updateSize:function(a){if(b.isIOS){var c=document.documentElement.clientWidth/window.innerWidth,d=window.innerHeight*c;b.wrap.css("height",d),b.wH=d}else b.wH=a||v.height();b.fixedContentPos||b.wrap.css("height",b.wH),y("Resize")},updateItemHTML:function(){var c=b.items[b.index];b.contentContainer.detach(),b.content&&b.content.detach(),c.parsed||(c=b.parseEl(b.index));var d=c.type;if(y("BeforeChange",[b.currItem?b.currItem.type:"",d]),b.currItem=c,!b.currTemplate[d]){var f=b.st[d]?b.st[d].markup:!1;y("FirstMarkupParse",f),f?b.currTemplate[d]=a(f):b.currTemplate[d]=!0}e&&e!==c.type&&b.container.removeClass("mfp-"+e+"-holder");var g=b["get"+d.charAt(0).toUpperCase()+d.slice(1)](c,b.currTemplate[d]);b.appendContent(g,d),c.preloaded=!0,y(n,c),e=c.type,b.container.prepend(b.contentContainer),y("AfterChange")},appendContent:function(a,c){b.content=a,a?b.st.showCloseBtn&&b.st.closeBtnInside&&b.currTemplate[c]===!0?b.content.find(".mfp-close").length||b.content.append(z()):b.content=a:b.content="",y(k),b.container.addClass("mfp-"+c+"-holder"),b.contentContainer.append(b.content)},parseEl:function(c){var d,e=b.items[c];if(e.tagName?e={el:a(e)}:(d=e.type,e={data:e,src:e.src}),e.el){for(var f=b.types,g=0;g<f.length;g++)if(e.el.hasClass("mfp-"+f[g])){d=f[g];break}e.src=e.el.attr("data-mfp-src"),e.src||(e.src=e.el.attr("href"))}return e.type=d||b.st.type||"inline",e.index=c,e.parsed=!0,b.items[c]=e,y("ElementParse",e),b.items[c]},addGroup:function(a,c){var d=function(d){d.mfpEl=this,b._openClick(d,a,c)};c||(c={});var e="click.magnificPopup";c.mainEl=a,c.items?(c.isObj=!0,a.off(e).on(e,d)):(c.isObj=!1,c.delegate?a.off(e).on(e,c.delegate,d):(c.items=a,a.off(e).on(e,d)))},_openClick:function(c,d,e){var f=void 0!==e.midClick?e.midClick:a.magnificPopup.defaults.midClick;if(f||!(2===c.which||c.ctrlKey||c.metaKey||c.altKey||c.shiftKey)){var g=void 0!==e.disableOn?e.disableOn:a.magnificPopup.defaults.disableOn;if(g)if(a.isFunction(g)){if(!g.call(b))return!0}else if(v.width()<g)return!0;c.type&&(c.preventDefault(),b.isOpen&&c.stopPropagation()),e.el=a(c.mfpEl),e.delegate&&(e.items=d.find(e.delegate)),b.open(e)}},updateStatus:function(a,d){if(b.preloader){c!==a&&b.container.removeClass("mfp-s-"+c),d||"loading"!==a||(d=b.st.tLoading);var e={status:a,text:d};y("UpdateStatus",e),a=e.status,d=e.text,b.preloader.html(d),b.preloader.find("a").on("click",function(a){a.stopImmediatePropagation()}),b.container.addClass("mfp-s-"+a),c=a}},_checkIfClose:function(c){if(!a(c).hasClass(s)){var d=b.st.closeOnContentClick,e=b.st.closeOnBgClick;if(d&&e)return!0;if(!b.content||a(c).hasClass("mfp-close")||b.preloader&&c===b.preloader[0])return!0;if(c===b.content[0]||a.contains(b.content[0],c)){if(d)return!0}else if(e&&a.contains(document,c))return!0;return!1}},_addClassToMFP:function(a){b.bgOverlay.addClass(a),b.wrap.addClass(a)},_removeClassFromMFP:function(a){this.bgOverlay.removeClass(a),b.wrap.removeClass(a)},_hasScrollBar:function(a){return(b.isIE7?d.height():document.body.scrollHeight)>(a||v.height())},_setFocus:function(){(b.st.focus?b.content.find(b.st.focus).eq(0):b.wrap).focus()},_onFocusIn:function(c){return c.target===b.wrap[0]||a.contains(b.wrap[0],c.target)?void 0:(b._setFocus(),!1)},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),y(l,[b,c,d]),a.each(c,function(a,c){if(void 0===c||c===!1)return!0;if(e=a.split("_"),e.length>1){var d=b.find(p+"-"+e[0]);if(d.length>0){var f=e[1];"replaceWith"===f?d[0]!==c[0]&&d.replaceWith(c):"img"===f?d.is("img")?d.attr("src",c):d.replaceWith('<img src="'+c+'" class="'+d.attr("class")+'" />'):d.attr(e[1],c)}}else b.find(p+"-"+a).html(c)})},_getScrollbarSize:function(){if(void 0===b.scrollbarSize){var a=document.createElement("div");a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),b.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return b.scrollbarSize}},a.magnificPopup={instance:null,proto:t.prototype,modules:[],open:function(b,c){return A(),b=b?a.extend(!0,{},b):{},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&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,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">×</button>',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},a.fn.magnificPopup=function(c){A();var d=a(this);if("string"==typeof c)if("open"===c){var e,f=u?d.data("magnificPopup"):d[0].magnificPopup,g=parseInt(arguments[1],10)||0;f.items?e=f.items[g]:(e=d,f.delegate&&(e=e.find(f.delegate)),e=e.eq(g)),b._openClick({mfpEl:e},d,f)}else b.isOpen&&b[c].apply(b,Array.prototype.slice.call(arguments,1));else c=a.extend(!0,{},c),u?d.data("magnificPopup",c):d[0].magnificPopup=c,b.addGroup(d,c);return d};var C,D,E,F="inline",G=function(){E&&(D.after(E.addClass(C)).detach(),E=null)};a.magnificPopup.registerModule(F,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){b.types.push(F),w(h+"."+F,function(){G()})},getInline:function(c,d){if(G(),c.src){var e=b.st.inline,f=a(c.src);if(f.length){var g=f[0].parentNode;g&&g.tagName&&(D||(C=e.hiddenClass,D=x(C),C="mfp-"+C),E=f.after(D).detach().removeClass(C)),b.updateStatus("ready")}else b.updateStatus("error",e.tNotFound),f=a("<div>");return c.inlineElement=f,f}return b.updateStatus("ready"),b._parseMarkup(d,{},c),d}}});var H,I="ajax",J=function(){H&&a(document.body).removeClass(H)},K=function(){J(),b.req&&b.req.abort()};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(){b.types.push(I),H=b.st.ajax.cursor,w(h+"."+I,K),w("BeforeChange."+I,K)},getAjax:function(c){H&&a(document.body).addClass(H),b.updateStatus("loading");var d=a.extend({url:c.src,success:function(d,e,f){var g={data:d,xhr:f};y("ParseAjax",g),b.appendContent(a(g.data),I),c.finished=!0,J(),b._setFocus(),setTimeout(function(){b.wrap.addClass(q)},16),b.updateStatus("ready"),y("AjaxContentAdded")},error:function(){J(),c.finished=c.loadError=!0,b.updateStatus("error",b.st.ajax.tError.replace("%url%",c.src))}},b.st.ajax.settings);return b.req=a.ajax(d),""}}});var L,M=function(c){if(c.data&&void 0!==c.data.title)return c.data.title;var d=b.st.image.titleSrc;if(d){if(a.isFunction(d))return d.call(b,c);if(c.el)return c.el.attr(d)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var c=b.st.image,d=".image";b.types.push("image"),w(m+d,function(){"image"===b.currItem.type&&c.cursor&&a(document.body).addClass(c.cursor)}),w(h+d,function(){c.cursor&&a(document.body).removeClass(c.cursor),v.off("resize"+p)}),w("Resize"+d,b.resizeImage),b.isLowIE&&w("AfterChange",b.resizeImage)},resizeImage:function(){var a=b.currItem;if(a&&a.img&&b.st.image.verticalFit){var c=0;b.isLowIE&&(c=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",b.wH-c)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,L&&clearInterval(L),a.isCheckingImgSize=!1,y("ImageHasSize",a),a.imgHidden&&(b.content&&b.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var c=0,d=a.img[0],e=function(f){L&&clearInterval(L),L=setInterval(function(){return d.naturalWidth>0?void b._onImageHasSize(a):(c>200&&clearInterval(L),c++,void(3===c?e(10):40===c?e(50):100===c&&e(500)))},f)};e(1)},getImage:function(c,d){var e=0,f=function(){c&&(c.img[0].complete?(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("ready")),c.hasSize=!0,c.loaded=!0,y("ImageLoadComplete")):(e++,200>e?setTimeout(f,100):g()))},g=function(){c&&(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("error",h.tError.replace("%url%",c.src))),c.hasSize=!0,c.loaded=!0,c.loadError=!0)},h=b.st.image,i=d.find(".mfp-img");if(i.length){var j=document.createElement("img");j.className="mfp-img",c.el&&c.el.find("img").length&&(j.alt=c.el.find("img").attr("alt")),c.img=a(j).on("load.mfploader",f).on("error.mfploader",g),j.src=c.src,i.is("img")&&(c.img=c.img.clone()),j=c.img[0],j.naturalWidth>0?c.hasSize=!0:j.width||(c.hasSize=!1)}return b._parseMarkup(d,{title:M(c),img_replaceWith:c.img},c),b.resizeImage(),c.hasSize?(L&&clearInterval(L),c.loadError?(d.addClass("mfp-loading"),b.updateStatus("error",h.tError.replace("%url%",c.src))):(d.removeClass("mfp-loading"),b.updateStatus("ready")),d):(b.updateStatus("loading"),c.loading=!0,c.hasSize||(c.imgHidden=!0,d.addClass("mfp-loading"),b.findImageSize(c)),d)}}});var N,O=function(){return void 0===N&&(N=void 0!==document.createElement("p").style.MozTransform),N};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a,c=b.st.zoom,d=".zoom";if(c.enabled&&b.supportsTransition){var e,f,g=c.duration,j=function(a){var b=a.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+c.duration/1e3+"s "+c.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,b.css(e),b},k=function(){b.content.css("visibility","visible")};w("BuildControls"+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.content.css("visibility","hidden"),a=b._getItemToZoom(),!a)return void k();f=j(a),f.css(b._getOffset()),b.wrap.append(f),e=setTimeout(function(){f.css(b._getOffset(!0)),e=setTimeout(function(){k(),setTimeout(function(){f.remove(),a=f=null,y("ZoomAnimationEnded")},16)},g)},16)}}),w(i+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.st.removalDelay=g,!a){if(a=b._getItemToZoom(),!a)return;f=j(a)}f.css(b._getOffset(!0)),b.wrap.append(f),b.content.css("visibility","hidden"),setTimeout(function(){f.css(b._getOffset())},16)}}),w(h+d,function(){b._allowZoom()&&(k(),f&&f.remove(),a=null)})}},_allowZoom:function(){return"image"===b.currItem.type},_getItemToZoom:function(){return b.currItem.hasSize?b.currItem.img:!1},_getOffset:function(c){var d;d=c?b.currItem.img:b.st.zoom.opener(b.currItem.el||b.currItem);var e=d.offset(),f=parseInt(d.css("padding-top"),10),g=parseInt(d.css("padding-bottom"),10);e.top-=a(window).scrollTop()-f;var h={width:d.width(),height:(u?d.innerHeight():d[0].offsetHeight)-g-f};return O()?h["-moz-transform"]=h.transform="translate("+e.left+"px,"+e.top+"px)":(h.left=e.left,h.top=e.top),h}}});var P="iframe",Q="//about:blank",R=function(a){if(b.currTemplate[P]){var c=b.currTemplate[P].find("iframe");c.length&&(a||(c[0].src=Q),b.isIE8&&c.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(P,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){b.types.push(P),w("BeforeChange",function(a,b,c){b!==c&&(b===P?R():c===P&&R(!0))}),w(h+"."+P,function(){R()})},getIframe:function(c,d){var e=c.src,f=b.st.iframe;a.each(f.patterns,function(){return e.indexOf(this.index)>-1?(this.id&&(e="string"==typeof this.id?e.substr(e.lastIndexOf(this.id)+this.id.length,e.length):this.id.call(this,e)),e=this.src.replace("%id%",e),!1):void 0});var g={};return f.srcAction&&(g[f.srcAction]=e),b._parseMarkup(d,g,c),b.updateStatus("ready"),d}}});var S=function(a){var c=b.items.length;return a>c-1?a-c:0>a?c+a:a},T=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,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=b.st.gallery,e=".mfp-gallery",g=Boolean(a.fn.mfpFastClick);return b.direction=!0,c&&c.enabled?(f+=" mfp-gallery",w(m+e,function(){c.navigateByImgClick&&b.wrap.on("click"+e,".mfp-img",function(){return b.items.length>1?(b.next(),!1):void 0}),d.on("keydown"+e,function(a){37===a.keyCode?b.prev():39===a.keyCode&&b.next()})}),w("UpdateStatus"+e,function(a,c){c.text&&(c.text=T(c.text,b.currItem.index,b.items.length))}),w(l+e,function(a,d,e,f){var g=b.items.length;e.counter=g>1?T(c.tCounter,f.index,g):""}),w("BuildControls"+e,function(){if(b.items.length>1&&c.arrows&&!b.arrowLeft){var d=c.arrowMarkup,e=b.arrowLeft=a(d.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(s),f=b.arrowRight=a(d.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(s),h=g?"mfpFastClick":"click";e[h](function(){b.prev()}),f[h](function(){b.next()}),b.isIE7&&(x("b",e[0],!1,!0),x("a",e[0],!1,!0),x("b",f[0],!1,!0),x("a",f[0],!1,!0)),b.container.append(e.add(f))}}),w(n+e,function(){b._preloadTimeout&&clearTimeout(b._preloadTimeout),b._preloadTimeout=setTimeout(function(){b.preloadNearbyImages(),b._preloadTimeout=null},16)}),void w(h+e,function(){d.off(e),b.wrap.off("click"+e),b.arrowLeft&&g&&b.arrowLeft.add(b.arrowRight).destroyMfpFastClick(),b.arrowRight=b.arrowLeft=null})):!1},next:function(){b.direction=!0,b.index=S(b.index+1),b.updateItemHTML()},prev:function(){b.direction=!1,b.index=S(b.index-1),b.updateItemHTML()},goTo:function(a){b.direction=a>=b.index,b.index=a,b.updateItemHTML()},preloadNearbyImages:function(){var a,c=b.st.gallery.preload,d=Math.min(c[0],b.items.length),e=Math.min(c[1],b.items.length);for(a=1;a<=(b.direction?e:d);a++)b._preloadItem(b.index+a);for(a=1;a<=(b.direction?d:e);a++)b._preloadItem(b.index-a)},_preloadItem:function(c){if(c=S(c),!b.items[c].preloaded){var d=b.items[c];d.parsed||(d=b.parseEl(c)),y("LazyLoad",d),"image"===d.type&&(d.img=a('<img class="mfp-img" />').on("load.mfploader",function(){d.hasSize=!0}).on("error.mfploader",function(){d.hasSize=!0,d.loadError=!0,y("LazyLoadError",d)}).attr("src",d.src)),d.preloaded=!0}}}});var U="retina";a.magnificPopup.registerModule(U,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=b.st.retina,c=a.ratio;c=isNaN(c)?c():c,c>1&&(w("ImageHasSize."+U,function(a,b){b.img.css({"max-width":b.img[0].naturalWidth/c,width:"100%"})}),w("ElementParse."+U,function(b,d){d.src=a.replaceSrc(d,c)}))}}}}),function(){var b=1e3,c="ontouchstart"in window,d=function(){v.off("touchmove"+f+" touchend"+f)},e="mfpFastClick",f="."+e;a.fn.mfpFastClick=function(e){return a(this).each(function(){var g,h=a(this);if(c){var i,j,k,l,m,n;h.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,v.on("touchmove"+f,function(a){m=a.originalEvent?a.originalEvent.touches:a.touches,n=m.length,m=m[0],(Math.abs(m.clientX-j)>10||Math.abs(m.clientY-k)>10)&&(l=!0,d())}).on("touchend"+f,function(a){d(),l||n>1||(g=!0,a.preventDefault(),clearTimeout(i),i=setTimeout(function(){g=!1},b),e())})})}h.on("click"+f,function(){g||e()})})},a.fn.destroyMfpFastClick=function(){a(this).off("touchstart"+f+" click"+f),c&&v.off("touchmove"+f+" touchend"+f)}}(),A()});
|
1 |
+
/*! Magnific Popup - v1.1.0 - 2016-02-20
|
2 |
+
* http://dimsemenov.com/plugins/magnific-popup/
|
3 |
+
* Copyright (c) 2016 Dmitry Semenov; */
|
4 |
+
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):window.jQuery||window.Zepto)}(function(a){var b,c,d,e,f,g,h="Close",i="BeforeClose",j="AfterClose",k="BeforeAppend",l="MarkupParse",m="Open",n="Change",o="mfp",p="."+o,q="mfp-ready",r="mfp-removing",s="mfp-prevent-close",t=function(){},u=!!window.jQuery,v=a(window),w=function(a,c){b.ev.on(o+a+p,c)},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(c,d){b.ev.triggerHandler(o+c,d),b.st.callbacks&&(c=c.charAt(0).toLowerCase()+c.slice(1),b.st.callbacks[c]&&b.st.callbacks[c].apply(b,a.isArray(d)?d:[d]))},z=function(c){return c===g&&b.currTemplate.closeBtn||(b.currTemplate.closeBtn=a(b.st.closeMarkup.replace("%title%",b.st.tClose)),g=c),b.currTemplate.closeBtn},A=function(){a.magnificPopup.instance||(b=new t,b.init(),a.magnificPopup.instance=b)},B=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(void 0!==a.transition)return!0;for(;b.length;)if(b.pop()+"Transition"in a)return!0;return!1};t.prototype={constructor:t,init:function(){var c=navigator.appVersion;b.isLowIE=b.isIE8=document.all&&!document.addEventListener,b.isAndroid=/android/gi.test(c),b.isIOS=/iphone|ipad|ipod/gi.test(c),b.supportsTransition=B(),b.probablyMobile=b.isAndroid||b.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),d=a(document),b.popupsCache={}},open:function(c){var e;if(c.isObj===!1){b.items=c.items.toArray(),b.index=0;var g,h=c.items;for(e=0;e<h.length;e++)if(g=h[e],g.parsed&&(g=g.el[0]),g===c.el[0]){b.index=e;break}}else b.items=a.isArray(c.items)?c.items:[c.items],b.index=c.index||0;if(b.isOpen)return void b.updateItemHTML();b.types=[],f="",c.mainEl&&c.mainEl.length?b.ev=c.mainEl.eq(0):b.ev=d,c.key?(b.popupsCache[c.key]||(b.popupsCache[c.key]={}),b.currTemplate=b.popupsCache[c.key]):b.currTemplate={},b.st=a.extend(!0,{},a.magnificPopup.defaults,c),b.fixedContentPos="auto"===b.st.fixedContentPos?!b.probablyMobile:b.st.fixedContentPos,b.st.modal&&(b.st.closeOnContentClick=!1,b.st.closeOnBgClick=!1,b.st.showCloseBtn=!1,b.st.enableEscapeKey=!1),b.bgOverlay||(b.bgOverlay=x("bg").on("click"+p,function(){b.close()}),b.wrap=x("wrap").attr("tabindex",-1).on("click"+p,function(a){b._checkIfClose(a.target)&&b.close()}),b.container=x("container",b.wrap)),b.contentContainer=x("content"),b.st.preloader&&(b.preloader=x("preloader",b.container,b.st.tLoading));var i=a.magnificPopup.modules;for(e=0;e<i.length;e++){var j=i[e];j=j.charAt(0).toUpperCase()+j.slice(1),b["init"+j].call(b)}y("BeforeOpen"),b.st.showCloseBtn&&(b.st.closeBtnInside?(w(l,function(a,b,c,d){c.close_replaceWith=z(d.type)}),f+=" mfp-close-btn-in"):b.wrap.append(z())),b.st.alignTop&&(f+=" mfp-align-top"),b.fixedContentPos?b.wrap.css({overflow:b.st.overflowY,overflowX:"hidden",overflowY:b.st.overflowY}):b.wrap.css({top:v.scrollTop(),position:"absolute"}),(b.st.fixedBgPos===!1||"auto"===b.st.fixedBgPos&&!b.fixedContentPos)&&b.bgOverlay.css({height:d.height(),position:"absolute"}),b.st.enableEscapeKey&&d.on("keyup"+p,function(a){27===a.keyCode&&b.close()}),v.on("resize"+p,function(){b.updateSize()}),b.st.closeOnContentClick||(f+=" mfp-auto-cursor"),f&&b.wrap.addClass(f);var k=b.wH=v.height(),n={};if(b.fixedContentPos&&b._hasScrollBar(k)){var o=b._getScrollbarSize();o&&(n.marginRight=o)}b.fixedContentPos&&(b.isIE7?a("body, html").css("overflow","hidden"):n.overflow="hidden");var r=b.st.mainClass;return b.isIE7&&(r+=" mfp-ie7"),r&&b._addClassToMFP(r),b.updateItemHTML(),y("BuildControls"),a("html").css(n),b.bgOverlay.add(b.wrap).prependTo(b.st.prependTo||a(document.body)),b._lastFocusedEl=document.activeElement,setTimeout(function(){b.content?(b._addClassToMFP(q),b._setFocus()):b.bgOverlay.addClass(q),d.on("focusin"+p,b._onFocusIn)},16),b.isOpen=!0,b.updateSize(k),y(m),c},close:function(){b.isOpen&&(y(i),b.isOpen=!1,b.st.removalDelay&&!b.isLowIE&&b.supportsTransition?(b._addClassToMFP(r),setTimeout(function(){b._close()},b.st.removalDelay)):b._close())},_close:function(){y(h);var c=r+" "+q+" ";if(b.bgOverlay.detach(),b.wrap.detach(),b.container.empty(),b.st.mainClass&&(c+=b.st.mainClass+" "),b._removeClassFromMFP(c),b.fixedContentPos){var e={marginRight:""};b.isIE7?a("body, html").css("overflow",""):e.overflow="",a("html").css(e)}d.off("keyup"+p+" focusin"+p),b.ev.off(p),b.wrap.attr("class","mfp-wrap").removeAttr("style"),b.bgOverlay.attr("class","mfp-bg"),b.container.attr("class","mfp-container"),!b.st.showCloseBtn||b.st.closeBtnInside&&b.currTemplate[b.currItem.type]!==!0||b.currTemplate.closeBtn&&b.currTemplate.closeBtn.detach(),b.st.autoFocusLast&&b._lastFocusedEl&&a(b._lastFocusedEl).focus(),b.currItem=null,b.content=null,b.currTemplate=null,b.prevHeight=0,y(j)},updateSize:function(a){if(b.isIOS){var c=document.documentElement.clientWidth/window.innerWidth,d=window.innerHeight*c;b.wrap.css("height",d),b.wH=d}else b.wH=a||v.height();b.fixedContentPos||b.wrap.css("height",b.wH),y("Resize")},updateItemHTML:function(){var c=b.items[b.index];b.contentContainer.detach(),b.content&&b.content.detach(),c.parsed||(c=b.parseEl(b.index));var d=c.type;if(y("BeforeChange",[b.currItem?b.currItem.type:"",d]),b.currItem=c,!b.currTemplate[d]){var f=b.st[d]?b.st[d].markup:!1;y("FirstMarkupParse",f),f?b.currTemplate[d]=a(f):b.currTemplate[d]=!0}e&&e!==c.type&&b.container.removeClass("mfp-"+e+"-holder");var g=b["get"+d.charAt(0).toUpperCase()+d.slice(1)](c,b.currTemplate[d]);b.appendContent(g,d),c.preloaded=!0,y(n,c),e=c.type,b.container.prepend(b.contentContainer),y("AfterChange")},appendContent:function(a,c){b.content=a,a?b.st.showCloseBtn&&b.st.closeBtnInside&&b.currTemplate[c]===!0?b.content.find(".mfp-close").length||b.content.append(z()):b.content=a:b.content="",y(k),b.container.addClass("mfp-"+c+"-holder"),b.contentContainer.append(b.content)},parseEl:function(c){var d,e=b.items[c];if(e.tagName?e={el:a(e)}:(d=e.type,e={data:e,src:e.src}),e.el){for(var f=b.types,g=0;g<f.length;g++)if(e.el.hasClass("mfp-"+f[g])){d=f[g];break}e.src=e.el.attr("data-mfp-src"),e.src||(e.src=e.el.attr("href"))}return e.type=d||b.st.type||"inline",e.index=c,e.parsed=!0,b.items[c]=e,y("ElementParse",e),b.items[c]},addGroup:function(a,c){var d=function(d){d.mfpEl=this,b._openClick(d,a,c)};c||(c={});var e="click.magnificPopup";c.mainEl=a,c.items?(c.isObj=!0,a.off(e).on(e,d)):(c.isObj=!1,c.delegate?a.off(e).on(e,c.delegate,d):(c.items=a,a.off(e).on(e,d)))},_openClick:function(c,d,e){var f=void 0!==e.midClick?e.midClick:a.magnificPopup.defaults.midClick;if(f||!(2===c.which||c.ctrlKey||c.metaKey||c.altKey||c.shiftKey)){var g=void 0!==e.disableOn?e.disableOn:a.magnificPopup.defaults.disableOn;if(g)if(a.isFunction(g)){if(!g.call(b))return!0}else if(v.width()<g)return!0;c.type&&(c.preventDefault(),b.isOpen&&c.stopPropagation()),e.el=a(c.mfpEl),e.delegate&&(e.items=d.find(e.delegate)),b.open(e)}},updateStatus:function(a,d){if(b.preloader){c!==a&&b.container.removeClass("mfp-s-"+c),d||"loading"!==a||(d=b.st.tLoading);var e={status:a,text:d};y("UpdateStatus",e),a=e.status,d=e.text,b.preloader.html(d),b.preloader.find("a").on("click",function(a){a.stopImmediatePropagation()}),b.container.addClass("mfp-s-"+a),c=a}},_checkIfClose:function(c){if(!a(c).hasClass(s)){var d=b.st.closeOnContentClick,e=b.st.closeOnBgClick;if(d&&e)return!0;if(!b.content||a(c).hasClass("mfp-close")||b.preloader&&c===b.preloader[0])return!0;if(c===b.content[0]||a.contains(b.content[0],c)){if(d)return!0}else if(e&&a.contains(document,c))return!0;return!1}},_addClassToMFP:function(a){b.bgOverlay.addClass(a),b.wrap.addClass(a)},_removeClassFromMFP:function(a){this.bgOverlay.removeClass(a),b.wrap.removeClass(a)},_hasScrollBar:function(a){return(b.isIE7?d.height():document.body.scrollHeight)>(a||v.height())},_setFocus:function(){(b.st.focus?b.content.find(b.st.focus).eq(0):b.wrap).focus()},_onFocusIn:function(c){return c.target===b.wrap[0]||a.contains(b.wrap[0],c.target)?void 0:(b._setFocus(),!1)},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),y(l,[b,c,d]),a.each(c,function(c,d){if(void 0===d||d===!1)return!0;if(e=c.split("_"),e.length>1){var f=b.find(p+"-"+e[0]);if(f.length>0){var g=e[1];"replaceWith"===g?f[0]!==d[0]&&f.replaceWith(d):"img"===g?f.is("img")?f.attr("src",d):f.replaceWith(a("<img>").attr("src",d).attr("class",f.attr("class"))):f.attr(e[1],d)}}else b.find(p+"-"+c).html(d)})},_getScrollbarSize:function(){if(void 0===b.scrollbarSize){var a=document.createElement("div");a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),b.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return b.scrollbarSize}},a.magnificPopup={instance:null,proto:t.prototype,modules:[],open:function(b,c){return A(),b=b?a.extend(!0,{},b):{},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&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,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">×</button>',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},a.fn.magnificPopup=function(c){A();var d=a(this);if("string"==typeof c)if("open"===c){var e,f=u?d.data("magnificPopup"):d[0].magnificPopup,g=parseInt(arguments[1],10)||0;f.items?e=f.items[g]:(e=d,f.delegate&&(e=e.find(f.delegate)),e=e.eq(g)),b._openClick({mfpEl:e},d,f)}else b.isOpen&&b[c].apply(b,Array.prototype.slice.call(arguments,1));else c=a.extend(!0,{},c),u?d.data("magnificPopup",c):d[0].magnificPopup=c,b.addGroup(d,c);return d};var C,D,E,F="inline",G=function(){E&&(D.after(E.addClass(C)).detach(),E=null)};a.magnificPopup.registerModule(F,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){b.types.push(F),w(h+"."+F,function(){G()})},getInline:function(c,d){if(G(),c.src){var e=b.st.inline,f=a(c.src);if(f.length){var g=f[0].parentNode;g&&g.tagName&&(D||(C=e.hiddenClass,D=x(C),C="mfp-"+C),E=f.after(D).detach().removeClass(C)),b.updateStatus("ready")}else b.updateStatus("error",e.tNotFound),f=a("<div>");return c.inlineElement=f,f}return b.updateStatus("ready"),b._parseMarkup(d,{},c),d}}});var H,I="ajax",J=function(){H&&a(document.body).removeClass(H)},K=function(){J(),b.req&&b.req.abort()};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(){b.types.push(I),H=b.st.ajax.cursor,w(h+"."+I,K),w("BeforeChange."+I,K)},getAjax:function(c){H&&a(document.body).addClass(H),b.updateStatus("loading");var d=a.extend({url:c.src,success:function(d,e,f){var g={data:d,xhr:f};y("ParseAjax",g),b.appendContent(a(g.data),I),c.finished=!0,J(),b._setFocus(),setTimeout(function(){b.wrap.addClass(q)},16),b.updateStatus("ready"),y("AjaxContentAdded")},error:function(){J(),c.finished=c.loadError=!0,b.updateStatus("error",b.st.ajax.tError.replace("%url%",c.src))}},b.st.ajax.settings);return b.req=a.ajax(d),""}}});var L,M=function(c){if(c.data&&void 0!==c.data.title)return c.data.title;var d=b.st.image.titleSrc;if(d){if(a.isFunction(d))return d.call(b,c);if(c.el)return c.el.attr(d)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var c=b.st.image,d=".image";b.types.push("image"),w(m+d,function(){"image"===b.currItem.type&&c.cursor&&a(document.body).addClass(c.cursor)}),w(h+d,function(){c.cursor&&a(document.body).removeClass(c.cursor),v.off("resize"+p)}),w("Resize"+d,b.resizeImage),b.isLowIE&&w("AfterChange",b.resizeImage)},resizeImage:function(){var a=b.currItem;if(a&&a.img&&b.st.image.verticalFit){var c=0;b.isLowIE&&(c=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",b.wH-c)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,L&&clearInterval(L),a.isCheckingImgSize=!1,y("ImageHasSize",a),a.imgHidden&&(b.content&&b.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var c=0,d=a.img[0],e=function(f){L&&clearInterval(L),L=setInterval(function(){return d.naturalWidth>0?void b._onImageHasSize(a):(c>200&&clearInterval(L),c++,void(3===c?e(10):40===c?e(50):100===c&&e(500)))},f)};e(1)},getImage:function(c,d){var e=0,f=function(){c&&(c.img[0].complete?(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("ready")),c.hasSize=!0,c.loaded=!0,y("ImageLoadComplete")):(e++,200>e?setTimeout(f,100):g()))},g=function(){c&&(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("error",h.tError.replace("%url%",c.src))),c.hasSize=!0,c.loaded=!0,c.loadError=!0)},h=b.st.image,i=d.find(".mfp-img");if(i.length){var j=document.createElement("img");j.className="mfp-img",c.el&&c.el.find("img").length&&(j.alt=c.el.find("img").attr("alt")),c.img=a(j).on("load.mfploader",f).on("error.mfploader",g),j.src=c.src,i.is("img")&&(c.img=c.img.clone()),j=c.img[0],j.naturalWidth>0?c.hasSize=!0:j.width||(c.hasSize=!1)}return b._parseMarkup(d,{title:M(c),img_replaceWith:c.img},c),b.resizeImage(),c.hasSize?(L&&clearInterval(L),c.loadError?(d.addClass("mfp-loading"),b.updateStatus("error",h.tError.replace("%url%",c.src))):(d.removeClass("mfp-loading"),b.updateStatus("ready")),d):(b.updateStatus("loading"),c.loading=!0,c.hasSize||(c.imgHidden=!0,d.addClass("mfp-loading"),b.findImageSize(c)),d)}}});var N,O=function(){return void 0===N&&(N=void 0!==document.createElement("p").style.MozTransform),N};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a,c=b.st.zoom,d=".zoom";if(c.enabled&&b.supportsTransition){var e,f,g=c.duration,j=function(a){var b=a.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+c.duration/1e3+"s "+c.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,b.css(e),b},k=function(){b.content.css("visibility","visible")};w("BuildControls"+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.content.css("visibility","hidden"),a=b._getItemToZoom(),!a)return void k();f=j(a),f.css(b._getOffset()),b.wrap.append(f),e=setTimeout(function(){f.css(b._getOffset(!0)),e=setTimeout(function(){k(),setTimeout(function(){f.remove(),a=f=null,y("ZoomAnimationEnded")},16)},g)},16)}}),w(i+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.st.removalDelay=g,!a){if(a=b._getItemToZoom(),!a)return;f=j(a)}f.css(b._getOffset(!0)),b.wrap.append(f),b.content.css("visibility","hidden"),setTimeout(function(){f.css(b._getOffset())},16)}}),w(h+d,function(){b._allowZoom()&&(k(),f&&f.remove(),a=null)})}},_allowZoom:function(){return"image"===b.currItem.type},_getItemToZoom:function(){return b.currItem.hasSize?b.currItem.img:!1},_getOffset:function(c){var d;d=c?b.currItem.img:b.st.zoom.opener(b.currItem.el||b.currItem);var e=d.offset(),f=parseInt(d.css("padding-top"),10),g=parseInt(d.css("padding-bottom"),10);e.top-=a(window).scrollTop()-f;var h={width:d.width(),height:(u?d.innerHeight():d[0].offsetHeight)-g-f};return O()?h["-moz-transform"]=h.transform="translate("+e.left+"px,"+e.top+"px)":(h.left=e.left,h.top=e.top),h}}});var P="iframe",Q="//about:blank",R=function(a){if(b.currTemplate[P]){var c=b.currTemplate[P].find("iframe");c.length&&(a||(c[0].src=Q),b.isIE8&&c.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(P,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){b.types.push(P),w("BeforeChange",function(a,b,c){b!==c&&(b===P?R():c===P&&R(!0))}),w(h+"."+P,function(){R()})},getIframe:function(c,d){var e=c.src,f=b.st.iframe;a.each(f.patterns,function(){return e.indexOf(this.index)>-1?(this.id&&(e="string"==typeof this.id?e.substr(e.lastIndexOf(this.id)+this.id.length,e.length):this.id.call(this,e)),e=this.src.replace("%id%",e),!1):void 0});var g={};return f.srcAction&&(g[f.srcAction]=e),b._parseMarkup(d,g,c),b.updateStatus("ready"),d}}});var S=function(a){var c=b.items.length;return a>c-1?a-c:0>a?c+a:a},T=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,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=b.st.gallery,e=".mfp-gallery";return b.direction=!0,c&&c.enabled?(f+=" mfp-gallery",w(m+e,function(){c.navigateByImgClick&&b.wrap.on("click"+e,".mfp-img",function(){return b.items.length>1?(b.next(),!1):void 0}),d.on("keydown"+e,function(a){37===a.keyCode?b.prev():39===a.keyCode&&b.next()})}),w("UpdateStatus"+e,function(a,c){c.text&&(c.text=T(c.text,b.currItem.index,b.items.length))}),w(l+e,function(a,d,e,f){var g=b.items.length;e.counter=g>1?T(c.tCounter,f.index,g):""}),w("BuildControls"+e,function(){if(b.items.length>1&&c.arrows&&!b.arrowLeft){var d=c.arrowMarkup,e=b.arrowLeft=a(d.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(s),f=b.arrowRight=a(d.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(s);e.click(function(){b.prev()}),f.click(function(){b.next()}),b.container.append(e.add(f))}}),w(n+e,function(){b._preloadTimeout&&clearTimeout(b._preloadTimeout),b._preloadTimeout=setTimeout(function(){b.preloadNearbyImages(),b._preloadTimeout=null},16)}),void w(h+e,function(){d.off(e),b.wrap.off("click"+e),b.arrowRight=b.arrowLeft=null})):!1},next:function(){b.direction=!0,b.index=S(b.index+1),b.updateItemHTML()},prev:function(){b.direction=!1,b.index=S(b.index-1),b.updateItemHTML()},goTo:function(a){b.direction=a>=b.index,b.index=a,b.updateItemHTML()},preloadNearbyImages:function(){var a,c=b.st.gallery.preload,d=Math.min(c[0],b.items.length),e=Math.min(c[1],b.items.length);for(a=1;a<=(b.direction?e:d);a++)b._preloadItem(b.index+a);for(a=1;a<=(b.direction?d:e);a++)b._preloadItem(b.index-a)},_preloadItem:function(c){if(c=S(c),!b.items[c].preloaded){var d=b.items[c];d.parsed||(d=b.parseEl(c)),y("LazyLoad",d),"image"===d.type&&(d.img=a('<img class="mfp-img" />').on("load.mfploader",function(){d.hasSize=!0}).on("error.mfploader",function(){d.hasSize=!0,d.loadError=!0,y("LazyLoadError",d)}).attr("src",d.src)),d.preloaded=!0}}}});var U="retina";a.magnificPopup.registerModule(U,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=b.st.retina,c=a.ratio;c=isNaN(c)?c():c,c>1&&(w("ImageHasSize."+U,function(a,b){b.img.css({"max-width":b.img[0].naturalWidth/c,width:"100%"})}),w("ElementParse."+U,function(b,d){d.src=a.replaceSrc(d,c)}))}}}}),A()});
|
assets/mag-popup/magnific-popup.css
CHANGED
@@ -1,353 +1,351 @@
|
|
1 |
/* Magnific Popup CSS */
|
2 |
.mfp-bg {
|
3 |
-
top:0;
|
4 |
-
left:0;
|
5 |
-
width:100%;
|
6 |
-
height:100%;
|
7 |
-
z-index:1042;
|
8 |
-
overflow:hidden;
|
9 |
-
position:fixed;
|
10 |
-
background
|
11 |
-
opacity:0.8;
|
12 |
-
|
13 |
.mfp-wrap {
|
14 |
-
top:0;
|
15 |
-
left:0;
|
16 |
-
width:100%;
|
17 |
-
height:100%;
|
18 |
-
z-index:1043;
|
19 |
-
position:fixed;
|
20 |
-
outline:none !important;
|
21 |
-
-webkit-backface-visibility:hidden; }
|
|
|
22 |
.mfp-container {
|
23 |
-
text-align:center;
|
24 |
-
position:absolute;
|
25 |
-
width:100%;
|
26 |
-
height:100%;
|
27 |
-
left:0;
|
28 |
-
top:0;
|
29 |
-
padding:0 8px;
|
30 |
-
|
31 |
-
|
32 |
-
box-sizing:border-box; }
|
33 |
.mfp-container:before {
|
34 |
-
content:'';
|
35 |
-
display:inline-block;
|
36 |
-
height:100%;
|
37 |
-
vertical-align:middle; }
|
|
|
38 |
.mfp-align-top .mfp-container:before {
|
39 |
-
display:none; }
|
|
|
40 |
.mfp-content {
|
41 |
-
position:relative;
|
42 |
-
display:inline-block;
|
43 |
-
vertical-align:middle;
|
44 |
-
margin:0 auto;
|
45 |
-
text-align:left;
|
46 |
-
z-index:1045; }
|
|
|
47 |
.mfp-inline-holder .mfp-content,
|
48 |
.mfp-ajax-holder .mfp-content {
|
49 |
-
width:100%;
|
50 |
-
cursor:auto; }
|
|
|
51 |
.mfp-ajax-cur {
|
52 |
-
cursor:progress; }
|
|
|
53 |
.mfp-zoom-out-cur, .mfp-zoom-out-cur .mfp-image-holder .mfp-close {
|
54 |
-
cursor
|
55 |
-
cursor
|
56 |
-
cursor:zoom-out; }
|
|
|
57 |
.mfp-zoom {
|
58 |
-
cursor:pointer;
|
59 |
-
cursor
|
60 |
-
cursor
|
61 |
-
cursor:zoom-in; }
|
|
|
62 |
.mfp-auto-cursor .mfp-content {
|
63 |
-
cursor:auto; }
|
|
|
64 |
.mfp-close,
|
65 |
.mfp-arrow,
|
66 |
.mfp-preloader,
|
67 |
.mfp-counter {
|
68 |
-
-webkit-user-select:none;
|
69 |
-
-moz-user-select:none;
|
70 |
-
user-select:none; }
|
|
|
71 |
.mfp-loading.mfp-figure {
|
72 |
-
display:none; }
|
|
|
73 |
.mfp-hide {
|
74 |
-
display:none !important; }
|
|
|
75 |
.mfp-preloader {
|
76 |
-
color
|
77 |
-
position:absolute;
|
78 |
-
top:50%;
|
79 |
-
width:auto;
|
80 |
-
text-align:center;
|
81 |
-
margin-top
|
82 |
-
left:8px;
|
83 |
-
right:8px;
|
84 |
-
z-index:1044; }
|
85 |
-
.mfp-preloader a {
|
86 |
-
|
87 |
-
.mfp-preloader a:hover {
|
88 |
-
|
|
|
89 |
.mfp-s-ready .mfp-preloader {
|
90 |
-
display:none; }
|
|
|
91 |
.mfp-s-error .mfp-content {
|
92 |
-
display:none; }
|
|
|
93 |
button.mfp-close,
|
94 |
button.mfp-arrow {
|
95 |
-
overflow:visible;
|
96 |
-
cursor:pointer;
|
97 |
-
background:transparent;
|
98 |
-
border:0;
|
99 |
-
-webkit-appearance:none;
|
100 |
-
display:block;
|
101 |
-
outline:none;
|
102 |
-
padding:0;
|
103 |
-
z-index:1046;
|
104 |
-
|
105 |
-
|
|
|
106 |
button::-moz-focus-inner {
|
107 |
-
padding:0;
|
108 |
-
border:0; }
|
|
|
109 |
.mfp-close {
|
110 |
-
width:44px;
|
111 |
-
height:44px;
|
112 |
-
line-height:44px;
|
113 |
-
position:absolute;
|
114 |
-
right:0;
|
115 |
-
top:0;
|
116 |
-
text-decoration:none;
|
117 |
-
text-align:center;
|
118 |
-
opacity:0.65;
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
font-
|
123 |
-
font-
|
124 |
-
|
125 |
-
.mfp-close:
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
top:1px; }
|
131 |
.mfp-close-btn-in .mfp-close {
|
132 |
-
color
|
|
|
133 |
.mfp-image-holder .mfp-close,
|
134 |
.mfp-iframe-holder .mfp-close {
|
135 |
-
color
|
136 |
-
right
|
137 |
-
text-align:right;
|
138 |
-
padding-right:6px;
|
139 |
-
width:100%; }
|
|
|
140 |
.mfp-counter {
|
141 |
-
position:absolute;
|
142 |
-
top:0;
|
143 |
-
right:0;
|
144 |
-
color
|
145 |
-
font-size:12px;
|
146 |
-
line-height:18px;
|
147 |
-
white-space:nowrap; }
|
|
|
148 |
.mfp-arrow {
|
149 |
-
position:absolute;
|
150 |
-
opacity:0.65;
|
151 |
-
|
152 |
-
|
153 |
-
top:
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
-
|
159 |
-
|
160 |
-
|
161 |
-
.mfp-arrow:
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
.mfp-arrow:
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
.mfp-arrow:before,
|
185 |
-
.mfp-arrow .mfp-b {
|
186 |
-
border-top-width:21px;
|
187 |
-
border-bottom-width:21px;
|
188 |
-
opacity:0.7; }
|
189 |
.mfp-arrow-left {
|
190 |
-
left:0; }
|
191 |
-
.mfp-arrow-left:after
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
border-right:27px solid #3f3f3f; }
|
199 |
.mfp-arrow-right {
|
200 |
-
right:0; }
|
201 |
-
.mfp-arrow-right:after
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
border-left:27px solid #3f3f3f; }
|
208 |
.mfp-iframe-holder {
|
209 |
-
padding-top:40px;
|
210 |
-
padding-bottom:40px; }
|
211 |
-
.mfp-iframe-holder .mfp-content {
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
.mfp-iframe-holder .mfp-close {
|
216 |
-
|
|
|
217 |
.mfp-iframe-scaler {
|
218 |
-
width:100%;
|
219 |
-
height:0;
|
220 |
-
overflow:hidden;
|
221 |
-
padding-top:56.25%; }
|
222 |
-
.mfp-iframe-scaler iframe {
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
|
|
231 |
/* Main image in popup */
|
232 |
img.mfp-img {
|
233 |
-
width:auto;
|
234 |
-
max-width:100%;
|
235 |
-
height:auto;
|
236 |
-
display:block;
|
237 |
-
line-height:0;
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
margin:0 auto; }
|
243 |
/* The shadow behind the image */
|
244 |
.mfp-figure {
|
245 |
-
line-height:0; }
|
246 |
-
.mfp-figure:after {
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
.mfp-figure small {
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
.mfp-figure figure {
|
265 |
-
|
|
|
266 |
.mfp-bottom-bar {
|
267 |
-
margin-top
|
268 |
-
position:absolute;
|
269 |
-
top:100%;
|
270 |
-
left:0;
|
271 |
-
width:100%;
|
272 |
-
cursor:auto; }
|
|
|
273 |
.mfp-title {
|
274 |
-
text-align:left;
|
275 |
-
line-height:18px;
|
276 |
-
color
|
277 |
-
word-wrap:break-word;
|
278 |
-
padding-right:36px; }
|
|
|
279 |
.mfp-image-holder .mfp-content {
|
280 |
-
max-width:100%; }
|
|
|
281 |
.mfp-gallery .mfp-image-holder .mfp-figure {
|
282 |
-
cursor:pointer; }
|
283 |
-
|
|
|
284 |
/**
|
285 |
* Remove all paddings around the image on small screen
|
286 |
*/
|
287 |
.mfp-img-mobile .mfp-image-holder {
|
288 |
-
padding-left:0;
|
289 |
-
padding-right:0; }
|
290 |
.mfp-img-mobile img.mfp-img {
|
291 |
-
padding:0; }
|
292 |
.mfp-img-mobile .mfp-figure:after {
|
293 |
-
top:0;
|
294 |
-
bottom:0; }
|
295 |
.mfp-img-mobile .mfp-figure small {
|
296 |
-
display:inline;
|
297 |
-
margin-left:5px; }
|
298 |
.mfp-img-mobile .mfp-bottom-bar {
|
299 |
-
background:rgba(0, 0, 0, 0.6);
|
300 |
-
bottom:0;
|
301 |
-
margin:0;
|
302 |
-
top:auto;
|
303 |
-
padding:3px 5px;
|
304 |
-
position:fixed;
|
305 |
-
|
306 |
-
-
|
307 |
-
|
308 |
-
.mfp-img-mobile .mfp-bottom-bar:empty {
|
309 |
-
padding:0; }
|
310 |
.mfp-img-mobile .mfp-counter {
|
311 |
-
right:5px;
|
312 |
-
top:3px; }
|
313 |
.mfp-img-mobile .mfp-close {
|
314 |
-
top:0;
|
315 |
-
right:0;
|
316 |
-
width:35px;
|
317 |
-
height:35px;
|
318 |
-
line-height:35px;
|
319 |
-
background:rgba(0, 0, 0, 0.6);
|
320 |
-
position:fixed;
|
321 |
-
text-align:center;
|
322 |
-
padding:0; }
|
323 |
-
|
324 |
-
@media all and (max-width:900px) {
|
325 |
.mfp-arrow {
|
326 |
-
-webkit-transform:scale(0.75);
|
327 |
-
transform:scale(0.75); }
|
328 |
.mfp-arrow-left {
|
329 |
-
-webkit-transform-origin:0;
|
330 |
-
transform-origin:0; }
|
331 |
.mfp-arrow-right {
|
332 |
-
-webkit-transform-origin:100%;
|
333 |
-
transform-origin:100%; }
|
334 |
.mfp-container {
|
335 |
-
padding-left:6px;
|
336 |
-
padding-right:6px; }
|
337 |
-
}
|
338 |
-
.mfp-ie7 .mfp-img {
|
339 |
-
padding:0; }
|
340 |
-
.mfp-ie7 .mfp-bottom-bar {
|
341 |
-
width:600px;
|
342 |
-
left:50%;
|
343 |
-
margin-left:-300px;
|
344 |
-
margin-top:5px;
|
345 |
-
padding-bottom:5px; }
|
346 |
-
.mfp-ie7 .mfp-container {
|
347 |
-
padding:0; }
|
348 |
-
.mfp-ie7 .mfp-content {
|
349 |
-
padding-top:44px; }
|
350 |
-
.mfp-ie7 .mfp-close {
|
351 |
-
top:0;
|
352 |
-
right:0;
|
353 |
-
padding-top:0; }
|
1 |
/* Magnific Popup CSS */
|
2 |
.mfp-bg {
|
3 |
+
top: 0;
|
4 |
+
left: 0;
|
5 |
+
width: 100%;
|
6 |
+
height: 100%;
|
7 |
+
z-index: 1042;
|
8 |
+
overflow: hidden;
|
9 |
+
position: fixed;
|
10 |
+
background: #0b0b0b;
|
11 |
+
opacity: 0.8; }
|
12 |
+
|
13 |
.mfp-wrap {
|
14 |
+
top: 0;
|
15 |
+
left: 0;
|
16 |
+
width: 100%;
|
17 |
+
height: 100%;
|
18 |
+
z-index: 1043;
|
19 |
+
position: fixed;
|
20 |
+
outline: none !important;
|
21 |
+
-webkit-backface-visibility: hidden; }
|
22 |
+
|
23 |
.mfp-container {
|
24 |
+
text-align: center;
|
25 |
+
position: absolute;
|
26 |
+
width: 100%;
|
27 |
+
height: 100%;
|
28 |
+
left: 0;
|
29 |
+
top: 0;
|
30 |
+
padding: 0 8px;
|
31 |
+
box-sizing: border-box; }
|
32 |
+
|
|
|
33 |
.mfp-container:before {
|
34 |
+
content: '';
|
35 |
+
display: inline-block;
|
36 |
+
height: 100%;
|
37 |
+
vertical-align: middle; }
|
38 |
+
|
39 |
.mfp-align-top .mfp-container:before {
|
40 |
+
display: none; }
|
41 |
+
|
42 |
.mfp-content {
|
43 |
+
position: relative;
|
44 |
+
display: inline-block;
|
45 |
+
vertical-align: middle;
|
46 |
+
margin: 0 auto;
|
47 |
+
text-align: left;
|
48 |
+
z-index: 1045; }
|
49 |
+
|
50 |
.mfp-inline-holder .mfp-content,
|
51 |
.mfp-ajax-holder .mfp-content {
|
52 |
+
width: 100%;
|
53 |
+
cursor: auto; }
|
54 |
+
|
55 |
.mfp-ajax-cur {
|
56 |
+
cursor: progress; }
|
57 |
+
|
58 |
.mfp-zoom-out-cur, .mfp-zoom-out-cur .mfp-image-holder .mfp-close {
|
59 |
+
cursor: -moz-zoom-out;
|
60 |
+
cursor: -webkit-zoom-out;
|
61 |
+
cursor: zoom-out; }
|
62 |
+
|
63 |
.mfp-zoom {
|
64 |
+
cursor: pointer;
|
65 |
+
cursor: -webkit-zoom-in;
|
66 |
+
cursor: -moz-zoom-in;
|
67 |
+
cursor: zoom-in; }
|
68 |
+
|
69 |
.mfp-auto-cursor .mfp-content {
|
70 |
+
cursor: auto; }
|
71 |
+
|
72 |
.mfp-close,
|
73 |
.mfp-arrow,
|
74 |
.mfp-preloader,
|
75 |
.mfp-counter {
|
76 |
+
-webkit-user-select: none;
|
77 |
+
-moz-user-select: none;
|
78 |
+
user-select: none; }
|
79 |
+
|
80 |
.mfp-loading.mfp-figure {
|
81 |
+
display: none; }
|
82 |
+
|
83 |
.mfp-hide {
|
84 |
+
display: none !important; }
|
85 |
+
|
86 |
.mfp-preloader {
|
87 |
+
color: #CCC;
|
88 |
+
position: absolute;
|
89 |
+
top: 50%;
|
90 |
+
width: auto;
|
91 |
+
text-align: center;
|
92 |
+
margin-top: -0.8em;
|
93 |
+
left: 8px;
|
94 |
+
right: 8px;
|
95 |
+
z-index: 1044; }
|
96 |
+
.mfp-preloader a {
|
97 |
+
color: #CCC; }
|
98 |
+
.mfp-preloader a:hover {
|
99 |
+
color: #FFF; }
|
100 |
+
|
101 |
.mfp-s-ready .mfp-preloader {
|
102 |
+
display: none; }
|
103 |
+
|
104 |
.mfp-s-error .mfp-content {
|
105 |
+
display: none; }
|
106 |
+
|
107 |
button.mfp-close,
|
108 |
button.mfp-arrow {
|
109 |
+
overflow: visible;
|
110 |
+
cursor: pointer;
|
111 |
+
background: transparent;
|
112 |
+
border: 0;
|
113 |
+
-webkit-appearance: none;
|
114 |
+
display: block;
|
115 |
+
outline: none;
|
116 |
+
padding: 0;
|
117 |
+
z-index: 1046;
|
118 |
+
box-shadow: none;
|
119 |
+
touch-action: manipulation; }
|
120 |
+
|
121 |
button::-moz-focus-inner {
|
122 |
+
padding: 0;
|
123 |
+
border: 0; }
|
124 |
+
|
125 |
.mfp-close {
|
126 |
+
width: 44px;
|
127 |
+
height: 44px;
|
128 |
+
line-height: 44px;
|
129 |
+
position: absolute;
|
130 |
+
right: 0;
|
131 |
+
top: 0;
|
132 |
+
text-decoration: none;
|
133 |
+
text-align: center;
|
134 |
+
opacity: 0.65;
|
135 |
+
padding: 0 0 18px 10px;
|
136 |
+
color: #FFF;
|
137 |
+
font-style: normal;
|
138 |
+
font-size: 28px;
|
139 |
+
font-family: Arial, Baskerville, monospace; }
|
140 |
+
.mfp-close:hover,
|
141 |
+
.mfp-close:focus {
|
142 |
+
opacity: 1; }
|
143 |
+
.mfp-close:active {
|
144 |
+
top: 1px; }
|
145 |
+
|
|
|
146 |
.mfp-close-btn-in .mfp-close {
|
147 |
+
color: #333; }
|
148 |
+
|
149 |
.mfp-image-holder .mfp-close,
|
150 |
.mfp-iframe-holder .mfp-close {
|
151 |
+
color: #FFF;
|
152 |
+
right: -6px;
|
153 |
+
text-align: right;
|
154 |
+
padding-right: 6px;
|
155 |
+
width: 100%; }
|
156 |
+
|
157 |
.mfp-counter {
|
158 |
+
position: absolute;
|
159 |
+
top: 0;
|
160 |
+
right: 0;
|
161 |
+
color: #CCC;
|
162 |
+
font-size: 12px;
|
163 |
+
line-height: 18px;
|
164 |
+
white-space: nowrap; }
|
165 |
+
|
166 |
.mfp-arrow {
|
167 |
+
position: absolute;
|
168 |
+
opacity: 0.65;
|
169 |
+
margin: 0;
|
170 |
+
top: 50%;
|
171 |
+
margin-top: -55px;
|
172 |
+
padding: 0;
|
173 |
+
width: 90px;
|
174 |
+
height: 110px;
|
175 |
+
-webkit-tap-highlight-color: transparent; }
|
176 |
+
.mfp-arrow:active {
|
177 |
+
margin-top: -54px; }
|
178 |
+
.mfp-arrow:hover,
|
179 |
+
.mfp-arrow:focus {
|
180 |
+
opacity: 1; }
|
181 |
+
.mfp-arrow:before,
|
182 |
+
.mfp-arrow:after {
|
183 |
+
content: '';
|
184 |
+
display: block;
|
185 |
+
width: 0;
|
186 |
+
height: 0;
|
187 |
+
position: absolute;
|
188 |
+
left: 0;
|
189 |
+
top: 0;
|
190 |
+
margin-top: 35px;
|
191 |
+
margin-left: 35px;
|
192 |
+
border: medium inset transparent; }
|
193 |
+
.mfp-arrow:after {
|
194 |
+
border-top-width: 13px;
|
195 |
+
border-bottom-width: 13px;
|
196 |
+
top: 8px; }
|
197 |
+
.mfp-arrow:before {
|
198 |
+
border-top-width: 21px;
|
199 |
+
border-bottom-width: 21px;
|
200 |
+
opacity: 0.7; }
|
201 |
+
|
|
|
|
|
|
|
|
|
|
|
202 |
.mfp-arrow-left {
|
203 |
+
left: 0; }
|
204 |
+
.mfp-arrow-left:after {
|
205 |
+
border-right: 17px solid #FFF;
|
206 |
+
margin-left: 31px; }
|
207 |
+
.mfp-arrow-left:before {
|
208 |
+
margin-left: 25px;
|
209 |
+
border-right: 27px solid #3F3F3F; }
|
210 |
+
|
|
|
211 |
.mfp-arrow-right {
|
212 |
+
right: 0; }
|
213 |
+
.mfp-arrow-right:after {
|
214 |
+
border-left: 17px solid #FFF;
|
215 |
+
margin-left: 39px; }
|
216 |
+
.mfp-arrow-right:before {
|
217 |
+
border-left: 27px solid #3F3F3F; }
|
218 |
+
|
|
|
219 |
.mfp-iframe-holder {
|
220 |
+
padding-top: 40px;
|
221 |
+
padding-bottom: 40px; }
|
222 |
+
.mfp-iframe-holder .mfp-content {
|
223 |
+
line-height: 0;
|
224 |
+
width: 100%;
|
225 |
+
max-width: 900px; }
|
226 |
+
.mfp-iframe-holder .mfp-close {
|
227 |
+
top: -40px; }
|
228 |
+
|
229 |
.mfp-iframe-scaler {
|
230 |
+
width: 100%;
|
231 |
+
height: 0;
|
232 |
+
overflow: hidden;
|
233 |
+
padding-top: 56.25%; }
|
234 |
+
.mfp-iframe-scaler iframe {
|
235 |
+
position: absolute;
|
236 |
+
display: block;
|
237 |
+
top: 0;
|
238 |
+
left: 0;
|
239 |
+
width: 100%;
|
240 |
+
height: 100%;
|
241 |
+
box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
|
242 |
+
background: #000; }
|
243 |
+
|
244 |
/* Main image in popup */
|
245 |
img.mfp-img {
|
246 |
+
width: auto;
|
247 |
+
max-width: 100%;
|
248 |
+
height: auto;
|
249 |
+
display: block;
|
250 |
+
line-height: 0;
|
251 |
+
box-sizing: border-box;
|
252 |
+
padding: 40px 0 40px;
|
253 |
+
margin: 0 auto; }
|
254 |
+
|
|
|
255 |
/* The shadow behind the image */
|
256 |
.mfp-figure {
|
257 |
+
line-height: 0; }
|
258 |
+
.mfp-figure:after {
|
259 |
+
content: '';
|
260 |
+
position: absolute;
|
261 |
+
left: 0;
|
262 |
+
top: 40px;
|
263 |
+
bottom: 40px;
|
264 |
+
display: block;
|
265 |
+
right: 0;
|
266 |
+
width: auto;
|
267 |
+
height: auto;
|
268 |
+
z-index: -1;
|
269 |
+
box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
|
270 |
+
background: #444; }
|
271 |
+
.mfp-figure small {
|
272 |
+
color: #BDBDBD;
|
273 |
+
display: block;
|
274 |
+
font-size: 12px;
|
275 |
+
line-height: 14px; }
|
276 |
+
.mfp-figure figure {
|
277 |
+
margin: 0; }
|
278 |
+
|
279 |
.mfp-bottom-bar {
|
280 |
+
margin-top: -36px;
|
281 |
+
position: absolute;
|
282 |
+
top: 100%;
|
283 |
+
left: 0;
|
284 |
+
width: 100%;
|
285 |
+
cursor: auto; }
|
286 |
+
|
287 |
.mfp-title {
|
288 |
+
text-align: left;
|
289 |
+
line-height: 18px;
|
290 |
+
color: #F3F3F3;
|
291 |
+
word-wrap: break-word;
|
292 |
+
padding-right: 36px; }
|
293 |
+
|
294 |
.mfp-image-holder .mfp-content {
|
295 |
+
max-width: 100%; }
|
296 |
+
|
297 |
.mfp-gallery .mfp-image-holder .mfp-figure {
|
298 |
+
cursor: pointer; }
|
299 |
+
|
300 |
+
@media screen and (max-width: 800px) and (orientation: landscape), screen and (max-height: 300px) {
|
301 |
/**
|
302 |
* Remove all paddings around the image on small screen
|
303 |
*/
|
304 |
.mfp-img-mobile .mfp-image-holder {
|
305 |
+
padding-left: 0;
|
306 |
+
padding-right: 0; }
|
307 |
.mfp-img-mobile img.mfp-img {
|
308 |
+
padding: 0; }
|
309 |
.mfp-img-mobile .mfp-figure:after {
|
310 |
+
top: 0;
|
311 |
+
bottom: 0; }
|
312 |
.mfp-img-mobile .mfp-figure small {
|
313 |
+
display: inline;
|
314 |
+
margin-left: 5px; }
|
315 |
.mfp-img-mobile .mfp-bottom-bar {
|
316 |
+
background: rgba(0, 0, 0, 0.6);
|
317 |
+
bottom: 0;
|
318 |
+
margin: 0;
|
319 |
+
top: auto;
|
320 |
+
padding: 3px 5px;
|
321 |
+
position: fixed;
|
322 |
+
box-sizing: border-box; }
|
323 |
+
.mfp-img-mobile .mfp-bottom-bar:empty {
|
324 |
+
padding: 0; }
|
|
|
|
|
325 |
.mfp-img-mobile .mfp-counter {
|
326 |
+
right: 5px;
|
327 |
+
top: 3px; }
|
328 |
.mfp-img-mobile .mfp-close {
|
329 |
+
top: 0;
|
330 |
+
right: 0;
|
331 |
+
width: 35px;
|
332 |
+
height: 35px;
|
333 |
+
line-height: 35px;
|
334 |
+
background: rgba(0, 0, 0, 0.6);
|
335 |
+
position: fixed;
|
336 |
+
text-align: center;
|
337 |
+
padding: 0; } }
|
338 |
+
|
339 |
+
@media all and (max-width: 900px) {
|
340 |
.mfp-arrow {
|
341 |
+
-webkit-transform: scale(0.75);
|
342 |
+
transform: scale(0.75); }
|
343 |
.mfp-arrow-left {
|
344 |
+
-webkit-transform-origin: 0;
|
345 |
+
transform-origin: 0; }
|
346 |
.mfp-arrow-right {
|
347 |
+
-webkit-transform-origin: 100%;
|
348 |
+
transform-origin: 100%; }
|
349 |
.mfp-container {
|
350 |
+
padding-left: 6px;
|
351 |
+
padding-right: 6px; } }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/swiper/maps/swiper.jquery.min.js.map
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"version":3,"sources":["swiper.jquery.js"],"names":["addLibraryPlugin","lib","fn","swiper","params","firstInstance","this","each","s","Swiper","$","container","round","a","Math","floor","autoplay","autoplayDelay","activeSlide","slides","eq","activeIndex","attr","autoplayTimeoutId","setTimeout","loop","fixLoop","_slideNext","emit","isEnd","autoplayStopOnLast","stopAutoplay","_slideTo","findElementInEvent","e","selector","el","target","is","parents","nodeType","found","index","_el","length","initObserver","options","ObserverFunc","window","MutationObserver","WebkitMutationObserver","observer","mutations","forEach","mutation","onResize","observe","attributes","childList","characterData","observers","push","handleKeyboard","originalEvent","kc","keyCode","charCode","allowSwipeToNext","isHorizontal","allowSwipeToPrev","shiftKey","altKey","ctrlKey","metaKey","document","activeElement","nodeName","toLowerCase","inView","slideClass","slideActiveClass","windowScroll","left","pageXOffset","top","pageYOffset","windowWidth","innerWidth","windowHeight","innerHeight","swiperOffset","offset","rtl","scrollLeft","swiperCoord","width","height","i","point","preventDefault","returnValue","slideNext","slidePrev","isEventSupported","eventName","isSupported","element","createElement","setAttribute","implementation","hasFeature","handleMousewheel","delta","rtlFactor","data","normalizeWheel","mousewheelForceToAxis","abs","pixelX","pixelY","mousewheelInvert","freeMode","position","getWrapperTranslate","mousewheelSensitivity","wasBeginning","isBeginning","wasEnd","minTranslate","maxTranslate","setWrapperTransition","setWrapperTranslate","updateProgress","updateActiveIndex","updateClasses","freeModeSticky","clearTimeout","mousewheel","timeout","slideReset","lazyLoading","lazy","load","autoplayDisableOnInteraction","Date","getTime","lastScrollTime","animating","mousewheelReleaseOnEdges","event","PIXEL_STEP","LINE_HEIGHT","PAGE_HEIGHT","sX","sY","pX","pY","detail","wheelDelta","wheelDeltaY","wheelDeltaX","axis","HORIZONTAL_AXIS","deltaY","deltaX","deltaMode","spinX","spinY","setParallaxTransform","progress","p","indexOf","parseInt","transform","normalizeEventName","toUpperCase","substring","defaults","direction","touchEventsTarget","initialSlide","speed","iOSEdgeSwipeDetection","iOSEdgeSwipeThreshold","freeModeMomentum","freeModeMomentumRatio","freeModeMomentumBounce","freeModeMomentumBounceRatio","freeModeMomentumVelocityRatio","freeModeMinimumVelocity","autoHeight","setWrapperSize","virtualTranslate","effect","coverflow","rotate","stretch","depth","modifier","slideShadows","flip","limitRotation","cube","shadow","shadowOffset","shadowScale","fade","crossFade","parallax","zoom","zoomMax","zoomMin","zoomToggle","scrollbar","scrollbarHide","scrollbarDraggable","scrollbarSnapOnRelease","keyboardControl","mousewheelControl","mousewheelEventsTarged","hashnav","hashnavWatchState","history","replaceState","breakpoints","undefined","spaceBetween","slidesPerView","slidesPerColumn","slidesPerColumnFill","slidesPerGroup","centeredSlides","slidesOffsetBefore","slidesOffsetAfter","roundLengths","touchRatio","touchAngle","simulateTouch","shortSwipes","longSwipes","longSwipesRatio","longSwipesMs","followFinger","onlyExternal","threshold","touchMoveStopPropagation","touchReleaseOnEdges","uniqueNavElements","pagination","paginationElement","paginationClickable","paginationHide","paginationBulletRender","paginationProgressRender","paginationFractionRender","paginationCustomRender","paginationType","resistance","resistanceRatio","nextButton","prevButton","watchSlidesProgress","watchSlidesVisibility","grabCursor","preventClicks","preventClicksPropagation","slideToClickedSlide","lazyLoadingInPrevNext","lazyLoadingInPrevNextAmount","lazyLoadingOnTransitionStart","preloadImages","updateOnImagesReady","loopAdditionalSlides","loopedSlides","control","controlInverse","controlBy","normalizeSlideIndex","swipeHandler","noSwiping","noSwipingClass","passiveListeners","containerModifierClass","slideDuplicateActiveClass","slideVisibleClass","slideDuplicateClass","slideNextClass","slideDuplicateNextClass","slidePrevClass","slideDuplicatePrevClass","wrapperClass","bulletClass","bulletActiveClass","buttonDisabledClass","paginationCurrentClass","paginationTotalClass","paginationHiddenClass","paginationProgressbarClass","paginationClickableClass","paginationModifierClass","lazyLoadingClass","lazyStatusLoadingClass","lazyStatusLoadedClass","lazyPreloaderClass","notificationClass","preloaderClass","zoomContainerClass","observeParents","a11y","prevSlideMessage","nextSlideMessage","firstSlideMessage","lastSlideMessage","paginationBulletMessage","runCallbacksOnInit","initialVirtualTranslate","originalParams","param","Dom7","jQuery","deepParam","def","deepDef","classNames","Zepto","currentBreakpoint","getActiveBreakpoint","breakpoint","points","hasOwnProperty","sort","b","setBreakpoint","breakPointsParams","needsReLoop","destroyLoop","reLoop","swipers","support","flexbox","transforms3d","touch","wrapper","children","paginationContainer","find","addClass","dir","css","wrongRTL","device","android","join","translate","velocity","lockSwipeToNext","unsetGrabCursor","lockSwipeToPrev","lockSwipes","unlockSwipeToNext","setGrabCursor","unlockSwipeToPrev","unlockSwipes","moving","style","cursor","imagesToLoad","imagesLoaded","loadImage","imgElement","src","srcset","sizes","checkForComplete","callback","onReady","image","complete","Image","onload","onerror","_onReady","update","currentSrc","getAttribute","autoplaying","autoplayPaused","startAutoplay","internal","pauseAutoplay","transitionEnd","snapGrid","updateAutoHeight","activeSlides","newHeight","ceil","offsetHeight","updateContainerSize","clientWidth","clientHeight","size","updateSlidesSize","slidesGrid","slidesSizesGrid","slidePosition","prevSlideSize","parseFloat","replace","virtualSize","marginLeft","marginTop","marginRight","marginBottom","slidesNumberEvenToRows","max","slideSize","slidesPerRow","numFullColumns","slide","newSlideOrderIndex","column","row","-webkit-box-ordinal-group","-moz-box-ordinal-group","-ms-flex-order","-webkit-order","order","outerWidth","outerHeight","swiperSlideSize","newSlidesGrid","updateSlidesOffset","swiperSlideOffset","offsetLeft","offsetTop","updateSlidesProgress","offsetCenter","removeClass","slideProgress","slideBefore","slideAfter","isVisible","translatesDiff","newActiveIndex","snapIndex","previousIndex","updateRealIndex","realIndex","hasClass","nextSlide","next","prevSlide","prev","current","total","bullets","text","scale","scaleX","scaleY","transition","html","disable","enable","updatePagination","paginationHTML","numberOfBullets","initPagination","updateTranslate","forceSetTranslate","newTranslate","min","set","translated","controller","spline","slideTo","forceUpdatePagination","slideChangedBySlideTo","touchEventsDesktop","start","move","end","navigator","pointerEnabled","msPointerEnabled","touchEvents","initEvents","detach","actionDom","action","moveCapture","nested","browser","ie","onTouchStart","onTouchMove","onTouchEnd","passiveListener","passive","capture","ios","onClickNext","onEnterKey","onClickPrev","onClickIndex","attachEvents","detachEvents","allowClick","stopPropagation","stopImmediatePropagation","updateClickedSlide","slideFound","clickedSlide","clickedIndex","slideToIndex","isTouched","isMoved","allowTouchCallbacks","touchStartTime","isScrolling","currentTranslate","startTranslate","allowThresholdMove","clickTimeout","allowMomentumBounce","formElements","lastClickTime","now","velocities","touches","startX","startY","currentX","currentY","diff","isTouchEvent","startMoving","type","which","targetTouches","pageX","pageY","swipeDirection","blur","preventedByNestedSwiper","atan2","PI","ieTouch","trigger","disableParentSwiper","pow","time","touchEndTime","timeDiff","toggleClass","currentPos","lastMoveEvent","pop","velocityEvent","distance","momentumDuration","momentumDistance","newPosition","afterBouncePosition","doBounce","bounceAmount","j","onTransitionStart","onTransitionEnd","stopIndex","groupSize","ratio","slideIndex","runCallbacks","lteIE9","setHistory","setHash","clientLeft","_slidePrev","disableTouchControl","enableTouchControl","duration","byController","effects","setTransition","x","y","z","setTranslate","getTranslate","matrix","curTransform","curStyle","transformMatrix","getComputedStyle","WebKitCSSMatrix","webkitTransform","split","map","MozTransform","OTransform","MsTransform","msTransform","getPropertyValue","toString","m41","m42","initObservers","containerParents","disconnectObservers","disconnect","createLoop","remove","prependSlides","appendSlides","append","cloneNode","prepend","removeAttr","updatePosition","oldIndex","newIndex","appendSlide","prependSlide","removeSlide","slidesIndexes","indexToRemove","removeAllSlides","tx","ty","slideOpacity","opacity","eventTriggered","triggerEvents","rotateY","rotateX","zIndex","shadowBefore","shadowAfter","cubeShadow","wrapperRotate","slideAngle","tz","-webkit-transform-origin","-moz-transform-origin","-ms-transform-origin","transform-origin","shadowAngle","multiplier","sin","cos","scale1","scale2","zFactor","isSafari","isUiWebView","center","slideOffset","offsetMultiplier","translateZ","translateY","translateX","slideTransform","ws","perspectiveOrigin","initialImageLoaded","loadImageInSlide","loadInDuplicate","img","add","_img","background","slideOriginalIndex","originalSlide","duplicatedSlide","amount","spv","maxIndex","minIndex","setDragPosition","sb","pointerPosition","clientX","clientY","track","dragSize","positionMin","moveDivider","positionMax","dragStart","dragTimeout","drag","dragMove","dragEnd","draggableEvents","enableDraggable","on","disableDraggable","off","trackSize","offsetWidth","divider","display","newPos","newSize","LinearSpline","lastIndex","i1","i3","interpolate","x2","binarySearch","guess","array","val","getInterpolateFunction","c","setControlledTranslate","controlledTranslate","controlled","isArray","setControlledTransition","onHashCange","newHash","location","hash","activeSlideHash","initialized","init","slideHash","destroy","pushState","paths","getPathValues","key","value","scrollToSlide","addEventListener","setHistoryPopState","pathArray","pathname","slice","slugify","includes","slideHistory","disableKeyboardControl","enableKeyboardControl","userAgent","disableMousewheelControl","enableMousewheelControl","parallaxDuration","currentScale","isScaling","gesture","slideWidth","slideHeight","imageWrap","minX","minY","maxX","maxY","touchesStart","touchesCurrent","prevPositionX","prevPositionY","prevTime","getDistanceBetweenTouches","x1","y1","y2","sqrt","onGestureStart","gestures","scaleStart","parent","onGestureChange","scaleMove","onGestureEnd","changedTouches","os","scaledWidth","scaledHeight","momentumDurationX","momentumDurationY","momentumDistanceX","newPositionX","momentumDistanceY","newPositionY","toggleZoom","touchX","touchY","offsetX","offsetY","diffX","diffY","imageWidth","imageHeight","translateMinX","translateMinY","translateMaxX","translateMaxY","_plugins","plugin","plugins","callPlugins","arguments","emitterEventListeners","handler","splice","once","_handler","makeFocusable","$el","addRole","role","addLabel","label","notify","click","liveRegion","message","notification","bullet","hashnavReplaceState","cleanupStyles","deleteInstance","removeEventListener","prototype","ua","test","arr","Object","apply","msMaxTouchPoints","maxTouchPoints","div","innerHTML","getElementsByTagName","match","ipad","ipod","iphone","Modernizr","DocumentTouch","csstransforms3d","styles","supportsPassive","opts","defineProperty","get","swiperDomPlugins","domLib","fireCallBack","call","events","dom","elStyle","webkitTransitionDuration","MsTransitionDuration","msTransitionDuration","MozTransitionDuration","OTransitionDuration","transitionDuration","includeMargins","module","exports","define","amd"],"mappings":";;;;;;;;;;;;;;CAcA,WACI,YAq7IA,SAASA,GAAiBC,GAC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GAAI5E,GAAI,EAAGA,EAAI3F,KAAKsC,OAAQqD,IAAK,CAClC,GAAIwvB,GAAUn1B,KAAK2F,GAAG2Q,KACtB6e,GAAQpQ,gBAAkBoQ,EAAQ/P,YAAc+P,EAAQ9P,YAAc8P,EAAQjQ,aAAeiQ,EAAQhQ,WAAagQ,EAAQ5qB,UAAYA,EAE1I,MAAOvK,QAGT,cAAgB80B,GAAOl1B,KACzBk1B,EAAOl1B,GAAG0c,WAAa,SAAU0H,GACL,gBAAbA,KACPA,GAAsB,KAE1B,KAAK,GAAIre,GAAI,EAAGA,EAAI3F,KAAKsC,OAAQqD,IAAK,CAClC,GAAIwvB,GAAUn1B,KAAK2F,GAAG2Q,KACtB6e,GAAQC,yBAA2BD,EAAQE,qBAAuBF,EAAQG,qBAAuBH,EAAQI,sBAAwBJ,EAAQK,oBAAsBL,EAAQM,mBAAqBzR,EAEhM,MAAOhkB,QAGT,cAAgB80B,GAAOl1B,KACzBk1B,EAAOl1B,GAAGya,WAAa,SAAUqb,GAC7B,MAAI11B,MAAKsC,OAAS,EACVozB,EACO11B,KAAK,GAAGurB,YAAcvS,WAAWhZ,KAAKsV,IAAI,iBAAmB0D,WAAWhZ,KAAKsV,IAAI,gBAEjFtV,KAAK,GAAGurB,YAEX,QAKxB7oB,OAAOvC,OAASA,KAKG,mBAAb,QAENw1B,OAAOC,QAAUlzB,OAAOvC,OAED,kBAAX01B,SAAyBA,OAAOC,KAC5CD,UAAW,WACP,YACA,OAAOnzB,QAAOvC","file":"../swiper.jquery.min.js","sourcesContent":["/**\n * Swiper 3.4.0\n * Most modern mobile touch slider and framework with hardware accelerated transitions\n * \n * http://www.idangero.us/swiper/\n * \n * Copyright 2016, Vladimir Kharlampidi\n * The iDangero.us\n * http://www.idangero.us/\n * \n * Licensed under MIT\n * \n * Released on: October 16, 2016\n */\n(function () {\n 'use strict';\n var $;\n /*===========================\n Swiper\n ===========================*/\n var Swiper = function (container, params) {\n if (!(this instanceof Swiper)) return new Swiper(container, params);\n\n var defaults = {\n direction: 'horizontal',\n touchEventsTarget: 'container',\n initialSlide: 0,\n speed: 300,\n // autoplay\n autoplay: false,\n autoplayDisableOnInteraction: true,\n autoplayStopOnLast: false,\n // To support iOS's swipe-to-go-back gesture (when being used in-app, with UIWebView).\n iOSEdgeSwipeDetection: false,\n iOSEdgeSwipeThreshold: 20,\n // Free mode\n freeMode: false,\n freeModeMomentum: true,\n freeModeMomentumRatio: 1,\n freeModeMomentumBounce: true,\n freeModeMomentumBounceRatio: 1,\n freeModeMomentumVelocityRatio: 1,\n freeModeSticky: false,\n freeModeMinimumVelocity: 0.02,\n // Autoheight\n autoHeight: false,\n // Set wrapper width\n setWrapperSize: false,\n // Virtual Translate\n virtualTranslate: false,\n // Effects\n effect: 'slide', // 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip'\n coverflow: {\n rotate: 50,\n stretch: 0,\n depth: 100,\n modifier: 1,\n slideShadows : true\n },\n flip: {\n slideShadows : true,\n limitRotation: true\n },\n cube: {\n slideShadows: true,\n shadow: true,\n shadowOffset: 20,\n shadowScale: 0.94\n },\n fade: {\n crossFade: false\n },\n // Parallax\n parallax: false,\n // Zoom\n zoom: false,\n zoomMax: 3,\n zoomMin: 1,\n zoomToggle: true,\n // Scrollbar\n scrollbar: null,\n scrollbarHide: true,\n scrollbarDraggable: false,\n scrollbarSnapOnRelease: false,\n // Keyboard Mousewheel\n keyboardControl: false,\n mousewheelControl: false,\n mousewheelReleaseOnEdges: false,\n mousewheelInvert: false,\n mousewheelForceToAxis: false,\n mousewheelSensitivity: 1,\n mousewheelEventsTarged: 'container',\n // Hash Navigation\n hashnav: false,\n hashnavWatchState: false,\n // History\n history: false,\n // Commong Nav State\n replaceState: false,\n // Breakpoints\n breakpoints: undefined,\n // Slides grid\n spaceBetween: 0,\n slidesPerView: 1,\n slidesPerColumn: 1,\n slidesPerColumnFill: 'column',\n slidesPerGroup: 1,\n centeredSlides: false,\n slidesOffsetBefore: 0, // in px\n slidesOffsetAfter: 0, // in px\n // Round length\n roundLengths: false,\n // Touches\n touchRatio: 1,\n touchAngle: 45,\n simulateTouch: true,\n shortSwipes: true,\n longSwipes: true,\n longSwipesRatio: 0.5,\n longSwipesMs: 300,\n followFinger: true,\n onlyExternal: false,\n threshold: 0,\n touchMoveStopPropagation: true,\n touchReleaseOnEdges: false,\n // Unique Navigation Elements\n uniqueNavElements: true,\n // Pagination\n pagination: null,\n paginationElement: 'span',\n paginationClickable: false,\n paginationHide: false,\n paginationBulletRender: null,\n paginationProgressRender: null,\n paginationFractionRender: null,\n paginationCustomRender: null,\n paginationType: 'bullets', // 'bullets' or 'progress' or 'fraction' or 'custom'\n // Resistance\n resistance: true,\n resistanceRatio: 0.85,\n // Next/prev buttons\n nextButton: null,\n prevButton: null,\n // Progress\n watchSlidesProgress: false,\n watchSlidesVisibility: false,\n // Cursor\n grabCursor: false,\n // Clicks\n preventClicks: true,\n preventClicksPropagation: true,\n slideToClickedSlide: false,\n // Lazy Loading\n lazyLoading: false,\n lazyLoadingInPrevNext: false,\n lazyLoadingInPrevNextAmount: 1,\n lazyLoadingOnTransitionStart: false,\n // Images\n preloadImages: true,\n updateOnImagesReady: true,\n // loop\n loop: false,\n loopAdditionalSlides: 0,\n loopedSlides: null,\n // Control\n control: undefined,\n controlInverse: false,\n controlBy: 'slide', //or 'container'\n normalizeSlideIndex: true,\n // Swiping/no swiping\n allowSwipeToPrev: true,\n allowSwipeToNext: true,\n swipeHandler: null, //'.swipe-handler',\n noSwiping: true,\n noSwipingClass: 'swiper-no-swiping',\n // Passive Listeners\n passiveListeners: true,\n // NS\n containerModifierClass: 'swiper-container-', // NEW\n slideClass: 'swiper-slide',\n slideActiveClass: 'swiper-slide-active',\n slideDuplicateActiveClass: 'swiper-slide-duplicate-active',\n slideVisibleClass: 'swiper-slide-visible',\n slideDuplicateClass: 'swiper-slide-duplicate',\n slideNextClass: 'swiper-slide-next',\n slideDuplicateNextClass: 'swiper-slide-duplicate-next',\n slidePrevClass: 'swiper-slide-prev',\n slideDuplicatePrevClass: 'swiper-slide-duplicate-prev',\n wrapperClass: 'swiper-wrapper',\n bulletClass: 'swiper-pagination-bullet',\n bulletActiveClass: 'swiper-pagination-bullet-active',\n buttonDisabledClass: 'swiper-button-disabled',\n paginationCurrentClass: 'swiper-pagination-current',\n paginationTotalClass: 'swiper-pagination-total',\n paginationHiddenClass: 'swiper-pagination-hidden',\n paginationProgressbarClass: 'swiper-pagination-progressbar',\n paginationClickableClass: 'swiper-pagination-clickable', // NEW\n paginationModifierClass: 'swiper-pagination-', // NEW\n lazyLoadingClass: 'swiper-lazy',\n lazyStatusLoadingClass: 'swiper-lazy-loading',\n lazyStatusLoadedClass: 'swiper-lazy-loaded',\n lazyPreloaderClass: 'swiper-lazy-preloader',\n notificationClass: 'swiper-notification',\n preloaderClass: 'preloader',\n zoomContainerClass: 'swiper-zoom-container',\n \n // Observer\n observer: false,\n observeParents: false,\n // Accessibility\n a11y: false,\n prevSlideMessage: 'Previous slide',\n nextSlideMessage: 'Next slide',\n firstSlideMessage: 'This is the first slide',\n lastSlideMessage: 'This is the last slide',\n paginationBulletMessage: 'Go to slide {{index}}',\n // Callbacks\n runCallbacksOnInit: true\n /*\n Callbacks:\n onInit: function (swiper)\n onDestroy: function (swiper)\n onClick: function (swiper, e)\n onTap: function (swiper, e)\n onDoubleTap: function (swiper, e)\n onSliderMove: function (swiper, e)\n onSlideChangeStart: function (swiper)\n onSlideChangeEnd: function (swiper)\n onTransitionStart: function (swiper)\n onTransitionEnd: function (swiper)\n onImagesReady: function (swiper)\n onProgress: function (swiper, progress)\n onTouchStart: function (swiper, e)\n onTouchMove: function (swiper, e)\n onTouchMoveOpposite: function (swiper, e)\n onTouchEnd: function (swiper, e)\n onReachBeginning: function (swiper)\n onReachEnd: function (swiper)\n onSetTransition: function (swiper, duration)\n onSetTranslate: function (swiper, translate)\n onAutoplayStart: function (swiper)\n onAutoplayStop: function (swiper),\n onLazyImageLoad: function (swiper, slide, image)\n onLazyImageReady: function (swiper, slide, image)\n */\n \n };\n var initialVirtualTranslate = params && params.virtualTranslate;\n \n params = params || {};\n var originalParams = {};\n for (var param in params) {\n if (typeof params[param] === 'object' && params[param] !== null && !(params[param].nodeType || params[param] === window || params[param] === document || (typeof Dom7 !== 'undefined' && params[param] instanceof Dom7) || (typeof jQuery !== 'undefined' && params[param] instanceof jQuery))) {\n originalParams[param] = {};\n for (var deepParam in params[param]) {\n originalParams[param][deepParam] = params[param][deepParam];\n }\n }\n else {\n originalParams[param] = params[param];\n }\n }\n for (var def in defaults) {\n if (typeof params[def] === 'undefined') {\n params[def] = defaults[def];\n }\n else if (typeof params[def] === 'object') {\n for (var deepDef in defaults[def]) {\n if (typeof params[def][deepDef] === 'undefined') {\n params[def][deepDef] = defaults[def][deepDef];\n }\n }\n }\n }\n \n // Swiper\n var s = this;\n \n // Params\n s.params = params;\n s.originalParams = originalParams;\n \n // Classname\n s.classNames = [];\n /*=========================\n Dom Library and plugins\n ===========================*/\n if (typeof $ !== 'undefined' && typeof Dom7 !== 'undefined'){\n $ = Dom7;\n }\n if (typeof $ === 'undefined') {\n if (typeof Dom7 === 'undefined') {\n $ = window.Dom7 || window.Zepto || window.jQuery;\n }\n else {\n $ = Dom7;\n }\n if (!$) return;\n }\n // Export it to Swiper instance\n s.$ = $;\n \n /*=========================\n Breakpoints\n ===========================*/\n s.currentBreakpoint = undefined;\n s.getActiveBreakpoint = function () {\n //Get breakpoint for window width\n if (!s.params.breakpoints) return false;\n var breakpoint = false;\n var points = [], point;\n for ( point in s.params.breakpoints ) {\n if (s.params.breakpoints.hasOwnProperty(point)) {\n points.push(point);\n }\n }\n points.sort(function (a, b) {\n return parseInt(a, 10) > parseInt(b, 10);\n });\n for (var i = 0; i < points.length; i++) {\n point = points[i];\n if (point >= window.innerWidth && !breakpoint) {\n breakpoint = point;\n }\n }\n return breakpoint || 'max';\n };\n s.setBreakpoint = function () {\n //Set breakpoint for window width and update parameters\n var breakpoint = s.getActiveBreakpoint();\n if (breakpoint && s.currentBreakpoint !== breakpoint) {\n var breakPointsParams = breakpoint in s.params.breakpoints ? s.params.breakpoints[breakpoint] : s.originalParams;\n var needsReLoop = s.params.loop && (breakPointsParams.slidesPerView !== s.params.slidesPerView);\n for ( var param in breakPointsParams ) {\n s.params[param] = breakPointsParams[param];\n }\n s.currentBreakpoint = breakpoint;\n if(needsReLoop && s.destroyLoop) {\n s.reLoop(true);\n }\n }\n };\n // Set breakpoint on load\n if (s.params.breakpoints) {\n s.setBreakpoint();\n }\n \n /*=========================\n Preparation - Define Container, Wrapper and Pagination\n ===========================*/\n s.container = $(container);\n if (s.container.length === 0) return;\n if (s.container.length > 1) {\n var swipers = [];\n s.container.each(function () {\n var container = this;\n swipers.push(new Swiper(this, params));\n });\n return swipers;\n }\n \n // Save instance in container HTML Element and in data\n s.container[0].swiper = s;\n s.container.data('swiper', s);\n \n s.classNames.push(s.params.containerModifierClass + s.params.direction);\n \n if (s.params.freeMode) {\n s.classNames.push(s.params.containerModifierClass + 'free-mode');\n }\n if (!s.support.flexbox) {\n s.classNames.push(s.params.containerModifierClass + 'no-flexbox');\n s.params.slidesPerColumn = 1;\n }\n if (s.params.autoHeight) {\n s.classNames.push(s.params.containerModifierClass + 'autoheight');\n }\n // Enable slides progress when required\n if (s.params.parallax || s.params.watchSlidesVisibility) {\n s.params.watchSlidesProgress = true;\n }\n // Max resistance when touchReleaseOnEdges\n if (s.params.touchReleaseOnEdges) {\n s.params.resistanceRatio = 0;\n }\n // Coverflow / 3D\n if (['cube', 'coverflow', 'flip'].indexOf(s.params.effect) >= 0) {\n if (s.support.transforms3d) {\n s.params.watchSlidesProgress = true;\n s.classNames.push(s.params.containerModifierClass + '3d');\n }\n else {\n s.params.effect = 'slide';\n }\n }\n if (s.params.effect !== 'slide') {\n s.classNames.push(s.params.containerModifierClass + s.params.effect);\n }\n if (s.params.effect === 'cube') {\n s.params.resistanceRatio = 0;\n s.params.slidesPerView = 1;\n s.params.slidesPerColumn = 1;\n s.params.slidesPerGroup = 1;\n s.params.centeredSlides = false;\n s.params.spaceBetween = 0;\n s.params.virtualTranslate = true;\n s.params.setWrapperSize = false;\n }\n if (s.params.effect === 'fade' || s.params.effect === 'flip') {\n s.params.slidesPerView = 1;\n s.params.slidesPerColumn = 1;\n s.params.slidesPerGroup = 1;\n s.params.watchSlidesProgress = true;\n s.params.spaceBetween = 0;\n s.params.setWrapperSize = false;\n if (typeof initialVirtualTranslate === 'undefined') {\n s.params.virtualTranslate = true;\n }\n }\n \n // Grab Cursor\n if (s.params.grabCursor && s.support.touch) {\n s.params.grabCursor = false;\n }\n \n // Wrapper\n s.wrapper = s.container.children('.' + s.params.wrapperClass);\n \n // Pagination\n if (s.params.pagination) {\n s.paginationContainer = $(s.params.pagination);\n if (s.params.uniqueNavElements && typeof s.params.pagination === 'string' && s.paginationContainer.length > 1 && s.container.find(s.params.pagination).length === 1) {\n s.paginationContainer = s.container.find(s.params.pagination);\n }\n \n if (s.params.paginationType === 'bullets' && s.params.paginationClickable) {\n s.paginationContainer.addClass(s.params.paginationModifierClass + 'clickable');\n }\n else {\n s.params.paginationClickable = false;\n }\n s.paginationContainer.addClass(s.params.paginationModifierClass + s.params.paginationType);\n }\n // Next/Prev Buttons\n if (s.params.nextButton || s.params.prevButton) {\n if (s.params.nextButton) {\n s.nextButton = $(s.params.nextButton);\n if (s.params.uniqueNavElements && typeof s.params.nextButton === 'string' && s.nextButton.length > 1 && s.container.find(s.params.nextButton).length === 1) {\n s.nextButton = s.container.find(s.params.nextButton);\n }\n }\n if (s.params.prevButton) {\n s.prevButton = $(s.params.prevButton);\n if (s.params.uniqueNavElements && typeof s.params.prevButton === 'string' && s.prevButton.length > 1 && s.container.find(s.params.prevButton).length === 1) {\n s.prevButton = s.container.find(s.params.prevButton);\n }\n }\n }\n \n // Is Horizontal\n s.isHorizontal = function () {\n return s.params.direction === 'horizontal';\n };\n // s.isH = isH;\n \n // RTL\n s.rtl = s.isHorizontal() && (s.container[0].dir.toLowerCase() === 'rtl' || s.container.css('direction') === 'rtl');\n if (s.rtl) {\n s.classNames.push(s.params.containerModifierClass + 'rtl');\n }\n \n // Wrong RTL support\n if (s.rtl) {\n s.wrongRTL = s.wrapper.css('display') === '-webkit-box';\n }\n \n // Columns\n if (s.params.slidesPerColumn > 1) {\n s.classNames.push(s.params.containerModifierClass + 'multirow');\n }\n \n // Check for Android\n if (s.device.android) {\n s.classNames.push(s.params.containerModifierClass + 'android');\n }\n \n // Add classes\n s.container.addClass(s.classNames.join(' '));\n \n // Translate\n s.translate = 0;\n \n // Progress\n s.progress = 0;\n \n // Velocity\n s.velocity = 0;\n \n /*=========================\n Locks, unlocks\n ===========================*/\n s.lockSwipeToNext = function () {\n s.params.allowSwipeToNext = false;\n if (s.params.allowSwipeToPrev === false && s.params.grabCursor) {\n s.unsetGrabCursor();\n }\n };\n s.lockSwipeToPrev = function () {\n s.params.allowSwipeToPrev = false;\n if (s.params.allowSwipeToNext === false && s.params.grabCursor) {\n s.unsetGrabCursor();\n }\n };\n s.lockSwipes = function () {\n s.params.allowSwipeToNext = s.params.allowSwipeToPrev = false;\n if (s.params.grabCursor) s.unsetGrabCursor();\n };\n s.unlockSwipeToNext = function () {\n s.params.allowSwipeToNext = true;\n if (s.params.allowSwipeToPrev === true && s.params.grabCursor) {\n s.setGrabCursor();\n }\n };\n s.unlockSwipeToPrev = function () {\n s.params.allowSwipeToPrev = true;\n if (s.params.allowSwipeToNext === true && s.params.grabCursor) {\n s.setGrabCursor();\n }\n };\n s.unlockSwipes = function () {\n s.params.allowSwipeToNext = s.params.allowSwipeToPrev = true;\n if (s.params.grabCursor) s.setGrabCursor();\n };\n \n /*=========================\n Round helper\n ===========================*/\n function round(a) {\n return Math.floor(a);\n }\n /*=========================\n Set grab cursor\n ===========================*/\n s.setGrabCursor = function(moving) {\n s.container[0].style.cursor = 'move';\n s.container[0].style.cursor = moving ? '-webkit-grabbing' : '-webkit-grab';\n s.container[0].style.cursor = moving ? '-moz-grabbin' : '-moz-grab';\n s.container[0].style.cursor = moving ? 'grabbing': 'grab';\n };\n s.unsetGrabCursor = function () {\n s.container[0].style.cursor = '';\n };\n if (s.params.grabCursor) {\n s.setGrabCursor();\n }\n /*=========================\n Update on Images Ready\n ===========================*/\n s.imagesToLoad = [];\n s.imagesLoaded = 0;\n \n s.loadImage = function (imgElement, src, srcset, sizes, checkForComplete, callback) {\n var image;\n function onReady () {\n if (callback) callback();\n }\n if (!imgElement.complete || !checkForComplete) {\n if (src) {\n image = new window.Image();\n image.onload = onReady;\n image.onerror = onReady;\n if (sizes) {\n image.sizes = sizes;\n }\n if (srcset) {\n image.srcset = srcset;\n }\n if (src) {\n image.src = src;\n }\n } else {\n onReady();\n }\n \n } else {//image already loaded...\n onReady();\n }\n };\n s.preloadImages = function () {\n s.imagesToLoad = s.container.find('img');\n function _onReady() {\n if (typeof s === 'undefined' || s === null) return;\n if (s.imagesLoaded !== undefined) s.imagesLoaded++;\n if (s.imagesLoaded === s.imagesToLoad.length) {\n if (s.params.updateOnImagesReady) s.update();\n s.emit('onImagesReady', s);\n }\n }\n for (var i = 0; i < s.imagesToLoad.length; i++) {\n s.loadImage(s.imagesToLoad[i], (s.imagesToLoad[i].currentSrc || s.imagesToLoad[i].getAttribute('src')), (s.imagesToLoad[i].srcset || s.imagesToLoad[i].getAttribute('srcset')), s.imagesToLoad[i].sizes || s.imagesToLoad[i].getAttribute('sizes'), true, _onReady);\n }\n };\n \n /*=========================\n Autoplay\n ===========================*/\n s.autoplayTimeoutId = undefined;\n s.autoplaying = false;\n s.autoplayPaused = false;\n function autoplay() {\n var autoplayDelay = s.params.autoplay;\n var activeSlide = s.slides.eq(s.activeIndex);\n if (activeSlide.attr('data-swiper-autoplay')) {\n autoplayDelay = activeSlide.attr('data-swiper-autoplay') || s.params.autoplay;\n }\n s.autoplayTimeoutId = setTimeout(function () {\n if (s.params.loop) {\n s.fixLoop();\n s._slideNext();\n s.emit('onAutoplay', s);\n }\n else {\n if (!s.isEnd) {\n s._slideNext();\n s.emit('onAutoplay', s);\n }\n else {\n if (!params.autoplayStopOnLast) {\n s._slideTo(0);\n s.emit('onAutoplay', s);\n }\n else {\n s.stopAutoplay();\n }\n }\n }\n }, autoplayDelay);\n }\n s.startAutoplay = function () {\n if (typeof s.autoplayTimeoutId !== 'undefined') return false;\n if (!s.params.autoplay) return false;\n if (s.autoplaying) return false;\n s.autoplaying = true;\n s.emit('onAutoplayStart', s);\n autoplay();\n };\n s.stopAutoplay = function (internal) {\n if (!s.autoplayTimeoutId) return;\n if (s.autoplayTimeoutId) clearTimeout(s.autoplayTimeoutId);\n s.autoplaying = false;\n s.autoplayTimeoutId = undefined;\n s.emit('onAutoplayStop', s);\n };\n s.pauseAutoplay = function (speed) {\n if (s.autoplayPaused) return;\n if (s.autoplayTimeoutId) clearTimeout(s.autoplayTimeoutId);\n s.autoplayPaused = true;\n if (speed === 0) {\n s.autoplayPaused = false;\n autoplay();\n }\n else {\n s.wrapper.transitionEnd(function () {\n if (!s) return;\n s.autoplayPaused = false;\n if (!s.autoplaying) {\n s.stopAutoplay();\n }\n else {\n autoplay();\n }\n });\n }\n };\n /*=========================\n Min/Max Translate\n ===========================*/\n s.minTranslate = function () {\n return (-s.snapGrid[0]);\n };\n s.maxTranslate = function () {\n return (-s.snapGrid[s.snapGrid.length - 1]);\n };\n /*=========================\n Slider/slides sizes\n ===========================*/\n s.updateAutoHeight = function () {\n var activeSlides = [];\n var newHeight = 0;\n \n // Find slides currently in view\n if(s.params.slidesPerView !== 'auto' && s.params.slidesPerView > 1) {\n for (i = 0; i < Math.ceil(s.params.slidesPerView); i++) {\n var index = s.activeIndex + i;\n if(index > s.slides.length) break;\n activeSlides.push(s.slides.eq(index)[0]);\n }\n } else {\n activeSlides.push(s.slides.eq(s.activeIndex)[0]);\n }\n \n // Find new height from heighest slide in view\n for (i = 0; i < activeSlides.length; i++) {\n if (typeof activeSlides[i] !== 'undefined') {\n var height = activeSlides[i].offsetHeight;\n newHeight = height > newHeight ? height : newHeight;\n }\n }\n \n // Update Height\n if (newHeight) s.wrapper.css('height', newHeight + 'px');\n };\n s.updateContainerSize = function () {\n var width, height;\n if (typeof s.params.width !== 'undefined') {\n width = s.params.width;\n }\n else {\n width = s.container[0].clientWidth;\n }\n if (typeof s.params.height !== 'undefined') {\n height = s.params.height;\n }\n else {\n height = s.container[0].clientHeight;\n }\n if (width === 0 && s.isHorizontal() || height === 0 && !s.isHorizontal()) {\n return;\n }\n \n //Subtract paddings\n width = width - parseInt(s.container.css('padding-left'), 10) - parseInt(s.container.css('padding-right'), 10);\n height = height - parseInt(s.container.css('padding-top'), 10) - parseInt(s.container.css('padding-bottom'), 10);\n \n // Store values\n s.width = width;\n s.height = height;\n s.size = s.isHorizontal() ? s.width : s.height;\n };\n \n s.updateSlidesSize = function () {\n s.slides = s.wrapper.children('.' + s.params.slideClass);\n s.snapGrid = [];\n s.slidesGrid = [];\n s.slidesSizesGrid = [];\n \n var spaceBetween = s.params.spaceBetween,\n slidePosition = -s.params.slidesOffsetBefore,\n i,\n prevSlideSize = 0,\n index = 0;\n if (typeof s.size === 'undefined') return;\n if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {\n spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * s.size;\n }\n \n s.virtualSize = -spaceBetween;\n // reset margins\n if (s.rtl) s.slides.css({marginLeft: '', marginTop: ''});\n else s.slides.css({marginRight: '', marginBottom: ''});\n \n var slidesNumberEvenToRows;\n if (s.params.slidesPerColumn > 1) {\n if (Math.floor(s.slides.length / s.params.slidesPerColumn) === s.slides.length / s.params.slidesPerColumn) {\n slidesNumberEvenToRows = s.slides.length;\n }\n else {\n slidesNumberEvenToRows = Math.ceil(s.slides.length / s.params.slidesPerColumn) * s.params.slidesPerColumn;\n }\n if (s.params.slidesPerView !== 'auto' && s.params.slidesPerColumnFill === 'row') {\n slidesNumberEvenToRows = Math.max(slidesNumberEvenToRows, s.params.slidesPerView * s.params.slidesPerColumn);\n }\n }\n \n // Calc slides\n var slideSize;\n var slidesPerColumn = s.params.slidesPerColumn;\n var slidesPerRow = slidesNumberEvenToRows / slidesPerColumn;\n var numFullColumns = slidesPerRow - (s.params.slidesPerColumn * slidesPerRow - s.slides.length);\n for (i = 0; i < s.slides.length; i++) {\n slideSize = 0;\n var slide = s.slides.eq(i);\n if (s.params.slidesPerColumn > 1) {\n // Set slides order\n var newSlideOrderIndex;\n var column, row;\n if (s.params.slidesPerColumnFill === 'column') {\n column = Math.floor(i / slidesPerColumn);\n row = i - column * slidesPerColumn;\n if (column > numFullColumns || (column === numFullColumns && row === slidesPerColumn-1)) {\n if (++row >= slidesPerColumn) {\n row = 0;\n column++;\n }\n }\n newSlideOrderIndex = column + row * slidesNumberEvenToRows / slidesPerColumn;\n slide\n .css({\n '-webkit-box-ordinal-group': newSlideOrderIndex,\n '-moz-box-ordinal-group': newSlideOrderIndex,\n '-ms-flex-order': newSlideOrderIndex,\n '-webkit-order': newSlideOrderIndex,\n 'order': newSlideOrderIndex\n });\n }\n else {\n row = Math.floor(i / slidesPerRow);\n column = i - row * slidesPerRow;\n }\n slide\n .css(\n 'margin-' + (s.isHorizontal() ? 'top' : 'left'),\n (row !== 0 && s.params.spaceBetween) && (s.params.spaceBetween + 'px')\n )\n .attr('data-swiper-column', column)\n .attr('data-swiper-row', row);\n \n }\n if (slide.css('display') === 'none') continue;\n if (s.params.slidesPerView === 'auto') {\n slideSize = s.isHorizontal() ? slide.outerWidth(true) : slide.outerHeight(true);\n if (s.params.roundLengths) slideSize = round(slideSize);\n }\n else {\n slideSize = (s.size - (s.params.slidesPerView - 1) * spaceBetween) / s.params.slidesPerView;\n if (s.params.roundLengths) slideSize = round(slideSize);\n \n if (s.isHorizontal()) {\n s.slides[i].style.width = slideSize + 'px';\n }\n else {\n s.slides[i].style.height = slideSize + 'px';\n }\n }\n s.slides[i].swiperSlideSize = slideSize;\n s.slidesSizesGrid.push(slideSize);\n \n \n if (s.params.centeredSlides) {\n slidePosition = slidePosition + slideSize / 2 + prevSlideSize / 2 + spaceBetween;\n if (i === 0) slidePosition = slidePosition - s.size / 2 - spaceBetween;\n if (Math.abs(slidePosition) < 1 / 1000) slidePosition = 0;\n if ((index) % s.params.slidesPerGroup === 0) s.snapGrid.push(slidePosition);\n s.slidesGrid.push(slidePosition);\n }\n else {\n if ((index) % s.params.slidesPerGroup === 0) s.snapGrid.push(slidePosition);\n s.slidesGrid.push(slidePosition);\n slidePosition = slidePosition + slideSize + spaceBetween;\n }\n \n s.virtualSize += slideSize + spaceBetween;\n \n prevSlideSize = slideSize;\n \n index ++;\n }\n s.virtualSize = Math.max(s.virtualSize, s.size) + s.params.slidesOffsetAfter;\n var newSlidesGrid;\n \n if (\n s.rtl && s.wrongRTL && (s.params.effect === 'slide' || s.params.effect === 'coverflow')) {\n s.wrapper.css({width: s.virtualSize + s.params.spaceBetween + 'px'});\n }\n if (!s.support.flexbox || s.params.setWrapperSize) {\n if (s.isHorizontal()) s.wrapper.css({width: s.virtualSize + s.params.spaceBetween + 'px'});\n else s.wrapper.css({height: s.virtualSize + s.params.spaceBetween + 'px'});\n }\n \n if (s.params.slidesPerColumn > 1) {\n s.virtualSize = (slideSize + s.params.spaceBetween) * slidesNumberEvenToRows;\n s.virtualSize = Math.ceil(s.virtualSize / s.params.slidesPerColumn) - s.params.spaceBetween;\n if (s.isHorizontal()) s.wrapper.css({width: s.virtualSize + s.params.spaceBetween + 'px'});\n else s.wrapper.css({height: s.virtualSize + s.params.spaceBetween + 'px'});\n if (s.params.centeredSlides) {\n newSlidesGrid = [];\n for (i = 0; i < s.snapGrid.length; i++) {\n if (s.snapGrid[i] < s.virtualSize + s.snapGrid[0]) newSlidesGrid.push(s.snapGrid[i]);\n }\n s.snapGrid = newSlidesGrid;\n }\n }\n \n // Remove last grid elements depending on width\n if (!s.params.centeredSlides) {\n newSlidesGrid = [];\n for (i = 0; i < s.snapGrid.length; i++) {\n if (s.snapGrid[i] <= s.virtualSize - s.size) {\n newSlidesGrid.push(s.snapGrid[i]);\n }\n }\n s.snapGrid = newSlidesGrid;\n if (Math.floor(s.virtualSize - s.size) - Math.floor(s.snapGrid[s.snapGrid.length - 1]) > 1) {\n s.snapGrid.push(s.virtualSize - s.size);\n }\n }\n if (s.snapGrid.length === 0) s.snapGrid = [0];\n \n if (s.params.spaceBetween !== 0) {\n if (s.isHorizontal()) {\n if (s.rtl) s.slides.css({marginLeft: spaceBetween + 'px'});\n else s.slides.css({marginRight: spaceBetween + 'px'});\n }\n else s.slides.css({marginBottom: spaceBetween + 'px'});\n }\n if (s.params.watchSlidesProgress) {\n s.updateSlidesOffset();\n }\n };\n s.updateSlidesOffset = function () {\n for (var i = 0; i < s.slides.length; i++) {\n s.slides[i].swiperSlideOffset = s.isHorizontal() ? s.slides[i].offsetLeft : s.slides[i].offsetTop;\n }\n };\n \n /*=========================\n Slider/slides progress\n ===========================*/\n s.updateSlidesProgress = function (translate) {\n if (typeof translate === 'undefined') {\n translate = s.translate || 0;\n }\n if (s.slides.length === 0) return;\n if (typeof s.slides[0].swiperSlideOffset === 'undefined') s.updateSlidesOffset();\n \n var offsetCenter = -translate;\n if (s.rtl) offsetCenter = translate;\n \n // Visible Slides\n s.slides.removeClass(s.params.slideVisibleClass);\n for (var i = 0; i < s.slides.length; i++) {\n var slide = s.slides[i];\n var slideProgress = (offsetCenter + (s.params.centeredSlides ? s.minTranslate() : 0) - slide.swiperSlideOffset) / (slide.swiperSlideSize + s.params.spaceBetween);\n if (s.params.watchSlidesVisibility) {\n var slideBefore = -(offsetCenter - slide.swiperSlideOffset);\n var slideAfter = slideBefore + s.slidesSizesGrid[i];\n var isVisible =\n (slideBefore >= 0 && slideBefore < s.size) ||\n (slideAfter > 0 && slideAfter <= s.size) ||\n (slideBefore <= 0 && slideAfter >= s.size);\n if (isVisible) {\n s.slides.eq(i).addClass(s.params.slideVisibleClass);\n }\n }\n slide.progress = s.rtl ? -slideProgress : slideProgress;\n }\n };\n s.updateProgress = function (translate) {\n if (typeof translate === 'undefined') {\n translate = s.translate || 0;\n }\n var translatesDiff = s.maxTranslate() - s.minTranslate();\n var wasBeginning = s.isBeginning;\n var wasEnd = s.isEnd;\n if (translatesDiff === 0) {\n s.progress = 0;\n s.isBeginning = s.isEnd = true;\n }\n else {\n s.progress = (translate - s.minTranslate()) / (translatesDiff);\n s.isBeginning = s.progress <= 0;\n s.isEnd = s.progress >= 1;\n }\n if (s.isBeginning && !wasBeginning) s.emit('onReachBeginning', s);\n if (s.isEnd && !wasEnd) s.emit('onReachEnd', s);\n \n if (s.params.watchSlidesProgress) s.updateSlidesProgress(translate);\n s.emit('onProgress', s, s.progress);\n };\n s.updateActiveIndex = function () {\n var translate = s.rtl ? s.translate : -s.translate;\n var newActiveIndex, i, snapIndex;\n for (i = 0; i < s.slidesGrid.length; i ++) {\n if (typeof s.slidesGrid[i + 1] !== 'undefined') {\n if (translate >= s.slidesGrid[i] && translate < s.slidesGrid[i + 1] - (s.slidesGrid[i + 1] - s.slidesGrid[i]) / 2) {\n newActiveIndex = i;\n }\n else if (translate >= s.slidesGrid[i] && translate < s.slidesGrid[i + 1]) {\n newActiveIndex = i + 1;\n }\n }\n else {\n if (translate >= s.slidesGrid[i]) {\n newActiveIndex = i;\n }\n }\n }\n // Normalize slideIndex\n if(s.params.normalizeSlideIndex){\n if (newActiveIndex < 0 || typeof newActiveIndex === 'undefined') newActiveIndex = 0;\n }\n // for (i = 0; i < s.slidesGrid.length; i++) {\n // if (- translate >= s.slidesGrid[i]) {\n // newActiveIndex = i;\n // }\n // }\n snapIndex = Math.floor(newActiveIndex / s.params.slidesPerGroup);\n if (snapIndex >= s.snapGrid.length) snapIndex = s.snapGrid.length - 1;\n \n if (newActiveIndex === s.activeIndex) {\n return;\n }\n s.snapIndex = snapIndex;\n s.previousIndex = s.activeIndex;\n s.activeIndex = newActiveIndex;\n s.updateClasses();\n s.updateRealIndex();\n };\n s.updateRealIndex = function(){\n s.realIndex = s.slides.eq(s.activeIndex).attr('data-swiper-slide-index') || s.activeIndex;\n };\n \n /*=========================\n Classes\n ===========================*/\n s.updateClasses = function () {\n s.slides.removeClass(s.params.slideActiveClass + ' ' + s.params.slideNextClass + ' ' + s.params.slidePrevClass + ' ' + s.params.slideDuplicateActiveClass + ' ' + s.params.slideDuplicateNextClass + ' ' + s.params.slideDuplicatePrevClass);\n var activeSlide = s.slides.eq(s.activeIndex);\n // Active classes\n activeSlide.addClass(s.params.slideActiveClass);\n if (params.loop) {\n // Duplicate to all looped slides\n if (activeSlide.hasClass(s.params.slideDuplicateClass)) {\n s.wrapper.children('.' + s.params.slideClass + ':not(.' + s.params.slideDuplicateClass + ')[data-swiper-slide-index=\"' + s.realIndex + '\"]').addClass(s.params.slideDuplicateActiveClass);\n }\n else {\n s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass + '[data-swiper-slide-index=\"' + s.realIndex + '\"]').addClass(s.params.slideDuplicateActiveClass);\n }\n }\n // Next Slide\n var nextSlide = activeSlide.next('.' + s.params.slideClass).addClass(s.params.slideNextClass);\n if (s.params.loop && nextSlide.length === 0) {\n nextSlide = s.slides.eq(0);\n nextSlide.addClass(s.params.slideNextClass);\n }\n // Prev Slide\n var prevSlide = activeSlide.prev('.' + s.params.slideClass).addClass(s.params.slidePrevClass);\n if (s.params.loop && prevSlide.length === 0) {\n prevSlide = s.slides.eq(-1);\n prevSlide.addClass(s.params.slidePrevClass);\n }\n if (params.loop) {\n // Duplicate to all looped slides\n if (nextSlide.hasClass(s.params.slideDuplicateClass)) {\n s.wrapper.children('.' + s.params.slideClass + ':not(.' + s.params.slideDuplicateClass + ')[data-swiper-slide-index=\"' + nextSlide.attr('data-swiper-slide-index') + '\"]').addClass(s.params.slideDuplicateNextClass);\n }\n else {\n s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass + '[data-swiper-slide-index=\"' + nextSlide.attr('data-swiper-slide-index') + '\"]').addClass(s.params.slideDuplicateNextClass);\n }\n if (prevSlide.hasClass(s.params.slideDuplicateClass)) {\n s.wrapper.children('.' + s.params.slideClass + ':not(.' + s.params.slideDuplicateClass + ')[data-swiper-slide-index=\"' + prevSlide.attr('data-swiper-slide-index') + '\"]').addClass(s.params.slideDuplicatePrevClass);\n }\n else {\n s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass + '[data-swiper-slide-index=\"' + prevSlide.attr('data-swiper-slide-index') + '\"]').addClass(s.params.slideDuplicatePrevClass);\n }\n }\n \n // Pagination\n if (s.paginationContainer && s.paginationContainer.length > 0) {\n // Current/Total\n var current,\n total = s.params.loop ? Math.ceil((s.slides.length - s.loopedSlides * 2) / s.params.slidesPerGroup) : s.snapGrid.length;\n if (s.params.loop) {\n current = Math.ceil((s.activeIndex - s.loopedSlides)/s.params.slidesPerGroup);\n if (current > s.slides.length - 1 - s.loopedSlides * 2) {\n current = current - (s.slides.length - s.loopedSlides * 2);\n }\n if (current > total - 1) current = current - total;\n if (current < 0 && s.params.paginationType !== 'bullets') current = total + current;\n }\n else {\n if (typeof s.snapIndex !== 'undefined') {\n current = s.snapIndex;\n }\n else {\n current = s.activeIndex || 0;\n }\n }\n // Types\n if (s.params.paginationType === 'bullets' && s.bullets && s.bullets.length > 0) {\n s.bullets.removeClass(s.params.bulletActiveClass);\n if (s.paginationContainer.length > 1) {\n s.bullets.each(function () {\n if ($(this).index() === current) $(this).addClass(s.params.bulletActiveClass);\n });\n }\n else {\n s.bullets.eq(current).addClass(s.params.bulletActiveClass);\n }\n }\n if (s.params.paginationType === 'fraction') {\n s.paginationContainer.find('.' + s.params.paginationCurrentClass).text(current + 1);\n s.paginationContainer.find('.' + s.params.paginationTotalClass).text(total);\n }\n if (s.params.paginationType === 'progress') {\n var scale = (current + 1) / total,\n scaleX = scale,\n scaleY = 1;\n if (!s.isHorizontal()) {\n scaleY = scale;\n scaleX = 1;\n }\n s.paginationContainer.find('.' + s.params.paginationProgressbarClass).transform('translate3d(0,0,0) scaleX(' + scaleX + ') scaleY(' + scaleY + ')').transition(s.params.speed);\n }\n if (s.params.paginationType === 'custom' && s.params.paginationCustomRender) {\n s.paginationContainer.html(s.params.paginationCustomRender(s, current + 1, total));\n s.emit('onPaginationRendered', s, s.paginationContainer[0]);\n }\n }\n \n // Next/active buttons\n if (!s.params.loop) {\n if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {\n if (s.isBeginning) {\n s.prevButton.addClass(s.params.buttonDisabledClass);\n if (s.params.a11y && s.a11y) s.a11y.disable(s.prevButton);\n }\n else {\n s.prevButton.removeClass(s.params.buttonDisabledClass);\n if (s.params.a11y && s.a11y) s.a11y.enable(s.prevButton);\n }\n }\n if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {\n if (s.isEnd) {\n s.nextButton.addClass(s.params.buttonDisabledClass);\n if (s.params.a11y && s.a11y) s.a11y.disable(s.nextButton);\n }\n else {\n s.nextButton.removeClass(s.params.buttonDisabledClass);\n if (s.params.a11y && s.a11y) s.a11y.enable(s.nextButton);\n }\n }\n }\n };\n \n /*=========================\n Pagination\n ===========================*/\n s.updatePagination = function () {\n if (!s.params.pagination) return;\n if (s.paginationContainer && s.paginationContainer.length > 0) {\n var paginationHTML = '';\n if (s.params.paginationType === 'bullets') {\n var numberOfBullets = s.params.loop ? Math.ceil((s.slides.length - s.loopedSlides * 2) / s.params.slidesPerGroup) : s.snapGrid.length;\n for (var i = 0; i < numberOfBullets; i++) {\n if (s.params.paginationBulletRender) {\n paginationHTML += s.params.paginationBulletRender(s, i, s.params.bulletClass);\n }\n else {\n paginationHTML += '<' + s.params.paginationElement+' class=\"' + s.params.bulletClass + '\"></' + s.params.paginationElement + '>';\n }\n }\n s.paginationContainer.html(paginationHTML);\n s.bullets = s.paginationContainer.find('.' + s.params.bulletClass);\n if (s.params.paginationClickable && s.params.a11y && s.a11y) {\n s.a11y.initPagination();\n }\n }\n if (s.params.paginationType === 'fraction') {\n if (s.params.paginationFractionRender) {\n paginationHTML = s.params.paginationFractionRender(s, s.params.paginationCurrentClass, s.params.paginationTotalClass);\n }\n else {\n paginationHTML =\n '<span class=\"' + s.params.paginationCurrentClass + '\"></span>' +\n ' / ' +\n '<span class=\"' + s.params.paginationTotalClass+'\"></span>';\n }\n s.paginationContainer.html(paginationHTML);\n }\n if (s.params.paginationType === 'progress') {\n if (s.params.paginationProgressRender) {\n paginationHTML = s.params.paginationProgressRender(s, s.params.paginationProgressbarClass);\n }\n else {\n paginationHTML = '<span class=\"' + s.params.paginationProgressbarClass + '\"></span>';\n }\n s.paginationContainer.html(paginationHTML);\n }\n if (s.params.paginationType !== 'custom') {\n s.emit('onPaginationRendered', s, s.paginationContainer[0]);\n }\n }\n };\n /*=========================\n Common update method\n ===========================*/\n s.update = function (updateTranslate) {\n s.updateContainerSize();\n s.updateSlidesSize();\n s.updateProgress();\n s.updatePagination();\n s.updateClasses();\n if (s.params.scrollbar && s.scrollbar) {\n s.scrollbar.set();\n }\n function forceSetTranslate() {\n var translate = s.rtl ? -s.translate : s.translate;\n newTranslate = Math.min(Math.max(s.translate, s.maxTranslate()), s.minTranslate());\n s.setWrapperTranslate(newTranslate);\n s.updateActiveIndex();\n s.updateClasses();\n }\n if (updateTranslate) {\n var translated, newTranslate;\n if (s.controller && s.controller.spline) {\n s.controller.spline = undefined;\n }\n if (s.params.freeMode) {\n forceSetTranslate();\n if (s.params.autoHeight) {\n s.updateAutoHeight();\n }\n }\n else {\n if ((s.params.slidesPerView === 'auto' || s.params.slidesPerView > 1) && s.isEnd && !s.params.centeredSlides) {\n translated = s.slideTo(s.slides.length - 1, 0, false, true);\n }\n else {\n translated = s.slideTo(s.activeIndex, 0, false, true);\n }\n if (!translated) {\n forceSetTranslate();\n }\n }\n }\n else if (s.params.autoHeight) {\n s.updateAutoHeight();\n }\n };\n \n /*=========================\n Resize Handler\n ===========================*/\n s.onResize = function (forceUpdatePagination) {\n //Breakpoints\n if (s.params.breakpoints) {\n s.setBreakpoint();\n }\n \n // Disable locks on resize\n var allowSwipeToPrev = s.params.allowSwipeToPrev;\n var allowSwipeToNext = s.params.allowSwipeToNext;\n s.params.allowSwipeToPrev = s.params.allowSwipeToNext = true;\n \n s.updateContainerSize();\n s.updateSlidesSize();\n if (s.params.slidesPerView === 'auto' || s.params.freeMode || forceUpdatePagination) s.updatePagination();\n if (s.params.scrollbar && s.scrollbar) {\n s.scrollbar.set();\n }\n if (s.controller && s.controller.spline) {\n s.controller.spline = undefined;\n }\n var slideChangedBySlideTo = false;\n if (s.params.freeMode) {\n var newTranslate = Math.min(Math.max(s.translate, s.maxTranslate()), s.minTranslate());\n s.setWrapperTranslate(newTranslate);\n s.updateActiveIndex();\n s.updateClasses();\n \n if (s.params.autoHeight) {\n s.updateAutoHeight();\n }\n }\n else {\n s.updateClasses();\n if ((s.params.slidesPerView === 'auto' || s.params.slidesPerView > 1) && s.isEnd && !s.params.centeredSlides) {\n slideChangedBySlideTo = s.slideTo(s.slides.length - 1, 0, false, true);\n }\n else {\n slideChangedBySlideTo = s.slideTo(s.activeIndex, 0, false, true);\n }\n }\n if (s.params.lazyLoading && !slideChangedBySlideTo && s.lazy) {\n s.lazy.load();\n }\n // Return locks after resize\n s.params.allowSwipeToPrev = allowSwipeToPrev;\n s.params.allowSwipeToNext = allowSwipeToNext;\n };\n \n /*=========================\n Events\n ===========================*/\n \n //Define Touch Events\n s.touchEventsDesktop = {start: 'mousedown', move: 'mousemove', end: 'mouseup'};\n if (window.navigator.pointerEnabled) s.touchEventsDesktop = {start: 'pointerdown', move: 'pointermove', end: 'pointerup'};\n else if (window.navigator.msPointerEnabled) s.touchEventsDesktop = {start: 'MSPointerDown', move: 'MSPointerMove', end: 'MSPointerUp'};\n s.touchEvents = {\n start : s.support.touch || !s.params.simulateTouch ? 'touchstart' : s.touchEventsDesktop.start,\n move : s.support.touch || !s.params.simulateTouch ? 'touchmove' : s.touchEventsDesktop.move,\n end : s.support.touch || !s.params.simulateTouch ? 'touchend' : s.touchEventsDesktop.end\n };\n \n \n // WP8 Touch Events Fix\n if (window.navigator.pointerEnabled || window.navigator.msPointerEnabled) {\n (s.params.touchEventsTarget === 'container' ? s.container : s.wrapper).addClass('swiper-wp8-' + s.params.direction);\n }\n \n // Attach/detach events\n s.initEvents = function (detach) {\n var actionDom = detach ? 'off' : 'on';\n var action = detach ? 'removeEventListener' : 'addEventListener';\n var touchEventsTarget = s.params.touchEventsTarget === 'container' ? s.container[0] : s.wrapper[0];\n var target = s.support.touch ? touchEventsTarget : document;\n \n var moveCapture = s.params.nested ? true : false;\n \n //Touch Events\n if (s.browser.ie) {\n touchEventsTarget[action](s.touchEvents.start, s.onTouchStart, false);\n target[action](s.touchEvents.move, s.onTouchMove, moveCapture);\n target[action](s.touchEvents.end, s.onTouchEnd, false);\n }\n else {\n if (s.support.touch) {\n var passiveListener = s.touchEvents.start === 'touchstart' && s.support.passiveListener && s.params.passiveListeners ? {passive: true, capture: false} : false;\n touchEventsTarget[action](s.touchEvents.start, s.onTouchStart, passiveListener);\n touchEventsTarget[action](s.touchEvents.move, s.onTouchMove, moveCapture);\n touchEventsTarget[action](s.touchEvents.end, s.onTouchEnd, passiveListener);\n }\n if ((params.simulateTouch && !s.device.ios && !s.device.android) || (params.simulateTouch && !s.support.touch && s.device.ios)) {\n touchEventsTarget[action]('mousedown', s.onTouchStart, false);\n document[action]('mousemove', s.onTouchMove, moveCapture);\n document[action]('mouseup', s.onTouchEnd, false);\n }\n }\n window[action]('resize', s.onResize);\n \n // Next, Prev, Index\n if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {\n s.nextButton[actionDom]('click', s.onClickNext);\n if (s.params.a11y && s.a11y) s.nextButton[actionDom]('keydown', s.a11y.onEnterKey);\n }\n if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {\n s.prevButton[actionDom]('click', s.onClickPrev);\n if (s.params.a11y && s.a11y) s.prevButton[actionDom]('keydown', s.a11y.onEnterKey);\n }\n if (s.params.pagination && s.params.paginationClickable) {\n s.paginationContainer[actionDom]('click', '.' + s.params.bulletClass, s.onClickIndex);\n if (s.params.a11y && s.a11y) s.paginationContainer[actionDom]('keydown', '.' + s.params.bulletClass, s.a11y.onEnterKey);\n }\n \n // Prevent Links Clicks\n if (s.params.preventClicks || s.params.preventClicksPropagation) touchEventsTarget[action]('click', s.preventClicks, true);\n };\n s.attachEvents = function () {\n s.initEvents();\n };\n s.detachEvents = function () {\n s.initEvents(true);\n };\n \n /*=========================\n Handle Clicks\n ===========================*/\n // Prevent Clicks\n s.allowClick = true;\n s.preventClicks = function (e) {\n if (!s.allowClick) {\n if (s.params.preventClicks) e.preventDefault();\n if (s.params.preventClicksPropagation && s.animating) {\n e.stopPropagation();\n e.stopImmediatePropagation();\n }\n }\n };\n // Clicks\n s.onClickNext = function (e) {\n e.preventDefault();\n if (s.isEnd && !s.params.loop) return;\n s.slideNext();\n };\n s.onClickPrev = function (e) {\n e.preventDefault();\n if (s.isBeginning && !s.params.loop) return;\n s.slidePrev();\n };\n s.onClickIndex = function (e) {\n e.preventDefault();\n var index = $(this).index() * s.params.slidesPerGroup;\n if (s.params.loop) index = index + s.loopedSlides;\n s.slideTo(index);\n };\n \n /*=========================\n Handle Touches\n ===========================*/\n function findElementInEvent(e, selector) {\n var el = $(e.target);\n if (!el.is(selector)) {\n if (typeof selector === 'string') {\n el = el.parents(selector);\n }\n else if (selector.nodeType) {\n var found;\n el.parents().each(function (index, _el) {\n if (_el === selector) found = selector;\n });\n if (!found) return undefined;\n else return selector;\n }\n }\n if (el.length === 0) {\n return undefined;\n }\n return el[0];\n }\n s.updateClickedSlide = function (e) {\n var slide = findElementInEvent(e, '.' + s.params.slideClass);\n var slideFound = false;\n if (slide) {\n for (var i = 0; i < s.slides.length; i++) {\n if (s.slides[i] === slide) slideFound = true;\n }\n }\n \n if (slide && slideFound) {\n s.clickedSlide = slide;\n s.clickedIndex = $(slide).index();\n }\n else {\n s.clickedSlide = undefined;\n s.clickedIndex = undefined;\n return;\n }\n if (s.params.slideToClickedSlide && s.clickedIndex !== undefined && s.clickedIndex !== s.activeIndex) {\n var slideToIndex = s.clickedIndex,\n realIndex,\n duplicatedSlides;\n if (s.params.loop) {\n if (s.animating) return;\n realIndex = $(s.clickedSlide).attr('data-swiper-slide-index');\n if (s.params.centeredSlides) {\n if ((slideToIndex < s.loopedSlides - s.params.slidesPerView/2) || (slideToIndex > s.slides.length - s.loopedSlides + s.params.slidesPerView/2)) {\n s.fixLoop();\n slideToIndex = s.wrapper.children('.' + s.params.slideClass + '[data-swiper-slide-index=\"' + realIndex + '\"]:not(.' + s.params.slideDuplicateClass + ')').eq(0).index();\n setTimeout(function () {\n s.slideTo(slideToIndex);\n }, 0);\n }\n else {\n s.slideTo(slideToIndex);\n }\n }\n else {\n if (slideToIndex > s.slides.length - s.params.slidesPerView) {\n s.fixLoop();\n slideToIndex = s.wrapper.children('.' + s.params.slideClass + '[data-swiper-slide-index=\"' + realIndex + '\"]:not(.' + s.params.slideDuplicateClass + ')').eq(0).index();\n setTimeout(function () {\n s.slideTo(slideToIndex);\n }, 0);\n }\n else {\n s.slideTo(slideToIndex);\n }\n }\n }\n else {\n s.slideTo(slideToIndex);\n }\n }\n };\n \n var isTouched,\n isMoved,\n allowTouchCallbacks,\n touchStartTime,\n isScrolling,\n currentTranslate,\n startTranslate,\n allowThresholdMove,\n // Form elements to match\n formElements = 'input, select, textarea, button, video',\n // Last click time\n lastClickTime = Date.now(), clickTimeout,\n //Velocities\n velocities = [],\n allowMomentumBounce;\n \n // Animating Flag\n s.animating = false;\n \n // Touches information\n s.touches = {\n startX: 0,\n startY: 0,\n currentX: 0,\n currentY: 0,\n diff: 0\n };\n \n // Touch handlers\n var isTouchEvent, startMoving;\n s.onTouchStart = function (e) {\n if (e.originalEvent) e = e.originalEvent;\n isTouchEvent = e.type === 'touchstart';\n if (!isTouchEvent && 'which' in e && e.which === 3) return;\n if (s.params.noSwiping && findElementInEvent(e, '.' + s.params.noSwipingClass)) {\n s.allowClick = true;\n return;\n }\n if (s.params.swipeHandler) {\n if (!findElementInEvent(e, s.params.swipeHandler)) return;\n }\n \n var startX = s.touches.currentX = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;\n var startY = s.touches.currentY = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;\n \n // Do NOT start if iOS edge swipe is detected. Otherwise iOS app (UIWebView) cannot swipe-to-go-back anymore\n if(s.device.ios && s.params.iOSEdgeSwipeDetection && startX <= s.params.iOSEdgeSwipeThreshold) {\n return;\n }\n \n isTouched = true;\n isMoved = false;\n allowTouchCallbacks = true;\n isScrolling = undefined;\n startMoving = undefined;\n s.touches.startX = startX;\n s.touches.startY = startY;\n touchStartTime = Date.now();\n s.allowClick = true;\n s.updateContainerSize();\n s.swipeDirection = undefined;\n if (s.params.threshold > 0) allowThresholdMove = false;\n if (e.type !== 'touchstart') {\n var preventDefault = true;\n if ($(e.target).is(formElements)) preventDefault = false;\n if (document.activeElement && $(document.activeElement).is(formElements)) {\n document.activeElement.blur();\n }\n if (preventDefault) {\n e.preventDefault();\n }\n }\n s.emit('onTouchStart', s, e);\n };\n \n s.onTouchMove = function (e) {\n if (e.originalEvent) e = e.originalEvent;\n if (isTouchEvent && e.type === 'mousemove') return;\n if (e.preventedByNestedSwiper) {\n s.touches.startX = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;\n s.touches.startY = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;\n return;\n }\n if (s.params.onlyExternal) {\n // isMoved = true;\n s.allowClick = false;\n if (isTouched) {\n s.touches.startX = s.touches.currentX = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;\n s.touches.startY = s.touches.currentY = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;\n touchStartTime = Date.now();\n }\n return;\n }\n if (isTouchEvent && s.params.touchReleaseOnEdges && !s.params.loop) {\n if (!s.isHorizontal()) {\n // Vertical\n if (\n (s.touches.currentY < s.touches.startY && s.translate <= s.maxTranslate()) ||\n (s.touches.currentY > s.touches.startY && s.translate >= s.minTranslate())\n ) {\n return;\n }\n }\n else {\n if (\n (s.touches.currentX < s.touches.startX && s.translate <= s.maxTranslate()) ||\n (s.touches.currentX > s.touches.startX && s.translate >= s.minTranslate())\n ) {\n return;\n }\n }\n }\n if (isTouchEvent && document.activeElement) {\n if (e.target === document.activeElement && $(e.target).is(formElements)) {\n isMoved = true;\n s.allowClick = false;\n return;\n }\n }\n if (allowTouchCallbacks) {\n s.emit('onTouchMove', s, e);\n }\n if (e.targetTouches && e.targetTouches.length > 1) return;\n \n s.touches.currentX = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;\n s.touches.currentY = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;\n \n if (typeof isScrolling === 'undefined') {\n var touchAngle;\n if (s.isHorizontal() && s.touches.currentY === s.touches.startY || !s.isHorizontal() && s.touches.currentX !== s.touches.startX) {\n isScrolling = false;\n }\n else {\n touchAngle = Math.atan2(Math.abs(s.touches.currentY - s.touches.startY), Math.abs(s.touches.currentX - s.touches.startX)) * 180 / Math.PI;\n isScrolling = s.isHorizontal() ? touchAngle > s.params.touchAngle : (90 - touchAngle > s.params.touchAngle);\n }\n }\n if (isScrolling) {\n s.emit('onTouchMoveOpposite', s, e);\n }\n if (typeof startMoving === 'undefined' && s.browser.ieTouch) {\n if (s.touches.currentX !== s.touches.startX || s.touches.currentY !== s.touches.startY) {\n startMoving = true;\n }\n }\n if (!isTouched) return;\n if (isScrolling) {\n isTouched = false;\n return;\n }\n if (!startMoving && s.browser.ieTouch) {\n return;\n }\n s.allowClick = false;\n s.emit('onSliderMove', s, e);\n e.preventDefault();\n if (s.params.touchMoveStopPropagation && !s.params.nested) {\n e.stopPropagation();\n }\n \n if (!isMoved) {\n if (params.loop) {\n s.fixLoop();\n }\n startTranslate = s.getWrapperTranslate();\n s.setWrapperTransition(0);\n if (s.animating) {\n s.wrapper.trigger('webkitTransitionEnd transitionend oTransitionEnd MSTransitionEnd msTransitionEnd');\n }\n if (s.params.autoplay && s.autoplaying) {\n if (s.params.autoplayDisableOnInteraction) {\n s.stopAutoplay();\n }\n else {\n s.pauseAutoplay();\n }\n }\n allowMomentumBounce = false;\n //Grab Cursor\n if (s.params.grabCursor && (s.params.allowSwipeToNext === true || s.params.allowSwipeToPrev === true)) {\n s.setGrabCursor(true);\n }\n }\n isMoved = true;\n \n var diff = s.touches.diff = s.isHorizontal() ? s.touches.currentX - s.touches.startX : s.touches.currentY - s.touches.startY;\n \n diff = diff * s.params.touchRatio;\n if (s.rtl) diff = -diff;\n \n s.swipeDirection = diff > 0 ? 'prev' : 'next';\n currentTranslate = diff + startTranslate;\n \n var disableParentSwiper = true;\n if ((diff > 0 && currentTranslate > s.minTranslate())) {\n disableParentSwiper = false;\n if (s.params.resistance) currentTranslate = s.minTranslate() - 1 + Math.pow(-s.minTranslate() + startTranslate + diff, s.params.resistanceRatio);\n }\n else if (diff < 0 && currentTranslate < s.maxTranslate()) {\n disableParentSwiper = false;\n if (s.params.resistance) currentTranslate = s.maxTranslate() + 1 - Math.pow(s.maxTranslate() - startTranslate - diff, s.params.resistanceRatio);\n }\n \n if (disableParentSwiper) {\n e.preventedByNestedSwiper = true;\n }\n \n // Directions locks\n if (!s.params.allowSwipeToNext && s.swipeDirection === 'next' && currentTranslate < startTranslate) {\n currentTranslate = startTranslate;\n }\n if (!s.params.allowSwipeToPrev && s.swipeDirection === 'prev' && currentTranslate > startTranslate) {\n currentTranslate = startTranslate;\n }\n \n \n // Threshold\n if (s.params.threshold > 0) {\n if (Math.abs(diff) > s.params.threshold || allowThresholdMove) {\n if (!allowThresholdMove) {\n allowThresholdMove = true;\n s.touches.startX = s.touches.currentX;\n s.touches.startY = s.touches.currentY;\n currentTranslate = startTranslate;\n s.touches.diff = s.isHorizontal() ? s.touches.currentX - s.touches.startX : s.touches.currentY - s.touches.startY;\n return;\n }\n }\n else {\n currentTranslate = startTranslate;\n return;\n }\n }\n \n if (!s.params.followFinger) return;\n \n // Update active index in free mode\n if (s.params.freeMode || s.params.watchSlidesProgress) {\n s.updateActiveIndex();\n }\n if (s.params.freeMode) {\n //Velocity\n if (velocities.length === 0) {\n velocities.push({\n position: s.touches[s.isHorizontal() ? 'startX' : 'startY'],\n time: touchStartTime\n });\n }\n velocities.push({\n position: s.touches[s.isHorizontal() ? 'currentX' : 'currentY'],\n time: (new window.Date()).getTime()\n });\n }\n // Update progress\n s.updateProgress(currentTranslate);\n // Update translate\n s.setWrapperTranslate(currentTranslate);\n };\n s.onTouchEnd = function (e) {\n if (e.originalEvent) e = e.originalEvent;\n if (allowTouchCallbacks) {\n s.emit('onTouchEnd', s, e);\n }\n allowTouchCallbacks = false;\n if (!isTouched) return;\n //Return Grab Cursor\n if (s.params.grabCursor && isMoved && isTouched && (s.params.allowSwipeToNext === true || s.params.allowSwipeToPrev === true)) {\n s.setGrabCursor(false);\n }\n \n // Time diff\n var touchEndTime = Date.now();\n var timeDiff = touchEndTime - touchStartTime;\n \n // Tap, doubleTap, Click\n if (s.allowClick) {\n s.updateClickedSlide(e);\n s.emit('onTap', s, e);\n if (timeDiff < 300 && (touchEndTime - lastClickTime) > 300) {\n if (clickTimeout) clearTimeout(clickTimeout);\n clickTimeout = setTimeout(function () {\n if (!s) return;\n if (s.params.paginationHide && s.paginationContainer.length > 0 && !$(e.target).hasClass(s.params.bulletClass)) {\n s.paginationContainer.toggleClass(s.params.paginationHiddenClass);\n }\n s.emit('onClick', s, e);\n }, 300);\n \n }\n if (timeDiff < 300 && (touchEndTime - lastClickTime) < 300) {\n if (clickTimeout) clearTimeout(clickTimeout);\n s.emit('onDoubleTap', s, e);\n }\n }\n \n lastClickTime = Date.now();\n setTimeout(function () {\n if (s) s.allowClick = true;\n }, 0);\n \n if (!isTouched || !isMoved || !s.swipeDirection || s.touches.diff === 0 || currentTranslate === startTranslate) {\n isTouched = isMoved = false;\n return;\n }\n isTouched = isMoved = false;\n \n var currentPos;\n if (s.params.followFinger) {\n currentPos = s.rtl ? s.translate : -s.translate;\n }\n else {\n currentPos = -currentTranslate;\n }\n if (s.params.freeMode) {\n if (currentPos < -s.minTranslate()) {\n s.slideTo(s.activeIndex);\n return;\n }\n else if (currentPos > -s.maxTranslate()) {\n if (s.slides.length < s.snapGrid.length) {\n s.slideTo(s.snapGrid.length - 1);\n }\n else {\n s.slideTo(s.slides.length - 1);\n }\n return;\n }\n \n if (s.params.freeModeMomentum) {\n if (velocities.length > 1) {\n var lastMoveEvent = velocities.pop(), velocityEvent = velocities.pop();\n \n var distance = lastMoveEvent.position - velocityEvent.position;\n var time = lastMoveEvent.time - velocityEvent.time;\n s.velocity = distance / time;\n s.velocity = s.velocity / 2;\n if (Math.abs(s.velocity) < s.params.freeModeMinimumVelocity) {\n s.velocity = 0;\n }\n // this implies that the user stopped moving a finger then released.\n // There would be no events with distance zero, so the last event is stale.\n if (time > 150 || (new window.Date().getTime() - lastMoveEvent.time) > 300) {\n s.velocity = 0;\n }\n } else {\n s.velocity = 0;\n }\n s.velocity = s.velocity * s.params.freeModeMomentumVelocityRatio;\n \n velocities.length = 0;\n var momentumDuration = 1000 * s.params.freeModeMomentumRatio;\n var momentumDistance = s.velocity * momentumDuration;\n \n var newPosition = s.translate + momentumDistance;\n if (s.rtl) newPosition = - newPosition;\n var doBounce = false;\n var afterBouncePosition;\n var bounceAmount = Math.abs(s.velocity) * 20 * s.params.freeModeMomentumBounceRatio;\n if (newPosition < s.maxTranslate()) {\n if (s.params.freeModeMomentumBounce) {\n if (newPosition + s.maxTranslate() < -bounceAmount) {\n newPosition = s.maxTranslate() - bounceAmount;\n }\n afterBouncePosition = s.maxTranslate();\n doBounce = true;\n allowMomentumBounce = true;\n }\n else {\n newPosition = s.maxTranslate();\n }\n }\n else if (newPosition > s.minTranslate()) {\n if (s.params.freeModeMomentumBounce) {\n if (newPosition - s.minTranslate() > bounceAmount) {\n newPosition = s.minTranslate() + bounceAmount;\n }\n afterBouncePosition = s.minTranslate();\n doBounce = true;\n allowMomentumBounce = true;\n }\n else {\n newPosition = s.minTranslate();\n }\n }\n else if (s.params.freeModeSticky) {\n var j = 0,\n nextSlide;\n for (j = 0; j < s.snapGrid.length; j += 1) {\n if (s.snapGrid[j] > -newPosition) {\n nextSlide = j;\n break;\n }\n \n }\n if (Math.abs(s.snapGrid[nextSlide] - newPosition) < Math.abs(s.snapGrid[nextSlide - 1] - newPosition) || s.swipeDirection === 'next') {\n newPosition = s.snapGrid[nextSlide];\n } else {\n newPosition = s.snapGrid[nextSlide - 1];\n }\n if (!s.rtl) newPosition = - newPosition;\n }\n //Fix duration\n if (s.velocity !== 0) {\n if (s.rtl) {\n momentumDuration = Math.abs((-newPosition - s.translate) / s.velocity);\n }\n else {\n momentumDuration = Math.abs((newPosition - s.translate) / s.velocity);\n }\n }\n else if (s.params.freeModeSticky) {\n s.slideReset();\n return;\n }\n \n if (s.params.freeModeMomentumBounce && doBounce) {\n s.updateProgress(afterBouncePosition);\n s.setWrapperTransition(momentumDuration);\n s.setWrapperTranslate(newPosition);\n s.onTransitionStart();\n s.animating = true;\n s.wrapper.transitionEnd(function () {\n if (!s || !allowMomentumBounce) return;\n s.emit('onMomentumBounce', s);\n \n s.setWrapperTransition(s.params.speed);\n s.setWrapperTranslate(afterBouncePosition);\n s.wrapper.transitionEnd(function () {\n if (!s) return;\n s.onTransitionEnd();\n });\n });\n } else if (s.velocity) {\n s.updateProgress(newPosition);\n s.setWrapperTransition(momentumDuration);\n s.setWrapperTranslate(newPosition);\n s.onTransitionStart();\n if (!s.animating) {\n s.animating = true;\n s.wrapper.transitionEnd(function () {\n if (!s) return;\n s.onTransitionEnd();\n });\n }\n \n } else {\n s.updateProgress(newPosition);\n }\n \n s.updateActiveIndex();\n }\n if (!s.params.freeModeMomentum || timeDiff >= s.params.longSwipesMs) {\n s.updateProgress();\n s.updateActiveIndex();\n }\n return;\n }\n \n // Find current slide\n var i, stopIndex = 0, groupSize = s.slidesSizesGrid[0];\n for (i = 0; i < s.slidesGrid.length; i += s.params.slidesPerGroup) {\n if (typeof s.slidesGrid[i + s.params.slidesPerGroup] !== 'undefined') {\n if (currentPos >= s.slidesGrid[i] && currentPos < s.slidesGrid[i + s.params.slidesPerGroup]) {\n stopIndex = i;\n groupSize = s.slidesGrid[i + s.params.slidesPerGroup] - s.slidesGrid[i];\n }\n }\n else {\n if (currentPos >= s.slidesGrid[i]) {\n stopIndex = i;\n groupSize = s.slidesGrid[s.slidesGrid.length - 1] - s.slidesGrid[s.slidesGrid.length - 2];\n }\n }\n }\n \n // Find current slide size\n var ratio = (currentPos - s.slidesGrid[stopIndex]) / groupSize;\n \n if (timeDiff > s.params.longSwipesMs) {\n // Long touches\n if (!s.params.longSwipes) {\n s.slideTo(s.activeIndex);\n return;\n }\n if (s.swipeDirection === 'next') {\n if (ratio >= s.params.longSwipesRatio) s.slideTo(stopIndex + s.params.slidesPerGroup);\n else s.slideTo(stopIndex);\n \n }\n if (s.swipeDirection === 'prev') {\n if (ratio > (1 - s.params.longSwipesRatio)) s.slideTo(stopIndex + s.params.slidesPerGroup);\n else s.slideTo(stopIndex);\n }\n }\n else {\n // Short swipes\n if (!s.params.shortSwipes) {\n s.slideTo(s.activeIndex);\n return;\n }\n if (s.swipeDirection === 'next') {\n s.slideTo(stopIndex + s.params.slidesPerGroup);\n \n }\n if (s.swipeDirection === 'prev') {\n s.slideTo(stopIndex);\n }\n }\n };\n /*=========================\n Transitions\n ===========================*/\n s._slideTo = function (slideIndex, speed) {\n return s.slideTo(slideIndex, speed, true, true);\n };\n s.slideTo = function (slideIndex, speed, runCallbacks, internal) {\n if (typeof runCallbacks === 'undefined') runCallbacks = true;\n if (typeof slideIndex === 'undefined') slideIndex = 0;\n if (slideIndex < 0) slideIndex = 0;\n s.snapIndex = Math.floor(slideIndex / s.params.slidesPerGroup);\n if (s.snapIndex >= s.snapGrid.length) s.snapIndex = s.snapGrid.length - 1;\n \n var translate = - s.snapGrid[s.snapIndex];\n // Stop autoplay\n if (s.params.autoplay && s.autoplaying) {\n if (internal || !s.params.autoplayDisableOnInteraction) {\n s.pauseAutoplay(speed);\n }\n else {\n s.stopAutoplay();\n }\n }\n // Update progress\n s.updateProgress(translate);\n \n // Normalize slideIndex\n if(s.params.normalizeSlideIndex){\n for (var i = 0; i < s.slidesGrid.length; i++) {\n if (- Math.floor(translate * 100) >= Math.floor(s.slidesGrid[i] * 100)) {\n slideIndex = i;\n }\n }\n }\n \n // Directions locks\n if (!s.params.allowSwipeToNext && translate < s.translate && translate < s.minTranslate()) {\n return false;\n }\n if (!s.params.allowSwipeToPrev && translate > s.translate && translate > s.maxTranslate()) {\n if ((s.activeIndex || 0) !== slideIndex ) return false;\n }\n \n // Update Index\n if (typeof speed === 'undefined') speed = s.params.speed;\n s.previousIndex = s.activeIndex || 0;\n s.activeIndex = slideIndex;\n s.updateRealIndex();\n if ((s.rtl && -translate === s.translate) || (!s.rtl && translate === s.translate)) {\n // Update Height\n if (s.params.autoHeight) {\n s.updateAutoHeight();\n }\n s.updateClasses();\n if (s.params.effect !== 'slide') {\n s.setWrapperTranslate(translate);\n }\n return false;\n }\n s.updateClasses();\n s.onTransitionStart(runCallbacks);\n \n if (speed === 0 || s.browser.lteIE9) {\n s.setWrapperTranslate(translate);\n s.setWrapperTransition(0);\n s.onTransitionEnd(runCallbacks);\n }\n else {\n s.setWrapperTranslate(translate);\n s.setWrapperTransition(speed);\n if (!s.animating) {\n s.animating = true;\n s.wrapper.transitionEnd(function () {\n if (!s) return;\n s.onTransitionEnd(runCallbacks);\n });\n }\n \n }\n \n return true;\n };\n \n s.onTransitionStart = function (runCallbacks) {\n if (typeof runCallbacks === 'undefined') runCallbacks = true;\n if (s.params.autoHeight) {\n s.updateAutoHeight();\n }\n if (s.lazy) s.lazy.onTransitionStart();\n if (runCallbacks) {\n s.emit('onTransitionStart', s);\n if (s.activeIndex !== s.previousIndex) {\n s.emit('onSlideChangeStart', s);\n if (s.activeIndex > s.previousIndex) {\n s.emit('onSlideNextStart', s);\n }\n else {\n s.emit('onSlidePrevStart', s);\n }\n }\n \n }\n };\n s.onTransitionEnd = function (runCallbacks) {\n s.animating = false;\n s.setWrapperTransition(0);\n if (typeof runCallbacks === 'undefined') runCallbacks = true;\n if (s.lazy) s.lazy.onTransitionEnd();\n if (runCallbacks) {\n s.emit('onTransitionEnd', s);\n if (s.activeIndex !== s.previousIndex) {\n s.emit('onSlideChangeEnd', s);\n if (s.activeIndex > s.previousIndex) {\n s.emit('onSlideNextEnd', s);\n }\n else {\n s.emit('onSlidePrevEnd', s);\n }\n }\n }\n if (s.params.history && s.history) {\n s.history.setHistory(s.params.history, s.activeIndex);\n }\n if (s.params.hashnav && s.hashnav) {\n s.hashnav.setHash();\n }\n \n };\n s.slideNext = function (runCallbacks, speed, internal) {\n if (s.params.loop) {\n if (s.animating) return false;\n s.fixLoop();\n var clientLeft = s.container[0].clientLeft;\n return s.slideTo(s.activeIndex + s.params.slidesPerGroup, speed, runCallbacks, internal);\n }\n else return s.slideTo(s.activeIndex + s.params.slidesPerGroup, speed, runCallbacks, internal);\n };\n s._slideNext = function (speed) {\n return s.slideNext(true, speed, true);\n };\n s.slidePrev = function (runCallbacks, speed, internal) {\n if (s.params.loop) {\n if (s.animating) return false;\n s.fixLoop();\n var clientLeft = s.container[0].clientLeft;\n return s.slideTo(s.activeIndex - 1, speed, runCallbacks, internal);\n }\n else return s.slideTo(s.activeIndex - 1, speed, runCallbacks, internal);\n };\n s._slidePrev = function (speed) {\n return s.slidePrev(true, speed, true);\n };\n s.slideReset = function (runCallbacks, speed, internal) {\n return s.slideTo(s.activeIndex, speed, runCallbacks);\n };\n \n s.disableTouchControl = function () {\n s.params.onlyExternal = true;\n return true;\n };\n s.enableTouchControl = function () {\n s.params.onlyExternal = false;\n return true;\n };\n \n /*=========================\n Translate/transition helpers\n ===========================*/\n s.setWrapperTransition = function (duration, byController) {\n s.wrapper.transition(duration);\n if (s.params.effect !== 'slide' && s.effects[s.params.effect]) {\n s.effects[s.params.effect].setTransition(duration);\n }\n if (s.params.parallax && s.parallax) {\n s.parallax.setTransition(duration);\n }\n if (s.params.scrollbar && s.scrollbar) {\n s.scrollbar.setTransition(duration);\n }\n if (s.params.control && s.controller) {\n s.controller.setTransition(duration, byController);\n }\n s.emit('onSetTransition', s, duration);\n };\n s.setWrapperTranslate = function (translate, updateActiveIndex, byController) {\n var x = 0, y = 0, z = 0;\n if (s.isHorizontal()) {\n x = s.rtl ? -translate : translate;\n }\n else {\n y = translate;\n }\n \n if (s.params.roundLengths) {\n x = round(x);\n y = round(y);\n }\n \n if (!s.params.virtualTranslate) {\n if (s.support.transforms3d) s.wrapper.transform('translate3d(' + x + 'px, ' + y + 'px, ' + z + 'px)');\n else s.wrapper.transform('translate(' + x + 'px, ' + y + 'px)');\n }\n \n s.translate = s.isHorizontal() ? x : y;\n \n // Check if we need to update progress\n var progress;\n var translatesDiff = s.maxTranslate() - s.minTranslate();\n if (translatesDiff === 0) {\n progress = 0;\n }\n else {\n progress = (translate - s.minTranslate()) / (translatesDiff);\n }\n if (progress !== s.progress) {\n s.updateProgress(translate);\n }\n \n if (updateActiveIndex) s.updateActiveIndex();\n if (s.params.effect !== 'slide' && s.effects[s.params.effect]) {\n s.effects[s.params.effect].setTranslate(s.translate);\n }\n if (s.params.parallax && s.parallax) {\n s.parallax.setTranslate(s.translate);\n }\n if (s.params.scrollbar && s.scrollbar) {\n s.scrollbar.setTranslate(s.translate);\n }\n if (s.params.control && s.controller) {\n s.controller.setTranslate(s.translate, byController);\n }\n s.emit('onSetTranslate', s, s.translate);\n };\n \n s.getTranslate = function (el, axis) {\n var matrix, curTransform, curStyle, transformMatrix;\n \n // automatic axis detection\n if (typeof axis === 'undefined') {\n axis = 'x';\n }\n \n if (s.params.virtualTranslate) {\n return s.rtl ? -s.translate : s.translate;\n }\n \n curStyle = window.getComputedStyle(el, null);\n if (window.WebKitCSSMatrix) {\n curTransform = curStyle.transform || curStyle.webkitTransform;\n if (curTransform.split(',').length > 6) {\n curTransform = curTransform.split(', ').map(function(a){\n return a.replace(',','.');\n }).join(', ');\n }\n // Some old versions of Webkit choke when 'none' is passed; pass\n // empty string instead in this case\n transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform);\n }\n else {\n transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');\n matrix = transformMatrix.toString().split(',');\n }\n \n if (axis === 'x') {\n //Latest Chrome and webkits Fix\n if (window.WebKitCSSMatrix)\n curTransform = transformMatrix.m41;\n //Crazy IE10 Matrix\n else if (matrix.length === 16)\n curTransform = parseFloat(matrix[12]);\n //Normal Browsers\n else\n curTransform = parseFloat(matrix[4]);\n }\n if (axis === 'y') {\n //Latest Chrome and webkits Fix\n if (window.WebKitCSSMatrix)\n curTransform = transformMatrix.m42;\n //Crazy IE10 Matrix\n else if (matrix.length === 16)\n curTransform = parseFloat(matrix[13]);\n //Normal Browsers\n else\n curTransform = parseFloat(matrix[5]);\n }\n if (s.rtl && curTransform) curTransform = -curTransform;\n return curTransform || 0;\n };\n s.getWrapperTranslate = function (axis) {\n if (typeof axis === 'undefined') {\n axis = s.isHorizontal() ? 'x' : 'y';\n }\n return s.getTranslate(s.wrapper[0], axis);\n };\n \n /*=========================\n Observer\n ===========================*/\n s.observers = [];\n function initObserver(target, options) {\n options = options || {};\n // create an observer instance\n var ObserverFunc = window.MutationObserver || window.WebkitMutationObserver;\n var observer = new ObserverFunc(function (mutations) {\n mutations.forEach(function (mutation) {\n s.onResize(true);\n s.emit('onObserverUpdate', s, mutation);\n });\n });\n \n observer.observe(target, {\n attributes: typeof options.attributes === 'undefined' ? true : options.attributes,\n childList: typeof options.childList === 'undefined' ? true : options.childList,\n characterData: typeof options.characterData === 'undefined' ? true : options.characterData\n });\n \n s.observers.push(observer);\n }\n s.initObservers = function () {\n if (s.params.observeParents) {\n var containerParents = s.container.parents();\n for (var i = 0; i < containerParents.length; i++) {\n initObserver(containerParents[i]);\n }\n }\n \n // Observe container\n initObserver(s.container[0], {childList: false});\n \n // Observe wrapper\n initObserver(s.wrapper[0], {attributes: false});\n };\n s.disconnectObservers = function () {\n for (var i = 0; i < s.observers.length; i++) {\n s.observers[i].disconnect();\n }\n s.observers = [];\n };\n /*=========================\n Loop\n ===========================*/\n // Create looped slides\n s.createLoop = function () {\n // Remove duplicated slides\n s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass).remove();\n \n var slides = s.wrapper.children('.' + s.params.slideClass);\n \n if(s.params.slidesPerView === 'auto' && !s.params.loopedSlides) s.params.loopedSlides = slides.length;\n \n s.loopedSlides = parseInt(s.params.loopedSlides || s.params.slidesPerView, 10);\n s.loopedSlides = s.loopedSlides + s.params.loopAdditionalSlides;\n if (s.loopedSlides > slides.length) {\n s.loopedSlides = slides.length;\n }\n \n var prependSlides = [], appendSlides = [], i;\n slides.each(function (index, el) {\n var slide = $(this);\n if (index < s.loopedSlides) appendSlides.push(el);\n if (index < slides.length && index >= slides.length - s.loopedSlides) prependSlides.push(el);\n slide.attr('data-swiper-slide-index', index);\n });\n for (i = 0; i < appendSlides.length; i++) {\n s.wrapper.append($(appendSlides[i].cloneNode(true)).addClass(s.params.slideDuplicateClass));\n }\n for (i = prependSlides.length - 1; i >= 0; i--) {\n s.wrapper.prepend($(prependSlides[i].cloneNode(true)).addClass(s.params.slideDuplicateClass));\n }\n };\n s.destroyLoop = function () {\n s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass).remove();\n s.slides.removeAttr('data-swiper-slide-index');\n };\n s.reLoop = function (updatePosition) {\n var oldIndex = s.activeIndex - s.loopedSlides;\n s.destroyLoop();\n s.createLoop();\n s.updateSlidesSize();\n if (updatePosition) {\n s.slideTo(oldIndex + s.loopedSlides, 0, false);\n }\n \n };\n s.fixLoop = function () {\n var newIndex;\n //Fix For Negative Oversliding\n if (s.activeIndex < s.loopedSlides) {\n newIndex = s.slides.length - s.loopedSlides * 3 + s.activeIndex;\n newIndex = newIndex + s.loopedSlides;\n s.slideTo(newIndex, 0, false, true);\n }\n //Fix For Positive Oversliding\n else if ((s.params.slidesPerView === 'auto' && s.activeIndex >= s.loopedSlides * 2) || (s.activeIndex > s.slides.length - s.params.slidesPerView * 2)) {\n newIndex = -s.slides.length + s.activeIndex + s.loopedSlides;\n newIndex = newIndex + s.loopedSlides;\n s.slideTo(newIndex, 0, false, true);\n }\n };\n /*=========================\n Append/Prepend/Remove Slides\n ===========================*/\n s.appendSlide = function (slides) {\n if (s.params.loop) {\n s.destroyLoop();\n }\n if (typeof slides === 'object' && slides.length) {\n for (var i = 0; i < slides.length; i++) {\n if (slides[i]) s.wrapper.append(slides[i]);\n }\n }\n else {\n s.wrapper.append(slides);\n }\n if (s.params.loop) {\n s.createLoop();\n }\n if (!(s.params.observer && s.support.observer)) {\n s.update(true);\n }\n };\n s.prependSlide = function (slides) {\n if (s.params.loop) {\n s.destroyLoop();\n }\n var newActiveIndex = s.activeIndex + 1;\n if (typeof slides === 'object' && slides.length) {\n for (var i = 0; i < slides.length; i++) {\n if (slides[i]) s.wrapper.prepend(slides[i]);\n }\n newActiveIndex = s.activeIndex + slides.length;\n }\n else {\n s.wrapper.prepend(slides);\n }\n if (s.params.loop) {\n s.createLoop();\n }\n if (!(s.params.observer && s.support.observer)) {\n s.update(true);\n }\n s.slideTo(newActiveIndex, 0, false);\n };\n s.removeSlide = function (slidesIndexes) {\n if (s.params.loop) {\n s.destroyLoop();\n s.slides = s.wrapper.children('.' + s.params.slideClass);\n }\n var newActiveIndex = s.activeIndex,\n indexToRemove;\n if (typeof slidesIndexes === 'object' && slidesIndexes.length) {\n for (var i = 0; i < slidesIndexes.length; i++) {\n indexToRemove = slidesIndexes[i];\n if (s.slides[indexToRemove]) s.slides.eq(indexToRemove).remove();\n if (indexToRemove < newActiveIndex) newActiveIndex--;\n }\n newActiveIndex = Math.max(newActiveIndex, 0);\n }\n else {\n indexToRemove = slidesIndexes;\n if (s.slides[indexToRemove]) s.slides.eq(indexToRemove).remove();\n if (indexToRemove < newActiveIndex) newActiveIndex--;\n newActiveIndex = Math.max(newActiveIndex, 0);\n }\n \n if (s.params.loop) {\n s.createLoop();\n }\n \n if (!(s.params.observer && s.support.observer)) {\n s.update(true);\n }\n if (s.params.loop) {\n s.slideTo(newActiveIndex + s.loopedSlides, 0, false);\n }\n else {\n s.slideTo(newActiveIndex, 0, false);\n }\n \n };\n s.removeAllSlides = function () {\n var slidesIndexes = [];\n for (var i = 0; i < s.slides.length; i++) {\n slidesIndexes.push(i);\n }\n s.removeSlide(slidesIndexes);\n };\n \n\n /*=========================\n Effects\n ===========================*/\n s.effects = {\n fade: {\n setTranslate: function () {\n for (var i = 0; i < s.slides.length; i++) {\n var slide = s.slides.eq(i);\n var offset = slide[0].swiperSlideOffset;\n var tx = -offset;\n if (!s.params.virtualTranslate) tx = tx - s.translate;\n var ty = 0;\n if (!s.isHorizontal()) {\n ty = tx;\n tx = 0;\n }\n var slideOpacity = s.params.fade.crossFade ?\n Math.max(1 - Math.abs(slide[0].progress), 0) :\n 1 + Math.min(Math.max(slide[0].progress, -1), 0);\n slide\n .css({\n opacity: slideOpacity\n })\n .transform('translate3d(' + tx + 'px, ' + ty + 'px, 0px)');\n \n }\n \n },\n setTransition: function (duration) {\n s.slides.transition(duration);\n if (s.params.virtualTranslate && duration !== 0) {\n var eventTriggered = false;\n s.slides.transitionEnd(function () {\n if (eventTriggered) return;\n if (!s) return;\n eventTriggered = true;\n s.animating = false;\n var triggerEvents = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'];\n for (var i = 0; i < triggerEvents.length; i++) {\n s.wrapper.trigger(triggerEvents[i]);\n }\n });\n }\n }\n },\n flip: {\n setTranslate: function () {\n for (var i = 0; i < s.slides.length; i++) {\n var slide = s.slides.eq(i);\n var progress = slide[0].progress;\n if (s.params.flip.limitRotation) {\n progress = Math.max(Math.min(slide[0].progress, 1), -1);\n }\n var offset = slide[0].swiperSlideOffset;\n var rotate = -180 * progress,\n rotateY = rotate,\n rotateX = 0,\n tx = -offset,\n ty = 0;\n if (!s.isHorizontal()) {\n ty = tx;\n tx = 0;\n rotateX = -rotateY;\n rotateY = 0;\n }\n else if (s.rtl) {\n rotateY = -rotateY;\n }\n \n slide[0].style.zIndex = -Math.abs(Math.round(progress)) + s.slides.length;\n \n if (s.params.flip.slideShadows) {\n //Set shadows\n var shadowBefore = s.isHorizontal() ? slide.find('.swiper-slide-shadow-left') : slide.find('.swiper-slide-shadow-top');\n var shadowAfter = s.isHorizontal() ? slide.find('.swiper-slide-shadow-right') : slide.find('.swiper-slide-shadow-bottom');\n if (shadowBefore.length === 0) {\n shadowBefore = $('<div class=\"swiper-slide-shadow-' + (s.isHorizontal() ? 'left' : 'top') + '\"></div>');\n slide.append(shadowBefore);\n }\n if (shadowAfter.length === 0) {\n shadowAfter = $('<div class=\"swiper-slide-shadow-' + (s.isHorizontal() ? 'right' : 'bottom') + '\"></div>');\n slide.append(shadowAfter);\n }\n if (shadowBefore.length) shadowBefore[0].style.opacity = Math.max(-progress, 0);\n if (shadowAfter.length) shadowAfter[0].style.opacity = Math.max(progress, 0);\n }\n \n slide\n .transform('translate3d(' + tx + 'px, ' + ty + 'px, 0px) rotateX(' + rotateX + 'deg) rotateY(' + rotateY + 'deg)');\n }\n },\n setTransition: function (duration) {\n s.slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration);\n if (s.params.virtualTranslate && duration !== 0) {\n var eventTriggered = false;\n s.slides.eq(s.activeIndex).transitionEnd(function () {\n if (eventTriggered) return;\n if (!s) return;\n if (!$(this).hasClass(s.params.slideActiveClass)) return;\n eventTriggered = true;\n s.animating = false;\n var triggerEvents = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'];\n for (var i = 0; i < triggerEvents.length; i++) {\n s.wrapper.trigger(triggerEvents[i]);\n }\n });\n }\n }\n },\n cube: {\n setTranslate: function () {\n var wrapperRotate = 0, cubeShadow;\n if (s.params.cube.shadow) {\n if (s.isHorizontal()) {\n cubeShadow = s.wrapper.find('.swiper-cube-shadow');\n if (cubeShadow.length === 0) {\n cubeShadow = $('<div class=\"swiper-cube-shadow\"></div>');\n s.wrapper.append(cubeShadow);\n }\n cubeShadow.css({height: s.width + 'px'});\n }\n else {\n cubeShadow = s.container.find('.swiper-cube-shadow');\n if (cubeShadow.length === 0) {\n cubeShadow = $('<div class=\"swiper-cube-shadow\"></div>');\n s.container.append(cubeShadow);\n }\n }\n }\n for (var i = 0; i < s.slides.length; i++) {\n var slide = s.slides.eq(i);\n var slideAngle = i * 90;\n var round = Math.floor(slideAngle / 360);\n if (s.rtl) {\n slideAngle = -slideAngle;\n round = Math.floor(-slideAngle / 360);\n }\n var progress = Math.max(Math.min(slide[0].progress, 1), -1);\n var tx = 0, ty = 0, tz = 0;\n if (i % 4 === 0) {\n tx = - round * 4 * s.size;\n tz = 0;\n }\n else if ((i - 1) % 4 === 0) {\n tx = 0;\n tz = - round * 4 * s.size;\n }\n else if ((i - 2) % 4 === 0) {\n tx = s.size + round * 4 * s.size;\n tz = s.size;\n }\n else if ((i - 3) % 4 === 0) {\n tx = - s.size;\n tz = 3 * s.size + s.size * 4 * round;\n }\n if (s.rtl) {\n tx = -tx;\n }\n \n if (!s.isHorizontal()) {\n ty = tx;\n tx = 0;\n }\n \n var transform = 'rotateX(' + (s.isHorizontal() ? 0 : -slideAngle) + 'deg) rotateY(' + (s.isHorizontal() ? slideAngle : 0) + 'deg) translate3d(' + tx + 'px, ' + ty + 'px, ' + tz + 'px)';\n if (progress <= 1 && progress > -1) {\n wrapperRotate = i * 90 + progress * 90;\n if (s.rtl) wrapperRotate = -i * 90 - progress * 90;\n }\n slide.transform(transform);\n if (s.params.cube.slideShadows) {\n //Set shadows\n var shadowBefore = s.isHorizontal() ? slide.find('.swiper-slide-shadow-left') : slide.find('.swiper-slide-shadow-top');\n var shadowAfter = s.isHorizontal() ? slide.find('.swiper-slide-shadow-right') : slide.find('.swiper-slide-shadow-bottom');\n if (shadowBefore.length === 0) {\n shadowBefore = $('<div class=\"swiper-slide-shadow-' + (s.isHorizontal() ? 'left' : 'top') + '\"></div>');\n slide.append(shadowBefore);\n }\n if (shadowAfter.length === 0) {\n shadowAfter = $('<div class=\"swiper-slide-shadow-' + (s.isHorizontal() ? 'right' : 'bottom') + '\"></div>');\n slide.append(shadowAfter);\n }\n if (shadowBefore.length) shadowBefore[0].style.opacity = Math.max(-progress, 0);\n if (shadowAfter.length) shadowAfter[0].style.opacity = Math.max(progress, 0);\n }\n }\n s.wrapper.css({\n '-webkit-transform-origin': '50% 50% -' + (s.size / 2) + 'px',\n '-moz-transform-origin': '50% 50% -' + (s.size / 2) + 'px',\n '-ms-transform-origin': '50% 50% -' + (s.size / 2) + 'px',\n 'transform-origin': '50% 50% -' + (s.size / 2) + 'px'\n });\n \n if (s.params.cube.shadow) {\n if (s.isHorizontal()) {\n cubeShadow.transform('translate3d(0px, ' + (s.width / 2 + s.params.cube.shadowOffset) + 'px, ' + (-s.width / 2) + 'px) rotateX(90deg) rotateZ(0deg) scale(' + (s.params.cube.shadowScale) + ')');\n }\n else {\n var shadowAngle = Math.abs(wrapperRotate) - Math.floor(Math.abs(wrapperRotate) / 90) * 90;\n var multiplier = 1.5 - (Math.sin(shadowAngle * 2 * Math.PI / 360) / 2 + Math.cos(shadowAngle * 2 * Math.PI / 360) / 2);\n var scale1 = s.params.cube.shadowScale,\n scale2 = s.params.cube.shadowScale / multiplier,\n offset = s.params.cube.shadowOffset;\n cubeShadow.transform('scale3d(' + scale1 + ', 1, ' + scale2 + ') translate3d(0px, ' + (s.height / 2 + offset) + 'px, ' + (-s.height / 2 / scale2) + 'px) rotateX(-90deg)');\n }\n }\n var zFactor = (s.isSafari || s.isUiWebView) ? (-s.size / 2) : 0;\n s.wrapper.transform('translate3d(0px,0,' + zFactor + 'px) rotateX(' + (s.isHorizontal() ? 0 : wrapperRotate) + 'deg) rotateY(' + (s.isHorizontal() ? -wrapperRotate : 0) + 'deg)');\n },\n setTransition: function (duration) {\n s.slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration);\n if (s.params.cube.shadow && !s.isHorizontal()) {\n s.container.find('.swiper-cube-shadow').transition(duration);\n }\n }\n },\n coverflow: {\n setTranslate: function () {\n var transform = s.translate;\n var center = s.isHorizontal() ? -transform + s.width / 2 : -transform + s.height / 2;\n var rotate = s.isHorizontal() ? s.params.coverflow.rotate: -s.params.coverflow.rotate;\n var translate = s.params.coverflow.depth;\n //Each slide offset from center\n for (var i = 0, length = s.slides.length; i < length; i++) {\n var slide = s.slides.eq(i);\n var slideSize = s.slidesSizesGrid[i];\n var slideOffset = slide[0].swiperSlideOffset;\n var offsetMultiplier = (center - slideOffset - slideSize / 2) / slideSize * s.params.coverflow.modifier;\n \n var rotateY = s.isHorizontal() ? rotate * offsetMultiplier : 0;\n var rotateX = s.isHorizontal() ? 0 : rotate * offsetMultiplier;\n // var rotateZ = 0\n var translateZ = -translate * Math.abs(offsetMultiplier);\n \n var translateY = s.isHorizontal() ? 0 : s.params.coverflow.stretch * (offsetMultiplier);\n var translateX = s.isHorizontal() ? s.params.coverflow.stretch * (offsetMultiplier) : 0;\n \n //Fix for ultra small values\n if (Math.abs(translateX) < 0.001) translateX = 0;\n if (Math.abs(translateY) < 0.001) translateY = 0;\n if (Math.abs(translateZ) < 0.001) translateZ = 0;\n if (Math.abs(rotateY) < 0.001) rotateY = 0;\n if (Math.abs(rotateX) < 0.001) rotateX = 0;\n \n var slideTransform = 'translate3d(' + translateX + 'px,' + translateY + 'px,' + translateZ + 'px) rotateX(' + rotateX + 'deg) rotateY(' + rotateY + 'deg)';\n \n slide.transform(slideTransform);\n slide[0].style.zIndex = -Math.abs(Math.round(offsetMultiplier)) + 1;\n if (s.params.coverflow.slideShadows) {\n //Set shadows\n var shadowBefore = s.isHorizontal() ? slide.find('.swiper-slide-shadow-left') : slide.find('.swiper-slide-shadow-top');\n var shadowAfter = s.isHorizontal() ? slide.find('.swiper-slide-shadow-right') : slide.find('.swiper-slide-shadow-bottom');\n if (shadowBefore.length === 0) {\n shadowBefore = $('<div class=\"swiper-slide-shadow-' + (s.isHorizontal() ? 'left' : 'top') + '\"></div>');\n slide.append(shadowBefore);\n }\n if (shadowAfter.length === 0) {\n shadowAfter = $('<div class=\"swiper-slide-shadow-' + (s.isHorizontal() ? 'right' : 'bottom') + '\"></div>');\n slide.append(shadowAfter);\n }\n if (shadowBefore.length) shadowBefore[0].style.opacity = offsetMultiplier > 0 ? offsetMultiplier : 0;\n if (shadowAfter.length) shadowAfter[0].style.opacity = (-offsetMultiplier) > 0 ? -offsetMultiplier : 0;\n }\n }\n \n //Set correct perspective for IE10\n if (s.browser.ie) {\n var ws = s.wrapper[0].style;\n ws.perspectiveOrigin = center + 'px 50%';\n }\n },\n setTransition: function (duration) {\n s.slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration);\n }\n }\n };\n\n /*=========================\n Images Lazy Loading\n ===========================*/\n s.lazy = {\n initialImageLoaded: false,\n loadImageInSlide: function (index, loadInDuplicate) {\n if (typeof index === 'undefined') return;\n if (typeof loadInDuplicate === 'undefined') loadInDuplicate = true;\n if (s.slides.length === 0) return;\n \n var slide = s.slides.eq(index);\n var img = slide.find('.' + s.params.lazyLoadingClass + ':not(.' + s.params.lazyStatusLoadedClass + '):not(.' + s.params.lazyStatusLoadingClass + ')');\n if (slide.hasClass(s.params.lazyLoadingClass) && !slide.hasClass(s.params.lazyStatusLoadedClass) && !slide.hasClass(s.params.lazyStatusLoadingClass)) {\n img = img.add(slide[0]);\n }\n if (img.length === 0) return;\n \n img.each(function () {\n var _img = $(this);\n _img.addClass(s.params.lazyStatusLoadingClass);\n var background = _img.attr('data-background');\n var src = _img.attr('data-src'),\n srcset = _img.attr('data-srcset'),\n sizes = _img.attr('data-sizes');\n s.loadImage(_img[0], (src || background), srcset, sizes, false, function () {\n if (background) {\n _img.css('background-image', 'url(\"' + background + '\")');\n _img.removeAttr('data-background');\n }\n else {\n if (srcset) {\n _img.attr('srcset', srcset);\n _img.removeAttr('data-srcset');\n }\n if (sizes) {\n _img.attr('sizes', sizes);\n _img.removeAttr('data-sizes');\n }\n if (src) {\n _img.attr('src', src);\n _img.removeAttr('data-src');\n }\n \n }\n \n _img.addClass(s.params.lazyStatusLoadedClass).removeClass(s.params.lazyStatusLoadingClass);\n slide.find('.' + s.params.lazyPreloaderClass + ', .' + s.params.preloaderClass).remove();\n if (s.params.loop && loadInDuplicate) {\n var slideOriginalIndex = slide.attr('data-swiper-slide-index');\n if (slide.hasClass(s.params.slideDuplicateClass)) {\n var originalSlide = s.wrapper.children('[data-swiper-slide-index=\"' + slideOriginalIndex + '\"]:not(.' + s.params.slideDuplicateClass + ')');\n s.lazy.loadImageInSlide(originalSlide.index(), false);\n }\n else {\n var duplicatedSlide = s.wrapper.children('.' + s.params.slideDuplicateClass + '[data-swiper-slide-index=\"' + slideOriginalIndex + '\"]');\n s.lazy.loadImageInSlide(duplicatedSlide.index(), false);\n }\n }\n s.emit('onLazyImageReady', s, slide[0], _img[0]);\n });\n \n s.emit('onLazyImageLoad', s, slide[0], _img[0]);\n });\n \n },\n load: function () {\n var i;\n var slidesPerView = s.params.slidesPerView;\n if (slidesPerView === 'auto') {\n slidesPerView = 0;\n }\n if (!s.lazy.initialImageLoaded) s.lazy.initialImageLoaded = true;\n if (s.params.watchSlidesVisibility) {\n s.wrapper.children('.' + s.params.slideVisibleClass).each(function () {\n s.lazy.loadImageInSlide($(this).index());\n });\n }\n else {\n if (slidesPerView > 1) {\n for (i = s.activeIndex; i < s.activeIndex + slidesPerView ; i++) {\n if (s.slides[i]) s.lazy.loadImageInSlide(i);\n }\n }\n else {\n s.lazy.loadImageInSlide(s.activeIndex);\n }\n }\n if (s.params.lazyLoadingInPrevNext) {\n if (slidesPerView > 1 || (s.params.lazyLoadingInPrevNextAmount && s.params.lazyLoadingInPrevNextAmount > 1)) {\n var amount = s.params.lazyLoadingInPrevNextAmount;\n var spv = slidesPerView;\n var maxIndex = Math.min(s.activeIndex + spv + Math.max(amount, spv), s.slides.length);\n var minIndex = Math.max(s.activeIndex - Math.max(spv, amount), 0);\n // Next Slides\n for (i = s.activeIndex + slidesPerView; i < maxIndex; i++) {\n if (s.slides[i]) s.lazy.loadImageInSlide(i);\n }\n // Prev Slides\n for (i = minIndex; i < s.activeIndex ; i++) {\n if (s.slides[i]) s.lazy.loadImageInSlide(i);\n }\n }\n else {\n var nextSlide = s.wrapper.children('.' + s.params.slideNextClass);\n if (nextSlide.length > 0) s.lazy.loadImageInSlide(nextSlide.index());\n \n var prevSlide = s.wrapper.children('.' + s.params.slidePrevClass);\n if (prevSlide.length > 0) s.lazy.loadImageInSlide(prevSlide.index());\n }\n }\n },\n onTransitionStart: function () {\n if (s.params.lazyLoading) {\n if (s.params.lazyLoadingOnTransitionStart || (!s.params.lazyLoadingOnTransitionStart && !s.lazy.initialImageLoaded)) {\n s.lazy.load();\n }\n }\n },\n onTransitionEnd: function () {\n if (s.params.lazyLoading && !s.params.lazyLoadingOnTransitionStart) {\n s.lazy.load();\n }\n }\n };\n \n\n /*=========================\n Scrollbar\n ===========================*/\n s.scrollbar = {\n isTouched: false,\n setDragPosition: function (e) {\n var sb = s.scrollbar;\n var x = 0, y = 0;\n var translate;\n var pointerPosition = s.isHorizontal() ?\n ((e.type === 'touchstart' || e.type === 'touchmove') ? e.targetTouches[0].pageX : e.pageX || e.clientX) :\n ((e.type === 'touchstart' || e.type === 'touchmove') ? e.targetTouches[0].pageY : e.pageY || e.clientY) ;\n var position = (pointerPosition) - sb.track.offset()[s.isHorizontal() ? 'left' : 'top'] - sb.dragSize / 2;\n var positionMin = -s.minTranslate() * sb.moveDivider;\n var positionMax = -s.maxTranslate() * sb.moveDivider;\n if (position < positionMin) {\n position = positionMin;\n }\n else if (position > positionMax) {\n position = positionMax;\n }\n position = -position / sb.moveDivider;\n s.updateProgress(position);\n s.setWrapperTranslate(position, true);\n },\n dragStart: function (e) {\n var sb = s.scrollbar;\n sb.isTouched = true;\n e.preventDefault();\n e.stopPropagation();\n \n sb.setDragPosition(e);\n clearTimeout(sb.dragTimeout);\n \n sb.track.transition(0);\n if (s.params.scrollbarHide) {\n sb.track.css('opacity', 1);\n }\n s.wrapper.transition(100);\n sb.drag.transition(100);\n s.emit('onScrollbarDragStart', s);\n },\n dragMove: function (e) {\n var sb = s.scrollbar;\n if (!sb.isTouched) return;\n if (e.preventDefault) e.preventDefault();\n else e.returnValue = false;\n sb.setDragPosition(e);\n s.wrapper.transition(0);\n sb.track.transition(0);\n sb.drag.transition(0);\n s.emit('onScrollbarDragMove', s);\n },\n dragEnd: function (e) {\n var sb = s.scrollbar;\n if (!sb.isTouched) return;\n sb.isTouched = false;\n if (s.params.scrollbarHide) {\n clearTimeout(sb.dragTimeout);\n sb.dragTimeout = setTimeout(function () {\n sb.track.css('opacity', 0);\n sb.track.transition(400);\n }, 1000);\n \n }\n s.emit('onScrollbarDragEnd', s);\n if (s.params.scrollbarSnapOnRelease) {\n s.slideReset();\n }\n },\n draggableEvents: (function () {\n if ((s.params.simulateTouch === false && !s.support.touch)) return s.touchEventsDesktop;\n else return s.touchEvents;\n })(),\n enableDraggable: function () {\n var sb = s.scrollbar;\n var target = s.support.touch ? sb.track : document;\n $(sb.track).on(sb.draggableEvents.start, sb.dragStart);\n $(target).on(sb.draggableEvents.move, sb.dragMove);\n $(target).on(sb.draggableEvents.end, sb.dragEnd);\n },\n disableDraggable: function () {\n var sb = s.scrollbar;\n var target = s.support.touch ? sb.track : document;\n $(sb.track).off(s.draggableEvents.start, sb.dragStart);\n $(target).off(s.draggableEvents.move, sb.dragMove);\n $(target).off(s.draggableEvents.end, sb.dragEnd);\n },\n set: function () {\n if (!s.params.scrollbar) return;\n var sb = s.scrollbar;\n sb.track = $(s.params.scrollbar);\n if (s.params.uniqueNavElements && typeof s.params.scrollbar === 'string' && sb.track.length > 1 && s.container.find(s.params.scrollbar).length === 1) {\n sb.track = s.container.find(s.params.scrollbar);\n }\n sb.drag = sb.track.find('.swiper-scrollbar-drag');\n if (sb.drag.length === 0) {\n sb.drag = $('<div class=\"swiper-scrollbar-drag\"></div>');\n sb.track.append(sb.drag);\n }\n sb.drag[0].style.width = '';\n sb.drag[0].style.height = '';\n sb.trackSize = s.isHorizontal() ? sb.track[0].offsetWidth : sb.track[0].offsetHeight;\n \n sb.divider = s.size / s.virtualSize;\n sb.moveDivider = sb.divider * (sb.trackSize / s.size);\n sb.dragSize = sb.trackSize * sb.divider;\n \n if (s.isHorizontal()) {\n sb.drag[0].style.width = sb.dragSize + 'px';\n }\n else {\n sb.drag[0].style.height = sb.dragSize + 'px';\n }\n \n if (sb.divider >= 1) {\n sb.track[0].style.display = 'none';\n }\n else {\n sb.track[0].style.display = '';\n }\n if (s.params.scrollbarHide) {\n sb.track[0].style.opacity = 0;\n }\n },\n setTranslate: function () {\n if (!s.params.scrollbar) return;\n var diff;\n var sb = s.scrollbar;\n var translate = s.translate || 0;\n var newPos;\n \n var newSize = sb.dragSize;\n newPos = (sb.trackSize - sb.dragSize) * s.progress;\n if (s.rtl && s.isHorizontal()) {\n newPos = -newPos;\n if (newPos > 0) {\n newSize = sb.dragSize - newPos;\n newPos = 0;\n }\n else if (-newPos + sb.dragSize > sb.trackSize) {\n newSize = sb.trackSize + newPos;\n }\n }\n else {\n if (newPos < 0) {\n newSize = sb.dragSize + newPos;\n newPos = 0;\n }\n else if (newPos + sb.dragSize > sb.trackSize) {\n newSize = sb.trackSize - newPos;\n }\n }\n if (s.isHorizontal()) {\n if (s.support.transforms3d) {\n sb.drag.transform('translate3d(' + (newPos) + 'px, 0, 0)');\n }\n else {\n sb.drag.transform('translateX(' + (newPos) + 'px)');\n }\n sb.drag[0].style.width = newSize + 'px';\n }\n else {\n if (s.support.transforms3d) {\n sb.drag.transform('translate3d(0px, ' + (newPos) + 'px, 0)');\n }\n else {\n sb.drag.transform('translateY(' + (newPos) + 'px)');\n }\n sb.drag[0].style.height = newSize + 'px';\n }\n if (s.params.scrollbarHide) {\n clearTimeout(sb.timeout);\n sb.track[0].style.opacity = 1;\n sb.timeout = setTimeout(function () {\n sb.track[0].style.opacity = 0;\n sb.track.transition(400);\n }, 1000);\n }\n },\n setTransition: function (duration) {\n if (!s.params.scrollbar) return;\n s.scrollbar.drag.transition(duration);\n }\n };\n\n /*=========================\n Controller\n ===========================*/\n s.controller = {\n LinearSpline: function (x, y) {\n this.x = x;\n this.y = y;\n this.lastIndex = x.length - 1;\n // Given an x value (x2), return the expected y2 value:\n // (x1,y1) is the known point before given value,\n // (x3,y3) is the known point after given value.\n var i1, i3;\n var l = this.x.length;\n \n this.interpolate = function (x2) {\n if (!x2) return 0;\n \n // Get the indexes of x1 and x3 (the array indexes before and after given x2):\n i3 = binarySearch(this.x, x2);\n i1 = i3 - 1;\n \n // We have our indexes i1 & i3, so we can calculate already:\n // y2 := ((x2−x1) × (y3−y1)) ÷ (x3−x1) + y1\n return ((x2 - this.x[i1]) * (this.y[i3] - this.y[i1])) / (this.x[i3] - this.x[i1]) + this.y[i1];\n };\n \n var binarySearch = (function() {\n var maxIndex, minIndex, guess;\n return function(array, val) {\n minIndex = -1;\n maxIndex = array.length;\n while (maxIndex - minIndex > 1)\n if (array[guess = maxIndex + minIndex >> 1] <= val) {\n minIndex = guess;\n } else {\n maxIndex = guess;\n }\n return maxIndex;\n };\n })();\n },\n //xxx: for now i will just save one spline function to to\n getInterpolateFunction: function(c){\n if(!s.controller.spline) s.controller.spline = s.params.loop ?\n new s.controller.LinearSpline(s.slidesGrid, c.slidesGrid) :\n new s.controller.LinearSpline(s.snapGrid, c.snapGrid);\n },\n setTranslate: function (translate, byController) {\n var controlled = s.params.control;\n var multiplier, controlledTranslate;\n function setControlledTranslate(c) {\n // this will create an Interpolate function based on the snapGrids\n // x is the Grid of the scrolled scroller and y will be the controlled scroller\n // it makes sense to create this only once and recall it for the interpolation\n // the function does a lot of value caching for performance\n translate = c.rtl && c.params.direction === 'horizontal' ? -s.translate : s.translate;\n if (s.params.controlBy === 'slide') {\n s.controller.getInterpolateFunction(c);\n // i am not sure why the values have to be multiplicated this way, tried to invert the snapGrid\n // but it did not work out\n controlledTranslate = -s.controller.spline.interpolate(-translate);\n }\n \n if(!controlledTranslate || s.params.controlBy === 'container'){\n multiplier = (c.maxTranslate() - c.minTranslate()) / (s.maxTranslate() - s.minTranslate());\n controlledTranslate = (translate - s.minTranslate()) * multiplier + c.minTranslate();\n }\n \n if (s.params.controlInverse) {\n controlledTranslate = c.maxTranslate() - controlledTranslate;\n }\n c.updateProgress(controlledTranslate);\n c.setWrapperTranslate(controlledTranslate, false, s);\n c.updateActiveIndex();\n }\n if (s.isArray(controlled)) {\n for (var i = 0; i < controlled.length; i++) {\n if (controlled[i] !== byController && controlled[i] instanceof Swiper) {\n setControlledTranslate(controlled[i]);\n }\n }\n }\n else if (controlled instanceof Swiper && byController !== controlled) {\n \n setControlledTranslate(controlled);\n }\n },\n setTransition: function (duration, byController) {\n var controlled = s.params.control;\n var i;\n function setControlledTransition(c) {\n c.setWrapperTransition(duration, s);\n if (duration !== 0) {\n c.onTransitionStart();\n c.wrapper.transitionEnd(function(){\n if (!controlled) return;\n if (c.params.loop && s.params.controlBy === 'slide') {\n c.fixLoop();\n }\n c.onTransitionEnd();\n \n });\n }\n }\n if (s.isArray(controlled)) {\n for (i = 0; i < controlled.length; i++) {\n if (controlled[i] !== byController && controlled[i] instanceof Swiper) {\n setControlledTransition(controlled[i]);\n }\n }\n }\n else if (controlled instanceof Swiper && byController !== controlled) {\n setControlledTransition(controlled);\n }\n }\n };\n\n /*=========================\n Hash Navigation\n ===========================*/\n s.hashnav = {\n onHashCange: function (e, a) {\n var newHash = document.location.hash.replace('#', '');\n var activeSlideHash = s.slides.eq(s.activeIndex).attr('data-hash');\n if (newHash !== activeSlideHash) {\n s.slideTo(s.wrapper.children('.' + s.params.slideClass + '[data-hash=\"' + (newHash) + '\"]').index());\n }\n },\n attachEvents: function (detach) {\n var action = detach ? 'off' : 'on';\n $(window)[action]('hashchange', s.hashnav.onHashCange);\n },\n setHash: function () {\n if (!s.hashnav.initialized || !s.params.hashnav) return;\n if (s.params.replaceState && window.history && window.history.replaceState) {\n window.history.replaceState(null, null, ('#' + s.slides.eq(s.activeIndex).attr('data-hash') || ''));\n } else {\n var slide = s.slides.eq(s.activeIndex);\n var hash = slide.attr('data-hash') || slide.attr('data-history');\n document.location.hash = hash || '';\n }\n },\n init: function () {\n if (!s.params.hashnav || s.params.history) return;\n s.hashnav.initialized = true;\n var hash = document.location.hash.replace('#', '');\n if (!hash) return;\n var speed = 0;\n for (var i = 0, length = s.slides.length; i < length; i++) {\n var slide = s.slides.eq(i);\n var slideHash = slide.attr('data-hash') || slide.attr('data-history');\n if (slideHash === hash && !slide.hasClass(s.params.slideDuplicateClass)) {\n var index = slide.index();\n s.slideTo(index, speed, s.params.runCallbacksOnInit, true);\n }\n }\n if (s.params.hashnavWatchState) s.hashnav.attachEvents();\n },\n destroy: function () {\n if (s.params.hashnavWatchState) s.hashnav.attachEvents(true);\n }\n };\n\n /*=========================\n History Api with fallback to Hashnav\n ===========================*/\n s.history = {\n init: function () {\n if (!s.params.history) return;\n if (!window.history || !window.history.pushState) {\n s.params.history = false;\n s.params.hashnav = true;\n return;\n }\n s.history.initialized = true;\n this.paths = this.getPathValues();\n if (!this.paths.key && !this.paths.value) return;\n this.scrollToSlide(0, this.paths.value, s.params.runCallbacksOnInit);\n if (!s.params.replaceState) {\n window.addEventListener('popstate', this.setHistoryPopState);\n }\n },\n setHistoryPopState: function() {\n s.history.paths = s.history.getPathValues();\n s.history.scrollToSlide(s.params.speed, s.history.paths.value, false);\n },\n getPathValues: function() {\n var pathArray = window.location.pathname.slice(1).split('/');\n var total = pathArray.length;\n var key = pathArray[total - 2];\n var value = pathArray[total - 1];\n return { key: key, value: value };\n },\n setHistory: function (key, index) {\n if (!s.history.initialized || !s.params.history) return;\n var slide = s.slides.eq(index);\n var value = this.slugify(slide.attr('data-history'));\n if (!window.location.pathname.includes(key)) {\n value = key + '/' + value;\n }\n if (s.params.replaceState) {\n window.history.replaceState(null, null, value);\n } else {\n window.history.pushState(null, null, value);\n }\n },\n slugify: function(text) {\n return text.toString().toLowerCase()\n .replace(/\\s+/g, '-')\n .replace(/[^\\w\\-]+/g, '')\n .replace(/\\-\\-+/g, '-')\n .replace(/^-+/, '')\n .replace(/-+$/, '');\n },\n scrollToSlide: function(speed, value, runCallbacks) {\n if (value) {\n for (var i = 0, length = s.slides.length; i < length; i++) {\n var slide = s.slides.eq(i);\n var slideHistory = this.slugify(slide.attr('data-history'));\n if (slideHistory === value && !slide.hasClass(s.params.slideDuplicateClass)) {\n var index = slide.index();\n s.slideTo(index, speed, runCallbacks);\n }\n }\n } else {\n s.slideTo(0, speed, runCallbacks);\n }\n }\n };\n\n /*=========================\n Keyboard Control\n ===========================*/\n function handleKeyboard(e) {\n if (e.originalEvent) e = e.originalEvent; //jquery fix\n var kc = e.keyCode || e.charCode;\n // Directions locks\n if (!s.params.allowSwipeToNext && (s.isHorizontal() && kc === 39 || !s.isHorizontal() && kc === 40)) {\n return false;\n }\n if (!s.params.allowSwipeToPrev && (s.isHorizontal() && kc === 37 || !s.isHorizontal() && kc === 38)) {\n return false;\n }\n if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {\n return;\n }\n if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) {\n return;\n }\n if (kc === 37 || kc === 39 || kc === 38 || kc === 40) {\n var inView = false;\n //Check that swiper should be inside of visible area of window\n if (s.container.parents('.' + s.params.slideClass).length > 0 && s.container.parents('.' + s.params.slideActiveClass).length === 0) {\n return;\n }\n var windowScroll = {\n left: window.pageXOffset,\n top: window.pageYOffset\n };\n var windowWidth = window.innerWidth;\n var windowHeight = window.innerHeight;\n var swiperOffset = s.container.offset();\n if (s.rtl) swiperOffset.left = swiperOffset.left - s.container[0].scrollLeft;\n var swiperCoord = [\n [swiperOffset.left, swiperOffset.top],\n [swiperOffset.left + s.width, swiperOffset.top],\n [swiperOffset.left, swiperOffset.top + s.height],\n [swiperOffset.left + s.width, swiperOffset.top + s.height]\n ];\n for (var i = 0; i < swiperCoord.length; i++) {\n var point = swiperCoord[i];\n if (\n point[0] >= windowScroll.left && point[0] <= windowScroll.left + windowWidth &&\n point[1] >= windowScroll.top && point[1] <= windowScroll.top + windowHeight\n ) {\n inView = true;\n }\n \n }\n if (!inView) return;\n }\n if (s.isHorizontal()) {\n if (kc === 37 || kc === 39) {\n if (e.preventDefault) e.preventDefault();\n else e.returnValue = false;\n }\n if ((kc === 39 && !s.rtl) || (kc === 37 && s.rtl)) s.slideNext();\n if ((kc === 37 && !s.rtl) || (kc === 39 && s.rtl)) s.slidePrev();\n }\n else {\n if (kc === 38 || kc === 40) {\n if (e.preventDefault) e.preventDefault();\n else e.returnValue = false;\n }\n if (kc === 40) s.slideNext();\n if (kc === 38) s.slidePrev();\n }\n }\n s.disableKeyboardControl = function () {\n s.params.keyboardControl = false;\n $(document).off('keydown', handleKeyboard);\n };\n s.enableKeyboardControl = function () {\n s.params.keyboardControl = true;\n $(document).on('keydown', handleKeyboard);\n };\n \n\n /*=========================\n Mousewheel Control\n ===========================*/\n s.mousewheel = {\n event: false,\n lastScrollTime: (new window.Date()).getTime()\n };\n if (s.params.mousewheelControl) {\n /**\n * The best combination if you prefer spinX + spinY normalization. It favors\n * the older DOMMouseScroll for Firefox, as FF does not include wheelDelta with\n * 'wheel' event, making spin speed determination impossible.\n */\n s.mousewheel.event = (navigator.userAgent.indexOf('firefox') > -1) ?\n 'DOMMouseScroll' :\n isEventSupported() ?\n 'wheel' : 'mousewheel';\n }\n \n function isEventSupported() {\n var eventName = 'onwheel';\n var isSupported = eventName in document;\n \n if (!isSupported) {\n var element = document.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof element[eventName] === 'function';\n }\n \n if (!isSupported &&\n document.implementation &&\n document.implementation.hasFeature &&\n // always returns true in newer browsers as per the standard.\n // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature\n document.implementation.hasFeature('', '') !== true ) {\n // This is the only way to test support for the `wheel` event in IE9+.\n isSupported = document.implementation.hasFeature('Events.wheel', '3.0');\n }\n \n return isSupported;\n }\n \n function handleMousewheel(e) {\n if (e.originalEvent) e = e.originalEvent; //jquery fix\n var delta = 0;\n var rtlFactor = s.rtl ? -1 : 1;\n \n var data = normalizeWheel( e );\n \n if (s.params.mousewheelForceToAxis) {\n if (s.isHorizontal()) {\n if (Math.abs(data.pixelX) > Math.abs(data.pixelY)) delta = data.pixelX * rtlFactor;\n else return;\n }\n else {\n if (Math.abs(data.pixelY) > Math.abs(data.pixelX)) delta = data.pixelY;\n else return;\n }\n }\n else {\n delta = Math.abs(data.pixelX) > Math.abs(data.pixelY) ? - data.pixelX * rtlFactor : - data.pixelY;\n }\n \n if (delta === 0) return;\n \n if (s.params.mousewheelInvert) delta = -delta;\n \n if (!s.params.freeMode) {\n if ((new window.Date()).getTime() - s.mousewheel.lastScrollTime > 60) {\n if (delta < 0) {\n if ((!s.isEnd || s.params.loop) && !s.animating) {\n s.slideNext();\n s.emit('onScroll', s, e);\n }\n else if (s.params.mousewheelReleaseOnEdges) return true;\n }\n else {\n if ((!s.isBeginning || s.params.loop) && !s.animating) {\n s.slidePrev();\n s.emit('onScroll', s, e);\n }\n else if (s.params.mousewheelReleaseOnEdges) return true;\n }\n }\n s.mousewheel.lastScrollTime = (new window.Date()).getTime();\n \n }\n else {\n //Freemode or scrollContainer:\n var position = s.getWrapperTranslate() + delta * s.params.mousewheelSensitivity;\n var wasBeginning = s.isBeginning,\n wasEnd = s.isEnd;\n \n if (position >= s.minTranslate()) position = s.minTranslate();\n if (position <= s.maxTranslate()) position = s.maxTranslate();\n \n s.setWrapperTransition(0);\n s.setWrapperTranslate(position);\n s.updateProgress();\n s.updateActiveIndex();\n \n if (!wasBeginning && s.isBeginning || !wasEnd && s.isEnd) {\n s.updateClasses();\n }\n \n if (s.params.freeModeSticky) {\n clearTimeout(s.mousewheel.timeout);\n s.mousewheel.timeout = setTimeout(function () {\n s.slideReset();\n }, 300);\n }\n else {\n if (s.params.lazyLoading && s.lazy) {\n s.lazy.load();\n }\n }\n // Emit event\n s.emit('onScroll', s, e);\n \n // Stop autoplay\n if (s.params.autoplay && s.params.autoplayDisableOnInteraction) s.stopAutoplay();\n \n // Return page scroll on edge positions\n if (position === 0 || position === s.maxTranslate()) return;\n }\n \n if (e.preventDefault) e.preventDefault();\n else e.returnValue = false;\n return false;\n }\n s.disableMousewheelControl = function () {\n if (!s.mousewheel.event) return false;\n var target = s.container;\n if (s.params.mousewheelEventsTarged !== 'container') {\n target = $(s.params.mousewheelEventsTarged);\n }\n target.off(s.mousewheel.event, handleMousewheel);\n return true;\n };\n \n s.enableMousewheelControl = function () {\n if (!s.mousewheel.event) return false;\n var target = s.container;\n if (s.params.mousewheelEventsTarged !== 'container') {\n target = $(s.params.mousewheelEventsTarged);\n }\n target.on(s.mousewheel.event, handleMousewheel);\n return true;\n };\n \n /**\n * Mouse wheel (and 2-finger trackpad) support on the web sucks. It is\n * complicated, thus this doc is long and (hopefully) detailed enough to answer\n * your questions.\n *\n * If you need to react to the mouse wheel in a predictable way, this code is\n * like your bestest friend. * hugs *\n *\n * As of today, there are 4 DOM event types you can listen to:\n *\n * 'wheel' -- Chrome(31+), FF(17+), IE(9+)\n * 'mousewheel' -- Chrome, IE(6+), Opera, Safari\n * 'MozMousePixelScroll' -- FF(3.5 only!) (2010-2013) -- don't bother!\n * 'DOMMouseScroll' -- FF(0.9.7+) since 2003\n *\n * So what to do? The is the best:\n *\n * normalizeWheel.getEventType();\n *\n * In your event callback, use this code to get sane interpretation of the\n * deltas. This code will return an object with properties:\n *\n * spinX -- normalized spin speed (use for zoom) - x plane\n * spinY -- \" - y plane\n * pixelX -- normalized distance (to pixels) - x plane\n * pixelY -- \" - y plane\n *\n * Wheel values are provided by the browser assuming you are using the wheel to\n * scroll a web page by a number of lines or pixels (or pages). Values can vary\n * significantly on different platforms and browsers, forgetting that you can\n * scroll at different speeds. Some devices (like trackpads) emit more events\n * at smaller increments with fine granularity, and some emit massive jumps with\n * linear speed or acceleration.\n *\n * This code does its best to normalize the deltas for you:\n *\n * - spin is trying to normalize how far the wheel was spun (or trackpad\n * dragged). This is super useful for zoom support where you want to\n * throw away the chunky scroll steps on the PC and make those equal to\n * the slow and smooth tiny steps on the Mac. Key data: This code tries to\n * resolve a single slow step on a wheel to 1.\n *\n * - pixel is normalizing the desired scroll delta in pixel units. You'll\n * get the crazy differences between browsers, but at least it'll be in\n * pixels!\n *\n * - positive value indicates scrolling DOWN/RIGHT, negative UP/LEFT. This\n * should translate to positive value zooming IN, negative zooming OUT.\n * This matches the newer 'wheel' event.\n *\n * Why are there spinX, spinY (or pixels)?\n *\n * - spinX is a 2-finger side drag on the trackpad, and a shift + wheel turn\n * with a mouse. It results in side-scrolling in the browser by default.\n *\n * - spinY is what you expect -- it's the classic axis of a mouse wheel.\n *\n * - I dropped spinZ/pixelZ. It is supported by the DOM 3 'wheel' event and\n * probably is by browsers in conjunction with fancy 3D controllers .. but\n * you know.\n *\n * Implementation info:\n *\n * Examples of 'wheel' event if you scroll slowly (down) by one step with an\n * average mouse:\n *\n * OS X + Chrome (mouse) - 4 pixel delta (wheelDelta -120)\n * OS X + Safari (mouse) - N/A pixel delta (wheelDelta -12)\n * OS X + Firefox (mouse) - 0.1 line delta (wheelDelta N/A)\n * Win8 + Chrome (mouse) - 100 pixel delta (wheelDelta -120)\n * Win8 + Firefox (mouse) - 3 line delta (wheelDelta -120)\n *\n * On the trackpad:\n *\n * OS X + Chrome (trackpad) - 2 pixel delta (wheelDelta -6)\n * OS X + Firefox (trackpad) - 1 pixel delta (wheelDelta N/A)\n *\n * On other/older browsers.. it's more complicated as there can be multiple and\n * also missing delta values.\n *\n * The 'wheel' event is more standard:\n *\n * http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents\n *\n * The basics is that it includes a unit, deltaMode (pixels, lines, pages), and\n * deltaX, deltaY and deltaZ. Some browsers provide other values to maintain\n * backward compatibility with older events. Those other values help us\n * better normalize spin speed. Example of what the browsers provide:\n *\n * | event.wheelDelta | event.detail\n * ------------------+------------------+--------------\n * Safari v5/OS X | -120 | 0\n * Safari v5/Win7 | -120 | 0\n * Chrome v17/OS X | -120 | 0\n * Chrome v17/Win7 | -120 | 0\n * IE9/Win7 | -120 | undefined\n * Firefox v4/OS X | undefined | 1\n * Firefox v4/Win7 | undefined | 3\n *\n */\n function normalizeWheel( /*object*/ event ) /*object*/ {\n // Reasonable defaults\n var PIXEL_STEP = 10;\n var LINE_HEIGHT = 40;\n var PAGE_HEIGHT = 800;\n \n var sX = 0, sY = 0, // spinX, spinY\n pX = 0, pY = 0; // pixelX, pixelY\n \n // Legacy\n if( 'detail' in event ) {\n sY = event.detail;\n }\n if( 'wheelDelta' in event ) {\n sY = -event.wheelDelta / 120;\n }\n if( 'wheelDeltaY' in event ) {\n sY = -event.wheelDeltaY / 120;\n }\n if( 'wheelDeltaX' in event ) {\n sX = -event.wheelDeltaX / 120;\n }\n \n // side scrolling on FF with DOMMouseScroll\n if( 'axis' in event && event.axis === event.HORIZONTAL_AXIS ) {\n sX = sY;\n sY = 0;\n }\n \n pX = sX * PIXEL_STEP;\n pY = sY * PIXEL_STEP;\n \n if( 'deltaY' in event ) {\n pY = event.deltaY;\n }\n if( 'deltaX' in event ) {\n pX = event.deltaX;\n }\n \n if( (pX || pY) && event.deltaMode ) {\n if( event.deltaMode === 1 ) { // delta in LINE units\n pX *= LINE_HEIGHT;\n pY *= LINE_HEIGHT;\n } else { // delta in PAGE units\n pX *= PAGE_HEIGHT;\n pY *= PAGE_HEIGHT;\n }\n }\n \n // Fall-back if spin cannot be determined\n if( pX && !sX ) {\n sX = (pX < 1) ? -1 : 1;\n }\n if( pY && !sY ) {\n sY = (pY < 1) ? -1 : 1;\n }\n \n return {\n spinX: sX,\n spinY: sY,\n pixelX: pX,\n pixelY: pY\n };\n }\n\n /*=========================\n Parallax\n ===========================*/\n function setParallaxTransform(el, progress) {\n el = $(el);\n var p, pX, pY;\n var rtlFactor = s.rtl ? -1 : 1;\n \n p = el.attr('data-swiper-parallax') || '0';\n pX = el.attr('data-swiper-parallax-x');\n pY = el.attr('data-swiper-parallax-y');\n if (pX || pY) {\n pX = pX || '0';\n pY = pY || '0';\n }\n else {\n if (s.isHorizontal()) {\n pX = p;\n pY = '0';\n }\n else {\n pY = p;\n pX = '0';\n }\n }\n \n if ((pX).indexOf('%') >= 0) {\n pX = parseInt(pX, 10) * progress * rtlFactor + '%';\n }\n else {\n pX = pX * progress * rtlFactor + 'px' ;\n }\n if ((pY).indexOf('%') >= 0) {\n pY = parseInt(pY, 10) * progress + '%';\n }\n else {\n pY = pY * progress + 'px' ;\n }\n \n el.transform('translate3d(' + pX + ', ' + pY + ',0px)');\n }\n s.parallax = {\n setTranslate: function () {\n s.container.children('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]').each(function(){\n setParallaxTransform(this, s.progress);\n \n });\n s.slides.each(function () {\n var slide = $(this);\n slide.find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]').each(function () {\n var progress = Math.min(Math.max(slide[0].progress, -1), 1);\n setParallaxTransform(this, progress);\n });\n });\n },\n setTransition: function (duration) {\n if (typeof duration === 'undefined') duration = s.params.speed;\n s.container.find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]').each(function(){\n var el = $(this);\n var parallaxDuration = parseInt(el.attr('data-swiper-parallax-duration'), 10) || duration;\n if (duration === 0) parallaxDuration = 0;\n el.transition(parallaxDuration);\n });\n }\n };\n \n\n /*=========================\n Zoom\n ===========================*/\n s.zoom = {\n // \"Global\" Props\n scale: 1,\n currentScale: 1,\n isScaling: false,\n gesture: {\n slide: undefined,\n slideWidth: undefined,\n slideHeight: undefined,\n image: undefined,\n imageWrap: undefined,\n zoomMax: s.params.zoomMax\n },\n image: {\n isTouched: undefined,\n isMoved: undefined,\n currentX: undefined,\n currentY: undefined,\n minX: undefined,\n minY: undefined,\n maxX: undefined,\n maxY: undefined,\n width: undefined,\n height: undefined,\n startX: undefined,\n startY: undefined,\n touchesStart: {},\n touchesCurrent: {}\n },\n velocity: {\n x: undefined,\n y: undefined,\n prevPositionX: undefined,\n prevPositionY: undefined,\n prevTime: undefined\n },\n // Calc Scale From Multi-touches\n getDistanceBetweenTouches: function (e) {\n if (e.targetTouches.length < 2) return 1;\n var x1 = e.targetTouches[0].pageX,\n y1 = e.targetTouches[0].pageY,\n x2 = e.targetTouches[1].pageX,\n y2 = e.targetTouches[1].pageY;\n var distance = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n return distance;\n },\n // Events\n onGestureStart: function (e) {\n var z = s.zoom;\n if (!s.support.gestures) {\n if (e.type !== 'touchstart' || e.type === 'touchstart' && e.targetTouches.length < 2) {\n return;\n }\n z.gesture.scaleStart = z.getDistanceBetweenTouches(e);\n }\n if (!z.gesture.slide || !z.gesture.slide.length) {\n z.gesture.slide = $(this);\n if (z.gesture.slide.length === 0) z.gesture.slide = s.slides.eq(s.activeIndex);\n z.gesture.image = z.gesture.slide.find('img, svg, canvas');\n z.gesture.imageWrap = z.gesture.image.parent('.' + s.params.zoomContainerClass);\n z.gesture.zoomMax = z.gesture.imageWrap.attr('data-swiper-zoom') || s.params.zoomMax ;\n if (z.gesture.imageWrap.length === 0) {\n z.gesture.image = undefined;\n return;\n }\n }\n z.gesture.image.transition(0);\n z.isScaling = true;\n },\n onGestureChange: function (e) {\n var z = s.zoom;\n if (!s.support.gestures) {\n if (e.type !== 'touchmove' || e.type === 'touchmove' && e.targetTouches.length < 2) {\n return;\n }\n z.gesture.scaleMove = z.getDistanceBetweenTouches(e);\n }\n if (!z.gesture.image || z.gesture.image.length === 0) return;\n if (s.support.gestures) {\n z.scale = e.scale * z.currentScale;\n }\n else {\n z.scale = (z.gesture.scaleMove / z.gesture.scaleStart) * z.currentScale;\n }\n if (z.scale > z.gesture.zoomMax) {\n z.scale = z.gesture.zoomMax - 1 + Math.pow((z.scale - z.gesture.zoomMax + 1), 0.5);\n }\n if (z.scale < s.params.zoomMin) {\n z.scale = s.params.zoomMin + 1 - Math.pow((s.params.zoomMin - z.scale + 1), 0.5);\n }\n z.gesture.image.transform('translate3d(0,0,0) scale(' + z.scale + ')');\n },\n onGestureEnd: function (e) {\n var z = s.zoom;\n if (!s.support.gestures) {\n if (e.type !== 'touchend' || e.type === 'touchend' && e.changedTouches.length < 2) {\n return;\n }\n }\n if (!z.gesture.image || z.gesture.image.length === 0) return;\n z.scale = Math.max(Math.min(z.scale, z.gesture.zoomMax), s.params.zoomMin);\n z.gesture.image.transition(s.params.speed).transform('translate3d(0,0,0) scale(' + z.scale + ')');\n z.currentScale = z.scale;\n z.isScaling = false;\n if (z.scale === 1) z.gesture.slide = undefined;\n },\n onTouchStart: function (s, e) {\n var z = s.zoom;\n if (!z.gesture.image || z.gesture.image.length === 0) return;\n if (z.image.isTouched) return;\n if (s.device.os === 'android') e.preventDefault();\n z.image.isTouched = true;\n z.image.touchesStart.x = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;\n z.image.touchesStart.y = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;\n },\n onTouchMove: function (e) {\n var z = s.zoom;\n if (!z.gesture.image || z.gesture.image.length === 0) return;\n s.allowClick = false;\n if (!z.image.isTouched || !z.gesture.slide) return;\n \n if (!z.image.isMoved) {\n z.image.width = z.gesture.image[0].offsetWidth;\n z.image.height = z.gesture.image[0].offsetHeight;\n z.image.startX = s.getTranslate(z.gesture.imageWrap[0], 'x') || 0;\n z.image.startY = s.getTranslate(z.gesture.imageWrap[0], 'y') || 0;\n z.gesture.slideWidth = z.gesture.slide[0].offsetWidth;\n z.gesture.slideHeight = z.gesture.slide[0].offsetHeight;\n z.gesture.imageWrap.transition(0);\n }\n // Define if we need image drag\n var scaledWidth = z.image.width * z.scale;\n var scaledHeight = z.image.height * z.scale;\n \n if (scaledWidth < z.gesture.slideWidth && scaledHeight < z.gesture.slideHeight) return;\n \n z.image.minX = Math.min((z.gesture.slideWidth / 2 - scaledWidth / 2), 0);\n z.image.maxX = -z.image.minX;\n z.image.minY = Math.min((z.gesture.slideHeight / 2 - scaledHeight / 2), 0);\n z.image.maxY = -z.image.minY;\n \n z.image.touchesCurrent.x = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;\n z.image.touchesCurrent.y = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;\n \n if (!z.image.isMoved && !z.isScaling) {\n if (s.isHorizontal() &&\n (Math.floor(z.image.minX) === Math.floor(z.image.startX) && z.image.touchesCurrent.x < z.image.touchesStart.x) ||\n (Math.floor(z.image.maxX) === Math.floor(z.image.startX) && z.image.touchesCurrent.x > z.image.touchesStart.x)\n ) {\n z.image.isTouched = false;\n return;\n }\n else if (!s.isHorizontal() &&\n (Math.floor(z.image.minY) === Math.floor(z.image.startY) && z.image.touchesCurrent.y < z.image.touchesStart.y) ||\n (Math.floor(z.image.maxY) === Math.floor(z.image.startY) && z.image.touchesCurrent.y > z.image.touchesStart.y)\n ) {\n z.image.isTouched = false;\n return;\n }\n }\n e.preventDefault();\n e.stopPropagation();\n \n z.image.isMoved = true;\n z.image.currentX = z.image.touchesCurrent.x - z.image.touchesStart.x + z.image.startX;\n z.image.currentY = z.image.touchesCurrent.y - z.image.touchesStart.y + z.image.startY;\n \n if (z.image.currentX < z.image.minX) {\n z.image.currentX = z.image.minX + 1 - Math.pow((z.image.minX - z.image.currentX + 1), 0.8);\n }\n if (z.image.currentX > z.image.maxX) {\n z.image.currentX = z.image.maxX - 1 + Math.pow((z.image.currentX - z.image.maxX + 1), 0.8);\n }\n \n if (z.image.currentY < z.image.minY) {\n z.image.currentY = z.image.minY + 1 - Math.pow((z.image.minY - z.image.currentY + 1), 0.8);\n }\n if (z.image.currentY > z.image.maxY) {\n z.image.currentY = z.image.maxY - 1 + Math.pow((z.image.currentY - z.image.maxY + 1), 0.8);\n }\n \n //Velocity\n if (!z.velocity.prevPositionX) z.velocity.prevPositionX = z.image.touchesCurrent.x;\n if (!z.velocity.prevPositionY) z.velocity.prevPositionY = z.image.touchesCurrent.y;\n if (!z.velocity.prevTime) z.velocity.prevTime = Date.now();\n z.velocity.x = (z.image.touchesCurrent.x - z.velocity.prevPositionX) / (Date.now() - z.velocity.prevTime) / 2;\n z.velocity.y = (z.image.touchesCurrent.y - z.velocity.prevPositionY) / (Date.now() - z.velocity.prevTime) / 2;\n if (Math.abs(z.image.touchesCurrent.x - z.velocity.prevPositionX) < 2) z.velocity.x = 0;\n if (Math.abs(z.image.touchesCurrent.y - z.velocity.prevPositionY) < 2) z.velocity.y = 0;\n z.velocity.prevPositionX = z.image.touchesCurrent.x;\n z.velocity.prevPositionY = z.image.touchesCurrent.y;\n z.velocity.prevTime = Date.now();\n \n z.gesture.imageWrap.transform('translate3d(' + z.image.currentX + 'px, ' + z.image.currentY + 'px,0)');\n },\n onTouchEnd: function (s, e) {\n var z = s.zoom;\n if (!z.gesture.image || z.gesture.image.length === 0) return;\n if (!z.image.isTouched || !z.image.isMoved) {\n z.image.isTouched = false;\n z.image.isMoved = false;\n return;\n }\n z.image.isTouched = false;\n z.image.isMoved = false;\n var momentumDurationX = 300;\n var momentumDurationY = 300;\n var momentumDistanceX = z.velocity.x * momentumDurationX;\n var newPositionX = z.image.currentX + momentumDistanceX;\n var momentumDistanceY = z.velocity.y * momentumDurationY;\n var newPositionY = z.image.currentY + momentumDistanceY;\n \n //Fix duration\n if (z.velocity.x !== 0) momentumDurationX = Math.abs((newPositionX - z.image.currentX) / z.velocity.x);\n if (z.velocity.y !== 0) momentumDurationY = Math.abs((newPositionY - z.image.currentY) / z.velocity.y);\n var momentumDuration = Math.max(momentumDurationX, momentumDurationY);\n \n z.image.currentX = newPositionX;\n z.image.currentY = newPositionY;\n \n // Define if we need image drag\n var scaledWidth = z.image.width * z.scale;\n var scaledHeight = z.image.height * z.scale;\n z.image.minX = Math.min((z.gesture.slideWidth / 2 - scaledWidth / 2), 0);\n z.image.maxX = -z.image.minX;\n z.image.minY = Math.min((z.gesture.slideHeight / 2 - scaledHeight / 2), 0);\n z.image.maxY = -z.image.minY;\n z.image.currentX = Math.max(Math.min(z.image.currentX, z.image.maxX), z.image.minX);\n z.image.currentY = Math.max(Math.min(z.image.currentY, z.image.maxY), z.image.minY);\n \n z.gesture.imageWrap.transition(momentumDuration).transform('translate3d(' + z.image.currentX + 'px, ' + z.image.currentY + 'px,0)');\n },\n onTransitionEnd: function (s) {\n var z = s.zoom;\n if (z.gesture.slide && s.previousIndex !== s.activeIndex) {\n z.gesture.image.transform('translate3d(0,0,0) scale(1)');\n z.gesture.imageWrap.transform('translate3d(0,0,0)');\n z.gesture.slide = z.gesture.image = z.gesture.imageWrap = undefined;\n z.scale = z.currentScale = 1;\n }\n },\n // Toggle Zoom\n toggleZoom: function (s, e) {\n var z = s.zoom;\n if (!z.gesture.slide) {\n z.gesture.slide = s.clickedSlide ? $(s.clickedSlide) : s.slides.eq(s.activeIndex);\n z.gesture.image = z.gesture.slide.find('img, svg, canvas');\n z.gesture.imageWrap = z.gesture.image.parent('.' + s.params.zoomContainerClass);\n }\n if (!z.gesture.image || z.gesture.image.length === 0) return;\n \n var touchX, touchY, offsetX, offsetY, diffX, diffY, translateX, translateY, imageWidth, imageHeight, scaledWidth, scaledHeight, translateMinX, translateMinY, translateMaxX, translateMaxY, slideWidth, slideHeight;\n \n if (typeof z.image.touchesStart.x === 'undefined' && e) {\n touchX = e.type === 'touchend' ? e.changedTouches[0].pageX : e.pageX;\n touchY = e.type === 'touchend' ? e.changedTouches[0].pageY : e.pageY;\n }\n else {\n touchX = z.image.touchesStart.x;\n touchY = z.image.touchesStart.y;\n }\n \n if (z.scale && z.scale !== 1) {\n // Zoom Out\n z.scale = z.currentScale = 1;\n z.gesture.imageWrap.transition(300).transform('translate3d(0,0,0)');\n z.gesture.image.transition(300).transform('translate3d(0,0,0) scale(1)');\n z.gesture.slide = undefined;\n }\n else {\n // Zoom In\n z.scale = z.currentScale = z.gesture.imageWrap.attr('data-swiper-zoom') || s.params.zoomMax;\n if (e) {\n slideWidth = z.gesture.slide[0].offsetWidth;\n slideHeight = z.gesture.slide[0].offsetHeight;\n offsetX = z.gesture.slide.offset().left;\n offsetY = z.gesture.slide.offset().top;\n diffX = offsetX + slideWidth/2 - touchX;\n diffY = offsetY + slideHeight/2 - touchY;\n \n imageWidth = z.gesture.image[0].offsetWidth;\n imageHeight = z.gesture.image[0].offsetHeight;\n scaledWidth = imageWidth * z.scale;\n scaledHeight = imageHeight * z.scale;\n \n translateMinX = Math.min((slideWidth / 2 - scaledWidth / 2), 0);\n translateMinY = Math.min((slideHeight / 2 - scaledHeight / 2), 0);\n translateMaxX = -translateMinX;\n translateMaxY = -translateMinY;\n \n translateX = diffX * z.scale;\n translateY = diffY * z.scale;\n \n if (translateX < translateMinX) {\n translateX = translateMinX;\n }\n if (translateX > translateMaxX) {\n translateX = translateMaxX;\n }\n \n if (translateY < translateMinY) {\n translateY = translateMinY;\n }\n if (translateY > translateMaxY) {\n translateY = translateMaxY;\n }\n }\n else {\n translateX = 0;\n translateY = 0;\n }\n z.gesture.imageWrap.transition(300).transform('translate3d(' + translateX + 'px, ' + translateY + 'px,0)');\n z.gesture.image.transition(300).transform('translate3d(0,0,0) scale(' + z.scale + ')');\n }\n },\n // Attach/Detach Events\n attachEvents: function (detach) {\n var action = detach ? 'off' : 'on';\n \n if (s.params.zoom) {\n var target = s.slides;\n var passiveListener = s.touchEvents.start === 'touchstart' && s.support.passiveListener && s.params.passiveListeners ? {passive: true, capture: false} : false;\n // Scale image\n if (s.support.gestures) {\n s.slides[action]('gesturestart', s.zoom.onGestureStart, passiveListener);\n s.slides[action]('gesturechange', s.zoom.onGestureChange, passiveListener);\n s.slides[action]('gestureend', s.zoom.onGestureEnd, passiveListener);\n }\n else if (s.touchEvents.start === 'touchstart') {\n s.slides[action](s.touchEvents.start, s.zoom.onGestureStart, passiveListener);\n s.slides[action](s.touchEvents.move, s.zoom.onGestureChange, passiveListener);\n s.slides[action](s.touchEvents.end, s.zoom.onGestureEnd, passiveListener);\n }\n \n // Move image\n s[action]('touchStart', s.zoom.onTouchStart);\n s.slides.each(function (index, slide){\n if ($(slide).find('.' + s.params.zoomContainerClass).length > 0) {\n $(slide)[action](s.touchEvents.move, s.zoom.onTouchMove);\n }\n });\n s[action]('touchEnd', s.zoom.onTouchEnd);\n \n // Scale Out\n s[action]('transitionEnd', s.zoom.onTransitionEnd);\n if (s.params.zoomToggle) {\n s.on('doubleTap', s.zoom.toggleZoom);\n }\n }\n },\n init: function () {\n s.zoom.attachEvents();\n },\n destroy: function () {\n s.zoom.attachEvents(true);\n }\n };\n\n /*=========================\n Plugins API. Collect all and init all plugins\n ===========================*/\n s._plugins = [];\n for (var plugin in s.plugins) {\n var p = s.plugins[plugin](s, s.params[plugin]);\n if (p) s._plugins.push(p);\n }\n // Method to call all plugins event/method\n s.callPlugins = function (eventName) {\n for (var i = 0; i < s._plugins.length; i++) {\n if (eventName in s._plugins[i]) {\n s._plugins[i][eventName](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);\n }\n }\n };\n\n /*=========================\n Events/Callbacks/Plugins Emitter\n ===========================*/\n function normalizeEventName (eventName) {\n if (eventName.indexOf('on') !== 0) {\n if (eventName[0] !== eventName[0].toUpperCase()) {\n eventName = 'on' + eventName[0].toUpperCase() + eventName.substring(1);\n }\n else {\n eventName = 'on' + eventName;\n }\n }\n return eventName;\n }\n s.emitterEventListeners = {\n \n };\n s.emit = function (eventName) {\n // Trigger callbacks\n if (s.params[eventName]) {\n s.params[eventName](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);\n }\n var i;\n // Trigger events\n if (s.emitterEventListeners[eventName]) {\n for (i = 0; i < s.emitterEventListeners[eventName].length; i++) {\n s.emitterEventListeners[eventName][i](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);\n }\n }\n // Trigger plugins\n if (s.callPlugins) s.callPlugins(eventName, arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);\n };\n s.on = function (eventName, handler) {\n eventName = normalizeEventName(eventName);\n if (!s.emitterEventListeners[eventName]) s.emitterEventListeners[eventName] = [];\n s.emitterEventListeners[eventName].push(handler);\n return s;\n };\n s.off = function (eventName, handler) {\n var i;\n eventName = normalizeEventName(eventName);\n if (typeof handler === 'undefined') {\n // Remove all handlers for such event\n s.emitterEventListeners[eventName] = [];\n return s;\n }\n if (!s.emitterEventListeners[eventName] || s.emitterEventListeners[eventName].length === 0) return;\n for (i = 0; i < s.emitterEventListeners[eventName].length; i++) {\n if(s.emitterEventListeners[eventName][i] === handler) s.emitterEventListeners[eventName].splice(i, 1);\n }\n return s;\n };\n s.once = function (eventName, handler) {\n eventName = normalizeEventName(eventName);\n var _handler = function () {\n handler(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]);\n s.off(eventName, _handler);\n };\n s.on(eventName, _handler);\n return s;\n };\n\n // Accessibility tools\n s.a11y = {\n makeFocusable: function ($el) {\n $el.attr('tabIndex', '0');\n return $el;\n },\n addRole: function ($el, role) {\n $el.attr('role', role);\n return $el;\n },\n \n addLabel: function ($el, label) {\n $el.attr('aria-label', label);\n return $el;\n },\n \n disable: function ($el) {\n $el.attr('aria-disabled', true);\n return $el;\n },\n \n enable: function ($el) {\n $el.attr('aria-disabled', false);\n return $el;\n },\n \n onEnterKey: function (event) {\n if (event.keyCode !== 13) return;\n if ($(event.target).is(s.params.nextButton)) {\n s.onClickNext(event);\n if (s.isEnd) {\n s.a11y.notify(s.params.lastSlideMessage);\n }\n else {\n s.a11y.notify(s.params.nextSlideMessage);\n }\n }\n else if ($(event.target).is(s.params.prevButton)) {\n s.onClickPrev(event);\n if (s.isBeginning) {\n s.a11y.notify(s.params.firstSlideMessage);\n }\n else {\n s.a11y.notify(s.params.prevSlideMessage);\n }\n }\n if ($(event.target).is('.' + s.params.bulletClass)) {\n $(event.target)[0].click();\n }\n },\n \n liveRegion: $('<span class=\"' + s.params.notificationClass + '\" aria-live=\"assertive\" aria-atomic=\"true\"></span>'),\n \n notify: function (message) {\n var notification = s.a11y.liveRegion;\n if (notification.length === 0) return;\n notification.html('');\n notification.html(message);\n },\n init: function () {\n // Setup accessibility\n if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {\n s.a11y.makeFocusable(s.nextButton);\n s.a11y.addRole(s.nextButton, 'button');\n s.a11y.addLabel(s.nextButton, s.params.nextSlideMessage);\n }\n if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {\n s.a11y.makeFocusable(s.prevButton);\n s.a11y.addRole(s.prevButton, 'button');\n s.a11y.addLabel(s.prevButton, s.params.prevSlideMessage);\n }\n \n $(s.container).append(s.a11y.liveRegion);\n },\n initPagination: function () {\n if (s.params.pagination && s.params.paginationClickable && s.bullets && s.bullets.length) {\n s.bullets.each(function () {\n var bullet = $(this);\n s.a11y.makeFocusable(bullet);\n s.a11y.addRole(bullet, 'button');\n s.a11y.addLabel(bullet, s.params.paginationBulletMessage.replace(/{{index}}/, bullet.index() + 1));\n });\n }\n },\n destroy: function () {\n if (s.a11y.liveRegion && s.a11y.liveRegion.length > 0) s.a11y.liveRegion.remove();\n }\n };\n \n\n /*=========================\n Init/Destroy\n ===========================*/\n s.init = function () {\n if (s.params.loop) s.createLoop();\n s.updateContainerSize();\n s.updateSlidesSize();\n s.updatePagination();\n if (s.params.scrollbar && s.scrollbar) {\n s.scrollbar.set();\n if (s.params.scrollbarDraggable) {\n s.scrollbar.enableDraggable();\n }\n }\n if (s.params.effect !== 'slide' && s.effects[s.params.effect]) {\n if (!s.params.loop) s.updateProgress();\n s.effects[s.params.effect].setTranslate();\n }\n if (s.params.loop) {\n s.slideTo(s.params.initialSlide + s.loopedSlides, 0, s.params.runCallbacksOnInit);\n }\n else {\n s.slideTo(s.params.initialSlide, 0, s.params.runCallbacksOnInit);\n if (s.params.initialSlide === 0) {\n if (s.parallax && s.params.parallax) s.parallax.setTranslate();\n if (s.lazy && s.params.lazyLoading) {\n s.lazy.load();\n s.lazy.initialImageLoaded = true;\n }\n }\n }\n s.attachEvents();\n if (s.params.observer && s.support.observer) {\n s.initObservers();\n }\n if (s.params.preloadImages && !s.params.lazyLoading) {\n s.preloadImages();\n }\n if (s.params.zoom && s.zoom) {\n s.zoom.init();\n }\n if (s.params.autoplay) {\n s.startAutoplay();\n }\n if (s.params.keyboardControl) {\n if (s.enableKeyboardControl) s.enableKeyboardControl();\n }\n if (s.params.mousewheelControl) {\n if (s.enableMousewheelControl) s.enableMousewheelControl();\n }\n // Deprecated hashnavReplaceState changed to replaceState for use in hashnav and history\n if (s.params.hashnavReplaceState) {\n s.params.replaceState = s.params.hashnavReplaceState;\n }\n if (s.params.history) {\n if (s.history) s.history.init();\n }\n if (s.params.hashnav) {\n if (s.hashnav) s.hashnav.init();\n }\n if (s.params.a11y && s.a11y) s.a11y.init();\n s.emit('onInit', s);\n };\n \n // Cleanup dynamic styles\n s.cleanupStyles = function () {\n // Container\n s.container.removeClass(s.classNames.join(' ')).removeAttr('style');\n \n // Wrapper\n s.wrapper.removeAttr('style');\n \n // Slides\n if (s.slides && s.slides.length) {\n s.slides\n .removeClass([\n s.params.slideVisibleClass,\n s.params.slideActiveClass,\n s.params.slideNextClass,\n s.params.slidePrevClass\n ].join(' '))\n .removeAttr('style')\n .removeAttr('data-swiper-column')\n .removeAttr('data-swiper-row');\n }\n \n // Pagination/Bullets\n if (s.paginationContainer && s.paginationContainer.length) {\n s.paginationContainer.removeClass(s.params.paginationHiddenClass);\n }\n if (s.bullets && s.bullets.length) {\n s.bullets.removeClass(s.params.bulletActiveClass);\n }\n \n // Buttons\n if (s.params.prevButton) $(s.params.prevButton).removeClass(s.params.buttonDisabledClass);\n if (s.params.nextButton) $(s.params.nextButton).removeClass(s.params.buttonDisabledClass);\n \n // Scrollbar\n if (s.params.scrollbar && s.scrollbar) {\n if (s.scrollbar.track && s.scrollbar.track.length) s.scrollbar.track.removeAttr('style');\n if (s.scrollbar.drag && s.scrollbar.drag.length) s.scrollbar.drag.removeAttr('style');\n }\n };\n \n // Destroy\n s.destroy = function (deleteInstance, cleanupStyles) {\n // Detach evebts\n s.detachEvents();\n // Stop autoplay\n s.stopAutoplay();\n // Disable draggable\n if (s.params.scrollbar && s.scrollbar) {\n if (s.params.scrollbarDraggable) {\n s.scrollbar.disableDraggable();\n }\n }\n // Destroy loop\n if (s.params.loop) {\n s.destroyLoop();\n }\n // Cleanup styles\n if (cleanupStyles) {\n s.cleanupStyles();\n }\n // Disconnect observer\n s.disconnectObservers();\n \n // Destroy zoom\n if (s.params.zoom && s.zoom) {\n s.zoom.destroy();\n }\n // Disable keyboard/mousewheel\n if (s.params.keyboardControl) {\n if (s.disableKeyboardControl) s.disableKeyboardControl();\n }\n if (s.params.mousewheelControl) {\n if (s.disableMousewheelControl) s.disableMousewheelControl();\n }\n // Disable a11y\n if (s.params.a11y && s.a11y) s.a11y.destroy();\n // Delete history popstate\n if (s.params.history && !s.params.replaceState) {\n window.removeEventListener('popstate', s.history.setHistoryPopState);\n }\n if (s.params.hashnav && s.hashnav) {\n s.hashnav.destroy();\n }\n // Destroy callback\n s.emit('onDestroy');\n // Delete instance\n if (deleteInstance !== false) s = null;\n };\n \n s.init();\n \n\n \n // Return swiper instance\n return s;\n };\n \n\n /*==================================================\n Prototype\n ====================================================*/\n Swiper.prototype = {\n isSafari: (function () {\n var ua = navigator.userAgent.toLowerCase();\n return (ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0);\n })(),\n isUiWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent),\n isArray: function (arr) {\n return Object.prototype.toString.apply(arr) === '[object Array]';\n },\n /*==================================================\n Browser\n ====================================================*/\n browser: {\n ie: window.navigator.pointerEnabled || window.navigator.msPointerEnabled,\n ieTouch: (window.navigator.msPointerEnabled && window.navigator.msMaxTouchPoints > 1) || (window.navigator.pointerEnabled && window.navigator.maxTouchPoints > 1),\n lteIE9: (function() {\n // create temporary DIV\n var div = document.createElement('div');\n // add content to tmp DIV which is wrapped into the IE HTML conditional statement\n div.innerHTML = '<!--[if lte IE 9]><i></i><![endif]-->';\n // return true / false value based on what will browser render\n return div.getElementsByTagName('i').length === 1;\n })()\n },\n /*==================================================\n Devices\n ====================================================*/\n device: (function () {\n var ua = navigator.userAgent;\n var android = ua.match(/(Android);?[\\s\\/]+([\\d.]+)?/);\n var ipad = ua.match(/(iPad).*OS\\s([\\d_]+)/);\n var ipod = ua.match(/(iPod)(.*OS\\s([\\d_]+))?/);\n var iphone = !ipad && ua.match(/(iPhone\\sOS)\\s([\\d_]+)/);\n return {\n ios: ipad || iphone || ipod,\n android: android\n };\n })(),\n /*==================================================\n Feature Detection\n ====================================================*/\n support: {\n touch : (window.Modernizr && Modernizr.touch === true) || (function () {\n return !!(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch);\n })(),\n \n transforms3d : (window.Modernizr && Modernizr.csstransforms3d === true) || (function () {\n var div = document.createElement('div').style;\n return ('webkitPerspective' in div || 'MozPerspective' in div || 'OPerspective' in div || 'MsPerspective' in div || 'perspective' in div);\n })(),\n \n flexbox: (function () {\n var div = document.createElement('div').style;\n var styles = ('alignItems webkitAlignItems webkitBoxAlign msFlexAlign mozBoxAlign webkitFlexDirection msFlexDirection mozBoxDirection mozBoxOrient webkitBoxDirection webkitBoxOrient').split(' ');\n for (var i = 0; i < styles.length; i++) {\n if (styles[i] in div) return true;\n }\n })(),\n \n observer: (function () {\n return ('MutationObserver' in window || 'WebkitMutationObserver' in window);\n })(),\n \n passiveListener: (function () {\n var supportsPassive = false;\n try {\n var opts = Object.defineProperty({}, 'passive', {\n get: function() {\n supportsPassive = true;\n }\n });\n window.addEventListener('testPassiveListener', null, opts);\n } catch (e) {}\n return supportsPassive;\n })(),\n \n gestures: (function () {\n return 'ongesturestart' in window;\n })()\n },\n /*==================================================\n Plugins\n ====================================================*/\n plugins: {}\n };\n \n\n /*===========================\n Get Dom libraries\n ===========================*/\n var swiperDomPlugins = ['jQuery', 'Zepto', 'Dom7'];\n for (var i = 0; i < swiperDomPlugins.length; i++) {\n \tif (window[swiperDomPlugins[i]]) {\n \t\taddLibraryPlugin(window[swiperDomPlugins[i]]);\n \t}\n }\n // Required DOM Plugins\n var domLib;\n if (typeof Dom7 === 'undefined') {\n \tdomLib = window.Dom7 || window.Zepto || window.jQuery;\n }\n else {\n \tdomLib = Dom7;\n }\n\n /*===========================\n Add .swiper plugin from Dom libraries\n ===========================*/\n function addLibraryPlugin(lib) {\n lib.fn.swiper = function (params) {\n var firstInstance;\n lib(this).each(function () {\n var s = new Swiper(this, params);\n if (!firstInstance) firstInstance = s;\n });\n return firstInstance;\n };\n }\n \n if (domLib) {\n if (!('transitionEnd' in domLib.fn)) {\n domLib.fn.transitionEnd = function (callback) {\n var events = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'],\n i, j, dom = this;\n function fireCallBack(e) {\n /*jshint validthis:true */\n if (e.target !== this) return;\n callback.call(this, e);\n for (i = 0; i < events.length; i++) {\n dom.off(events[i], fireCallBack);\n }\n }\n if (callback) {\n for (i = 0; i < events.length; i++) {\n dom.on(events[i], fireCallBack);\n }\n }\n return this;\n };\n }\n if (!('transform' in domLib.fn)) {\n domLib.fn.transform = function (transform) {\n for (var i = 0; i < this.length; i++) {\n var elStyle = this[i].style;\n elStyle.webkitTransform = elStyle.MsTransform = elStyle.msTransform = elStyle.MozTransform = elStyle.OTransform = elStyle.transform = transform;\n }\n return this;\n };\n }\n if (!('transition' in domLib.fn)) {\n domLib.fn.transition = function (duration) {\n if (typeof duration !== 'string') {\n duration = duration + 'ms';\n }\n for (var i = 0; i < this.length; i++) {\n var elStyle = this[i].style;\n elStyle.webkitTransitionDuration = elStyle.MsTransitionDuration = elStyle.msTransitionDuration = elStyle.MozTransitionDuration = elStyle.OTransitionDuration = elStyle.transitionDuration = duration;\n }\n return this;\n };\n }\n if (!('outerWidth' in domLib.fn)) {\n domLib.fn.outerWidth = function (includeMargins) {\n if (this.length > 0) {\n if (includeMargins)\n return this[0].offsetWidth + parseFloat(this.css('margin-right')) + parseFloat(this.css('margin-left'));\n else\n return this[0].offsetWidth;\n }\n else return null;\n };\n }\n }\n\n window.Swiper = Swiper;\n})();\n/*===========================\nSwiper AMD Export\n===========================*/\nif (typeof(module) !== 'undefined')\n{\n module.exports = window.Swiper;\n}\nelse if (typeof define === 'function' && define.amd) {\n define([], function () {\n 'use strict';\n return window.Swiper;\n });\n}\n//# sourceMappingURL=maps/swiper.jquery.js.map\n"]}
|
assets/swiper/swiper.jquery.js
ADDED
@@ -0,0 +1,4630 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Swiper 3.4.0
|
3 |
+
* Most modern mobile touch slider and framework with hardware accelerated transitions
|
4 |
+
*
|
5 |
+
* http://www.idangero.us/swiper/
|
6 |
+
*
|
7 |
+
* Copyright 2016, Vladimir Kharlampidi
|
8 |
+
* The iDangero.us
|
9 |
+
* http://www.idangero.us/
|
10 |
+
*
|
11 |
+
* Licensed under MIT
|
12 |
+
*
|
13 |
+
* Released on: October 16, 2016
|
14 |
+
*/
|
15 |
+
(function () {
|
16 |
+
'use strict';
|
17 |
+
var $;
|
18 |
+
/*===========================
|
19 |
+
Swiper
|
20 |
+
===========================*/
|
21 |
+
var Swiper = function (container, params) {
|
22 |
+
if (!(this instanceof Swiper)) return new Swiper(container, params);
|
23 |
+
|
24 |
+
var defaults = {
|
25 |
+
direction: 'horizontal',
|
26 |
+
touchEventsTarget: 'container',
|
27 |
+
initialSlide: 0,
|
28 |
+
speed: 300,
|
29 |
+
// autoplay
|
30 |
+
autoplay: false,
|
31 |
+
autoplayDisableOnInteraction: true,
|
32 |
+
autoplayStopOnLast: false,
|
33 |
+
// To support iOS's swipe-to-go-back gesture (when being used in-app, with UIWebView).
|
34 |
+
iOSEdgeSwipeDetection: false,
|
35 |
+
iOSEdgeSwipeThreshold: 20,
|
36 |
+
// Free mode
|
37 |
+
freeMode: false,
|
38 |
+
freeModeMomentum: true,
|
39 |
+
freeModeMomentumRatio: 1,
|
40 |
+
freeModeMomentumBounce: true,
|
41 |
+
freeModeMomentumBounceRatio: 1,
|
42 |
+
freeModeMomentumVelocityRatio: 1,
|
43 |
+
freeModeSticky: false,
|
44 |
+
freeModeMinimumVelocity: 0.02,
|
45 |
+
// Autoheight
|
46 |
+
autoHeight: false,
|
47 |
+
// Set wrapper width
|
48 |
+
setWrapperSize: false,
|
49 |
+
// Virtual Translate
|
50 |
+
virtualTranslate: false,
|
51 |
+
// Effects
|
52 |
+
effect: 'slide', // 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip'
|
53 |
+
coverflow: {
|
54 |
+
rotate: 50,
|
55 |
+
stretch: 0,
|
56 |
+
depth: 100,
|
57 |
+
modifier: 1,
|
58 |
+
slideShadows : true
|
59 |
+
},
|
60 |
+
flip: {
|
61 |
+
slideShadows : true,
|
62 |
+
limitRotation: true
|
63 |
+
},
|
64 |
+
cube: {
|
65 |
+
slideShadows: true,
|
66 |
+
shadow: true,
|
67 |
+
shadowOffset: 20,
|
68 |
+
shadowScale: 0.94
|
69 |
+
},
|
70 |
+
fade: {
|
71 |
+
crossFade: false
|
72 |
+
},
|
73 |
+
// Parallax
|
74 |
+
parallax: false,
|
75 |
+
// Zoom
|
76 |
+
zoom: false,
|
77 |
+
zoomMax: 3,
|
78 |
+
zoomMin: 1,
|
79 |
+
zoomToggle: true,
|
80 |
+
// Scrollbar
|
81 |
+
scrollbar: null,
|
82 |
+
scrollbarHide: true,
|
83 |
+
scrollbarDraggable: false,
|
84 |
+
scrollbarSnapOnRelease: false,
|
85 |
+
// Keyboard Mousewheel
|
86 |
+
keyboardControl: false,
|
87 |
+
mousewheelControl: false,
|
88 |
+
mousewheelReleaseOnEdges: false,
|
89 |
+
mousewheelInvert: false,
|
90 |
+
mousewheelForceToAxis: false,
|
91 |
+
mousewheelSensitivity: 1,
|
92 |
+
mousewheelEventsTarged: 'container',
|
93 |
+
// Hash Navigation
|
94 |
+
hashnav: false,
|
95 |
+
hashnavWatchState: false,
|
96 |
+
// History
|
97 |
+
history: false,
|
98 |
+
// Commong Nav State
|
99 |
+
replaceState: false,
|
100 |
+
// Breakpoints
|
101 |
+
breakpoints: undefined,
|
102 |
+
// Slides grid
|
103 |
+
spaceBetween: 0,
|
104 |
+
slidesPerView: 1,
|
105 |
+
slidesPerColumn: 1,
|
106 |
+
slidesPerColumnFill: 'column',
|
107 |
+
slidesPerGroup: 1,
|
108 |
+
centeredSlides: false,
|
109 |
+
slidesOffsetBefore: 0, // in px
|
110 |
+
slidesOffsetAfter: 0, // in px
|
111 |
+
// Round length
|
112 |
+
roundLengths: false,
|
113 |
+
// Touches
|
114 |
+
touchRatio: 1,
|
115 |
+
touchAngle: 45,
|
116 |
+
simulateTouch: true,
|
117 |
+
shortSwipes: true,
|
118 |
+
longSwipes: true,
|
119 |
+
longSwipesRatio: 0.5,
|
120 |
+
longSwipesMs: 300,
|
121 |
+
followFinger: true,
|
122 |
+
onlyExternal: false,
|
123 |
+
threshold: 0,
|
124 |
+
touchMoveStopPropagation: true,
|
125 |
+
touchReleaseOnEdges: false,
|
126 |
+
// Unique Navigation Elements
|
127 |
+
uniqueNavElements: true,
|
128 |
+
// Pagination
|
129 |
+
pagination: null,
|
130 |
+
paginationElement: 'span',
|
131 |
+
paginationClickable: false,
|
132 |
+
paginationHide: false,
|
133 |
+
paginationBulletRender: null,
|
134 |
+
paginationProgressRender: null,
|
135 |
+
paginationFractionRender: null,
|
136 |
+
paginationCustomRender: null,
|
137 |
+
paginationType: 'bullets', // 'bullets' or 'progress' or 'fraction' or 'custom'
|
138 |
+
// Resistance
|
139 |
+
resistance: true,
|
140 |
+
resistanceRatio: 0.85,
|
141 |
+
// Next/prev buttons
|
142 |
+
nextButton: null,
|
143 |
+
prevButton: null,
|
144 |
+
// Progress
|
145 |
+
watchSlidesProgress: false,
|
146 |
+
watchSlidesVisibility: false,
|
147 |
+
// Cursor
|
148 |
+
grabCursor: false,
|
149 |
+
// Clicks
|
150 |
+
preventClicks: true,
|
151 |
+
preventClicksPropagation: true,
|
152 |
+
slideToClickedSlide: false,
|
153 |
+
// Lazy Loading
|
154 |
+
lazyLoading: false,
|
155 |
+
lazyLoadingInPrevNext: false,
|
156 |
+
lazyLoadingInPrevNextAmount: 1,
|
157 |
+
lazyLoadingOnTransitionStart: false,
|
158 |
+
// Images
|
159 |
+
preloadImages: true,
|
160 |
+
updateOnImagesReady: true,
|
161 |
+
// loop
|
162 |
+
loop: false,
|
163 |
+
loopAdditionalSlides: 0,
|
164 |
+
loopedSlides: null,
|
165 |
+
// Control
|
166 |
+
control: undefined,
|
167 |
+
controlInverse: false,
|
168 |
+
controlBy: 'slide', //or 'container'
|
169 |
+
normalizeSlideIndex: true,
|
170 |
+
// Swiping/no swiping
|
171 |
+
allowSwipeToPrev: true,
|
172 |
+
allowSwipeToNext: true,
|
173 |
+
swipeHandler: null, //'.swipe-handler',
|
174 |
+
noSwiping: true,
|
175 |
+
noSwipingClass: 'swiper-no-swiping',
|
176 |
+
// Passive Listeners
|
177 |
+
passiveListeners: true,
|
178 |
+
// NS
|
179 |
+
containerModifierClass: 'swiper-container-', // NEW
|
180 |
+
slideClass: 'swiper-slide',
|
181 |
+
slideActiveClass: 'swiper-slide-active',
|
182 |
+
slideDuplicateActiveClass: 'swiper-slide-duplicate-active',
|
183 |
+
slideVisibleClass: 'swiper-slide-visible',
|
184 |
+
slideDuplicateClass: 'swiper-slide-duplicate',
|
185 |
+
slideNextClass: 'swiper-slide-next',
|
186 |
+
slideDuplicateNextClass: 'swiper-slide-duplicate-next',
|
187 |
+
slidePrevClass: 'swiper-slide-prev',
|
188 |
+
slideDuplicatePrevClass: 'swiper-slide-duplicate-prev',
|
189 |
+
wrapperClass: 'swiper-wrapper',
|
190 |
+
bulletClass: 'swiper-pagination-bullet',
|
191 |
+
bulletActiveClass: 'swiper-pagination-bullet-active',
|
192 |
+
buttonDisabledClass: 'swiper-button-disabled',
|
193 |
+
paginationCurrentClass: 'swiper-pagination-current',
|
194 |
+
paginationTotalClass: 'swiper-pagination-total',
|
195 |
+
paginationHiddenClass: 'swiper-pagination-hidden',
|
196 |
+
paginationProgressbarClass: 'swiper-pagination-progressbar',
|
197 |
+
paginationClickableClass: 'swiper-pagination-clickable', // NEW
|
198 |
+
paginationModifierClass: 'swiper-pagination-', // NEW
|
199 |
+
lazyLoadingClass: 'swiper-lazy',
|
200 |
+
lazyStatusLoadingClass: 'swiper-lazy-loading',
|
201 |
+
lazyStatusLoadedClass: 'swiper-lazy-loaded',
|
202 |
+
lazyPreloaderClass: 'swiper-lazy-preloader',
|
203 |
+
notificationClass: 'swiper-notification',
|
204 |
+
preloaderClass: 'preloader',
|
205 |
+
zoomContainerClass: 'swiper-zoom-container',
|
206 |
+
|
207 |
+
// Observer
|
208 |
+
observer: false,
|
209 |
+
observeParents: false,
|
210 |
+
// Accessibility
|
211 |
+
a11y: false,
|
212 |
+
prevSlideMessage: 'Previous slide',
|
213 |
+
nextSlideMessage: 'Next slide',
|
214 |
+
firstSlideMessage: 'This is the first slide',
|
215 |
+
lastSlideMessage: 'This is the last slide',
|
216 |
+
paginationBulletMessage: 'Go to slide {{index}}',
|
217 |
+
// Callbacks
|
218 |
+
runCallbacksOnInit: true
|
219 |
+
/*
|
220 |
+
Callbacks:
|
221 |
+
onInit: function (swiper)
|
222 |
+
onDestroy: function (swiper)
|
223 |
+
onClick: function (swiper, e)
|
224 |
+
onTap: function (swiper, e)
|
225 |
+
onDoubleTap: function (swiper, e)
|
226 |
+
onSliderMove: function (swiper, e)
|
227 |
+
onSlideChangeStart: function (swiper)
|
228 |
+
onSlideChangeEnd: function (swiper)
|
229 |
+
onTransitionStart: function (swiper)
|
230 |
+
onTransitionEnd: function (swiper)
|
231 |
+
onImagesReady: function (swiper)
|
232 |
+
onProgress: function (swiper, progress)
|
233 |
+
onTouchStart: function (swiper, e)
|
234 |
+
onTouchMove: function (swiper, e)
|
235 |
+
onTouchMoveOpposite: function (swiper, e)
|
236 |
+
onTouchEnd: function (swiper, e)
|
237 |
+
onReachBeginning: function (swiper)
|
238 |
+
onReachEnd: function (swiper)
|
239 |
+
onSetTransition: function (swiper, duration)
|
240 |
+
onSetTranslate: function (swiper, translate)
|
241 |
+
onAutoplayStart: function (swiper)
|
242 |
+
onAutoplayStop: function (swiper),
|
243 |
+
onLazyImageLoad: function (swiper, slide, image)
|
244 |
+
onLazyImageReady: function (swiper, slide, image)
|
245 |
+
*/
|
246 |
+
|
247 |
+
};
|
248 |
+
var initialVirtualTranslate = params && params.virtualTranslate;
|
249 |
+
|
250 |
+
params = params || {};
|
251 |
+
var originalParams = {};
|
252 |
+
for (var param in params) {
|
253 |
+
if (typeof params[param] === 'object' && params[param] !== null && !(params[param].nodeType || params[param] === window || params[param] === document || (typeof Dom7 !== 'undefined' && params[param] instanceof Dom7) || (typeof jQuery !== 'undefined' && params[param] instanceof jQuery))) {
|
254 |
+
originalParams[param] = {};
|
255 |
+
for (var deepParam in params[param]) {
|
256 |
+
originalParams[param][deepParam] = params[param][deepParam];
|
257 |
+
}
|
258 |
+
}
|
259 |
+
else {
|
260 |
+
originalParams[param] = params[param];
|
261 |
+
}
|
262 |
+
}
|
263 |
+
for (var def in defaults) {
|
264 |
+
if (typeof params[def] === 'undefined') {
|
265 |
+
params[def] = defaults[def];
|
266 |
+
}
|
267 |
+
else if (typeof params[def] === 'object') {
|
268 |
+
for (var deepDef in defaults[def]) {
|
269 |
+
if (typeof params[def][deepDef] === 'undefined') {
|
270 |
+
params[def][deepDef] = defaults[def][deepDef];
|
271 |
+
}
|
272 |
+
}
|
273 |
+
}
|
274 |
+
}
|
275 |
+
|
276 |
+
// Swiper
|
277 |
+
var s = this;
|
278 |
+
|
279 |
+
// Params
|
280 |
+
s.params = params;
|
281 |
+
s.originalParams = originalParams;
|
282 |
+
|
283 |
+
// Classname
|
284 |
+
s.classNames = [];
|
285 |
+
/*=========================
|
286 |
+
Dom Library and plugins
|
287 |
+
===========================*/
|
288 |
+
if (typeof $ !== 'undefined' && typeof Dom7 !== 'undefined'){
|
289 |
+
$ = Dom7;
|
290 |
+
}
|
291 |
+
if (typeof $ === 'undefined') {
|
292 |
+
if (typeof Dom7 === 'undefined') {
|
293 |
+
$ = window.Dom7 || window.Zepto || window.jQuery;
|
294 |
+
}
|
295 |
+
else {
|
296 |
+
$ = Dom7;
|
297 |
+
}
|
298 |
+
if (!$) return;
|
299 |
+
}
|
300 |
+
// Export it to Swiper instance
|
301 |
+
s.$ = $;
|
302 |
+
|
303 |
+
/*=========================
|
304 |
+
Breakpoints
|
305 |
+
===========================*/
|
306 |
+
s.currentBreakpoint = undefined;
|
307 |
+
s.getActiveBreakpoint = function () {
|
308 |
+
//Get breakpoint for window width
|
309 |
+
if (!s.params.breakpoints) return false;
|
310 |
+
var breakpoint = false;
|
311 |
+
var points = [], point;
|
312 |
+
for ( point in s.params.breakpoints ) {
|
313 |
+
if (s.params.breakpoints.hasOwnProperty(point)) {
|
314 |
+
points.push(point);
|
315 |
+
}
|
316 |
+
}
|
317 |
+
points.sort(function (a, b) {
|
318 |
+
return parseInt(a, 10) > parseInt(b, 10);
|
319 |
+
});
|
320 |
+
for (var i = 0; i < points.length; i++) {
|
321 |
+
point = points[i];
|
322 |
+
if (point >= window.innerWidth && !breakpoint) {
|
323 |
+
breakpoint = point;
|
324 |
+
}
|
325 |
+
}
|
326 |
+
return breakpoint || 'max';
|
327 |
+
};
|
328 |
+
s.setBreakpoint = function () {
|
329 |
+
//Set breakpoint for window width and update parameters
|
330 |
+
var breakpoint = s.getActiveBreakpoint();
|
331 |
+
if (breakpoint && s.currentBreakpoint !== breakpoint) {
|
332 |
+
var breakPointsParams = breakpoint in s.params.breakpoints ? s.params.breakpoints[breakpoint] : s.originalParams;
|
333 |
+
var needsReLoop = s.params.loop && (breakPointsParams.slidesPerView !== s.params.slidesPerView);
|
334 |
+
for ( var param in breakPointsParams ) {
|
335 |
+
s.params[param] = breakPointsParams[param];
|
336 |
+
}
|
337 |
+
s.currentBreakpoint = breakpoint;
|
338 |
+
if(needsReLoop && s.destroyLoop) {
|
339 |
+
s.reLoop(true);
|
340 |
+
}
|
341 |
+
}
|
342 |
+
};
|
343 |
+
// Set breakpoint on load
|
344 |
+
if (s.params.breakpoints) {
|
345 |
+
s.setBreakpoint();
|
346 |
+
}
|
347 |
+
|
348 |
+
/*=========================
|
349 |
+
Preparation - Define Container, Wrapper and Pagination
|
350 |
+
===========================*/
|
351 |
+
s.container = $(container);
|
352 |
+
if (s.container.length === 0) return;
|
353 |
+
if (s.container.length > 1) {
|
354 |
+
var swipers = [];
|
355 |
+
s.container.each(function () {
|
356 |
+
var container = this;
|
357 |
+
swipers.push(new Swiper(this, params));
|
358 |
+
});
|
359 |
+
return swipers;
|
360 |
+
}
|
361 |
+
|
362 |
+
// Save instance in container HTML Element and in data
|
363 |
+
s.container[0].swiper = s;
|
364 |
+
s.container.data('swiper', s);
|
365 |
+
|
366 |
+
s.classNames.push(s.params.containerModifierClass + s.params.direction);
|
367 |
+
|
368 |
+
if (s.params.freeMode) {
|
369 |
+
s.classNames.push(s.params.containerModifierClass + 'free-mode');
|
370 |
+
}
|
371 |
+
if (!s.support.flexbox) {
|
372 |
+
s.classNames.push(s.params.containerModifierClass + 'no-flexbox');
|
373 |
+
s.params.slidesPerColumn = 1;
|
374 |
+
}
|
375 |
+
if (s.params.autoHeight) {
|
376 |
+
s.classNames.push(s.params.containerModifierClass + 'autoheight');
|
377 |
+
}
|
378 |
+
// Enable slides progress when required
|
379 |
+
if (s.params.parallax || s.params.watchSlidesVisibility) {
|
380 |
+
s.params.watchSlidesProgress = true;
|
381 |
+
}
|
382 |
+
// Max resistance when touchReleaseOnEdges
|
383 |
+
if (s.params.touchReleaseOnEdges) {
|
384 |
+
s.params.resistanceRatio = 0;
|
385 |
+
}
|
386 |
+
// Coverflow / 3D
|
387 |
+
if (['cube', 'coverflow', 'flip'].indexOf(s.params.effect) >= 0) {
|
388 |
+
if (s.support.transforms3d) {
|
389 |
+
s.params.watchSlidesProgress = true;
|
390 |
+
s.classNames.push(s.params.containerModifierClass + '3d');
|
391 |
+
}
|
392 |
+
else {
|
393 |
+
s.params.effect = 'slide';
|
394 |
+
}
|
395 |
+
}
|
396 |
+
if (s.params.effect !== 'slide') {
|
397 |
+
s.classNames.push(s.params.containerModifierClass + s.params.effect);
|
398 |
+
}
|
399 |
+
if (s.params.effect === 'cube') {
|
400 |
+
s.params.resistanceRatio = 0;
|
401 |
+
s.params.slidesPerView = 1;
|
402 |
+
s.params.slidesPerColumn = 1;
|
403 |
+
s.params.slidesPerGroup = 1;
|
404 |
+
s.params.centeredSlides = false;
|
405 |
+
s.params.spaceBetween = 0;
|
406 |
+
s.params.virtualTranslate = true;
|
407 |
+
s.params.setWrapperSize = false;
|
408 |
+
}
|
409 |
+
if (s.params.effect === 'fade' || s.params.effect === 'flip') {
|
410 |
+
s.params.slidesPerView = 1;
|
411 |
+
s.params.slidesPerColumn = 1;
|
412 |
+
s.params.slidesPerGroup = 1;
|
413 |
+
s.params.watchSlidesProgress = true;
|
414 |
+
s.params.spaceBetween = 0;
|
415 |
+
s.params.setWrapperSize = false;
|
416 |
+
if (typeof initialVirtualTranslate === 'undefined') {
|
417 |
+
s.params.virtualTranslate = true;
|
418 |
+
}
|
419 |
+
}
|
420 |
+
|
421 |
+
// Grab Cursor
|
422 |
+
if (s.params.grabCursor && s.support.touch) {
|
423 |
+
s.params.grabCursor = false;
|
424 |
+
}
|
425 |
+
|
426 |
+
// Wrapper
|
427 |
+
s.wrapper = s.container.children('.' + s.params.wrapperClass);
|
428 |
+
|
429 |
+
// Pagination
|
430 |
+
if (s.params.pagination) {
|
431 |
+
s.paginationContainer = $(s.params.pagination);
|
432 |
+
if (s.params.uniqueNavElements && typeof s.params.pagination === 'string' && s.paginationContainer.length > 1 && s.container.find(s.params.pagination).length === 1) {
|
433 |
+
s.paginationContainer = s.container.find(s.params.pagination);
|
434 |
+
}
|
435 |
+
|
436 |
+
if (s.params.paginationType === 'bullets' && s.params.paginationClickable) {
|
437 |
+
s.paginationContainer.addClass(s.params.paginationModifierClass + 'clickable');
|
438 |
+
}
|
439 |
+
else {
|
440 |
+
s.params.paginationClickable = false;
|
441 |
+
}
|
442 |
+
s.paginationContainer.addClass(s.params.paginationModifierClass + s.params.paginationType);
|
443 |
+
}
|
444 |
+
// Next/Prev Buttons
|
445 |
+
if (s.params.nextButton || s.params.prevButton) {
|
446 |
+
if (s.params.nextButton) {
|
447 |
+
s.nextButton = $(s.params.nextButton);
|
448 |
+
if (s.params.uniqueNavElements && typeof s.params.nextButton === 'string' && s.nextButton.length > 1 && s.container.find(s.params.nextButton).length === 1) {
|
449 |
+
s.nextButton = s.container.find(s.params.nextButton);
|
450 |
+
}
|
451 |
+
}
|
452 |
+
if (s.params.prevButton) {
|
453 |
+
s.prevButton = $(s.params.prevButton);
|
454 |
+
if (s.params.uniqueNavElements && typeof s.params.prevButton === 'string' && s.prevButton.length > 1 && s.container.find(s.params.prevButton).length === 1) {
|
455 |
+
s.prevButton = s.container.find(s.params.prevButton);
|
456 |
+
}
|
457 |
+
}
|
458 |
+
}
|
459 |
+
|
460 |
+
// Is Horizontal
|
461 |
+
s.isHorizontal = function () {
|
462 |
+
return s.params.direction === 'horizontal';
|
463 |
+
};
|
464 |
+
// s.isH = isH;
|
465 |
+
|
466 |
+
// RTL
|
467 |
+
s.rtl = s.isHorizontal() && (s.container[0].dir.toLowerCase() === 'rtl' || s.container.css('direction') === 'rtl');
|
468 |
+
if (s.rtl) {
|
469 |
+
s.classNames.push(s.params.containerModifierClass + 'rtl');
|
470 |
+
}
|
471 |
+
|
472 |
+
// Wrong RTL support
|
473 |
+
if (s.rtl) {
|
474 |
+
s.wrongRTL = s.wrapper.css('display') === '-webkit-box';
|
475 |
+
}
|
476 |
+
|
477 |
+
// Columns
|
478 |
+
if (s.params.slidesPerColumn > 1) {
|
479 |
+
s.classNames.push(s.params.containerModifierClass + 'multirow');
|
480 |
+
}
|
481 |
+
|
482 |
+
// Check for Android
|
483 |
+
if (s.device.android) {
|
484 |
+
s.classNames.push(s.params.containerModifierClass + 'android');
|
485 |
+
}
|
486 |
+
|
487 |
+
// Add classes
|
488 |
+
s.container.addClass(s.classNames.join(' '));
|
489 |
+
|
490 |
+
// Translate
|
491 |
+
s.translate = 0;
|
492 |
+
|
493 |
+
// Progress
|
494 |
+
s.progress = 0;
|
495 |
+
|
496 |
+
// Velocity
|
497 |
+
s.velocity = 0;
|
498 |
+
|
499 |
+
/*=========================
|
500 |
+
Locks, unlocks
|
501 |
+
===========================*/
|
502 |
+
s.lockSwipeToNext = function () {
|
503 |
+
s.params.allowSwipeToNext = false;
|
504 |
+
if (s.params.allowSwipeToPrev === false && s.params.grabCursor) {
|
505 |
+
s.unsetGrabCursor();
|
506 |
+
}
|
507 |
+
};
|
508 |
+
s.lockSwipeToPrev = function () {
|
509 |
+
s.params.allowSwipeToPrev = false;
|
510 |
+
if (s.params.allowSwipeToNext === false && s.params.grabCursor) {
|
511 |
+
s.unsetGrabCursor();
|
512 |
+
}
|
513 |
+
};
|
514 |
+
s.lockSwipes = function () {
|
515 |
+
s.params.allowSwipeToNext = s.params.allowSwipeToPrev = false;
|
516 |
+
if (s.params.grabCursor) s.unsetGrabCursor();
|
517 |
+
};
|
518 |
+
s.unlockSwipeToNext = function () {
|
519 |
+
s.params.allowSwipeToNext = true;
|
520 |
+
if (s.params.allowSwipeToPrev === true && s.params.grabCursor) {
|
521 |
+
s.setGrabCursor();
|
522 |
+
}
|
523 |
+
};
|
524 |
+
s.unlockSwipeToPrev = function () {
|
525 |
+
s.params.allowSwipeToPrev = true;
|
526 |
+
if (s.params.allowSwipeToNext === true && s.params.grabCursor) {
|
527 |
+
s.setGrabCursor();
|
528 |
+
}
|
529 |
+
};
|
530 |
+
s.unlockSwipes = function () {
|
531 |
+
s.params.allowSwipeToNext = s.params.allowSwipeToPrev = true;
|
532 |
+
if (s.params.grabCursor) s.setGrabCursor();
|
533 |
+
};
|
534 |
+
|
535 |
+
/*=========================
|
536 |
+
Round helper
|
537 |
+
===========================*/
|
538 |
+
function round(a) {
|
539 |
+
return Math.floor(a);
|
540 |
+
}
|
541 |
+
/*=========================
|
542 |
+
Set grab cursor
|
543 |
+
===========================*/
|
544 |
+
s.setGrabCursor = function(moving) {
|
545 |
+
s.container[0].style.cursor = 'move';
|
546 |
+
s.container[0].style.cursor = moving ? '-webkit-grabbing' : '-webkit-grab';
|
547 |
+
s.container[0].style.cursor = moving ? '-moz-grabbin' : '-moz-grab';
|
548 |
+
s.container[0].style.cursor = moving ? 'grabbing': 'grab';
|
549 |
+
};
|
550 |
+
s.unsetGrabCursor = function () {
|
551 |
+
s.container[0].style.cursor = '';
|
552 |
+
};
|
553 |
+
if (s.params.grabCursor) {
|
554 |
+
s.setGrabCursor();
|
555 |
+
}
|
556 |
+
/*=========================
|
557 |
+
Update on Images Ready
|
558 |
+
===========================*/
|
559 |
+
s.imagesToLoad = [];
|
560 |
+
s.imagesLoaded = 0;
|
561 |
+
|
562 |
+
s.loadImage = function (imgElement, src, srcset, sizes, checkForComplete, callback) {
|
563 |
+
var image;
|
564 |
+
function onReady () {
|
565 |
+
if (callback) callback();
|
566 |
+
}
|
567 |
+
if (!imgElement.complete || !checkForComplete) {
|
568 |
+
if (src) {
|
569 |
+
image = new window.Image();
|
570 |
+
image.onload = onReady;
|
571 |
+
image.onerror = onReady;
|
572 |
+
if (sizes) {
|
573 |
+
image.sizes = sizes;
|
574 |
+
}
|
575 |
+
if (srcset) {
|
576 |
+
image.srcset = srcset;
|
577 |
+
}
|
578 |
+
if (src) {
|
579 |
+
image.src = src;
|
580 |
+
}
|
581 |
+
} else {
|
582 |
+
onReady();
|
583 |
+
}
|
584 |
+
|
585 |
+
} else {//image already loaded...
|
586 |
+
onReady();
|
587 |
+
}
|
588 |
+
};
|
589 |
+
s.preloadImages = function () {
|
590 |
+
s.imagesToLoad = s.container.find('img');
|
591 |
+
function _onReady() {
|
592 |
+
if (typeof s === 'undefined' || s === null) return;
|
593 |
+
if (s.imagesLoaded !== undefined) s.imagesLoaded++;
|
594 |
+
if (s.imagesLoaded === s.imagesToLoad.length) {
|
595 |
+
if (s.params.updateOnImagesReady) s.update();
|
596 |
+
s.emit('onImagesReady', s);
|
597 |
+
}
|
598 |
+
}
|
599 |
+
for (var i = 0; i < s.imagesToLoad.length; i++) {
|
600 |
+
s.loadImage(s.imagesToLoad[i], (s.imagesToLoad[i].currentSrc || s.imagesToLoad[i].getAttribute('src')), (s.imagesToLoad[i].srcset || s.imagesToLoad[i].getAttribute('srcset')), s.imagesToLoad[i].sizes || s.imagesToLoad[i].getAttribute('sizes'), true, _onReady);
|
601 |
+
}
|
602 |
+
};
|
603 |
+
|
604 |
+
/*=========================
|
605 |
+
Autoplay
|
606 |
+
===========================*/
|
607 |
+
s.autoplayTimeoutId = undefined;
|
608 |
+
s.autoplaying = false;
|
609 |
+
s.autoplayPaused = false;
|
610 |
+
function autoplay() {
|
611 |
+
var autoplayDelay = s.params.autoplay;
|
612 |
+
var activeSlide = s.slides.eq(s.activeIndex);
|
613 |
+
if (activeSlide.attr('data-swiper-autoplay')) {
|
614 |
+
autoplayDelay = activeSlide.attr('data-swiper-autoplay') || s.params.autoplay;
|
615 |
+
}
|
616 |
+
s.autoplayTimeoutId = setTimeout(function () {
|
617 |
+
if (s.params.loop) {
|
618 |
+
s.fixLoop();
|
619 |
+
s._slideNext();
|
620 |
+
s.emit('onAutoplay', s);
|
621 |
+
}
|
622 |
+
else {
|
623 |
+
if (!s.isEnd) {
|
624 |
+
s._slideNext();
|
625 |
+
s.emit('onAutoplay', s);
|
626 |
+
}
|
627 |
+
else {
|
628 |
+
if (!params.autoplayStopOnLast) {
|
629 |
+
s._slideTo(0);
|
630 |
+
s.emit('onAutoplay', s);
|
631 |
+
}
|
632 |
+
else {
|
633 |
+
s.stopAutoplay();
|
634 |
+
}
|
635 |
+
}
|
636 |
+
}
|
637 |
+
}, autoplayDelay);
|
638 |
+
}
|
639 |
+
s.startAutoplay = function () {
|
640 |
+
if (typeof s.autoplayTimeoutId !== 'undefined') return false;
|
641 |
+
if (!s.params.autoplay) return false;
|
642 |
+
if (s.autoplaying) return false;
|
643 |
+
s.autoplaying = true;
|
644 |
+
s.emit('onAutoplayStart', s);
|
645 |
+
autoplay();
|
646 |
+
};
|
647 |
+
s.stopAutoplay = function (internal) {
|
648 |
+
if (!s.autoplayTimeoutId) return;
|
649 |
+
if (s.autoplayTimeoutId) clearTimeout(s.autoplayTimeoutId);
|
650 |
+
s.autoplaying = false;
|
651 |
+
s.autoplayTimeoutId = undefined;
|
652 |
+
s.emit('onAutoplayStop', s);
|
653 |
+
};
|
654 |
+
s.pauseAutoplay = function (speed) {
|
655 |
+
if (s.autoplayPaused) return;
|
656 |
+
if (s.autoplayTimeoutId) clearTimeout(s.autoplayTimeoutId);
|
657 |
+
s.autoplayPaused = true;
|
658 |
+
if (speed === 0) {
|
659 |
+
s.autoplayPaused = false;
|
660 |
+
autoplay();
|
661 |
+
}
|
662 |
+
else {
|
663 |
+
s.wrapper.transitionEnd(function () {
|
664 |
+
if (!s) return;
|
665 |
+
s.autoplayPaused = false;
|
666 |
+
if (!s.autoplaying) {
|
667 |
+
s.stopAutoplay();
|
668 |
+
}
|
669 |
+
else {
|
670 |
+
autoplay();
|
671 |
+
}
|
672 |
+
});
|
673 |
+
}
|
674 |
+
};
|
675 |
+
/*=========================
|
676 |
+
Min/Max Translate
|
677 |
+
===========================*/
|
678 |
+
s.minTranslate = function () {
|
679 |
+
return (-s.snapGrid[0]);
|
680 |
+
};
|
681 |
+
s.maxTranslate = function () {
|
682 |
+
return (-s.snapGrid[s.snapGrid.length - 1]);
|
683 |
+
};
|
684 |
+
/*=========================
|
685 |
+
Slider/slides sizes
|
686 |
+
===========================*/
|
687 |
+
s.updateAutoHeight = function () {
|
688 |
+
var activeSlides = [];
|
689 |
+
var newHeight = 0;
|
690 |
+
|
691 |
+
// Find slides currently in view
|
692 |
+
if(s.params.slidesPerView !== 'auto' && s.params.slidesPerView > 1) {
|
693 |
+
for (i = 0; i < Math.ceil(s.params.slidesPerView); i++) {
|
694 |
+
var index = s.activeIndex + i;
|
695 |
+
if(index > s.slides.length) break;
|
696 |
+
activeSlides.push(s.slides.eq(index)[0]);
|
697 |
+
}
|
698 |
+
} else {
|
699 |
+
activeSlides.push(s.slides.eq(s.activeIndex)[0]);
|
700 |
+
}
|
701 |
+
|
702 |
+
// Find new height from heighest slide in view
|
703 |
+
for (i = 0; i < activeSlides.length; i++) {
|
704 |
+
if (typeof activeSlides[i] !== 'undefined') {
|
705 |
+
var height = activeSlides[i].offsetHeight;
|
706 |
+
newHeight = height > newHeight ? height : newHeight;
|
707 |
+
}
|
708 |
+
}
|
709 |
+
|
710 |
+
// Update Height
|
711 |
+
if (newHeight) s.wrapper.css('height', newHeight + 'px');
|
712 |
+
};
|
713 |
+
s.updateContainerSize = function () {
|
714 |
+
var width, height;
|
715 |
+
if (typeof s.params.width !== 'undefined') {
|
716 |
+
width = s.params.width;
|
717 |
+
}
|
718 |
+
else {
|
719 |
+
width = s.container[0].clientWidth;
|
720 |
+
}
|
721 |
+
if (typeof s.params.height !== 'undefined') {
|
722 |
+
height = s.params.height;
|
723 |
+
}
|
724 |
+
else {
|
725 |
+
height = s.container[0].clientHeight;
|
726 |
+
}
|
727 |
+
if (width === 0 && s.isHorizontal() || height === 0 && !s.isHorizontal()) {
|
728 |
+
return;
|
729 |
+
}
|
730 |
+
|
731 |
+
//Subtract paddings
|
732 |
+
width = width - parseInt(s.container.css('padding-left'), 10) - parseInt(s.container.css('padding-right'), 10);
|
733 |
+
height = height - parseInt(s.container.css('padding-top'), 10) - parseInt(s.container.css('padding-bottom'), 10);
|
734 |
+
|
735 |
+
// Store values
|
736 |
+
s.width = width;
|
737 |
+
s.height = height;
|
738 |
+
s.size = s.isHorizontal() ? s.width : s.height;
|
739 |
+
};
|
740 |
+
|
741 |
+
s.updateSlidesSize = function () {
|
742 |
+
s.slides = s.wrapper.children('.' + s.params.slideClass);
|
743 |
+
s.snapGrid = [];
|
744 |
+
s.slidesGrid = [];
|
745 |
+
s.slidesSizesGrid = [];
|
746 |
+
|
747 |
+
var spaceBetween = s.params.spaceBetween,
|
748 |
+
slidePosition = -s.params.slidesOffsetBefore,
|
749 |
+
i,
|
750 |
+
prevSlideSize = 0,
|
751 |
+
index = 0;
|
752 |
+
if (typeof s.size === 'undefined') return;
|
753 |
+
if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {
|
754 |
+
spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * s.size;
|
755 |
+
}
|
756 |
+
|
757 |
+
s.virtualSize = -spaceBetween;
|
758 |
+
// reset margins
|
759 |
+
if (s.rtl) s.slides.css({marginLeft: '', marginTop: ''});
|
760 |
+
else s.slides.css({marginRight: '', marginBottom: ''});
|
761 |
+
|
762 |
+
var slidesNumberEvenToRows;
|
763 |
+
if (s.params.slidesPerColumn > 1) {
|
764 |
+
if (Math.floor(s.slides.length / s.params.slidesPerColumn) === s.slides.length / s.params.slidesPerColumn) {
|
765 |
+
slidesNumberEvenToRows = s.slides.length;
|
766 |
+
}
|
767 |
+
else {
|
768 |
+
slidesNumberEvenToRows = Math.ceil(s.slides.length / s.params.slidesPerColumn) * s.params.slidesPerColumn;
|
769 |
+
}
|
770 |
+
if (s.params.slidesPerView !== 'auto' && s.params.slidesPerColumnFill === 'row') {
|
771 |
+
slidesNumberEvenToRows = Math.max(slidesNumberEvenToRows, s.params.slidesPerView * s.params.slidesPerColumn);
|
772 |
+
}
|
773 |
+
}
|
774 |
+
|
775 |
+
// Calc slides
|
776 |
+
var slideSize;
|
777 |
+
var slidesPerColumn = s.params.slidesPerColumn;
|
778 |
+
var slidesPerRow = slidesNumberEvenToRows / slidesPerColumn;
|
779 |
+
var numFullColumns = slidesPerRow - (s.params.slidesPerColumn * slidesPerRow - s.slides.length);
|
780 |
+
for (i = 0; i < s.slides.length; i++) {
|
781 |
+
slideSize = 0;
|
782 |
+
var slide = s.slides.eq(i);
|
783 |
+
if (s.params.slidesPerColumn > 1) {
|
784 |
+
// Set slides order
|
785 |
+
var newSlideOrderIndex;
|
786 |
+
var column, row;
|
787 |
+
if (s.params.slidesPerColumnFill === 'column') {
|
788 |
+
column = Math.floor(i / slidesPerColumn);
|
789 |
+
row = i - column * slidesPerColumn;
|
790 |
+
if (column > numFullColumns || (column === numFullColumns && row === slidesPerColumn-1)) {
|
791 |
+
if (++row >= slidesPerColumn) {
|
792 |
+
row = 0;
|
793 |
+
column++;
|
794 |
+
}
|
795 |
+
}
|
796 |
+
newSlideOrderIndex = column + row * slidesNumberEvenToRows / slidesPerColumn;
|
797 |
+
slide
|
798 |
+
.css({
|
799 |
+
'-webkit-box-ordinal-group': newSlideOrderIndex,
|
800 |
+
'-moz-box-ordinal-group': newSlideOrderIndex,
|
801 |
+
'-ms-flex-order': newSlideOrderIndex,
|
802 |
+
'-webkit-order': newSlideOrderIndex,
|
803 |
+
'order': newSlideOrderIndex
|
804 |
+
});
|
805 |
+
}
|
806 |
+
else {
|
807 |
+
row = Math.floor(i / slidesPerRow);
|
808 |
+
column = i - row * slidesPerRow;
|
809 |
+
}
|
810 |
+
slide
|
811 |
+
.css(
|
812 |
+
'margin-' + (s.isHorizontal() ? 'top' : 'left'),
|
813 |
+
(row !== 0 && s.params.spaceBetween) && (s.params.spaceBetween + 'px')
|
814 |
+
)
|
815 |
+
.attr('data-swiper-column', column)
|
816 |
+
.attr('data-swiper-row', row);
|
817 |
+
|
818 |
+
}
|
819 |
+
if (slide.css('display') === 'none') continue;
|
820 |
+
if (s.params.slidesPerView === 'auto') {
|
821 |
+
slideSize = s.isHorizontal() ? slide.outerWidth(true) : slide.outerHeight(true);
|
822 |
+
if (s.params.roundLengths) slideSize = round(slideSize);
|
823 |
+
}
|
824 |
+
else {
|
825 |
+
slideSize = (s.size - (s.params.slidesPerView - 1) * spaceBetween) / s.params.slidesPerView;
|
826 |
+
if (s.params.roundLengths) slideSize = round(slideSize);
|
827 |
+
|
828 |
+
if (s.isHorizontal()) {
|
829 |
+
s.slides[i].style.width = slideSize + 'px';
|
830 |
+
}
|
831 |
+
else {
|
832 |
+
s.slides[i].style.height = slideSize + 'px';
|
833 |
+
}
|
834 |
+
}
|
835 |
+
s.slides[i].swiperSlideSize = slideSize;
|
836 |
+
s.slidesSizesGrid.push(slideSize);
|
837 |
+
|
838 |
+
|
839 |
+
if (s.params.centeredSlides) {
|
840 |
+
slidePosition = slidePosition + slideSize / 2 + prevSlideSize / 2 + spaceBetween;
|
841 |
+
if (i === 0) slidePosition = slidePosition - s.size / 2 - spaceBetween;
|
842 |
+
if (Math.abs(slidePosition) < 1 / 1000) slidePosition = 0;
|
843 |
+
if ((index) % s.params.slidesPerGroup === 0) s.snapGrid.push(slidePosition);
|
844 |
+
s.slidesGrid.push(slidePosition);
|
845 |
+
}
|
846 |
+
else {
|
847 |
+
if ((index) % s.params.slidesPerGroup === 0) s.snapGrid.push(slidePosition);
|
848 |
+
s.slidesGrid.push(slidePosition);
|
849 |
+
slidePosition = slidePosition + slideSize + spaceBetween;
|
850 |
+
}
|
851 |
+
|
852 |
+
s.virtualSize += slideSize + spaceBetween;
|
853 |
+
|
854 |
+
prevSlideSize = slideSize;
|
855 |
+
|
856 |
+
index ++;
|
857 |
+
}
|
858 |
+
s.virtualSize = Math.max(s.virtualSize, s.size) + s.params.slidesOffsetAfter;
|
859 |
+
var newSlidesGrid;
|
860 |
+
|
861 |
+
if (
|
862 |
+
s.rtl && s.wrongRTL && (s.params.effect === 'slide' || s.params.effect === 'coverflow')) {
|
863 |
+
s.wrapper.css({width: s.virtualSize + s.params.spaceBetween + 'px'});
|
864 |
+
}
|
865 |
+
if (!s.support.flexbox || s.params.setWrapperSize) {
|
866 |
+
if (s.isHorizontal()) s.wrapper.css({width: s.virtualSize + s.params.spaceBetween + 'px'});
|
867 |
+
else s.wrapper.css({height: s.virtualSize + s.params.spaceBetween + 'px'});
|
868 |
+
}
|
869 |
+
|
870 |
+
if (s.params.slidesPerColumn > 1) {
|
871 |
+
s.virtualSize = (slideSize + s.params.spaceBetween) * slidesNumberEvenToRows;
|
872 |
+
s.virtualSize = Math.ceil(s.virtualSize / s.params.slidesPerColumn) - s.params.spaceBetween;
|
873 |
+
if (s.isHorizontal()) s.wrapper.css({width: s.virtualSize + s.params.spaceBetween + 'px'});
|
874 |
+
else s.wrapper.css({height: s.virtualSize + s.params.spaceBetween + 'px'});
|
875 |
+
if (s.params.centeredSlides) {
|
876 |
+
newSlidesGrid = [];
|
877 |
+
for (i = 0; i < s.snapGrid.length; i++) {
|
878 |
+
if (s.snapGrid[i] < s.virtualSize + s.snapGrid[0]) newSlidesGrid.push(s.snapGrid[i]);
|
879 |
+
}
|
880 |
+
s.snapGrid = newSlidesGrid;
|
881 |
+
}
|
882 |
+
}
|
883 |
+
|
884 |
+
// Remove last grid elements depending on width
|
885 |
+
if (!s.params.centeredSlides) {
|
886 |
+
newSlidesGrid = [];
|
887 |
+
for (i = 0; i < s.snapGrid.length; i++) {
|
888 |
+
if (s.snapGrid[i] <= s.virtualSize - s.size) {
|
889 |
+
newSlidesGrid.push(s.snapGrid[i]);
|
890 |
+
}
|
891 |
+
}
|
892 |
+
s.snapGrid = newSlidesGrid;
|
893 |
+
if (Math.floor(s.virtualSize - s.size) - Math.floor(s.snapGrid[s.snapGrid.length - 1]) > 1) {
|
894 |
+
s.snapGrid.push(s.virtualSize - s.size);
|
895 |
+
}
|
896 |
+
}
|
897 |
+
if (s.snapGrid.length === 0) s.snapGrid = [0];
|
898 |
+
|
899 |
+
if (s.params.spaceBetween !== 0) {
|
900 |
+
if (s.isHorizontal()) {
|
901 |
+
if (s.rtl) s.slides.css({marginLeft: spaceBetween + 'px'});
|
902 |
+
else s.slides.css({marginRight: spaceBetween + 'px'});
|
903 |
+
}
|
904 |
+
else s.slides.css({marginBottom: spaceBetween + 'px'});
|
905 |
+
}
|
906 |
+
if (s.params.watchSlidesProgress) {
|
907 |
+
s.updateSlidesOffset();
|
908 |
+
}
|
909 |
+
};
|
910 |
+
s.updateSlidesOffset = function () {
|
911 |
+
for (var i = 0; i < s.slides.length; i++) {
|
912 |
+
s.slides[i].swiperSlideOffset = s.isHorizontal() ? s.slides[i].offsetLeft : s.slides[i].offsetTop;
|
913 |
+
}
|
914 |
+
};
|
915 |
+
|
916 |
+
/*=========================
|
917 |
+
Slider/slides progress
|
918 |
+
===========================*/
|
919 |
+
s.updateSlidesProgress = function (translate) {
|
920 |
+
if (typeof translate === 'undefined') {
|
921 |
+
translate = s.translate || 0;
|
922 |
+
}
|
923 |
+
if (s.slides.length === 0) return;
|
924 |
+
if (typeof s.slides[0].swiperSlideOffset === 'undefined') s.updateSlidesOffset();
|
925 |
+
|
926 |
+
var offsetCenter = -translate;
|
927 |
+
if (s.rtl) offsetCenter = translate;
|
928 |
+
|
929 |
+
// Visible Slides
|
930 |
+
s.slides.removeClass(s.params.slideVisibleClass);
|
931 |
+
for (var i = 0; i < s.slides.length; i++) {
|
932 |
+
var slide = s.slides[i];
|
933 |
+
var slideProgress = (offsetCenter + (s.params.centeredSlides ? s.minTranslate() : 0) - slide.swiperSlideOffset) / (slide.swiperSlideSize + s.params.spaceBetween);
|
934 |
+
if (s.params.watchSlidesVisibility) {
|
935 |
+
var slideBefore = -(offsetCenter - slide.swiperSlideOffset);
|
936 |
+
var slideAfter = slideBefore + s.slidesSizesGrid[i];
|
937 |
+
var isVisible =
|
938 |
+
(slideBefore >= 0 && slideBefore < s.size) ||
|
939 |
+
(slideAfter > 0 && slideAfter <= s.size) ||
|
940 |
+
(slideBefore <= 0 && slideAfter >= s.size);
|
941 |
+
if (isVisible) {
|
942 |
+
s.slides.eq(i).addClass(s.params.slideVisibleClass);
|
943 |
+
}
|
944 |
+
}
|
945 |
+
slide.progress = s.rtl ? -slideProgress : slideProgress;
|
946 |
+
}
|
947 |
+
};
|
948 |
+
s.updateProgress = function (translate) {
|
949 |
+
if (typeof translate === 'undefined') {
|
950 |
+
translate = s.translate || 0;
|
951 |
+
}
|
952 |
+
var translatesDiff = s.maxTranslate() - s.minTranslate();
|
953 |
+
var wasBeginning = s.isBeginning;
|
954 |
+
var wasEnd = s.isEnd;
|
955 |
+
if (translatesDiff === 0) {
|
956 |
+
s.progress = 0;
|
957 |
+
s.isBeginning = s.isEnd = true;
|
958 |
+
}
|
959 |
+
else {
|
960 |
+
s.progress = (translate - s.minTranslate()) / (translatesDiff);
|
961 |
+
s.isBeginning = s.progress <= 0;
|
962 |
+
s.isEnd = s.progress >= 1;
|
963 |
+
}
|
964 |
+
if (s.isBeginning && !wasBeginning) s.emit('onReachBeginning', s);
|
965 |
+
if (s.isEnd && !wasEnd) s.emit('onReachEnd', s);
|
966 |
+
|
967 |
+
if (s.params.watchSlidesProgress) s.updateSlidesProgress(translate);
|
968 |
+
s.emit('onProgress', s, s.progress);
|
969 |
+
};
|
970 |
+
s.updateActiveIndex = function () {
|
971 |
+
var translate = s.rtl ? s.translate : -s.translate;
|
972 |
+
var newActiveIndex, i, snapIndex;
|
973 |
+
for (i = 0; i < s.slidesGrid.length; i ++) {
|
974 |
+
if (typeof s.slidesGrid[i + 1] !== 'undefined') {
|
975 |
+
if (translate >= s.slidesGrid[i] && translate < s.slidesGrid[i + 1] - (s.slidesGrid[i + 1] - s.slidesGrid[i]) / 2) {
|
976 |
+
newActiveIndex = i;
|
977 |
+
}
|
978 |
+
else if (translate >= s.slidesGrid[i] && translate < s.slidesGrid[i + 1]) {
|
979 |
+
newActiveIndex = i + 1;
|
980 |
+
}
|
981 |
+
}
|
982 |
+
else {
|
983 |
+
if (translate >= s.slidesGrid[i]) {
|
984 |
+
newActiveIndex = i;
|
985 |
+
}
|
986 |
+
}
|
987 |
+
}
|
988 |
+
// Normalize slideIndex
|
989 |
+
if(s.params.normalizeSlideIndex){
|
990 |
+
if (newActiveIndex < 0 || typeof newActiveIndex === 'undefined') newActiveIndex = 0;
|
991 |
+
}
|
992 |
+
// for (i = 0; i < s.slidesGrid.length; i++) {
|
993 |
+
// if (- translate >= s.slidesGrid[i]) {
|
994 |
+
// newActiveIndex = i;
|
995 |
+
// }
|
996 |
+
// }
|
997 |
+
snapIndex = Math.floor(newActiveIndex / s.params.slidesPerGroup);
|
998 |
+
if (snapIndex >= s.snapGrid.length) snapIndex = s.snapGrid.length - 1;
|
999 |
+
|
1000 |
+
if (newActiveIndex === s.activeIndex) {
|
1001 |
+
return;
|
1002 |
+
}
|
1003 |
+
s.snapIndex = snapIndex;
|
1004 |
+
s.previousIndex = s.activeIndex;
|
1005 |
+
s.activeIndex = newActiveIndex;
|
1006 |
+
s.updateClasses();
|
1007 |
+
s.updateRealIndex();
|
1008 |
+
};
|
1009 |
+
s.updateRealIndex = function(){
|
1010 |
+
s.realIndex = s.slides.eq(s.activeIndex).attr('data-swiper-slide-index') || s.activeIndex;
|
1011 |
+
};
|
1012 |
+
|
1013 |
+
/*=========================
|
1014 |
+
Classes
|
1015 |
+
===========================*/
|
1016 |
+
s.updateClasses = function () {
|
1017 |
+
s.slides.removeClass(s.params.slideActiveClass + ' ' + s.params.slideNextClass + ' ' + s.params.slidePrevClass + ' ' + s.params.slideDuplicateActiveClass + ' ' + s.params.slideDuplicateNextClass + ' ' + s.params.slideDuplicatePrevClass);
|
1018 |
+
var activeSlide = s.slides.eq(s.activeIndex);
|
1019 |
+
// Active classes
|
1020 |
+
activeSlide.addClass(s.params.slideActiveClass);
|
1021 |
+
if (params.loop) {
|
1022 |
+
// Duplicate to all looped slides
|
1023 |
+
if (activeSlide.hasClass(s.params.slideDuplicateClass)) {
|
1024 |
+
s.wrapper.children('.' + s.params.slideClass + ':not(.' + s.params.slideDuplicateClass + ')[data-swiper-slide-index="' + s.realIndex + '"]').addClass(s.params.slideDuplicateActiveClass);
|
1025 |
+
}
|
1026 |
+
else {
|
1027 |
+
s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass + '[data-swiper-slide-index="' + s.realIndex + '"]').addClass(s.params.slideDuplicateActiveClass);
|
1028 |
+
}
|
1029 |
+
}
|
1030 |
+
// Next Slide
|
1031 |
+
var nextSlide = activeSlide.next('.' + s.params.slideClass).addClass(s.params.slideNextClass);
|
1032 |
+
if (s.params.loop && nextSlide.length === 0) {
|
1033 |
+
nextSlide = s.slides.eq(0);
|
1034 |
+
nextSlide.addClass(s.params.slideNextClass);
|
1035 |
+
}
|
1036 |
+
// Prev Slide
|
1037 |
+
var prevSlide = activeSlide.prev('.' + s.params.slideClass).addClass(s.params.slidePrevClass);
|
1038 |
+
if (s.params.loop && prevSlide.length === 0) {
|
1039 |
+
prevSlide = s.slides.eq(-1);
|
1040 |
+
prevSlide.addClass(s.params.slidePrevClass);
|
1041 |
+
}
|
1042 |
+
if (params.loop) {
|
1043 |
+
// Duplicate to all looped slides
|
1044 |
+
if (nextSlide.hasClass(s.params.slideDuplicateClass)) {
|
1045 |
+
s.wrapper.children('.' + s.params.slideClass + ':not(.' + s.params.slideDuplicateClass + ')[data-swiper-slide-index="' + nextSlide.attr('data-swiper-slide-index') + '"]').addClass(s.params.slideDuplicateNextClass);
|
1046 |
+
}
|
1047 |
+
else {
|
1048 |
+
s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass + '[data-swiper-slide-index="' + nextSlide.attr('data-swiper-slide-index') + '"]').addClass(s.params.slideDuplicateNextClass);
|
1049 |
+
}
|
1050 |
+
if (prevSlide.hasClass(s.params.slideDuplicateClass)) {
|
1051 |
+
s.wrapper.children('.' + s.params.slideClass + ':not(.' + s.params.slideDuplicateClass + ')[data-swiper-slide-index="' + prevSlide.attr('data-swiper-slide-index') + '"]').addClass(s.params.slideDuplicatePrevClass);
|
1052 |
+
}
|
1053 |
+
else {
|
1054 |
+
s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass + '[data-swiper-slide-index="' + prevSlide.attr('data-swiper-slide-index') + '"]').addClass(s.params.slideDuplicatePrevClass);
|
1055 |
+
}
|
1056 |
+
}
|
1057 |
+
|
1058 |
+
// Pagination
|
1059 |
+
if (s.paginationContainer && s.paginationContainer.length > 0) {
|
1060 |
+
// Current/Total
|
1061 |
+
var current,
|
1062 |
+
total = s.params.loop ? Math.ceil((s.slides.length - s.loopedSlides * 2) / s.params.slidesPerGroup) : s.snapGrid.length;
|
1063 |
+
if (s.params.loop) {
|
1064 |
+
current = Math.ceil((s.activeIndex - s.loopedSlides)/s.params.slidesPerGroup);
|
1065 |
+
if (current > s.slides.length - 1 - s.loopedSlides * 2) {
|
1066 |
+
current = current - (s.slides.length - s.loopedSlides * 2);
|
1067 |
+
}
|
1068 |
+
if (current > total - 1) current = current - total;
|
1069 |
+
if (current < 0 && s.params.paginationType !== 'bullets') current = total + current;
|
1070 |
+
}
|
1071 |
+
else {
|
1072 |
+
if (typeof s.snapIndex !== 'undefined') {
|
1073 |
+
current = s.snapIndex;
|
1074 |
+
}
|
1075 |
+
else {
|
1076 |
+
current = s.activeIndex || 0;
|
1077 |
+
}
|
1078 |
+
}
|
1079 |
+
// Types
|
1080 |
+
if (s.params.paginationType === 'bullets' && s.bullets && s.bullets.length > 0) {
|
1081 |
+
s.bullets.removeClass(s.params.bulletActiveClass);
|
1082 |
+
if (s.paginationContainer.length > 1) {
|
1083 |
+
s.bullets.each(function () {
|
1084 |
+
if ($(this).index() === current) $(this).addClass(s.params.bulletActiveClass);
|
1085 |
+
});
|
1086 |
+
}
|
1087 |
+
else {
|
1088 |
+
s.bullets.eq(current).addClass(s.params.bulletActiveClass);
|
1089 |
+
}
|
1090 |
+
}
|
1091 |
+
if (s.params.paginationType === 'fraction') {
|
1092 |
+
s.paginationContainer.find('.' + s.params.paginationCurrentClass).text(current + 1);
|
1093 |
+
s.paginationContainer.find('.' + s.params.paginationTotalClass).text(total);
|
1094 |
+
}
|
1095 |
+
if (s.params.paginationType === 'progress') {
|
1096 |
+
var scale = (current + 1) / total,
|
1097 |
+
scaleX = scale,
|
1098 |
+
scaleY = 1;
|
1099 |
+
if (!s.isHorizontal()) {
|
1100 |
+
scaleY = scale;
|
1101 |
+
scaleX = 1;
|
1102 |
+
}
|
1103 |
+
s.paginationContainer.find('.' + s.params.paginationProgressbarClass).transform('translate3d(0,0,0) scaleX(' + scaleX + ') scaleY(' + scaleY + ')').transition(s.params.speed);
|
1104 |
+
}
|
1105 |
+
if (s.params.paginationType === 'custom' && s.params.paginationCustomRender) {
|
1106 |
+
s.paginationContainer.html(s.params.paginationCustomRender(s, current + 1, total));
|
1107 |
+
s.emit('onPaginationRendered', s, s.paginationContainer[0]);
|
1108 |
+
}
|
1109 |
+
}
|
1110 |
+
|
1111 |
+
// Next/active buttons
|
1112 |
+
if (!s.params.loop) {
|
1113 |
+
if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {
|
1114 |
+
if (s.isBeginning) {
|
1115 |
+
s.prevButton.addClass(s.params.buttonDisabledClass);
|
1116 |
+
if (s.params.a11y && s.a11y) s.a11y.disable(s.prevButton);
|
1117 |
+
}
|
1118 |
+
else {
|
1119 |
+
s.prevButton.removeClass(s.params.buttonDisabledClass);
|
1120 |
+
if (s.params.a11y && s.a11y) s.a11y.enable(s.prevButton);
|
1121 |
+
}
|
1122 |
+
}
|
1123 |
+
if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {
|
1124 |
+
if (s.isEnd) {
|
1125 |
+
s.nextButton.addClass(s.params.buttonDisabledClass);
|
1126 |
+
if (s.params.a11y && s.a11y) s.a11y.disable(s.nextButton);
|
1127 |
+
}
|
1128 |
+
else {
|
1129 |
+
s.nextButton.removeClass(s.params.buttonDisabledClass);
|
1130 |
+
if (s.params.a11y && s.a11y) s.a11y.enable(s.nextButton);
|
1131 |
+
}
|
1132 |
+
}
|
1133 |
+
}
|
1134 |
+
};
|
1135 |
+
|
1136 |
+
/*=========================
|
1137 |
+
Pagination
|
1138 |
+
===========================*/
|
1139 |
+
s.updatePagination = function () {
|
1140 |
+
if (!s.params.pagination) return;
|
1141 |
+
if (s.paginationContainer && s.paginationContainer.length > 0) {
|
1142 |
+
var paginationHTML = '';
|
1143 |
+
if (s.params.paginationType === 'bullets') {
|
1144 |
+
var numberOfBullets = s.params.loop ? Math.ceil((s.slides.length - s.loopedSlides * 2) / s.params.slidesPerGroup) : s.snapGrid.length;
|
1145 |
+
for (var i = 0; i < numberOfBullets; i++) {
|
1146 |
+
if (s.params.paginationBulletRender) {
|
1147 |
+
paginationHTML += s.params.paginationBulletRender(s, i, s.params.bulletClass);
|
1148 |
+
}
|
1149 |
+
else {
|
1150 |
+
paginationHTML += '<' + s.params.paginationElement+' class="' + s.params.bulletClass + '"></' + s.params.paginationElement + '>';
|
1151 |
+
}
|
1152 |
+
}
|
1153 |
+
s.paginationContainer.html(paginationHTML);
|
1154 |
+
s.bullets = s.paginationContainer.find('.' + s.params.bulletClass);
|
1155 |
+
if (s.params.paginationClickable && s.params.a11y && s.a11y) {
|
1156 |
+
s.a11y.initPagination();
|
1157 |
+
}
|
1158 |
+
}
|
1159 |
+
if (s.params.paginationType === 'fraction') {
|
1160 |
+
if (s.params.paginationFractionRender) {
|
1161 |
+
paginationHTML = s.params.paginationFractionRender(s, s.params.paginationCurrentClass, s.params.paginationTotalClass);
|
1162 |
+
}
|
1163 |
+
else {
|
1164 |
+
paginationHTML =
|
1165 |
+
'<span class="' + s.params.paginationCurrentClass + '"></span>' +
|
1166 |
+
' / ' +
|
1167 |
+
'<span class="' + s.params.paginationTotalClass+'"></span>';
|
1168 |
+
}
|
1169 |
+
s.paginationContainer.html(paginationHTML);
|
1170 |
+
}
|
1171 |
+
if (s.params.paginationType === 'progress') {
|
1172 |
+
if (s.params.paginationProgressRender) {
|
1173 |
+
paginationHTML = s.params.paginationProgressRender(s, s.params.paginationProgressbarClass);
|
1174 |
+
}
|
1175 |
+
else {
|
1176 |
+
paginationHTML = '<span class="' + s.params.paginationProgressbarClass + '"></span>';
|
1177 |
+
}
|
1178 |
+
s.paginationContainer.html(paginationHTML);
|
1179 |
+
}
|
1180 |
+
if (s.params.paginationType !== 'custom') {
|
1181 |
+
s.emit('onPaginationRendered', s, s.paginationContainer[0]);
|
1182 |
+
}
|
1183 |
+
}
|
1184 |
+
};
|
1185 |
+
/*=========================
|
1186 |
+
Common update method
|
1187 |
+
===========================*/
|
1188 |
+
s.update = function (updateTranslate) {
|
1189 |
+
s.updateContainerSize();
|
1190 |
+
s.updateSlidesSize();
|
1191 |
+
s.updateProgress();
|
1192 |
+
s.updatePagination();
|
1193 |
+
s.updateClasses();
|
1194 |
+
if (s.params.scrollbar && s.scrollbar) {
|
1195 |
+
s.scrollbar.set();
|
1196 |
+
}
|
1197 |
+
function forceSetTranslate() {
|
1198 |
+
var translate = s.rtl ? -s.translate : s.translate;
|
1199 |
+
newTranslate = Math.min(Math.max(s.translate, s.maxTranslate()), s.minTranslate());
|
1200 |
+
s.setWrapperTranslate(newTranslate);
|
1201 |
+
s.updateActiveIndex();
|
1202 |
+
s.updateClasses();
|
1203 |
+
}
|
1204 |
+
if (updateTranslate) {
|
1205 |
+
var translated, newTranslate;
|
1206 |
+
if (s.controller && s.controller.spline) {
|
1207 |
+
s.controller.spline = undefined;
|
1208 |
+
}
|
1209 |
+
if (s.params.freeMode) {
|
1210 |
+
forceSetTranslate();
|
1211 |
+
if (s.params.autoHeight) {
|
1212 |
+
s.updateAutoHeight();
|
1213 |
+
}
|
1214 |
+
}
|
1215 |
+
else {
|
1216 |
+
if ((s.params.slidesPerView === 'auto' || s.params.slidesPerView > 1) && s.isEnd && !s.params.centeredSlides) {
|
1217 |
+
translated = s.slideTo(s.slides.length - 1, 0, false, true);
|
1218 |
+
}
|
1219 |
+
else {
|
1220 |
+
translated = s.slideTo(s.activeIndex, 0, false, true);
|
1221 |
+
}
|
1222 |
+
if (!translated) {
|
1223 |
+
forceSetTranslate();
|
1224 |
+
}
|
1225 |
+
}
|
1226 |
+
}
|
1227 |
+
else if (s.params.autoHeight) {
|
1228 |
+
s.updateAutoHeight();
|
1229 |
+
}
|
1230 |
+
};
|
1231 |
+
|
1232 |
+
/*=========================
|
1233 |
+
Resize Handler
|
1234 |
+
===========================*/
|
1235 |
+
s.onResize = function (forceUpdatePagination) {
|
1236 |
+
//Breakpoints
|
1237 |
+
if (s.params.breakpoints) {
|
1238 |
+
s.setBreakpoint();
|
1239 |
+
}
|
1240 |
+
|
1241 |
+
// Disable locks on resize
|
1242 |
+
var allowSwipeToPrev = s.params.allowSwipeToPrev;
|
1243 |
+
var allowSwipeToNext = s.params.allowSwipeToNext;
|
1244 |
+
s.params.allowSwipeToPrev = s.params.allowSwipeToNext = true;
|
1245 |
+
|
1246 |
+
s.updateContainerSize();
|
1247 |
+
s.updateSlidesSize();
|
1248 |
+
if (s.params.slidesPerView === 'auto' || s.params.freeMode || forceUpdatePagination) s.updatePagination();
|
1249 |
+
if (s.params.scrollbar && s.scrollbar) {
|
1250 |
+
s.scrollbar.set();
|
1251 |
+
}
|
1252 |
+
if (s.controller && s.controller.spline) {
|
1253 |
+
s.controller.spline = undefined;
|
1254 |
+
}
|
1255 |
+
var slideChangedBySlideTo = false;
|
1256 |
+
if (s.params.freeMode) {
|
1257 |
+
var newTranslate = Math.min(Math.max(s.translate, s.maxTranslate()), s.minTranslate());
|
1258 |
+
s.setWrapperTranslate(newTranslate);
|
1259 |
+
s.updateActiveIndex();
|
1260 |
+
s.updateClasses();
|
1261 |
+
|
1262 |
+
if (s.params.autoHeight) {
|
1263 |
+
s.updateAutoHeight();
|
1264 |
+
}
|
1265 |
+
}
|
1266 |
+
else {
|
1267 |
+
s.updateClasses();
|
1268 |
+
if ((s.params.slidesPerView === 'auto' || s.params.slidesPerView > 1) && s.isEnd && !s.params.centeredSlides) {
|
1269 |
+
slideChangedBySlideTo = s.slideTo(s.slides.length - 1, 0, false, true);
|
1270 |
+
}
|
1271 |
+
else {
|
1272 |
+
slideChangedBySlideTo = s.slideTo(s.activeIndex, 0, false, true);
|
1273 |
+
}
|
1274 |
+
}
|
1275 |
+
if (s.params.lazyLoading && !slideChangedBySlideTo && s.lazy) {
|
1276 |
+
s.lazy.load();
|
1277 |
+
}
|
1278 |
+
// Return locks after resize
|
1279 |
+
s.params.allowSwipeToPrev = allowSwipeToPrev;
|
1280 |
+
s.params.allowSwipeToNext = allowSwipeToNext;
|
1281 |
+
};
|
1282 |
+
|
1283 |
+
/*=========================
|
1284 |
+
Events
|
1285 |
+
===========================*/
|
1286 |
+
|
1287 |
+
//Define Touch Events
|
1288 |
+
s.touchEventsDesktop = {start: 'mousedown', move: 'mousemove', end: 'mouseup'};
|
1289 |
+
if (window.navigator.pointerEnabled) s.touchEventsDesktop = {start: 'pointerdown', move: 'pointermove', end: 'pointerup'};
|
1290 |
+
else if (window.navigator.msPointerEnabled) s.touchEventsDesktop = {start: 'MSPointerDown', move: 'MSPointerMove', end: 'MSPointerUp'};
|
1291 |
+
s.touchEvents = {
|
1292 |
+
start : s.support.touch || !s.params.simulateTouch ? 'touchstart' : s.touchEventsDesktop.start,
|
1293 |
+
move : s.support.touch || !s.params.simulateTouch ? 'touchmove' : s.touchEventsDesktop.move,
|
1294 |
+
end : s.support.touch || !s.params.simulateTouch ? 'touchend' : s.touchEventsDesktop.end
|
1295 |
+
};
|
1296 |
+
|
1297 |
+
|
1298 |
+
// WP8 Touch Events Fix
|
1299 |
+
if (window.navigator.pointerEnabled || window.navigator.msPointerEnabled) {
|
1300 |
+
(s.params.touchEventsTarget === 'container' ? s.container : s.wrapper).addClass('swiper-wp8-' + s.params.direction);
|
1301 |
+
}
|
1302 |
+
|
1303 |
+
// Attach/detach events
|
1304 |
+
s.initEvents = function (detach) {
|
1305 |
+
var actionDom = detach ? 'off' : 'on';
|
1306 |
+
var action = detach ? 'removeEventListener' : 'addEventListener';
|
1307 |
+
var touchEventsTarget = s.params.touchEventsTarget === 'container' ? s.container[0] : s.wrapper[0];
|
1308 |
+
var target = s.support.touch ? touchEventsTarget : document;
|
1309 |
+
|
1310 |
+
var moveCapture = s.params.nested ? true : false;
|
1311 |
+
|
1312 |
+
//Touch Events
|
1313 |
+
if (s.browser.ie) {
|
1314 |
+
touchEventsTarget[action](s.touchEvents.start, s.onTouchStart, false);
|
1315 |
+
target[action](s.touchEvents.move, s.onTouchMove, moveCapture);
|
1316 |
+
target[action](s.touchEvents.end, s.onTouchEnd, false);
|
1317 |
+
}
|
1318 |
+
else {
|
1319 |
+
if (s.support.touch) {
|
1320 |
+
var passiveListener = s.touchEvents.start === 'touchstart' && s.support.passiveListener && s.params.passiveListeners ? {passive: true, capture: false} : false;
|
1321 |
+
touchEventsTarget[action](s.touchEvents.start, s.onTouchStart, passiveListener);
|
1322 |
+
touchEventsTarget[action](s.touchEvents.move, s.onTouchMove, moveCapture);
|
1323 |
+
touchEventsTarget[action](s.touchEvents.end, s.onTouchEnd, passiveListener);
|
1324 |
+
}
|
1325 |
+
if ((params.simulateTouch && !s.device.ios && !s.device.android) || (params.simulateTouch && !s.support.touch && s.device.ios)) {
|
1326 |
+
touchEventsTarget[action]('mousedown', s.onTouchStart, false);
|
1327 |
+
document[action]('mousemove', s.onTouchMove, moveCapture);
|
1328 |
+
document[action]('mouseup', s.onTouchEnd, false);
|
1329 |
+
}
|
1330 |
+
}
|
1331 |
+
window[action]('resize', s.onResize);
|
1332 |
+
|
1333 |
+
// Next, Prev, Index
|
1334 |
+
if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {
|
1335 |
+
s.nextButton[actionDom]('click', s.onClickNext);
|
1336 |
+
if (s.params.a11y && s.a11y) s.nextButton[actionDom]('keydown', s.a11y.onEnterKey);
|
1337 |
+
}
|
1338 |
+
if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {
|
1339 |
+
s.prevButton[actionDom]('click', s.onClickPrev);
|
1340 |
+
if (s.params.a11y && s.a11y) s.prevButton[actionDom]('keydown', s.a11y.onEnterKey);
|
1341 |
+
}
|
1342 |
+
if (s.params.pagination && s.params.paginationClickable) {
|
1343 |
+
s.paginationContainer[actionDom]('click', '.' + s.params.bulletClass, s.onClickIndex);
|
1344 |
+
if (s.params.a11y && s.a11y) s.paginationContainer[actionDom]('keydown', '.' + s.params.bulletClass, s.a11y.onEnterKey);
|
1345 |
+
}
|
1346 |
+
|
1347 |
+
// Prevent Links Clicks
|
1348 |
+
if (s.params.preventClicks || s.params.preventClicksPropagation) touchEventsTarget[action]('click', s.preventClicks, true);
|
1349 |
+
};
|
1350 |
+
s.attachEvents = function () {
|
1351 |
+
s.initEvents();
|
1352 |
+
};
|
1353 |
+
s.detachEvents = function () {
|
1354 |
+
s.initEvents(true);
|
1355 |
+
};
|
1356 |
+
|
1357 |
+
/*=========================
|
1358 |
+
Handle Clicks
|
1359 |
+
===========================*/
|
1360 |
+
// Prevent Clicks
|
1361 |
+
s.allowClick = true;
|
1362 |
+
s.preventClicks = function (e) {
|
1363 |
+
if (!s.allowClick) {
|
1364 |
+
if (s.params.preventClicks) e.preventDefault();
|
1365 |
+
if (s.params.preventClicksPropagation && s.animating) {
|
1366 |
+
e.stopPropagation();
|
1367 |
+
e.stopImmediatePropagation();
|
1368 |
+
}
|
1369 |
+
}
|
1370 |
+
};
|
1371 |
+
// Clicks
|
1372 |
+
s.onClickNext = function (e) {
|
1373 |
+
e.preventDefault();
|
1374 |
+
if (s.isEnd && !s.params.loop) return;
|
1375 |
+
s.slideNext();
|
1376 |
+
};
|
1377 |
+
s.onClickPrev = function (e) {
|
1378 |
+
e.preventDefault();
|
1379 |
+
if (s.isBeginning && !s.params.loop) return;
|
1380 |
+
s.slidePrev();
|
1381 |
+
};
|
1382 |
+
s.onClickIndex = function (e) {
|
1383 |
+
e.preventDefault();
|
1384 |
+
var index = $(this).index() * s.params.slidesPerGroup;
|
1385 |
+
if (s.params.loop) index = index + s.loopedSlides;
|
1386 |
+
s.slideTo(index);
|
1387 |
+
};
|
1388 |
+
|
1389 |
+
/*=========================
|
1390 |
+
Handle Touches
|
1391 |
+
===========================*/
|
1392 |
+
function findElementInEvent(e, selector) {
|
1393 |
+
var el = $(e.target);
|
1394 |
+
if (!el.is(selector)) {
|
1395 |
+
if (typeof selector === 'string') {
|
1396 |
+
el = el.parents(selector);
|
1397 |
+
}
|
1398 |
+
else if (selector.nodeType) {
|
1399 |
+
var found;
|
1400 |
+
el.parents().each(function (index, _el) {
|
1401 |
+
if (_el === selector) found = selector;
|
1402 |
+
});
|
1403 |
+
if (!found) return undefined;
|
1404 |
+
else return selector;
|
1405 |
+
}
|
1406 |
+
}
|
1407 |
+
if (el.length === 0) {
|
1408 |
+
return undefined;
|
1409 |
+
}
|
1410 |
+
return el[0];
|
1411 |
+
}
|
1412 |
+
s.updateClickedSlide = function (e) {
|
1413 |
+
var slide = findElementInEvent(e, '.' + s.params.slideClass);
|
1414 |
+
var slideFound = false;
|
1415 |
+
if (slide) {
|
1416 |
+
for (var i = 0; i < s.slides.length; i++) {
|
1417 |
+
if (s.slides[i] === slide) slideFound = true;
|
1418 |
+
}
|
1419 |
+
}
|
1420 |
+
|
1421 |
+
if (slide && slideFound) {
|
1422 |
+
s.clickedSlide = slide;
|
1423 |
+
s.clickedIndex = $(slide).index();
|
1424 |
+
}
|
1425 |
+
else {
|
1426 |
+
s.clickedSlide = undefined;
|
1427 |
+
s.clickedIndex = undefined;
|
1428 |
+
return;
|
1429 |
+
}
|
1430 |
+
if (s.params.slideToClickedSlide && s.clickedIndex !== undefined && s.clickedIndex !== s.activeIndex) {
|
1431 |
+
var slideToIndex = s.clickedIndex,
|
1432 |
+
realIndex,
|
1433 |
+
duplicatedSlides;
|
1434 |
+
if (s.params.loop) {
|
1435 |
+
if (s.animating) return;
|
1436 |
+
realIndex = $(s.clickedSlide).attr('data-swiper-slide-index');
|
1437 |
+
if (s.params.centeredSlides) {
|
1438 |
+
if ((slideToIndex < s.loopedSlides - s.params.slidesPerView/2) || (slideToIndex > s.slides.length - s.loopedSlides + s.params.slidesPerView/2)) {
|
1439 |
+
s.fixLoop();
|
1440 |
+
slideToIndex = s.wrapper.children('.' + s.params.slideClass + '[data-swiper-slide-index="' + realIndex + '"]:not(.' + s.params.slideDuplicateClass + ')').eq(0).index();
|
1441 |
+
setTimeout(function () {
|
1442 |
+
s.slideTo(slideToIndex);
|
1443 |
+
}, 0);
|
1444 |
+
}
|
1445 |
+
else {
|
1446 |
+
s.slideTo(slideToIndex);
|
1447 |
+
}
|
1448 |
+
}
|
1449 |
+
else {
|
1450 |
+
if (slideToIndex > s.slides.length - s.params.slidesPerView) {
|
1451 |
+
s.fixLoop();
|
1452 |
+
slideToIndex = s.wrapper.children('.' + s.params.slideClass + '[data-swiper-slide-index="' + realIndex + '"]:not(.' + s.params.slideDuplicateClass + ')').eq(0).index();
|
1453 |
+
setTimeout(function () {
|
1454 |
+
s.slideTo(slideToIndex);
|
1455 |
+
}, 0);
|
1456 |
+
}
|
1457 |
+
else {
|
1458 |
+
s.slideTo(slideToIndex);
|
1459 |
+
}
|
1460 |
+
}
|
1461 |
+
}
|
1462 |
+
else {
|
1463 |
+
s.slideTo(slideToIndex);
|
1464 |
+
}
|
1465 |
+
}
|
1466 |
+
};
|
1467 |
+
|
1468 |
+
var isTouched,
|
1469 |
+
isMoved,
|
1470 |
+
allowTouchCallbacks,
|
1471 |
+
touchStartTime,
|
1472 |
+
isScrolling,
|
1473 |
+
currentTranslate,
|
1474 |
+
startTranslate,
|
1475 |
+
allowThresholdMove,
|
1476 |
+
// Form elements to match
|
1477 |
+
formElements = 'input, select, textarea, button, video',
|
1478 |
+
// Last click time
|
1479 |
+
lastClickTime = Date.now(), clickTimeout,
|
1480 |
+
//Velocities
|
1481 |
+
velocities = [],
|
1482 |
+
allowMomentumBounce;
|
1483 |
+
|
1484 |
+
// Animating Flag
|
1485 |
+
s.animating = false;
|
1486 |
+
|
1487 |
+
// Touches information
|
1488 |
+
s.touches = {
|
1489 |
+
startX: 0,
|
1490 |
+
startY: 0,
|
1491 |
+
currentX: 0,
|
1492 |
+
currentY: 0,
|
1493 |
+
diff: 0
|
1494 |
+
};
|
1495 |
+
|
1496 |
+
// Touch handlers
|
1497 |
+
var isTouchEvent, startMoving;
|
1498 |
+
s.onTouchStart = function (e) {
|
1499 |
+
if (e.originalEvent) e = e.originalEvent;
|
1500 |
+
isTouchEvent = e.type === 'touchstart';
|
1501 |
+
if (!isTouchEvent && 'which' in e && e.which === 3) return;
|
1502 |
+
if (s.params.noSwiping && findElementInEvent(e, '.' + s.params.noSwipingClass)) {
|
1503 |
+
s.allowClick = true;
|
1504 |
+
return;
|
1505 |
+
}
|
1506 |
+
if (s.params.swipeHandler) {
|
1507 |
+
if (!findElementInEvent(e, s.params.swipeHandler)) return;
|
1508 |
+
}
|
1509 |
+
|
1510 |
+
var startX = s.touches.currentX = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;
|
1511 |
+
var startY = s.touches.currentY = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;
|
1512 |
+
|
1513 |
+
// Do NOT start if iOS edge swipe is detected. Otherwise iOS app (UIWebView) cannot swipe-to-go-back anymore
|
1514 |
+
if(s.device.ios && s.params.iOSEdgeSwipeDetection && startX <= s.params.iOSEdgeSwipeThreshold) {
|
1515 |
+
return;
|
1516 |
+
}
|
1517 |
+
|
1518 |
+
isTouched = true;
|
1519 |
+
isMoved = false;
|
1520 |
+
allowTouchCallbacks = true;
|
1521 |
+
isScrolling = undefined;
|
1522 |
+
startMoving = undefined;
|
1523 |
+
s.touches.startX = startX;
|
1524 |
+
s.touches.startY = startY;
|
1525 |
+
touchStartTime = Date.now();
|
1526 |
+
s.allowClick = true;
|
1527 |
+
s.updateContainerSize();
|
1528 |
+
s.swipeDirection = undefined;
|
1529 |
+
if (s.params.threshold > 0) allowThresholdMove = false;
|
1530 |
+
if (e.type !== 'touchstart') {
|
1531 |
+
var preventDefault = true;
|
1532 |
+
if ($(e.target).is(formElements)) preventDefault = false;
|
1533 |
+
if (document.activeElement && $(document.activeElement).is(formElements)) {
|
1534 |
+
document.activeElement.blur();
|
1535 |
+
}
|
1536 |
+
if (preventDefault) {
|
1537 |
+
e.preventDefault();
|
1538 |
+
}
|
1539 |
+
}
|
1540 |
+
s.emit('onTouchStart', s, e);
|
1541 |
+
};
|
1542 |
+
|
1543 |
+
s.onTouchMove = function (e) {
|
1544 |
+
if (e.originalEvent) e = e.originalEvent;
|
1545 |
+
if (isTouchEvent && e.type === 'mousemove') return;
|
1546 |
+
if (e.preventedByNestedSwiper) {
|
1547 |
+
s.touches.startX = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;
|
1548 |
+
s.touches.startY = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;
|
1549 |
+
return;
|
1550 |
+
}
|
1551 |
+
if (s.params.onlyExternal) {
|
1552 |
+
// isMoved = true;
|
1553 |
+
s.allowClick = false;
|
1554 |
+
if (isTouched) {
|
1555 |
+
s.touches.startX = s.touches.currentX = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;
|
1556 |
+
s.touches.startY = s.touches.currentY = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;
|
1557 |
+
touchStartTime = Date.now();
|
1558 |
+
}
|
1559 |
+
return;
|
1560 |
+
}
|
1561 |
+
if (isTouchEvent && s.params.touchReleaseOnEdges && !s.params.loop) {
|
1562 |
+
if (!s.isHorizontal()) {
|
1563 |
+
// Vertical
|
1564 |
+
if (
|
1565 |
+
(s.touches.currentY < s.touches.startY && s.translate <= s.maxTranslate()) ||
|
1566 |
+
(s.touches.currentY > s.touches.startY && s.translate >= s.minTranslate())
|
1567 |
+
) {
|
1568 |
+
return;
|
1569 |
+
}
|
1570 |
+
}
|
1571 |
+
else {
|
1572 |
+
if (
|
1573 |
+
(s.touches.currentX < s.touches.startX && s.translate <= s.maxTranslate()) ||
|
1574 |
+
(s.touches.currentX > s.touches.startX && s.translate >= s.minTranslate())
|
1575 |
+
) {
|
1576 |
+
return;
|
1577 |
+
}
|
1578 |
+
}
|
1579 |
+
}
|
1580 |
+
if (isTouchEvent && document.activeElement) {
|
1581 |
+
if (e.target === document.activeElement && $(e.target).is(formElements)) {
|
1582 |
+
isMoved = true;
|
1583 |
+
s.allowClick = false;
|
1584 |
+
return;
|
1585 |
+
}
|
1586 |
+
}
|
1587 |
+
if (allowTouchCallbacks) {
|
1588 |
+
s.emit('onTouchMove', s, e);
|
1589 |
+
}
|
1590 |
+
if (e.targetTouches && e.targetTouches.length > 1) return;
|
1591 |
+
|
1592 |
+
s.touches.currentX = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;
|
1593 |
+
s.touches.currentY = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;
|
1594 |
+
|
1595 |
+
if (typeof isScrolling === 'undefined') {
|
1596 |
+
var touchAngle;
|
1597 |
+
if (s.isHorizontal() && s.touches.currentY === s.touches.startY || !s.isHorizontal() && s.touches.currentX !== s.touches.startX) {
|
1598 |
+
isScrolling = false;
|
1599 |
+
}
|
1600 |
+
else {
|
1601 |
+
touchAngle = Math.atan2(Math.abs(s.touches.currentY - s.touches.startY), Math.abs(s.touches.currentX - s.touches.startX)) * 180 / Math.PI;
|
1602 |
+
isScrolling = s.isHorizontal() ? touchAngle > s.params.touchAngle : (90 - touchAngle > s.params.touchAngle);
|
1603 |
+
}
|
1604 |
+
}
|
1605 |
+
if (isScrolling) {
|
1606 |
+
s.emit('onTouchMoveOpposite', s, e);
|
1607 |
+
}
|
1608 |
+
if (typeof startMoving === 'undefined' && s.browser.ieTouch) {
|
1609 |
+
if (s.touches.currentX !== s.touches.startX || s.touches.currentY !== s.touches.startY) {
|
1610 |
+
startMoving = true;
|
1611 |
+
}
|
1612 |
+
}
|
1613 |
+
if (!isTouched) return;
|
1614 |
+
if (isScrolling) {
|
1615 |
+
isTouched = false;
|
1616 |
+
return;
|
1617 |
+
}
|
1618 |
+
if (!startMoving && s.browser.ieTouch) {
|
1619 |
+
return;
|
1620 |
+
}
|
1621 |
+
s.allowClick = false;
|
1622 |
+
s.emit('onSliderMove', s, e);
|
1623 |
+
e.preventDefault();
|
1624 |
+
if (s.params.touchMoveStopPropagation && !s.params.nested) {
|
1625 |
+
e.stopPropagation();
|
1626 |
+
}
|
1627 |
+
|
1628 |
+
if (!isMoved) {
|
1629 |
+
if (params.loop) {
|
1630 |
+
s.fixLoop();
|
1631 |
+
}
|
1632 |
+
startTranslate = s.getWrapperTranslate();
|
1633 |
+
s.setWrapperTransition(0);
|
1634 |
+
if (s.animating) {
|
1635 |
+
s.wrapper.trigger('webkitTransitionEnd transitionend oTransitionEnd MSTransitionEnd msTransitionEnd');
|
1636 |
+
}
|
1637 |
+
if (s.params.autoplay && s.autoplaying) {
|
1638 |
+
if (s.params.autoplayDisableOnInteraction) {
|
1639 |
+
s.stopAutoplay();
|
1640 |
+
}
|
1641 |
+
else {
|
1642 |
+
s.pauseAutoplay();
|
1643 |
+
}
|
1644 |
+
}
|
1645 |
+
allowMomentumBounce = false;
|
1646 |
+
//Grab Cursor
|
1647 |
+
if (s.params.grabCursor && (s.params.allowSwipeToNext === true || s.params.allowSwipeToPrev === true)) {
|
1648 |
+
s.setGrabCursor(true);
|
1649 |
+
}
|
1650 |
+
}
|
1651 |
+
isMoved = true;
|
1652 |
+
|
1653 |
+
var diff = s.touches.diff = s.isHorizontal() ? s.touches.currentX - s.touches.startX : s.touches.currentY - s.touches.startY;
|
1654 |
+
|
1655 |
+
diff = diff * s.params.touchRatio;
|
1656 |
+
if (s.rtl) diff = -diff;
|
1657 |
+
|
1658 |
+
s.swipeDirection = diff > 0 ? 'prev' : 'next';
|
1659 |
+
currentTranslate = diff + startTranslate;
|
1660 |
+
|
1661 |
+
var disableParentSwiper = true;
|
1662 |
+
if ((diff > 0 && currentTranslate > s.minTranslate())) {
|
1663 |
+
disableParentSwiper = false;
|
1664 |
+
if (s.params.resistance) currentTranslate = s.minTranslate() - 1 + Math.pow(-s.minTranslate() + startTranslate + diff, s.params.resistanceRatio);
|
1665 |
+
}
|
1666 |
+
else if (diff < 0 && currentTranslate < s.maxTranslate()) {
|
1667 |
+
disableParentSwiper = false;
|
1668 |
+
if (s.params.resistance) currentTranslate = s.maxTranslate() + 1 - Math.pow(s.maxTranslate() - startTranslate - diff, s.params.resistanceRatio);
|
1669 |
+
}
|
1670 |
+
|
1671 |
+
if (disableParentSwiper) {
|
1672 |
+
e.preventedByNestedSwiper = true;
|
1673 |
+
}
|
1674 |
+
|
1675 |
+
// Directions locks
|
1676 |
+
if (!s.params.allowSwipeToNext && s.swipeDirection === 'next' && currentTranslate < startTranslate) {
|
1677 |
+
currentTranslate = startTranslate;
|
1678 |
+
}
|
1679 |
+
if (!s.params.allowSwipeToPrev && s.swipeDirection === 'prev' && currentTranslate > startTranslate) {
|
1680 |
+
currentTranslate = startTranslate;
|
1681 |
+
}
|
1682 |
+
|
1683 |
+
|
1684 |
+
// Threshold
|
1685 |
+
if (s.params.threshold > 0) {
|
1686 |
+
if (Math.abs(diff) > s.params.threshold || allowThresholdMove) {
|
1687 |
+
if (!allowThresholdMove) {
|
1688 |
+
allowThresholdMove = true;
|
1689 |
+
s.touches.startX = s.touches.currentX;
|
1690 |
+
s.touches.startY = s.touches.currentY;
|
1691 |
+
currentTranslate = startTranslate;
|
1692 |
+
s.touches.diff = s.isHorizontal() ? s.touches.currentX - s.touches.startX : s.touches.currentY - s.touches.startY;
|
1693 |
+
return;
|
1694 |
+
}
|
1695 |
+
}
|
1696 |
+
else {
|
1697 |
+
currentTranslate = startTranslate;
|
1698 |
+
return;
|
1699 |
+
}
|
1700 |
+
}
|
1701 |
+
|
1702 |
+
if (!s.params.followFinger) return;
|
1703 |
+
|
1704 |
+
// Update active index in free mode
|
1705 |
+
if (s.params.freeMode || s.params.watchSlidesProgress) {
|
1706 |
+
s.updateActiveIndex();
|
1707 |
+
}
|
1708 |
+
if (s.params.freeMode) {
|
1709 |
+
//Velocity
|
1710 |
+
if (velocities.length === 0) {
|
1711 |
+
velocities.push({
|
1712 |
+
position: s.touches[s.isHorizontal() ? 'startX' : 'startY'],
|
1713 |
+
time: touchStartTime
|
1714 |
+
});
|
1715 |
+
}
|
1716 |
+
velocities.push({
|
1717 |
+
position: s.touches[s.isHorizontal() ? 'currentX' : 'currentY'],
|
1718 |
+
time: (new window.Date()).getTime()
|
1719 |
+
});
|
1720 |
+
}
|
1721 |
+
// Update progress
|
1722 |
+
s.updateProgress(currentTranslate);
|
1723 |
+
// Update translate
|
1724 |
+
s.setWrapperTranslate(currentTranslate);
|
1725 |
+
};
|
1726 |
+
s.onTouchEnd = function (e) {
|
1727 |
+
if (e.originalEvent) e = e.originalEvent;
|
1728 |
+
if (allowTouchCallbacks) {
|
1729 |
+
s.emit('onTouchEnd', s, e);
|
1730 |
+
}
|
1731 |
+
allowTouchCallbacks = false;
|
1732 |
+
if (!isTouched) return;
|
1733 |
+
//Return Grab Cursor
|
1734 |
+
if (s.params.grabCursor && isMoved && isTouched && (s.params.allowSwipeToNext === true || s.params.allowSwipeToPrev === true)) {
|
1735 |
+
s.setGrabCursor(false);
|
1736 |
+
}
|
1737 |
+
|
1738 |
+
// Time diff
|
1739 |
+
var touchEndTime = Date.now();
|
1740 |
+
var timeDiff = touchEndTime - touchStartTime;
|
1741 |
+
|
1742 |
+
// Tap, doubleTap, Click
|
1743 |
+
if (s.allowClick) {
|
1744 |
+
s.updateClickedSlide(e);
|
1745 |
+
s.emit('onTap', s, e);
|
1746 |
+
if (timeDiff < 300 && (touchEndTime - lastClickTime) > 300) {
|
1747 |
+
if (clickTimeout) clearTimeout(clickTimeout);
|
1748 |
+
clickTimeout = setTimeout(function () {
|
1749 |
+
if (!s) return;
|
1750 |
+
if (s.params.paginationHide && s.paginationContainer.length > 0 && !$(e.target).hasClass(s.params.bulletClass)) {
|
1751 |
+
s.paginationContainer.toggleClass(s.params.paginationHiddenClass);
|
1752 |
+
}
|
1753 |
+
s.emit('onClick', s, e);
|
1754 |
+
}, 300);
|
1755 |
+
|
1756 |
+
}
|
1757 |
+
if (timeDiff < 300 && (touchEndTime - lastClickTime) < 300) {
|
1758 |
+
if (clickTimeout) clearTimeout(clickTimeout);
|
1759 |
+
s.emit('onDoubleTap', s, e);
|
1760 |
+
}
|
1761 |
+
}
|
1762 |
+
|
1763 |
+
lastClickTime = Date.now();
|
1764 |
+
setTimeout(function () {
|
1765 |
+
if (s) s.allowClick = true;
|
1766 |
+
}, 0);
|
1767 |
+
|
1768 |
+
if (!isTouched || !isMoved || !s.swipeDirection || s.touches.diff === 0 || currentTranslate === startTranslate) {
|
1769 |
+
isTouched = isMoved = false;
|
1770 |
+
return;
|
1771 |
+
}
|
1772 |
+
isTouched = isMoved = false;
|
1773 |
+
|
1774 |
+
var currentPos;
|
1775 |
+
if (s.params.followFinger) {
|
1776 |
+
currentPos = s.rtl ? s.translate : -s.translate;
|
1777 |
+
}
|
1778 |
+
else {
|
1779 |
+
currentPos = -currentTranslate;
|
1780 |
+
}
|
1781 |
+
if (s.params.freeMode) {
|
1782 |
+
if (currentPos < -s.minTranslate()) {
|
1783 |
+
s.slideTo(s.activeIndex);
|
1784 |
+
return;
|
1785 |
+
}
|
1786 |
+
else if (currentPos > -s.maxTranslate()) {
|
1787 |
+
if (s.slides.length < s.snapGrid.length) {
|
1788 |
+
s.slideTo(s.snapGrid.length - 1);
|
1789 |
+
}
|
1790 |
+
else {
|
1791 |
+
s.slideTo(s.slides.length - 1);
|
1792 |
+
}
|
1793 |
+
return;
|
1794 |
+
}
|
1795 |
+
|
1796 |
+
if (s.params.freeModeMomentum) {
|
1797 |
+
if (velocities.length > 1) {
|
1798 |
+
var lastMoveEvent = velocities.pop(), velocityEvent = velocities.pop();
|
1799 |
+
|
1800 |
+
var distance = lastMoveEvent.position - velocityEvent.position;
|
1801 |
+
var time = lastMoveEvent.time - velocityEvent.time;
|
1802 |
+
s.velocity = distance / time;
|
1803 |
+
s.velocity = s.velocity / 2;
|
1804 |
+
if (Math.abs(s.velocity) < s.params.freeModeMinimumVelocity) {
|
1805 |
+
s.velocity = 0;
|
1806 |
+
}
|
1807 |
+
// this implies that the user stopped moving a finger then released.
|
1808 |
+
// There would be no events with distance zero, so the last event is stale.
|
1809 |
+
if (time > 150 || (new window.Date().getTime() - lastMoveEvent.time) > 300) {
|
1810 |
+
s.velocity = 0;
|
1811 |
+
}
|
1812 |
+
} else {
|
1813 |
+
s.velocity = 0;
|
1814 |
+
}
|
1815 |
+
s.velocity = s.velocity * s.params.freeModeMomentumVelocityRatio;
|
1816 |
+
|
1817 |
+
velocities.length = 0;
|
1818 |
+
var momentumDuration = 1000 * s.params.freeModeMomentumRatio;
|
1819 |
+
var momentumDistance = s.velocity * momentumDuration;
|
1820 |
+
|
1821 |
+
var newPosition = s.translate + momentumDistance;
|
1822 |
+
if (s.rtl) newPosition = - newPosition;
|
1823 |
+
var doBounce = false;
|
1824 |
+
var afterBouncePosition;
|
1825 |
+
var bounceAmount = Math.abs(s.velocity) * 20 * s.params.freeModeMomentumBounceRatio;
|
1826 |
+
if (newPosition < s.maxTranslate()) {
|
1827 |
+
if (s.params.freeModeMomentumBounce) {
|
1828 |
+
if (newPosition + s.maxTranslate() < -bounceAmount) {
|
1829 |
+
newPosition = s.maxTranslate() - bounceAmount;
|
1830 |
+
}
|
1831 |
+
afterBouncePosition = s.maxTranslate();
|
1832 |
+
doBounce = true;
|
1833 |
+
allowMomentumBounce = true;
|
1834 |
+
}
|
1835 |
+
else {
|
1836 |
+
newPosition = s.maxTranslate();
|
1837 |
+
}
|
1838 |
+
}
|
1839 |
+
else if (newPosition > s.minTranslate()) {
|
1840 |
+
if (s.params.freeModeMomentumBounce) {
|
1841 |
+
if (newPosition - s.minTranslate() > bounceAmount) {
|
1842 |
+
newPosition = s.minTranslate() + bounceAmount;
|
1843 |
+
}
|
1844 |
+
afterBouncePosition = s.minTranslate();
|
1845 |
+
doBounce = true;
|
1846 |
+
allowMomentumBounce = true;
|
1847 |
+
}
|
1848 |
+
else {
|
1849 |
+
newPosition = s.minTranslate();
|
1850 |
+
}
|
1851 |
+
}
|
1852 |
+
else if (s.params.freeModeSticky) {
|
1853 |
+
var j = 0,
|
1854 |
+
nextSlide;
|
1855 |
+
for (j = 0; j < s.snapGrid.length; j += 1) {
|
1856 |
+
if (s.snapGrid[j] > -newPosition) {
|
1857 |
+
nextSlide = j;
|
1858 |
+
break;
|
1859 |
+
}
|
1860 |
+
|
1861 |
+
}
|
1862 |
+
if (Math.abs(s.snapGrid[nextSlide] - newPosition) < Math.abs(s.snapGrid[nextSlide - 1] - newPosition) || s.swipeDirection === 'next') {
|
1863 |
+
newPosition = s.snapGrid[nextSlide];
|
1864 |
+
} else {
|
1865 |
+
newPosition = s.snapGrid[nextSlide - 1];
|
1866 |
+
}
|
1867 |
+
if (!s.rtl) newPosition = - newPosition;
|
1868 |
+
}
|
1869 |
+
//Fix duration
|
1870 |
+
if (s.velocity !== 0) {
|
1871 |
+
if (s.rtl) {
|
1872 |
+
momentumDuration = Math.abs((-newPosition - s.translate) / s.velocity);
|
1873 |
+
}
|
1874 |
+
else {
|
1875 |
+
momentumDuration = Math.abs((newPosition - s.translate) / s.velocity);
|
1876 |
+
}
|
1877 |
+
}
|
1878 |
+
else if (s.params.freeModeSticky) {
|
1879 |
+
s.slideReset();
|
1880 |
+
return;
|
1881 |
+
}
|
1882 |
+
|
1883 |
+
if (s.params.freeModeMomentumBounce && doBounce) {
|
1884 |
+
s.updateProgress(afterBouncePosition);
|
1885 |
+
s.setWrapperTransition(momentumDuration);
|
1886 |
+
s.setWrapperTranslate(newPosition);
|
1887 |
+
s.onTransitionStart();
|
1888 |
+
s.animating = true;
|
1889 |
+
s.wrapper.transitionEnd(function () {
|
1890 |
+
if (!s || !allowMomentumBounce) return;
|
1891 |
+
s.emit('onMomentumBounce', s);
|
1892 |
+
|
1893 |
+
s.setWrapperTransition(s.params.speed);
|
1894 |
+
s.setWrapperTranslate(afterBouncePosition);
|
1895 |
+
s.wrapper.transitionEnd(function () {
|
1896 |
+
if (!s) return;
|
1897 |
+
s.onTransitionEnd();
|
1898 |
+
});
|
1899 |
+
});
|
1900 |
+
} else if (s.velocity) {
|
1901 |
+
s.updateProgress(newPosition);
|
1902 |
+
s.setWrapperTransition(momentumDuration);
|
1903 |
+
s.setWrapperTranslate(newPosition);
|
1904 |
+
s.onTransitionStart();
|
1905 |
+
if (!s.animating) {
|
1906 |
+
s.animating = true;
|
1907 |
+
s.wrapper.transitionEnd(function () {
|
1908 |
+
if (!s) return;
|
1909 |
+
s.onTransitionEnd();
|
1910 |
+
});
|
1911 |
+
}
|
1912 |
+
|
1913 |
+
} else {
|
1914 |
+
s.updateProgress(newPosition);
|
1915 |
+
}
|
1916 |
+
|
1917 |
+
s.updateActiveIndex();
|
1918 |
+
}
|
1919 |
+
if (!s.params.freeModeMomentum || timeDiff >= s.params.longSwipesMs) {
|
1920 |
+
s.updateProgress();
|
1921 |
+
s.updateActiveIndex();
|
1922 |
+
}
|
1923 |
+
return;
|
1924 |
+
}
|
1925 |
+
|
1926 |
+
// Find current slide
|
1927 |
+
var i, stopIndex = 0, groupSize = s.slidesSizesGrid[0];
|
1928 |
+
for (i = 0; i < s.slidesGrid.length; i += s.params.slidesPerGroup) {
|
1929 |
+
if (typeof s.slidesGrid[i + s.params.slidesPerGroup] !== 'undefined') {
|
1930 |
+
if (currentPos >= s.slidesGrid[i] && currentPos < s.slidesGrid[i + s.params.slidesPerGroup]) {
|
1931 |
+
stopIndex = i;
|
1932 |
+
groupSize = s.slidesGrid[i + s.params.slidesPerGroup] - s.slidesGrid[i];
|
1933 |
+
}
|
1934 |
+
}
|
1935 |
+
else {
|
1936 |
+
if (currentPos >= s.slidesGrid[i]) {
|
1937 |
+
stopIndex = i;
|
1938 |
+
groupSize = s.slidesGrid[s.slidesGrid.length - 1] - s.slidesGrid[s.slidesGrid.length - 2];
|
1939 |
+
}
|
1940 |
+
}
|
1941 |
+
}
|
1942 |
+
|
1943 |
+
// Find current slide size
|
1944 |
+
var ratio = (currentPos - s.slidesGrid[stopIndex]) / groupSize;
|
1945 |
+
|
1946 |
+
if (timeDiff > s.params.longSwipesMs) {
|
1947 |
+
// Long touches
|
1948 |
+
if (!s.params.longSwipes) {
|
1949 |
+
s.slideTo(s.activeIndex);
|
1950 |
+
return;
|
1951 |
+
}
|
1952 |
+
if (s.swipeDirection === 'next') {
|
1953 |
+
if (ratio >= s.params.longSwipesRatio) s.slideTo(stopIndex + s.params.slidesPerGroup);
|
1954 |
+
else s.slideTo(stopIndex);
|
1955 |
+
|
1956 |
+
}
|
1957 |
+
if (s.swipeDirection === 'prev') {
|
1958 |
+
if (ratio > (1 - s.params.longSwipesRatio)) s.slideTo(stopIndex + s.params.slidesPerGroup);
|
1959 |
+
else s.slideTo(stopIndex);
|
1960 |
+
}
|
1961 |
+
}
|
1962 |
+
else {
|
1963 |
+
// Short swipes
|
1964 |
+
if (!s.params.shortSwipes) {
|
1965 |
+
s.slideTo(s.activeIndex);
|
1966 |
+
return;
|
1967 |
+
}
|
1968 |
+
if (s.swipeDirection === 'next') {
|
1969 |
+
s.slideTo(stopIndex + s.params.slidesPerGroup);
|
1970 |
+
|
1971 |
+
}
|
1972 |
+
if (s.swipeDirection === 'prev') {
|
1973 |
+
s.slideTo(stopIndex);
|
1974 |
+
}
|
1975 |
+
}
|
1976 |
+
};
|
1977 |
+
/*=========================
|
1978 |
+
Transitions
|
1979 |
+
===========================*/
|
1980 |
+
s._slideTo = function (slideIndex, speed) {
|
1981 |
+
return s.slideTo(slideIndex, speed, true, true);
|
1982 |
+
};
|
1983 |
+
s.slideTo = function (slideIndex, speed, runCallbacks, internal) {
|
1984 |
+
if (typeof runCallbacks === 'undefined') runCallbacks = true;
|
1985 |
+
if (typeof slideIndex === 'undefined') slideIndex = 0;
|
1986 |
+
if (slideIndex < 0) slideIndex = 0;
|
1987 |
+
s.snapIndex = Math.floor(slideIndex / s.params.slidesPerGroup);
|
1988 |
+
if (s.snapIndex >= s.snapGrid.length) s.snapIndex = s.snapGrid.length - 1;
|
1989 |
+
|
1990 |
+
var translate = - s.snapGrid[s.snapIndex];
|
1991 |
+
// Stop autoplay
|
1992 |
+
if (s.params.autoplay && s.autoplaying) {
|
1993 |
+
if (internal || !s.params.autoplayDisableOnInteraction) {
|
1994 |
+
s.pauseAutoplay(speed);
|
1995 |
+
}
|
1996 |
+
else {
|
1997 |
+
s.stopAutoplay();
|
1998 |
+
}
|
1999 |
+
}
|
2000 |
+
// Update progress
|
2001 |
+
s.updateProgress(translate);
|
2002 |
+
|
2003 |
+
// Normalize slideIndex
|
2004 |
+
if(s.params.normalizeSlideIndex){
|
2005 |
+
for (var i = 0; i < s.slidesGrid.length; i++) {
|
2006 |
+
if (- Math.floor(translate * 100) >= Math.floor(s.slidesGrid[i] * 100)) {
|
2007 |
+
slideIndex = i;
|
2008 |
+
}
|
2009 |
+
}
|
2010 |
+
}
|
2011 |
+
|
2012 |
+
// Directions locks
|
2013 |
+
if (!s.params.allowSwipeToNext && translate < s.translate && translate < s.minTranslate()) {
|
2014 |
+
return false;
|
2015 |
+
}
|
2016 |
+
if (!s.params.allowSwipeToPrev && translate > s.translate && translate > s.maxTranslate()) {
|
2017 |
+
if ((s.activeIndex || 0) !== slideIndex ) return false;
|
2018 |
+
}
|
2019 |
+
|
2020 |
+
// Update Index
|
2021 |
+
if (typeof speed === 'undefined') speed = s.params.speed;
|
2022 |
+
s.previousIndex = s.activeIndex || 0;
|
2023 |
+
s.activeIndex = slideIndex;
|
2024 |
+
s.updateRealIndex();
|
2025 |
+
if ((s.rtl && -translate === s.translate) || (!s.rtl && translate === s.translate)) {
|
2026 |
+
// Update Height
|
2027 |
+
if (s.params.autoHeight) {
|
2028 |
+
s.updateAutoHeight();
|
2029 |
+
}
|
2030 |
+
s.updateClasses();
|
2031 |
+
if (s.params.effect !== 'slide') {
|
2032 |
+
s.setWrapperTranslate(translate);
|
2033 |
+
}
|
2034 |
+
return false;
|
2035 |
+
}
|
2036 |
+
s.updateClasses();
|
2037 |
+
s.onTransitionStart(runCallbacks);
|
2038 |
+
|
2039 |
+
if (speed === 0 || s.browser.lteIE9) {
|
2040 |
+
s.setWrapperTranslate(translate);
|
2041 |
+
s.setWrapperTransition(0);
|
2042 |
+
s.onTransitionEnd(runCallbacks);
|
2043 |
+
}
|
2044 |
+
else {
|
2045 |
+
s.setWrapperTranslate(translate);
|
2046 |
+
s.setWrapperTransition(speed);
|
2047 |
+
if (!s.animating) {
|
2048 |
+
s.animating = true;
|
2049 |
+
s.wrapper.transitionEnd(function () {
|
2050 |
+
if (!s) return;
|
2051 |
+
s.onTransitionEnd(runCallbacks);
|
2052 |
+
});
|
2053 |
+
}
|
2054 |
+
|
2055 |
+
}
|
2056 |
+
|
2057 |
+
return true;
|
2058 |
+
};
|
2059 |
+
|
2060 |
+
s.onTransitionStart = function (runCallbacks) {
|
2061 |
+
if (typeof runCallbacks === 'undefined') runCallbacks = true;
|
2062 |
+
if (s.params.autoHeight) {
|
2063 |
+
s.updateAutoHeight();
|
2064 |
+
}
|
2065 |
+
if (s.lazy) s.lazy.onTransitionStart();
|
2066 |
+
if (runCallbacks) {
|
2067 |
+
s.emit('onTransitionStart', s);
|
2068 |
+
if (s.activeIndex !== s.previousIndex) {
|
2069 |
+
s.emit('onSlideChangeStart', s);
|
2070 |
+
if (s.activeIndex > s.previousIndex) {
|
2071 |
+
s.emit('onSlideNextStart', s);
|
2072 |
+
}
|
2073 |
+
else {
|
2074 |
+
s.emit('onSlidePrevStart', s);
|
2075 |
+
}
|
2076 |
+
}
|
2077 |
+
|
2078 |
+
}
|
2079 |
+
};
|
2080 |
+
s.onTransitionEnd = function (runCallbacks) {
|
2081 |
+
s.animating = false;
|
2082 |
+
s.setWrapperTransition(0);
|
2083 |
+
if (typeof runCallbacks === 'undefined') runCallbacks = true;
|
2084 |
+
if (s.lazy) s.lazy.onTransitionEnd();
|
2085 |
+
if (runCallbacks) {
|
2086 |
+
s.emit('onTransitionEnd', s);
|
2087 |
+
if (s.activeIndex !== s.previousIndex) {
|
2088 |
+
s.emit('onSlideChangeEnd', s);
|
2089 |
+
if (s.activeIndex > s.previousIndex) {
|
2090 |
+
s.emit('onSlideNextEnd', s);
|
2091 |
+
}
|
2092 |
+
else {
|
2093 |
+
s.emit('onSlidePrevEnd', s);
|
2094 |
+
}
|
2095 |
+
}
|
2096 |
+
}
|
2097 |
+
if (s.params.history && s.history) {
|
2098 |
+
s.history.setHistory(s.params.history, s.activeIndex);
|
2099 |
+
}
|
2100 |
+
if (s.params.hashnav && s.hashnav) {
|
2101 |
+
s.hashnav.setHash();
|
2102 |
+
}
|
2103 |
+
|
2104 |
+
};
|
2105 |
+
s.slideNext = function (runCallbacks, speed, internal) {
|
2106 |
+
if (s.params.loop) {
|
2107 |
+
if (s.animating) return false;
|
2108 |
+
s.fixLoop();
|
2109 |
+
var clientLeft = s.container[0].clientLeft;
|
2110 |
+
return s.slideTo(s.activeIndex + s.params.slidesPerGroup, speed, runCallbacks, internal);
|
2111 |
+
}
|
2112 |
+
else return s.slideTo(s.activeIndex + s.params.slidesPerGroup, speed, runCallbacks, internal);
|
2113 |
+
};
|
2114 |
+
s._slideNext = function (speed) {
|
2115 |
+
return s.slideNext(true, speed, true);
|
2116 |
+
};
|
2117 |
+
s.slidePrev = function (runCallbacks, speed, internal) {
|
2118 |
+
if (s.params.loop) {
|
2119 |
+
if (s.animating) return false;
|
2120 |
+
s.fixLoop();
|
2121 |
+
var clientLeft = s.container[0].clientLeft;
|
2122 |
+
return s.slideTo(s.activeIndex - 1, speed, runCallbacks, internal);
|
2123 |
+
}
|
2124 |
+
else return s.slideTo(s.activeIndex - 1, speed, runCallbacks, internal);
|
2125 |
+
};
|
2126 |
+
s._slidePrev = function (speed) {
|
2127 |
+
return s.slidePrev(true, speed, true);
|
2128 |
+
};
|
2129 |
+
s.slideReset = function (runCallbacks, speed, internal) {
|
2130 |
+
return s.slideTo(s.activeIndex, speed, runCallbacks);
|
2131 |
+
};
|
2132 |
+
|
2133 |
+
s.disableTouchControl = function () {
|
2134 |
+
s.params.onlyExternal = true;
|
2135 |
+
return true;
|
2136 |
+
};
|
2137 |
+
s.enableTouchControl = function () {
|
2138 |
+
s.params.onlyExternal = false;
|
2139 |
+
return true;
|
2140 |
+
};
|
2141 |
+
|
2142 |
+
/*=========================
|
2143 |
+
Translate/transition helpers
|
2144 |
+
===========================*/
|
2145 |
+
s.setWrapperTransition = function (duration, byController) {
|
2146 |
+
s.wrapper.transition(duration);
|
2147 |
+
if (s.params.effect !== 'slide' && s.effects[s.params.effect]) {
|
2148 |
+
s.effects[s.params.effect].setTransition(duration);
|
2149 |
+
}
|
2150 |
+
if (s.params.parallax && s.parallax) {
|
2151 |
+
s.parallax.setTransition(duration);
|
2152 |
+
}
|
2153 |
+
if (s.params.scrollbar && s.scrollbar) {
|
2154 |
+
s.scrollbar.setTransition(duration);
|
2155 |
+
}
|
2156 |
+
if (s.params.control && s.controller) {
|
2157 |
+
s.controller.setTransition(duration, byController);
|
2158 |
+
}
|
2159 |
+
s.emit('onSetTransition', s, duration);
|
2160 |
+
};
|
2161 |
+
s.setWrapperTranslate = function (translate, updateActiveIndex, byController) {
|
2162 |
+
var x = 0, y = 0, z = 0;
|
2163 |
+
if (s.isHorizontal()) {
|
2164 |
+
x = s.rtl ? -translate : translate;
|
2165 |
+
}
|
2166 |
+
else {
|
2167 |
+
y = translate;
|
2168 |
+
}
|
2169 |
+
|
2170 |
+
if (s.params.roundLengths) {
|
2171 |
+
x = round(x);
|
2172 |
+
y = round(y);
|
2173 |
+
}
|
2174 |
+
|
2175 |
+
if (!s.params.virtualTranslate) {
|
2176 |
+
if (s.support.transforms3d) s.wrapper.transform('translate3d(' + x + 'px, ' + y + 'px, ' + z + 'px)');
|
2177 |
+
else s.wrapper.transform('translate(' + x + 'px, ' + y + 'px)');
|
2178 |
+
}
|
2179 |
+
|
2180 |
+
s.translate = s.isHorizontal() ? x : y;
|
2181 |
+
|
2182 |
+
// Check if we need to update progress
|
2183 |
+
var progress;
|
2184 |
+
var translatesDiff = s.maxTranslate() - s.minTranslate();
|
2185 |
+
if (translatesDiff === 0) {
|
2186 |
+
progress = 0;
|
2187 |
+
}
|
2188 |
+
else {
|
2189 |
+
progress = (translate - s.minTranslate()) / (translatesDiff);
|
2190 |
+
}
|
2191 |
+
if (progress !== s.progress) {
|
2192 |
+
s.updateProgress(translate);
|
2193 |
+
}
|
2194 |
+
|
2195 |
+
if (updateActiveIndex) s.updateActiveIndex();
|
2196 |
+
if (s.params.effect !== 'slide' && s.effects[s.params.effect]) {
|
2197 |
+
s.effects[s.params.effect].setTranslate(s.translate);
|
2198 |
+
}
|
2199 |
+
if (s.params.parallax && s.parallax) {
|
2200 |
+
s.parallax.setTranslate(s.translate);
|
2201 |
+
}
|
2202 |
+
if (s.params.scrollbar && s.scrollbar) {
|
2203 |
+
s.scrollbar.setTranslate(s.translate);
|
2204 |
+
}
|
2205 |
+
if (s.params.control && s.controller) {
|
2206 |
+
s.controller.setTranslate(s.translate, byController);
|
2207 |
+
}
|
2208 |
+
s.emit('onSetTranslate', s, s.translate);
|
2209 |
+
};
|
2210 |
+
|
2211 |
+
s.getTranslate = function (el, axis) {
|
2212 |
+
var matrix, curTransform, curStyle, transformMatrix;
|
2213 |
+
|
2214 |
+
// automatic axis detection
|
2215 |
+
if (typeof axis === 'undefined') {
|
2216 |
+
axis = 'x';
|
2217 |
+
}
|
2218 |
+
|
2219 |
+
if (s.params.virtualTranslate) {
|
2220 |
+
return s.rtl ? -s.translate : s.translate;
|
2221 |
+
}
|
2222 |
+
|
2223 |
+
curStyle = window.getComputedStyle(el, null);
|
2224 |
+
if (window.WebKitCSSMatrix) {
|
2225 |
+
curTransform = curStyle.transform || curStyle.webkitTransform;
|
2226 |
+
if (curTransform.split(',').length > 6) {
|
2227 |
+
curTransform = curTransform.split(', ').map(function(a){
|
2228 |
+
return a.replace(',','.');
|
2229 |
+
}).join(', ');
|
2230 |
+
}
|
2231 |
+
// Some old versions of Webkit choke when 'none' is passed; pass
|
2232 |
+
// empty string instead in this case
|
2233 |
+
transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform);
|
2234 |
+
}
|
2235 |
+
else {
|
2236 |
+
transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');
|
2237 |
+
matrix = transformMatrix.toString().split(',');
|
2238 |
+
}
|
2239 |
+
|
2240 |
+
if (axis === 'x') {
|
2241 |
+
//Latest Chrome and webkits Fix
|
2242 |
+
if (window.WebKitCSSMatrix)
|
2243 |
+
curTransform = transformMatrix.m41;
|
2244 |
+
//Crazy IE10 Matrix
|
2245 |
+
else if (matrix.length === 16)
|
2246 |
+
curTransform = parseFloat(matrix[12]);
|
2247 |
+
//Normal Browsers
|
2248 |
+
else
|
2249 |
+
curTransform = parseFloat(matrix[4]);
|
2250 |
+
}
|
2251 |
+
if (axis === 'y') {
|
2252 |
+
//Latest Chrome and webkits Fix
|
2253 |
+
if (window.WebKitCSSMatrix)
|
2254 |
+
curTransform = transformMatrix.m42;
|
2255 |
+
//Crazy IE10 Matrix
|
2256 |
+
else if (matrix.length === 16)
|
2257 |
+
curTransform = parseFloat(matrix[13]);
|
2258 |
+
//Normal Browsers
|
2259 |
+
else
|
2260 |
+
curTransform = parseFloat(matrix[5]);
|
2261 |
+
}
|
2262 |
+
if (s.rtl && curTransform) curTransform = -curTransform;
|
2263 |
+
return curTransform || 0;
|
2264 |
+
};
|
2265 |
+
s.getWrapperTranslate = function (axis) {
|
2266 |
+
if (typeof axis === 'undefined') {
|
2267 |
+
axis = s.isHorizontal() ? 'x' : 'y';
|
2268 |
+
}
|
2269 |
+
return s.getTranslate(s.wrapper[0], axis);
|
2270 |
+
};
|
2271 |
+
|
2272 |
+
/*=========================
|
2273 |
+
Observer
|
2274 |
+
===========================*/
|
2275 |
+
s.observers = [];
|
2276 |
+
function initObserver(target, options) {
|
2277 |
+
options = options || {};
|
2278 |
+
// create an observer instance
|
2279 |
+
var ObserverFunc = window.MutationObserver || window.WebkitMutationObserver;
|
2280 |
+
var observer = new ObserverFunc(function (mutations) {
|
2281 |
+
mutations.forEach(function (mutation) {
|
2282 |
+
s.onResize(true);
|
2283 |
+
s.emit('onObserverUpdate', s, mutation);
|
2284 |
+
});
|
2285 |
+
});
|
2286 |
+
|
2287 |
+
observer.observe(target, {
|
2288 |
+
attributes: typeof options.attributes === 'undefined' ? true : options.attributes,
|
2289 |
+
childList: typeof options.childList === 'undefined' ? true : options.childList,
|
2290 |
+
characterData: typeof options.characterData === 'undefined' ? true : options.characterData
|
2291 |
+
});
|
2292 |
+
|
2293 |
+
s.observers.push(observer);
|
2294 |
+
}
|
2295 |
+
s.initObservers = function () {
|
2296 |
+
if (s.params.observeParents) {
|
2297 |
+
var containerParents = s.container.parents();
|
2298 |
+
for (var i = 0; i < containerParents.length; i++) {
|
2299 |
+
initObserver(containerParents[i]);
|
2300 |
+
}
|
2301 |
+
}
|
2302 |
+
|
2303 |
+
// Observe container
|
2304 |
+
initObserver(s.container[0], {childList: false});
|
2305 |
+
|
2306 |
+
// Observe wrapper
|
2307 |
+
initObserver(s.wrapper[0], {attributes: false});
|
2308 |
+
};
|
2309 |
+
s.disconnectObservers = function () {
|
2310 |
+
for (var i = 0; i < s.observers.length; i++) {
|
2311 |
+
s.observers[i].disconnect();
|
2312 |
+
}
|
2313 |
+
s.observers = [];
|
2314 |
+
};
|
2315 |
+
/*=========================
|
2316 |
+
Loop
|
2317 |
+
===========================*/
|
2318 |
+
// Create looped slides
|
2319 |
+
s.createLoop = function () {
|
2320 |
+
// Remove duplicated slides
|
2321 |
+
s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass).remove();
|
2322 |
+
|
2323 |
+
var slides = s.wrapper.children('.' + s.params.slideClass);
|
2324 |
+
|
2325 |
+
if(s.params.slidesPerView === 'auto' && !s.params.loopedSlides) s.params.loopedSlides = slides.length;
|
2326 |
+
|
2327 |
+
s.loopedSlides = parseInt(s.params.loopedSlides || s.params.slidesPerView, 10);
|
2328 |
+
s.loopedSlides = s.loopedSlides + s.params.loopAdditionalSlides;
|
2329 |
+
if (s.loopedSlides > slides.length) {
|
2330 |
+
s.loopedSlides = slides.length;
|
2331 |
+
}
|
2332 |
+
|
2333 |
+
var prependSlides = [], appendSlides = [], i;
|
2334 |
+
slides.each(function (index, el) {
|
2335 |
+
var slide = $(this);
|
2336 |
+
if (index < s.loopedSlides) appendSlides.push(el);
|
2337 |
+
if (index < slides.length && index >= slides.length - s.loopedSlides) prependSlides.push(el);
|
2338 |
+
slide.attr('data-swiper-slide-index', index);
|
2339 |
+
});
|
2340 |
+
for (i = 0; i < appendSlides.length; i++) {
|
2341 |
+
s.wrapper.append($(appendSlides[i].cloneNode(true)).addClass(s.params.slideDuplicateClass));
|
2342 |
+
}
|
2343 |
+
for (i = prependSlides.length - 1; i >= 0; i--) {
|
2344 |
+
s.wrapper.prepend($(prependSlides[i].cloneNode(true)).addClass(s.params.slideDuplicateClass));
|
2345 |
+
}
|
2346 |
+
};
|
2347 |
+
s.destroyLoop = function () {
|
2348 |
+
s.wrapper.children('.' + s.params.slideClass + '.' + s.params.slideDuplicateClass).remove();
|
2349 |
+
s.slides.removeAttr('data-swiper-slide-index');
|
2350 |
+
};
|
2351 |
+
s.reLoop = function (updatePosition) {
|
2352 |
+
var oldIndex = s.activeIndex - s.loopedSlides;
|
2353 |
+
s.destroyLoop();
|
2354 |
+
s.createLoop();
|
2355 |
+
s.updateSlidesSize();
|
2356 |
+
if (updatePosition) {
|
2357 |
+
s.slideTo(oldIndex + s.loopedSlides, 0, false);
|
2358 |
+
}
|
2359 |
+
|
2360 |
+
};
|
2361 |
+
s.fixLoop = function () {
|
2362 |
+
var newIndex;
|
2363 |
+
//Fix For Negative Oversliding
|
2364 |
+
if (s.activeIndex < s.loopedSlides) {
|
2365 |
+
newIndex = s.slides.length - s.loopedSlides * 3 + s.activeIndex;
|
2366 |
+
newIndex = newIndex + s.loopedSlides;
|
2367 |
+
s.slideTo(newIndex, 0, false, true);
|
2368 |
+
}
|
2369 |
+
//Fix For Positive Oversliding
|
2370 |
+
else if ((s.params.slidesPerView === 'auto' && s.activeIndex >= s.loopedSlides * 2) || (s.activeIndex > s.slides.length - s.params.slidesPerView * 2)) {
|
2371 |
+
newIndex = -s.slides.length + s.activeIndex + s.loopedSlides;
|
2372 |
+
newIndex = newIndex + s.loopedSlides;
|
2373 |
+
s.slideTo(newIndex, 0, false, true);
|
2374 |
+
}
|
2375 |
+
};
|
2376 |
+
/*=========================
|
2377 |
+
Append/Prepend/Remove Slides
|
2378 |
+
===========================*/
|
2379 |
+
s.appendSlide = function (slides) {
|
2380 |
+
if (s.params.loop) {
|
2381 |
+
s.destroyLoop();
|
2382 |
+
}
|
2383 |
+
if (typeof slides === 'object' && slides.length) {
|
2384 |
+
for (var i = 0; i < slides.length; i++) {
|
2385 |
+
if (slides[i]) s.wrapper.append(slides[i]);
|
2386 |
+
}
|
2387 |
+
}
|
2388 |
+
else {
|
2389 |
+
s.wrapper.append(slides);
|
2390 |
+
}
|
2391 |
+
if (s.params.loop) {
|
2392 |
+
s.createLoop();
|
2393 |
+
}
|
2394 |
+
if (!(s.params.observer && s.support.observer)) {
|
2395 |
+
s.update(true);
|
2396 |
+
}
|
2397 |
+
};
|
2398 |
+
s.prependSlide = function (slides) {
|
2399 |
+
if (s.params.loop) {
|
2400 |
+
s.destroyLoop();
|
2401 |
+
}
|
2402 |
+
var newActiveIndex = s.activeIndex + 1;
|
2403 |
+
if (typeof slides === 'object' && slides.length) {
|
2404 |
+
for (var i = 0; i < slides.length; i++) {
|
2405 |
+
if (slides[i]) s.wrapper.prepend(slides[i]);
|
2406 |
+
}
|
2407 |
+
newActiveIndex = s.activeIndex + slides.length;
|
2408 |
+
}
|
2409 |
+
else {
|
2410 |
+
s.wrapper.prepend(slides);
|
2411 |
+
}
|
2412 |
+
if (s.params.loop) {
|
2413 |
+
s.createLoop();
|
2414 |
+
}
|
2415 |
+
if (!(s.params.observer && s.support.observer)) {
|
2416 |
+
s.update(true);
|
2417 |
+
}
|
2418 |
+
s.slideTo(newActiveIndex, 0, false);
|
2419 |
+
};
|
2420 |
+
s.removeSlide = function (slidesIndexes) {
|
2421 |
+
if (s.params.loop) {
|
2422 |
+
s.destroyLoop();
|
2423 |
+
s.slides = s.wrapper.children('.' + s.params.slideClass);
|
2424 |
+
}
|
2425 |
+
var newActiveIndex = s.activeIndex,
|
2426 |
+
indexToRemove;
|
2427 |
+
if (typeof slidesIndexes === 'object' && slidesIndexes.length) {
|
2428 |
+
for (var i = 0; i < slidesIndexes.length; i++) {
|
2429 |
+
indexToRemove = slidesIndexes[i];
|
2430 |
+
if (s.slides[indexToRemove]) s.slides.eq(indexToRemove).remove();
|
2431 |
+
if (indexToRemove < newActiveIndex) newActiveIndex--;
|
2432 |
+
}
|
2433 |
+
newActiveIndex = Math.max(newActiveIndex, 0);
|
2434 |
+
}
|
2435 |
+
else {
|
2436 |
+
indexToRemove = slidesIndexes;
|
2437 |
+
if (s.slides[indexToRemove]) s.slides.eq(indexToRemove).remove();
|
2438 |
+
if (indexToRemove < newActiveIndex) newActiveIndex--;
|
2439 |
+
newActiveIndex = Math.max(newActiveIndex, 0);
|
2440 |
+
}
|
2441 |
+
|
2442 |
+
if (s.params.loop) {
|
2443 |
+
s.createLoop();
|
2444 |
+
}
|
2445 |
+
|
2446 |
+
if (!(s.params.observer && s.support.observer)) {
|
2447 |
+
s.update(true);
|
2448 |
+
}
|
2449 |
+
if (s.params.loop) {
|
2450 |
+
s.slideTo(newActiveIndex + s.loopedSlides, 0, false);
|
2451 |
+
}
|
2452 |
+
else {
|
2453 |
+
s.slideTo(newActiveIndex, 0, false);
|
2454 |
+
}
|
2455 |
+
|
2456 |
+
};
|
2457 |
+
s.removeAllSlides = function () {
|
2458 |
+
var slidesIndexes = [];
|
2459 |
+
for (var i = 0; i < s.slides.length; i++) {
|
2460 |
+
slidesIndexes.push(i);
|
2461 |
+
}
|
2462 |
+
s.removeSlide(slidesIndexes);
|
2463 |
+
};
|
2464 |
+
|
2465 |
+
|
2466 |
+
/*=========================
|
2467 |
+
Effects
|
2468 |
+
===========================*/
|
2469 |
+
s.effects = {
|
2470 |
+
fade: {
|
2471 |
+
setTranslate: function () {
|
2472 |
+
for (var i = 0; i < s.slides.length; i++) {
|
2473 |
+
var slide = s.slides.eq(i);
|
2474 |
+
var offset = slide[0].swiperSlideOffset;
|
2475 |
+
var tx = -offset;
|
2476 |
+
if (!s.params.virtualTranslate) tx = tx - s.translate;
|
2477 |
+
var ty = 0;
|
2478 |
+
if (!s.isHorizontal()) {
|
2479 |
+
ty = tx;
|
2480 |
+
tx = 0;
|
2481 |
+
}
|
2482 |
+
var slideOpacity = s.params.fade.crossFade ?
|
2483 |
+
Math.max(1 - Math.abs(slide[0].progress), 0) :
|
2484 |
+
1 + Math.min(Math.max(slide[0].progress, -1), 0);
|
2485 |
+
slide
|
2486 |
+
.css({
|
2487 |
+
opacity: slideOpacity
|
2488 |
+
})
|
2489 |
+
.transform('translate3d(' + tx + 'px, ' + ty + 'px, 0px)');
|
2490 |
+
|
2491 |
+
}
|
2492 |
+
|
2493 |
+
},
|
2494 |
+
setTransition: function (duration) {
|
2495 |
+
s.slides.transition(duration);
|
2496 |
+
if (s.params.virtualTranslate && duration !== 0) {
|
2497 |
+
var eventTriggered = false;
|
2498 |
+
s.slides.transitionEnd(function () {
|
2499 |
+
if (eventTriggered) return;
|
2500 |
+
if (!s) return;
|
2501 |
+
eventTriggered = true;
|
2502 |
+
s.animating = false;
|
2503 |
+
var triggerEvents = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'];
|
2504 |
+
for (var i = 0; i < triggerEvents.length; i++) {
|
2505 |
+
s.wrapper.trigger(triggerEvents[i]);
|
2506 |
+
}
|
2507 |
+
});
|
2508 |
+
}
|
2509 |
+
}
|
2510 |
+
},
|
2511 |
+
flip: {
|
2512 |
+
setTranslate: function () {
|
2513 |
+
for (var i = 0; i < s.slides.length; i++) {
|
2514 |
+
var slide = s.slides.eq(i);
|
2515 |
+
var progress = slide[0].progress;
|
2516 |
+
if (s.params.flip.limitRotation) {
|
2517 |
+
progress = Math.max(Math.min(slide[0].progress, 1), -1);
|
2518 |
+
}
|
2519 |
+
var offset = slide[0].swiperSlideOffset;
|
2520 |
+
var rotate = -180 * progress,
|
2521 |
+
rotateY = rotate,
|
2522 |
+
rotateX = 0,
|
2523 |
+
tx = -offset,
|
2524 |
+
ty = 0;
|
2525 |
+
if (!s.isHorizontal()) {
|
2526 |
+
ty = tx;
|
2527 |
+
tx = 0;
|
2528 |
+
rotateX = -rotateY;
|
2529 |
+
rotateY = 0;
|
2530 |
+
}
|
2531 |
+
else if (s.rtl) {
|
2532 |
+
rotateY = -rotateY;
|
2533 |
+
}
|
2534 |
+
|
2535 |
+
slide[0].style.zIndex = -Math.abs(Math.round(progress)) + s.slides.length;
|
2536 |
+
|
2537 |
+
if (s.params.flip.slideShadows) {
|
2538 |
+
//Set shadows
|
2539 |
+
var shadowBefore = s.isHorizontal() ? slide.find('.swiper-slide-shadow-left') : slide.find('.swiper-slide-shadow-top');
|
2540 |
+
var shadowAfter = s.isHorizontal() ? slide.find('.swiper-slide-shadow-right') : slide.find('.swiper-slide-shadow-bottom');
|
2541 |
+
if (shadowBefore.length === 0) {
|
2542 |
+
shadowBefore = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'left' : 'top') + '"></div>');
|
2543 |
+
slide.append(shadowBefore);
|
2544 |
+
}
|
2545 |
+
if (shadowAfter.length === 0) {
|
2546 |
+
shadowAfter = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'right' : 'bottom') + '"></div>');
|
2547 |
+
slide.append(shadowAfter);
|
2548 |
+
}
|
2549 |
+
if (shadowBefore.length) shadowBefore[0].style.opacity = Math.max(-progress, 0);
|
2550 |
+
if (shadowAfter.length) shadowAfter[0].style.opacity = Math.max(progress, 0);
|
2551 |
+
}
|
2552 |
+
|
2553 |
+
slide
|
2554 |
+
.transform('translate3d(' + tx + 'px, ' + ty + 'px, 0px) rotateX(' + rotateX + 'deg) rotateY(' + rotateY + 'deg)');
|
2555 |
+
}
|
2556 |
+
},
|
2557 |
+
setTransition: function (duration) {
|
2558 |
+
s.slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration);
|
2559 |
+
if (s.params.virtualTranslate && duration !== 0) {
|
2560 |
+
var eventTriggered = false;
|
2561 |
+
s.slides.eq(s.activeIndex).transitionEnd(function () {
|
2562 |
+
if (eventTriggered) return;
|
2563 |
+
if (!s) return;
|
2564 |
+
if (!$(this).hasClass(s.params.slideActiveClass)) return;
|
2565 |
+
eventTriggered = true;
|
2566 |
+
s.animating = false;
|
2567 |
+
var triggerEvents = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'];
|
2568 |
+
for (var i = 0; i < triggerEvents.length; i++) {
|
2569 |
+
s.wrapper.trigger(triggerEvents[i]);
|
2570 |
+
}
|
2571 |
+
});
|
2572 |
+
}
|
2573 |
+
}
|
2574 |
+
},
|
2575 |
+
cube: {
|
2576 |
+
setTranslate: function () {
|
2577 |
+
var wrapperRotate = 0, cubeShadow;
|
2578 |
+
if (s.params.cube.shadow) {
|
2579 |
+
if (s.isHorizontal()) {
|
2580 |
+
cubeShadow = s.wrapper.find('.swiper-cube-shadow');
|
2581 |
+
if (cubeShadow.length === 0) {
|
2582 |
+
cubeShadow = $('<div class="swiper-cube-shadow"></div>');
|
2583 |
+
s.wrapper.append(cubeShadow);
|
2584 |
+
}
|
2585 |
+
cubeShadow.css({height: s.width + 'px'});
|
2586 |
+
}
|
2587 |
+
else {
|
2588 |
+
cubeShadow = s.container.find('.swiper-cube-shadow');
|
2589 |
+
if (cubeShadow.length === 0) {
|
2590 |
+
cubeShadow = $('<div class="swiper-cube-shadow"></div>');
|
2591 |
+
s.container.append(cubeShadow);
|
2592 |
+
}
|
2593 |
+
}
|
2594 |
+
}
|
2595 |
+
for (var i = 0; i < s.slides.length; i++) {
|
2596 |
+
var slide = s.slides.eq(i);
|
2597 |
+
var slideAngle = i * 90;
|
2598 |
+
var round = Math.floor(slideAngle / 360);
|
2599 |
+
if (s.rtl) {
|
2600 |
+
slideAngle = -slideAngle;
|
2601 |
+
round = Math.floor(-slideAngle / 360);
|
2602 |
+
}
|
2603 |
+
var progress = Math.max(Math.min(slide[0].progress, 1), -1);
|
2604 |
+
var tx = 0, ty = 0, tz = 0;
|
2605 |
+
if (i % 4 === 0) {
|
2606 |
+
tx = - round * 4 * s.size;
|
2607 |
+
tz = 0;
|
2608 |
+
}
|
2609 |
+
else if ((i - 1) % 4 === 0) {
|
2610 |
+
tx = 0;
|
2611 |
+
tz = - round * 4 * s.size;
|
2612 |
+
}
|
2613 |
+
else if ((i - 2) % 4 === 0) {
|
2614 |
+
tx = s.size + round * 4 * s.size;
|
2615 |
+
tz = s.size;
|
2616 |
+
}
|
2617 |
+
else if ((i - 3) % 4 === 0) {
|
2618 |
+
tx = - s.size;
|
2619 |
+
tz = 3 * s.size + s.size * 4 * round;
|
2620 |
+
}
|
2621 |
+
if (s.rtl) {
|
2622 |
+
tx = -tx;
|
2623 |
+
}
|
2624 |
+
|
2625 |
+
if (!s.isHorizontal()) {
|
2626 |
+
ty = tx;
|
2627 |
+
tx = 0;
|
2628 |
+
}
|
2629 |
+
|
2630 |
+
var transform = 'rotateX(' + (s.isHorizontal() ? 0 : -slideAngle) + 'deg) rotateY(' + (s.isHorizontal() ? slideAngle : 0) + 'deg) translate3d(' + tx + 'px, ' + ty + 'px, ' + tz + 'px)';
|
2631 |
+
if (progress <= 1 && progress > -1) {
|
2632 |
+
wrapperRotate = i * 90 + progress * 90;
|
2633 |
+
if (s.rtl) wrapperRotate = -i * 90 - progress * 90;
|
2634 |
+
}
|
2635 |
+
slide.transform(transform);
|
2636 |
+
if (s.params.cube.slideShadows) {
|
2637 |
+
//Set shadows
|
2638 |
+
var shadowBefore = s.isHorizontal() ? slide.find('.swiper-slide-shadow-left') : slide.find('.swiper-slide-shadow-top');
|
2639 |
+
var shadowAfter = s.isHorizontal() ? slide.find('.swiper-slide-shadow-right') : slide.find('.swiper-slide-shadow-bottom');
|
2640 |
+
if (shadowBefore.length === 0) {
|
2641 |
+
shadowBefore = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'left' : 'top') + '"></div>');
|
2642 |
+
slide.append(shadowBefore);
|
2643 |
+
}
|
2644 |
+
if (shadowAfter.length === 0) {
|
2645 |
+
shadowAfter = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'right' : 'bottom') + '"></div>');
|
2646 |
+
slide.append(shadowAfter);
|
2647 |
+
}
|
2648 |
+
if (shadowBefore.length) shadowBefore[0].style.opacity = Math.max(-progress, 0);
|
2649 |
+
if (shadowAfter.length) shadowAfter[0].style.opacity = Math.max(progress, 0);
|
2650 |
+
}
|
2651 |
+
}
|
2652 |
+
s.wrapper.css({
|
2653 |
+
'-webkit-transform-origin': '50% 50% -' + (s.size / 2) + 'px',
|
2654 |
+
'-moz-transform-origin': '50% 50% -' + (s.size / 2) + 'px',
|
2655 |
+
'-ms-transform-origin': '50% 50% -' + (s.size / 2) + 'px',
|
2656 |
+
'transform-origin': '50% 50% -' + (s.size / 2) + 'px'
|
2657 |
+
});
|
2658 |
+
|
2659 |
+
if (s.params.cube.shadow) {
|
2660 |
+
if (s.isHorizontal()) {
|
2661 |
+
cubeShadow.transform('translate3d(0px, ' + (s.width / 2 + s.params.cube.shadowOffset) + 'px, ' + (-s.width / 2) + 'px) rotateX(90deg) rotateZ(0deg) scale(' + (s.params.cube.shadowScale) + ')');
|
2662 |
+
}
|
2663 |
+
else {
|
2664 |
+
var shadowAngle = Math.abs(wrapperRotate) - Math.floor(Math.abs(wrapperRotate) / 90) * 90;
|
2665 |
+
var multiplier = 1.5 - (Math.sin(shadowAngle * 2 * Math.PI / 360) / 2 + Math.cos(shadowAngle * 2 * Math.PI / 360) / 2);
|
2666 |
+
var scale1 = s.params.cube.shadowScale,
|
2667 |
+
scale2 = s.params.cube.shadowScale / multiplier,
|
2668 |
+
offset = s.params.cube.shadowOffset;
|
2669 |
+
cubeShadow.transform('scale3d(' + scale1 + ', 1, ' + scale2 + ') translate3d(0px, ' + (s.height / 2 + offset) + 'px, ' + (-s.height / 2 / scale2) + 'px) rotateX(-90deg)');
|
2670 |
+
}
|
2671 |
+
}
|
2672 |
+
var zFactor = (s.isSafari || s.isUiWebView) ? (-s.size / 2) : 0;
|
2673 |
+
s.wrapper.transform('translate3d(0px,0,' + zFactor + 'px) rotateX(' + (s.isHorizontal() ? 0 : wrapperRotate) + 'deg) rotateY(' + (s.isHorizontal() ? -wrapperRotate : 0) + 'deg)');
|
2674 |
+
},
|
2675 |
+
setTransition: function (duration) {
|
2676 |
+
s.slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration);
|
2677 |
+
if (s.params.cube.shadow && !s.isHorizontal()) {
|
2678 |
+
s.container.find('.swiper-cube-shadow').transition(duration);
|
2679 |
+
}
|
2680 |
+
}
|
2681 |
+
},
|
2682 |
+
coverflow: {
|
2683 |
+
setTranslate: function () {
|
2684 |
+
var transform = s.translate;
|
2685 |
+
var center = s.isHorizontal() ? -transform + s.width / 2 : -transform + s.height / 2;
|
2686 |
+
var rotate = s.isHorizontal() ? s.params.coverflow.rotate: -s.params.coverflow.rotate;
|
2687 |
+
var translate = s.params.coverflow.depth;
|
2688 |
+
//Each slide offset from center
|
2689 |
+
for (var i = 0, length = s.slides.length; i < length; i++) {
|
2690 |
+
var slide = s.slides.eq(i);
|
2691 |
+
var slideSize = s.slidesSizesGrid[i];
|
2692 |
+
var slideOffset = slide[0].swiperSlideOffset;
|
2693 |
+
var offsetMultiplier = (center - slideOffset - slideSize / 2) / slideSize * s.params.coverflow.modifier;
|
2694 |
+
|
2695 |
+
var rotateY = s.isHorizontal() ? rotate * offsetMultiplier : 0;
|
2696 |
+
var rotateX = s.isHorizontal() ? 0 : rotate * offsetMultiplier;
|
2697 |
+
// var rotateZ = 0
|
2698 |
+
var translateZ = -translate * Math.abs(offsetMultiplier);
|
2699 |
+
|
2700 |
+
var translateY = s.isHorizontal() ? 0 : s.params.coverflow.stretch * (offsetMultiplier);
|
2701 |
+
var translateX = s.isHorizontal() ? s.params.coverflow.stretch * (offsetMultiplier) : 0;
|
2702 |
+
|
2703 |
+
//Fix for ultra small values
|
2704 |
+
if (Math.abs(translateX) < 0.001) translateX = 0;
|
2705 |
+
if (Math.abs(translateY) < 0.001) translateY = 0;
|
2706 |
+
if (Math.abs(translateZ) < 0.001) translateZ = 0;
|
2707 |
+
if (Math.abs(rotateY) < 0.001) rotateY = 0;
|
2708 |
+
if (Math.abs(rotateX) < 0.001) rotateX = 0;
|
2709 |
+
|
2710 |
+
var slideTransform = 'translate3d(' + translateX + 'px,' + translateY + 'px,' + translateZ + 'px) rotateX(' + rotateX + 'deg) rotateY(' + rotateY + 'deg)';
|
2711 |
+
|
2712 |
+
slide.transform(slideTransform);
|
2713 |
+
slide[0].style.zIndex = -Math.abs(Math.round(offsetMultiplier)) + 1;
|
2714 |
+
if (s.params.coverflow.slideShadows) {
|
2715 |
+
//Set shadows
|
2716 |
+
var shadowBefore = s.isHorizontal() ? slide.find('.swiper-slide-shadow-left') : slide.find('.swiper-slide-shadow-top');
|
2717 |
+
var shadowAfter = s.isHorizontal() ? slide.find('.swiper-slide-shadow-right') : slide.find('.swiper-slide-shadow-bottom');
|
2718 |
+
if (shadowBefore.length === 0) {
|
2719 |
+
shadowBefore = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'left' : 'top') + '"></div>');
|
2720 |
+
slide.append(shadowBefore);
|
2721 |
+
}
|
2722 |
+
if (shadowAfter.length === 0) {
|
2723 |
+
shadowAfter = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'right' : 'bottom') + '"></div>');
|
2724 |
+
slide.append(shadowAfter);
|
2725 |
+
}
|
2726 |
+
if (shadowBefore.length) shadowBefore[0].style.opacity = offsetMultiplier > 0 ? offsetMultiplier : 0;
|
2727 |
+
if (shadowAfter.length) shadowAfter[0].style.opacity = (-offsetMultiplier) > 0 ? -offsetMultiplier : 0;
|
2728 |
+
}
|
2729 |
+
}
|
2730 |
+
|
2731 |
+
//Set correct perspective for IE10
|
2732 |
+
if (s.browser.ie) {
|
2733 |
+
var ws = s.wrapper[0].style;
|
2734 |
+
ws.perspectiveOrigin = center + 'px 50%';
|
2735 |
+
}
|
2736 |
+
},
|
2737 |
+
setTransition: function (duration) {
|
2738 |
+
s.slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration);
|
2739 |
+
}
|
2740 |
+
}
|
2741 |
+
};
|
2742 |
+
|
2743 |
+
/*=========================
|
2744 |
+
Images Lazy Loading
|
2745 |
+
===========================*/
|
2746 |
+
s.lazy = {
|
2747 |
+
initialImageLoaded: false,
|
2748 |
+
loadImageInSlide: function (index, loadInDuplicate) {
|
2749 |
+
if (typeof index === 'undefined') return;
|
2750 |
+
if (typeof loadInDuplicate === 'undefined') loadInDuplicate = true;
|
2751 |
+
if (s.slides.length === 0) return;
|
2752 |
+
|
2753 |
+
var slide = s.slides.eq(index);
|
2754 |
+
var img = slide.find('.' + s.params.lazyLoadingClass + ':not(.' + s.params.lazyStatusLoadedClass + '):not(.' + s.params.lazyStatusLoadingClass + ')');
|
2755 |
+
if (slide.hasClass(s.params.lazyLoadingClass) && !slide.hasClass(s.params.lazyStatusLoadedClass) && !slide.hasClass(s.params.lazyStatusLoadingClass)) {
|
2756 |
+
img = img.add(slide[0]);
|
2757 |
+
}
|
2758 |
+
if (img.length === 0) return;
|
2759 |
+
|
2760 |
+
img.each(function () {
|
2761 |
+
var _img = $(this);
|
2762 |
+
_img.addClass(s.params.lazyStatusLoadingClass);
|
2763 |
+
var background = _img.attr('data-background');
|
2764 |
+
var src = _img.attr('data-src'),
|
2765 |
+
srcset = _img.attr('data-srcset'),
|
2766 |
+
sizes = _img.attr('data-sizes');
|
2767 |
+
s.loadImage(_img[0], (src || background), srcset, sizes, false, function () {
|
2768 |
+
if (background) {
|
2769 |
+
_img.css('background-image', 'url("' + background + '")');
|
2770 |
+
_img.removeAttr('data-background');
|
2771 |
+
}
|
2772 |
+
else {
|
2773 |
+
if (srcset) {
|
2774 |
+
_img.attr('srcset', srcset);
|
2775 |
+
_img.removeAttr('data-srcset');
|
2776 |
+
}
|
2777 |
+
if (sizes) {
|
2778 |
+
_img.attr('sizes', sizes);
|
2779 |
+
_img.removeAttr('data-sizes');
|
2780 |
+
}
|
2781 |
+
if (src) {
|
2782 |
+
_img.attr('src', src);
|
2783 |
+
_img.removeAttr('data-src');
|
2784 |
+
}
|
2785 |
+
|
2786 |
+
}
|
2787 |
+
|
2788 |
+
_img.addClass(s.params.lazyStatusLoadedClass).removeClass(s.params.lazyStatusLoadingClass);
|
2789 |
+
slide.find('.' + s.params.lazyPreloaderClass + ', .' + s.params.preloaderClass).remove();
|
2790 |
+
if (s.params.loop && loadInDuplicate) {
|
2791 |
+
var slideOriginalIndex = slide.attr('data-swiper-slide-index');
|
2792 |
+
if (slide.hasClass(s.params.slideDuplicateClass)) {
|
2793 |
+
var originalSlide = s.wrapper.children('[data-swiper-slide-index="' + slideOriginalIndex + '"]:not(.' + s.params.slideDuplicateClass + ')');
|
2794 |
+
s.lazy.loadImageInSlide(originalSlide.index(), false);
|
2795 |
+
}
|
2796 |
+
else {
|
2797 |
+
var duplicatedSlide = s.wrapper.children('.' + s.params.slideDuplicateClass + '[data-swiper-slide-index="' + slideOriginalIndex + '"]');
|
2798 |
+
s.lazy.loadImageInSlide(duplicatedSlide.index(), false);
|
2799 |
+
}
|
2800 |
+
}
|
2801 |
+
s.emit('onLazyImageReady', s, slide[0], _img[0]);
|
2802 |
+
});
|
2803 |
+
|
2804 |
+
s.emit('onLazyImageLoad', s, slide[0], _img[0]);
|
2805 |
+
});
|
2806 |
+
|
2807 |
+
},
|
2808 |
+
load: function () {
|
2809 |
+
var i;
|
2810 |
+
var slidesPerView = s.params.slidesPerView;
|
2811 |
+
if (slidesPerView === 'auto') {
|
2812 |
+
slidesPerView = 0;
|
2813 |
+
}
|
2814 |
+
if (!s.lazy.initialImageLoaded) s.lazy.initialImageLoaded = true;
|
2815 |
+
if (s.params.watchSlidesVisibility) {
|
2816 |
+
s.wrapper.children('.' + s.params.slideVisibleClass).each(function () {
|
2817 |
+
s.lazy.loadImageInSlide($(this).index());
|
2818 |
+
});
|
2819 |
+
}
|
2820 |
+
else {
|
2821 |
+
if (slidesPerView > 1) {
|
2822 |
+
for (i = s.activeIndex; i < s.activeIndex + slidesPerView ; i++) {
|
2823 |
+
if (s.slides[i]) s.lazy.loadImageInSlide(i);
|
2824 |
+
}
|
2825 |
+
}
|
2826 |
+
else {
|
2827 |
+
s.lazy.loadImageInSlide(s.activeIndex);
|
2828 |
+
}
|
2829 |
+
}
|
2830 |
+
if (s.params.lazyLoadingInPrevNext) {
|
2831 |
+
if (slidesPerView > 1 || (s.params.lazyLoadingInPrevNextAmount && s.params.lazyLoadingInPrevNextAmount > 1)) {
|
2832 |
+
var amount = s.params.lazyLoadingInPrevNextAmount;
|
2833 |
+
var spv = slidesPerView;
|
2834 |
+
var maxIndex = Math.min(s.activeIndex + spv + Math.max(amount, spv), s.slides.length);
|
2835 |
+
var minIndex = Math.max(s.activeIndex - Math.max(spv, amount), 0);
|
2836 |
+
// Next Slides
|
2837 |
+
for (i = s.activeIndex + slidesPerView; i < maxIndex; i++) {
|
2838 |
+
if (s.slides[i]) s.lazy.loadImageInSlide(i);
|
2839 |
+
}
|
2840 |
+
// Prev Slides
|
2841 |
+
for (i = minIndex; i < s.activeIndex ; i++) {
|
2842 |
+
if (s.slides[i]) s.lazy.loadImageInSlide(i);
|
2843 |
+
}
|
2844 |
+
}
|
2845 |
+
else {
|
2846 |
+
var nextSlide = s.wrapper.children('.' + s.params.slideNextClass);
|
2847 |
+
if (nextSlide.length > 0) s.lazy.loadImageInSlide(nextSlide.index());
|
2848 |
+
|
2849 |
+
var prevSlide = s.wrapper.children('.' + s.params.slidePrevClass);
|
2850 |
+
if (prevSlide.length > 0) s.lazy.loadImageInSlide(prevSlide.index());
|
2851 |
+
}
|
2852 |
+
}
|
2853 |
+
},
|
2854 |
+
onTransitionStart: function () {
|
2855 |
+
if (s.params.lazyLoading) {
|
2856 |
+
if (s.params.lazyLoadingOnTransitionStart || (!s.params.lazyLoadingOnTransitionStart && !s.lazy.initialImageLoaded)) {
|
2857 |
+
s.lazy.load();
|
2858 |
+
}
|
2859 |
+
}
|
2860 |
+
},
|
2861 |
+
onTransitionEnd: function () {
|
2862 |
+
if (s.params.lazyLoading && !s.params.lazyLoadingOnTransitionStart) {
|
2863 |
+
s.lazy.load();
|
2864 |
+
}
|
2865 |
+
}
|
2866 |
+
};
|
2867 |
+
|
2868 |
+
|
2869 |
+
/*=========================
|
2870 |
+
Scrollbar
|
2871 |
+
===========================*/
|
2872 |
+
s.scrollbar = {
|
2873 |
+
isTouched: false,
|
2874 |
+
setDragPosition: function (e) {
|
2875 |
+
var sb = s.scrollbar;
|
2876 |
+
var x = 0, y = 0;
|
2877 |
+
var translate;
|
2878 |
+
var pointerPosition = s.isHorizontal() ?
|
2879 |
+
((e.type === 'touchstart' || e.type === 'touchmove') ? e.targetTouches[0].pageX : e.pageX || e.clientX) :
|
2880 |
+
((e.type === 'touchstart' || e.type === 'touchmove') ? e.targetTouches[0].pageY : e.pageY || e.clientY) ;
|
2881 |
+
var position = (pointerPosition) - sb.track.offset()[s.isHorizontal() ? 'left' : 'top'] - sb.dragSize / 2;
|
2882 |
+
var positionMin = -s.minTranslate() * sb.moveDivider;
|
2883 |
+
var positionMax = -s.maxTranslate() * sb.moveDivider;
|
2884 |
+
if (position < positionMin) {
|
2885 |
+
position = positionMin;
|
2886 |
+
}
|
2887 |
+
else if (position > positionMax) {
|
2888 |
+
position = positionMax;
|
2889 |
+
}
|
2890 |
+
position = -position / sb.moveDivider;
|
2891 |
+
s.updateProgress(position);
|
2892 |
+
s.setWrapperTranslate(position, true);
|
2893 |
+
},
|
2894 |
+
dragStart: function (e) {
|
2895 |
+
var sb = s.scrollbar;
|
2896 |
+
sb.isTouched = true;
|
2897 |
+
e.preventDefault();
|
2898 |
+
e.stopPropagation();
|
2899 |
+
|
2900 |
+
sb.setDragPosition(e);
|
2901 |
+
clearTimeout(sb.dragTimeout);
|
2902 |
+
|
2903 |
+
sb.track.transition(0);
|
2904 |
+
if (s.params.scrollbarHide) {
|
2905 |
+
sb.track.css('opacity', 1);
|
2906 |
+
}
|
2907 |
+
s.wrapper.transition(100);
|
2908 |
+
sb.drag.transition(100);
|
2909 |
+
s.emit('onScrollbarDragStart', s);
|
2910 |
+
},
|
2911 |
+
dragMove: function (e) {
|
2912 |
+
var sb = s.scrollbar;
|
2913 |
+
if (!sb.isTouched) return;
|
2914 |
+
if (e.preventDefault) e.preventDefault();
|
2915 |
+
else e.returnValue = false;
|
2916 |
+
sb.setDragPosition(e);
|
2917 |
+
s.wrapper.transition(0);
|
2918 |
+
sb.track.transition(0);
|
2919 |
+
sb.drag.transition(0);
|
2920 |
+
s.emit('onScrollbarDragMove', s);
|
2921 |
+
},
|
2922 |
+
dragEnd: function (e) {
|
2923 |
+
var sb = s.scrollbar;
|
2924 |
+
if (!sb.isTouched) return;
|
2925 |
+
sb.isTouched = false;
|
2926 |
+
if (s.params.scrollbarHide) {
|
2927 |
+
clearTimeout(sb.dragTimeout);
|
2928 |
+
sb.dragTimeout = setTimeout(function () {
|
2929 |
+
sb.track.css('opacity', 0);
|
2930 |
+
sb.track.transition(400);
|
2931 |
+
}, 1000);
|
2932 |
+
|
2933 |
+
}
|
2934 |
+
s.emit('onScrollbarDragEnd', s);
|
2935 |
+
if (s.params.scrollbarSnapOnRelease) {
|
2936 |
+
s.slideReset();
|
2937 |
+
}
|
2938 |
+
},
|
2939 |
+
draggableEvents: (function () {
|
2940 |
+
if ((s.params.simulateTouch === false && !s.support.touch)) return s.touchEventsDesktop;
|
2941 |
+
else return s.touchEvents;
|
2942 |
+
})(),
|
2943 |
+
enableDraggable: function () {
|
2944 |
+
var sb = s.scrollbar;
|
2945 |
+
var target = s.support.touch ? sb.track : document;
|
2946 |
+
$(sb.track).on(sb.draggableEvents.start, sb.dragStart);
|
2947 |
+
$(target).on(sb.draggableEvents.move, sb.dragMove);
|
2948 |
+
$(target).on(sb.draggableEvents.end, sb.dragEnd);
|
2949 |
+
},
|
2950 |
+
disableDraggable: function () {
|
2951 |
+
var sb = s.scrollbar;
|
2952 |
+
var target = s.support.touch ? sb.track : document;
|
2953 |
+
$(sb.track).off(s.draggableEvents.start, sb.dragStart);
|
2954 |
+
$(target).off(s.draggableEvents.move, sb.dragMove);
|
2955 |
+
$(target).off(s.draggableEvents.end, sb.dragEnd);
|
2956 |
+
},
|
2957 |
+
set: function () {
|
2958 |
+
if (!s.params.scrollbar) return;
|
2959 |
+
var sb = s.scrollbar;
|
2960 |
+
sb.track = $(s.params.scrollbar);
|
2961 |
+
if (s.params.uniqueNavElements && typeof s.params.scrollbar === 'string' && sb.track.length > 1 && s.container.find(s.params.scrollbar).length === 1) {
|
2962 |
+
sb.track = s.container.find(s.params.scrollbar);
|
2963 |
+
}
|
2964 |
+
sb.drag = sb.track.find('.swiper-scrollbar-drag');
|
2965 |
+
if (sb.drag.length === 0) {
|
2966 |
+
sb.drag = $('<div class="swiper-scrollbar-drag"></div>');
|
2967 |
+
sb.track.append(sb.drag);
|
2968 |
+
}
|
2969 |
+
sb.drag[0].style.width = '';
|
2970 |
+
sb.drag[0].style.height = '';
|
2971 |
+
sb.trackSize = s.isHorizontal() ? sb.track[0].offsetWidth : sb.track[0].offsetHeight;
|
2972 |
+
|
2973 |
+
sb.divider = s.size / s.virtualSize;
|
2974 |
+
sb.moveDivider = sb.divider * (sb.trackSize / s.size);
|
2975 |
+
sb.dragSize = sb.trackSize * sb.divider;
|
2976 |
+
|
2977 |
+
if (s.isHorizontal()) {
|
2978 |
+
sb.drag[0].style.width = sb.dragSize + 'px';
|
2979 |
+
}
|
2980 |
+
else {
|
2981 |
+
sb.drag[0].style.height = sb.dragSize + 'px';
|
2982 |
+
}
|
2983 |
+
|
2984 |
+
if (sb.divider >= 1) {
|
2985 |
+
sb.track[0].style.display = 'none';
|
2986 |
+
}
|
2987 |
+
else {
|
2988 |
+
sb.track[0].style.display = '';
|
2989 |
+
}
|
2990 |
+
if (s.params.scrollbarHide) {
|
2991 |
+
sb.track[0].style.opacity = 0;
|
2992 |
+
}
|
2993 |
+
},
|
2994 |
+
setTranslate: function () {
|
2995 |
+
if (!s.params.scrollbar) return;
|
2996 |
+
var diff;
|
2997 |
+
var sb = s.scrollbar;
|
2998 |
+
var translate = s.translate || 0;
|
2999 |
+
var newPos;
|
3000 |
+
|
3001 |
+
var newSize = sb.dragSize;
|
3002 |
+
newPos = (sb.trackSize - sb.dragSize) * s.progress;
|
3003 |
+
if (s.rtl && s.isHorizontal()) {
|
3004 |
+
newPos = -newPos;
|
3005 |
+
if (newPos > 0) {
|
3006 |
+
newSize = sb.dragSize - newPos;
|
3007 |
+
newPos = 0;
|
3008 |
+
}
|
3009 |
+
else if (-newPos + sb.dragSize > sb.trackSize) {
|
3010 |
+
newSize = sb.trackSize + newPos;
|
3011 |
+
}
|
3012 |
+
}
|
3013 |
+
else {
|
3014 |
+
if (newPos < 0) {
|
3015 |
+
newSize = sb.dragSize + newPos;
|
3016 |
+
newPos = 0;
|
3017 |
+
}
|
3018 |
+
else if (newPos + sb.dragSize > sb.trackSize) {
|
3019 |
+
newSize = sb.trackSize - newPos;
|
3020 |
+
}
|
3021 |
+
}
|
3022 |
+
if (s.isHorizontal()) {
|
3023 |
+
if (s.support.transforms3d) {
|
3024 |
+
sb.drag.transform('translate3d(' + (newPos) + 'px, 0, 0)');
|
3025 |
+
}
|
3026 |
+
else {
|
3027 |
+
sb.drag.transform('translateX(' + (newPos) + 'px)');
|
3028 |
+
}
|
3029 |
+
sb.drag[0].style.width = newSize + 'px';
|
3030 |
+
}
|
3031 |
+
else {
|
3032 |
+
if (s.support.transforms3d) {
|
3033 |
+
sb.drag.transform('translate3d(0px, ' + (newPos) + 'px, 0)');
|
3034 |
+
}
|
3035 |
+
else {
|
3036 |
+
sb.drag.transform('translateY(' + (newPos) + 'px)');
|
3037 |
+
}
|
3038 |
+
sb.drag[0].style.height = newSize + 'px';
|
3039 |
+
}
|
3040 |
+
if (s.params.scrollbarHide) {
|
3041 |
+
clearTimeout(sb.timeout);
|
3042 |
+
sb.track[0].style.opacity = 1;
|
3043 |
+
sb.timeout = setTimeout(function () {
|
3044 |
+
sb.track[0].style.opacity = 0;
|
3045 |
+
sb.track.transition(400);
|
3046 |
+
}, 1000);
|
3047 |
+
}
|
3048 |
+
},
|
3049 |
+
setTransition: function (duration) {
|
3050 |
+
if (!s.params.scrollbar) return;
|
3051 |
+
s.scrollbar.drag.transition(duration);
|
3052 |
+
}
|
3053 |
+
};
|
3054 |
+
|
3055 |
+
/*=========================
|
3056 |
+
Controller
|
3057 |
+
===========================*/
|
3058 |
+
s.controller = {
|
3059 |
+
LinearSpline: function (x, y) {
|
3060 |
+
this.x = x;
|
3061 |
+
this.y = y;
|
3062 |
+
this.lastIndex = x.length - 1;
|
3063 |
+
// Given an x value (x2), return the expected y2 value:
|
3064 |
+
// (x1,y1) is the known point before given value,
|
3065 |
+
// (x3,y3) is the known point after given value.
|
3066 |
+
var i1, i3;
|
3067 |
+
var l = this.x.length;
|
3068 |
+
|
3069 |
+
this.interpolate = function (x2) {
|
3070 |
+
if (!x2) return 0;
|
3071 |
+
|
3072 |
+
// Get the indexes of x1 and x3 (the array indexes before and after given x2):
|
3073 |
+
i3 = binarySearch(this.x, x2);
|
3074 |
+
i1 = i3 - 1;
|
3075 |
+
|
3076 |
+
// We have our indexes i1 & i3, so we can calculate already:
|
3077 |
+
// y2 := ((x2−x1) × (y3−y1)) ÷ (x3−x1) + y1
|
3078 |
+
return ((x2 - this.x[i1]) * (this.y[i3] - this.y[i1])) / (this.x[i3] - this.x[i1]) + this.y[i1];
|
3079 |
+
};
|
3080 |
+
|
3081 |
+
var binarySearch = (function() {
|
3082 |
+
var maxIndex, minIndex, guess;
|
3083 |
+
return function(array, val) {
|
3084 |
+
minIndex = -1;
|
3085 |
+
maxIndex = array.length;
|
3086 |
+
while (maxIndex - minIndex > 1)
|
3087 |
+
if (array[guess = maxIndex + minIndex >> 1] <= val) {
|
3088 |
+
minIndex = guess;
|
3089 |
+
} else {
|
3090 |
+
maxIndex = guess;
|
3091 |
+
}
|
3092 |
+
return maxIndex;
|
3093 |
+
};
|
3094 |
+
})();
|
3095 |
+
},
|
3096 |
+
//xxx: for now i will just save one spline function to to
|
3097 |
+
getInterpolateFunction: function(c){
|
3098 |
+
if(!s.controller.spline) s.controller.spline = s.params.loop ?
|
3099 |
+
new s.controller.LinearSpline(s.slidesGrid, c.slidesGrid) :
|
3100 |
+
new s.controller.LinearSpline(s.snapGrid, c.snapGrid);
|
3101 |
+
},
|
3102 |
+
setTranslate: function (translate, byController) {
|
3103 |
+
var controlled = s.params.control;
|
3104 |
+
var multiplier, controlledTranslate;
|
3105 |
+
function setControlledTranslate(c) {
|
3106 |
+
// this will create an Interpolate function based on the snapGrids
|
3107 |
+
// x is the Grid of the scrolled scroller and y will be the controlled scroller
|
3108 |
+
// it makes sense to create this only once and recall it for the interpolation
|
3109 |
+
// the function does a lot of value caching for performance
|
3110 |
+
translate = c.rtl && c.params.direction === 'horizontal' ? -s.translate : s.translate;
|
3111 |
+
if (s.params.controlBy === 'slide') {
|
3112 |
+
s.controller.getInterpolateFunction(c);
|
3113 |
+
// i am not sure why the values have to be multiplicated this way, tried to invert the snapGrid
|
3114 |
+
// but it did not work out
|
3115 |
+
controlledTranslate = -s.controller.spline.interpolate(-translate);
|
3116 |
+
}
|
3117 |
+
|
3118 |
+
if(!controlledTranslate || s.params.controlBy === 'container'){
|
3119 |
+
multiplier = (c.maxTranslate() - c.minTranslate()) / (s.maxTranslate() - s.minTranslate());
|
3120 |
+
controlledTranslate = (translate - s.minTranslate()) * multiplier + c.minTranslate();
|
3121 |
+
}
|
3122 |
+
|
3123 |
+
if (s.params.controlInverse) {
|
3124 |
+
controlledTranslate = c.maxTranslate() - controlledTranslate;
|
3125 |
+
}
|
3126 |
+
c.updateProgress(controlledTranslate);
|
3127 |
+
c.setWrapperTranslate(controlledTranslate, false, s);
|
3128 |
+
c.updateActiveIndex();
|
3129 |
+
}
|
3130 |
+
if (s.isArray(controlled)) {
|
3131 |
+
for (var i = 0; i < controlled.length; i++) {
|
3132 |
+
if (controlled[i] !== byController && controlled[i] instanceof Swiper) {
|
3133 |
+
setControlledTranslate(controlled[i]);
|
3134 |
+
}
|
3135 |
+
}
|
3136 |
+
}
|
3137 |
+
else if (controlled instanceof Swiper && byController !== controlled) {
|
3138 |
+
|
3139 |
+
setControlledTranslate(controlled);
|
3140 |
+
}
|
3141 |
+
},
|
3142 |
+
setTransition: function (duration, byController) {
|
3143 |
+
var controlled = s.params.control;
|
3144 |
+
var i;
|
3145 |
+
function setControlledTransition(c) {
|
3146 |
+
c.setWrapperTransition(duration, s);
|
3147 |
+
if (duration !== 0) {
|
3148 |
+
c.onTransitionStart();
|
3149 |
+
c.wrapper.transitionEnd(function(){
|
3150 |
+
if (!controlled) return;
|
3151 |
+
if (c.params.loop && s.params.controlBy === 'slide') {
|
3152 |
+
c.fixLoop();
|
3153 |
+
}
|
3154 |
+
c.onTransitionEnd();
|
3155 |
+
|
3156 |
+
});
|
3157 |
+
}
|
3158 |
+
}
|
3159 |
+
if (s.isArray(controlled)) {
|
3160 |
+
for (i = 0; i < controlled.length; i++) {
|
3161 |
+
if (controlled[i] !== byController && controlled[i] instanceof Swiper) {
|
3162 |
+
setControlledTransition(controlled[i]);
|
3163 |
+
}
|
3164 |
+
}
|
3165 |
+
}
|
3166 |
+
else if (controlled instanceof Swiper && byController !== controlled) {
|
3167 |
+
setControlledTransition(controlled);
|
3168 |
+
}
|
3169 |
+
}
|
3170 |
+
};
|
3171 |
+
|
3172 |
+
/*=========================
|
3173 |
+
Hash Navigation
|
3174 |
+
===========================*/
|
3175 |
+
s.hashnav = {
|
3176 |
+
onHashCange: function (e, a) {
|
3177 |
+
var newHash = document.location.hash.replace('#', '');
|
3178 |
+
var activeSlideHash = s.slides.eq(s.activeIndex).attr('data-hash');
|
3179 |
+
if (newHash !== activeSlideHash) {
|
3180 |
+
s.slideTo(s.wrapper.children('.' + s.params.slideClass + '[data-hash="' + (newHash) + '"]').index());
|
3181 |
+
}
|
3182 |
+
},
|
3183 |
+
attachEvents: function (detach) {
|
3184 |
+
var action = detach ? 'off' : 'on';
|
3185 |
+
$(window)[action]('hashchange', s.hashnav.onHashCange);
|
3186 |
+
},
|
3187 |
+
setHash: function () {
|
3188 |
+
if (!s.hashnav.initialized || !s.params.hashnav) return;
|
3189 |
+
if (s.params.replaceState && window.history && window.history.replaceState) {
|
3190 |
+
window.history.replaceState(null, null, ('#' + s.slides.eq(s.activeIndex).attr('data-hash') || ''));
|
3191 |
+
} else {
|
3192 |
+
var slide = s.slides.eq(s.activeIndex);
|
3193 |
+
var hash = slide.attr('data-hash') || slide.attr('data-history');
|
3194 |
+
document.location.hash = hash || '';
|
3195 |
+
}
|
3196 |
+
},
|
3197 |
+
init: function () {
|
3198 |
+
if (!s.params.hashnav || s.params.history) return;
|
3199 |
+
s.hashnav.initialized = true;
|
3200 |
+
var hash = document.location.hash.replace('#', '');
|
3201 |
+
if (!hash) return;
|
3202 |
+
var speed = 0;
|
3203 |
+
for (var i = 0, length = s.slides.length; i < length; i++) {
|
3204 |
+
var slide = s.slides.eq(i);
|
3205 |
+
var slideHash = slide.attr('data-hash') || slide.attr('data-history');
|
3206 |
+
if (slideHash === hash && !slide.hasClass(s.params.slideDuplicateClass)) {
|
3207 |
+
var index = slide.index();
|
3208 |
+
s.slideTo(index, speed, s.params.runCallbacksOnInit, true);
|
3209 |
+
}
|
3210 |
+
}
|
3211 |
+
if (s.params.hashnavWatchState) s.hashnav.attachEvents();
|
3212 |
+
},
|
3213 |
+
destroy: function () {
|
3214 |
+
if (s.params.hashnavWatchState) s.hashnav.attachEvents(true);
|
3215 |
+
}
|
3216 |
+
};
|
3217 |
+
|
3218 |
+
/*=========================
|
3219 |
+
History Api with fallback to Hashnav
|
3220 |
+
===========================*/
|
3221 |
+
s.history = {
|
3222 |
+
init: function () {
|
3223 |
+
if (!s.params.history) return;
|
3224 |
+
if (!window.history || !window.history.pushState) {
|
3225 |
+
s.params.history = false;
|
3226 |
+
s.params.hashnav = true;
|
3227 |
+
return;
|
3228 |
+
}
|
3229 |
+
s.history.initialized = true;
|
3230 |
+
this.paths = this.getPathValues();
|
3231 |
+
if (!this.paths.key && !this.paths.value) return;
|
3232 |
+
this.scrollToSlide(0, this.paths.value, s.params.runCallbacksOnInit);
|
3233 |
+
if (!s.params.replaceState) {
|
3234 |
+
window.addEventListener('popstate', this.setHistoryPopState);
|
3235 |
+
}
|
3236 |
+
},
|
3237 |
+
setHistoryPopState: function() {
|
3238 |
+
s.history.paths = s.history.getPathValues();
|
3239 |
+
s.history.scrollToSlide(s.params.speed, s.history.paths.value, false);
|
3240 |
+
},
|
3241 |
+
getPathValues: function() {
|
3242 |
+
var pathArray = window.location.pathname.slice(1).split('/');
|
3243 |
+
var total = pathArray.length;
|
3244 |
+
var key = pathArray[total - 2];
|
3245 |
+
var value = pathArray[total - 1];
|
3246 |
+
return { key: key, value: value };
|
3247 |
+
},
|
3248 |
+
setHistory: function (key, index) {
|
3249 |
+
if (!s.history.initialized || !s.params.history) return;
|
3250 |
+
var slide = s.slides.eq(index);
|
3251 |
+
var value = this.slugify(slide.attr('data-history'));
|
3252 |
+
if (!window.location.pathname.includes(key)) {
|
3253 |
+
value = key + '/' + value;
|
3254 |
+
}
|
3255 |
+
if (s.params.replaceState) {
|
3256 |
+
window.history.replaceState(null, null, value);
|
3257 |
+
} else {
|
3258 |
+
window.history.pushState(null, null, value);
|
3259 |
+
}
|
3260 |
+
},
|
3261 |
+
slugify: function(text) {
|
3262 |
+
return text.toString().toLowerCase()
|
3263 |
+
.replace(/\s+/g, '-')
|
3264 |
+
.replace(/[^\w\-]+/g, '')
|
3265 |
+
.replace(/\-\-+/g, '-')
|
3266 |
+
.replace(/^-+/, '')
|
3267 |
+
.replace(/-+$/, '');
|
3268 |
+
},
|
3269 |
+
scrollToSlide: function(speed, value, runCallbacks) {
|
3270 |
+
if (value) {
|
3271 |
+
for (var i = 0, length = s.slides.length; i < length; i++) {
|
3272 |
+
var slide = s.slides.eq(i);
|
3273 |
+
var slideHistory = this.slugify(slide.attr('data-history'));
|
3274 |
+
if (slideHistory === value && !slide.hasClass(s.params.slideDuplicateClass)) {
|
3275 |
+
var index = slide.index();
|
3276 |
+
s.slideTo(index, speed, runCallbacks);
|
3277 |
+
}
|
3278 |
+
}
|
3279 |
+
} else {
|
3280 |
+
s.slideTo(0, speed, runCallbacks);
|
3281 |
+
}
|
3282 |
+
}
|
3283 |
+
};
|
3284 |
+
|
3285 |
+
/*=========================
|
3286 |
+
Keyboard Control
|
3287 |
+
===========================*/
|
3288 |
+
function handleKeyboard(e) {
|
3289 |
+
if (e.originalEvent) e = e.originalEvent; //jquery fix
|
3290 |
+
var kc = e.keyCode || e.charCode;
|
3291 |
+
// Directions locks
|
3292 |
+
if (!s.params.allowSwipeToNext && (s.isHorizontal() && kc === 39 || !s.isHorizontal() && kc === 40)) {
|
3293 |
+
return false;
|
3294 |
+
}
|
3295 |
+
if (!s.params.allowSwipeToPrev && (s.isHorizontal() && kc === 37 || !s.isHorizontal() && kc === 38)) {
|
3296 |
+
return false;
|
3297 |
+
}
|
3298 |
+
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
|
3299 |
+
return;
|
3300 |
+
}
|
3301 |
+
if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) {
|
3302 |
+
return;
|
3303 |
+
}
|
3304 |
+
if (kc === 37 || kc === 39 || kc === 38 || kc === 40) {
|
3305 |
+
var inView = false;
|
3306 |
+
//Check that swiper should be inside of visible area of window
|
3307 |
+
if (s.container.parents('.' + s.params.slideClass).length > 0 && s.container.parents('.' + s.params.slideActiveClass).length === 0) {
|
3308 |
+
return;
|
3309 |
+
}
|
3310 |
+
var windowScroll = {
|
3311 |
+
left: window.pageXOffset,
|
3312 |
+
top: window.pageYOffset
|
3313 |
+
};
|
3314 |
+
var windowWidth = window.innerWidth;
|
3315 |
+
var windowHeight = window.innerHeight;
|
3316 |
+
var swiperOffset = s.container.offset();
|
3317 |
+
if (s.rtl) swiperOffset.left = swiperOffset.left - s.container[0].scrollLeft;
|
3318 |
+
var swiperCoord = [
|
3319 |
+
[swiperOffset.left, swiperOffset.top],
|
3320 |
+
[swiperOffset.left + s.width, swiperOffset.top],
|
3321 |
+
[swiperOffset.left, swiperOffset.top + s.height],
|
3322 |
+
[swiperOffset.left + s.width, swiperOffset.top + s.height]
|
3323 |
+
];
|
3324 |
+
for (var i = 0; i < swiperCoord.length; i++) {
|
3325 |
+
var point = swiperCoord[i];
|
3326 |
+
if (
|
3327 |
+
point[0] >= windowScroll.left && point[0] <= windowScroll.left + windowWidth &&
|
3328 |
+
point[1] >= windowScroll.top && point[1] <= windowScroll.top + windowHeight
|
3329 |
+
) {
|
3330 |
+
inView = true;
|
3331 |
+
}
|
3332 |
+
|
3333 |
+
}
|
3334 |
+
if (!inView) return;
|
3335 |
+
}
|
3336 |
+
if (s.isHorizontal()) {
|
3337 |
+
if (kc === 37 || kc === 39) {
|
3338 |
+
if (e.preventDefault) e.preventDefault();
|
3339 |
+
else e.returnValue = false;
|
3340 |
+
}
|
3341 |
+
if ((kc === 39 && !s.rtl) || (kc === 37 && s.rtl)) s.slideNext();
|
3342 |
+
if ((kc === 37 && !s.rtl) || (kc === 39 && s.rtl)) s.slidePrev();
|
3343 |
+
}
|
3344 |
+
else {
|
3345 |
+
if (kc === 38 || kc === 40) {
|
3346 |
+
if (e.preventDefault) e.preventDefault();
|
3347 |
+
else e.returnValue = false;
|
3348 |
+
}
|
3349 |
+
if (kc === 40) s.slideNext();
|
3350 |
+
if (kc === 38) s.slidePrev();
|
3351 |
+
}
|
3352 |
+
}
|
3353 |
+
s.disableKeyboardControl = function () {
|
3354 |
+
s.params.keyboardControl = false;
|
3355 |
+
$(document).off('keydown', handleKeyboard);
|
3356 |
+
};
|
3357 |
+
s.enableKeyboardControl = function () {
|
3358 |
+
s.params.keyboardControl = true;
|
3359 |
+
$(document).on('keydown', handleKeyboard);
|
3360 |
+
};
|
3361 |
+
|
3362 |
+
|
3363 |
+
/*=========================
|
3364 |
+
Mousewheel Control
|
3365 |
+
===========================*/
|
3366 |
+
s.mousewheel = {
|
3367 |
+
event: false,
|
3368 |
+
lastScrollTime: (new window.Date()).getTime()
|
3369 |
+
};
|
3370 |
+
if (s.params.mousewheelControl) {
|
3371 |
+
/**
|
3372 |
+
* The best combination if you prefer spinX + spinY normalization. It favors
|
3373 |
+
* the older DOMMouseScroll for Firefox, as FF does not include wheelDelta with
|
3374 |
+
* 'wheel' event, making spin speed determination impossible.
|
3375 |
+
*/
|
3376 |
+
s.mousewheel.event = (navigator.userAgent.indexOf('firefox') > -1) ?
|
3377 |
+
'DOMMouseScroll' :
|
3378 |
+
isEventSupported() ?
|
3379 |
+
'wheel' : 'mousewheel';
|
3380 |
+
}
|
3381 |
+
|
3382 |
+
function isEventSupported() {
|
3383 |
+
var eventName = 'onwheel';
|
3384 |
+
var isSupported = eventName in document;
|
3385 |
+
|
3386 |
+
if (!isSupported) {
|
3387 |
+
var element = document.createElement('div');
|
3388 |
+
element.setAttribute(eventName, 'return;');
|
3389 |
+
isSupported = typeof element[eventName] === 'function';
|
3390 |
+
}
|
3391 |
+
|
3392 |
+
if (!isSupported &&
|
3393 |
+
document.implementation &&
|
3394 |
+
document.implementation.hasFeature &&
|
3395 |
+
// always returns true in newer browsers as per the standard.
|
3396 |
+
// @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
|
3397 |
+
document.implementation.hasFeature('', '') !== true ) {
|
3398 |
+
// This is the only way to test support for the `wheel` event in IE9+.
|
3399 |
+
isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
|
3400 |
+
}
|
3401 |
+
|
3402 |
+
return isSupported;
|
3403 |
+
}
|
3404 |
+
|
3405 |
+
function handleMousewheel(e) {
|
3406 |
+
if (e.originalEvent) e = e.originalEvent; //jquery fix
|
3407 |
+
var delta = 0;
|
3408 |
+
var rtlFactor = s.rtl ? -1 : 1;
|
3409 |
+
|
3410 |
+
var data = normalizeWheel( e );
|
3411 |
+
|
3412 |
+
if (s.params.mousewheelForceToAxis) {
|
3413 |
+
if (s.isHorizontal()) {
|
3414 |
+
if (Math.abs(data.pixelX) > Math.abs(data.pixelY)) delta = data.pixelX * rtlFactor;
|
3415 |
+
else return;
|
3416 |
+
}
|
3417 |
+
else {
|
3418 |
+
if (Math.abs(data.pixelY) > Math.abs(data.pixelX)) delta = data.pixelY;
|
3419 |
+
else return;
|
3420 |
+
}
|
3421 |
+
}
|
3422 |
+
else {
|
3423 |
+
delta = Math.abs(data.pixelX) > Math.abs(data.pixelY) ? - data.pixelX * rtlFactor : - data.pixelY;
|
3424 |
+
}
|
3425 |
+
|
3426 |
+
if (delta === 0) return;
|
3427 |
+
|
3428 |
+
if (s.params.mousewheelInvert) delta = -delta;
|
3429 |
+
|
3430 |
+
if (!s.params.freeMode) {
|
3431 |
+
if ((new window.Date()).getTime() - s.mousewheel.lastScrollTime > 60) {
|
3432 |
+
if (delta < 0) {
|
3433 |
+
if ((!s.isEnd || s.params.loop) && !s.animating) {
|
3434 |
+
s.slideNext();
|
3435 |
+
s.emit('onScroll', s, e);
|
3436 |
+
}
|
3437 |
+
else if (s.params.mousewheelReleaseOnEdges) return true;
|
3438 |
+
}
|
3439 |
+
else {
|
3440 |
+
if ((!s.isBeginning || s.params.loop) && !s.animating) {
|
3441 |
+
s.slidePrev();
|
3442 |
+
s.emit('onScroll', s, e);
|
3443 |
+
}
|
3444 |
+
else if (s.params.mousewheelReleaseOnEdges) return true;
|
3445 |
+
}
|
3446 |
+
}
|
3447 |
+
s.mousewheel.lastScrollTime = (new window.Date()).getTime();
|
3448 |
+
|
3449 |
+
}
|
3450 |
+
else {
|
3451 |
+
//Freemode or scrollContainer:
|
3452 |
+
var position = s.getWrapperTranslate() + delta * s.params.mousewheelSensitivity;
|
3453 |
+
var wasBeginning = s.isBeginning,
|
3454 |
+
wasEnd = s.isEnd;
|
3455 |
+
|
3456 |
+
if (position >= s.minTranslate()) position = s.minTranslate();
|
3457 |
+
if (position <= s.maxTranslate()) position = s.maxTranslate();
|
3458 |
+
|
3459 |
+
s.setWrapperTransition(0);
|
3460 |
+
s.setWrapperTranslate(position);
|
3461 |
+
s.updateProgress();
|
3462 |
+
s.updateActiveIndex();
|
3463 |
+
|
3464 |
+
if (!wasBeginning && s.isBeginning || !wasEnd && s.isEnd) {
|
3465 |
+
s.updateClasses();
|
3466 |
+
}
|
3467 |
+
|
3468 |
+
if (s.params.freeModeSticky) {
|
3469 |
+
clearTimeout(s.mousewheel.timeout);
|
3470 |
+
s.mousewheel.timeout = setTimeout(function () {
|
3471 |
+
s.slideReset();
|
3472 |
+
}, 300);
|
3473 |
+
}
|
3474 |
+
else {
|
3475 |
+
if (s.params.lazyLoading && s.lazy) {
|
3476 |
+
s.lazy.load();
|
3477 |
+
}
|
3478 |
+
}
|
3479 |
+
// Emit event
|
3480 |
+
s.emit('onScroll', s, e);
|
3481 |
+
|
3482 |
+
// Stop autoplay
|
3483 |
+
if (s.params.autoplay && s.params.autoplayDisableOnInteraction) s.stopAutoplay();
|
3484 |
+
|
3485 |
+
// Return page scroll on edge positions
|
3486 |
+
if (position === 0 || position === s.maxTranslate()) return;
|
3487 |
+
}
|
3488 |
+
|
3489 |
+
if (e.preventDefault) e.preventDefault();
|
3490 |
+
else e.returnValue = false;
|
3491 |
+
return false;
|
3492 |
+
}
|
3493 |
+
s.disableMousewheelControl = function () {
|
3494 |
+
if (!s.mousewheel.event) return false;
|
3495 |
+
var target = s.container;
|
3496 |
+
if (s.params.mousewheelEventsTarged !== 'container') {
|
3497 |
+
target = $(s.params.mousewheelEventsTarged);
|
3498 |
+
}
|
3499 |
+
target.off(s.mousewheel.event, handleMousewheel);
|
3500 |
+
return true;
|
3501 |
+
};
|
3502 |
+
|
3503 |
+
s.enableMousewheelControl = function () {
|
3504 |
+
if (!s.mousewheel.event) return false;
|
3505 |
+
var target = s.container;
|
3506 |
+
if (s.params.mousewheelEventsTarged !== 'container') {
|
3507 |
+
target = $(s.params.mousewheelEventsTarged);
|
3508 |
+
}
|
3509 |
+
target.on(s.mousewheel.event, handleMousewheel);
|
3510 |
+
return true;
|
3511 |
+
};
|
3512 |
+
|
3513 |
+
/**
|
3514 |
+
* Mouse wheel (and 2-finger trackpad) support on the web sucks. It is
|
3515 |
+
* complicated, thus this doc is long and (hopefully) detailed enough to answer
|
3516 |
+
* your questions.
|
3517 |
+
*
|
3518 |
+
* If you need to react to the mouse wheel in a predictable way, this code is
|
3519 |
+
* like your bestest friend. * hugs *
|
3520 |
+
*
|
3521 |
+
* As of today, there are 4 DOM event types you can listen to:
|
3522 |
+
*
|
3523 |
+
* 'wheel' -- Chrome(31+), FF(17+), IE(9+)
|
3524 |
+
* 'mousewheel' -- Chrome, IE(6+), Opera, Safari
|
3525 |
+
* 'MozMousePixelScroll' -- FF(3.5 only!) (2010-2013) -- don't bother!
|
3526 |
+
* 'DOMMouseScroll' -- FF(0.9.7+) since 2003
|
3527 |
+
*
|
3528 |
+
* So what to do? The is the best:
|
3529 |
+
*
|
3530 |
+
* normalizeWheel.getEventType();
|
3531 |
+
*
|
3532 |
+
* In your event callback, use this code to get sane interpretation of the
|
3533 |
+
* deltas. This code will return an object with properties:
|
3534 |
+
*
|
3535 |
+
* spinX -- normalized spin speed (use for zoom) - x plane
|
3536 |
+
* spinY -- " - y plane
|
3537 |
+
* pixelX -- normalized distance (to pixels) - x plane
|
3538 |
+
* pixelY -- " - y plane
|
3539 |
+
*
|
3540 |
+
* Wheel values are provided by the browser assuming you are using the wheel to
|
3541 |
+
* scroll a web page by a number of lines or pixels (or pages). Values can vary
|
3542 |
+
* significantly on different platforms and browsers, forgetting that you can
|
3543 |
+
* scroll at different speeds. Some devices (like trackpads) emit more events
|
3544 |
+
* at smaller increments with fine granularity, and some emit massive jumps with
|
3545 |
+
* linear speed or acceleration.
|
3546 |
+
*
|
3547 |
+
* This code does its best to normalize the deltas for you:
|
3548 |
+
*
|
3549 |
+
* - spin is trying to normalize how far the wheel was spun (or trackpad
|
3550 |
+
* dragged). This is super useful for zoom support where you want to
|
3551 |
+
* throw away the chunky scroll steps on the PC and make those equal to
|
3552 |
+
* the slow and smooth tiny steps on the Mac. Key data: This code tries to
|
3553 |
+
* resolve a single slow step on a wheel to 1.
|
3554 |
+
*
|
3555 |
+
* - pixel is normalizing the desired scroll delta in pixel units. You'll
|
3556 |
+
* get the crazy differences between browsers, but at least it'll be in
|
3557 |
+
* pixels!
|
3558 |
+
*
|
3559 |
+
* - positive value indicates scrolling DOWN/RIGHT, negative UP/LEFT. This
|
3560 |
+
* should translate to positive value zooming IN, negative zooming OUT.
|
3561 |
+
* This matches the newer 'wheel' event.
|
3562 |
+
*
|
3563 |
+
* Why are there spinX, spinY (or pixels)?
|
3564 |
+
*
|
3565 |
+
* - spinX is a 2-finger side drag on the trackpad, and a shift + wheel turn
|
3566 |
+
* with a mouse. It results in side-scrolling in the browser by default.
|
3567 |
+
*
|
3568 |
+
* - spinY is what you expect -- it's the classic axis of a mouse wheel.
|
3569 |
+
*
|
3570 |
+
* - I dropped spinZ/pixelZ. It is supported by the DOM 3 'wheel' event and
|
3571 |
+
* probably is by browsers in conjunction with fancy 3D controllers .. but
|
3572 |
+
* you know.
|
3573 |
+
*
|
3574 |
+
* Implementation info:
|
3575 |
+
*
|
3576 |
+
* Examples of 'wheel' event if you scroll slowly (down) by one step with an
|
3577 |
+
* average mouse:
|
3578 |
+
*
|
3579 |
+
* OS X + Chrome (mouse) - 4 pixel delta (wheelDelta -120)
|
3580 |
+
* OS X + Safari (mouse) - N/A pixel delta (wheelDelta -12)
|
3581 |
+
* OS X + Firefox (mouse) - 0.1 line delta (wheelDelta N/A)
|
3582 |
+
* Win8 + Chrome (mouse) - 100 pixel delta (wheelDelta -120)
|
3583 |
+
* Win8 + Firefox (mouse) - 3 line delta (wheelDelta -120)
|
3584 |
+
*
|
3585 |
+
* On the trackpad:
|
3586 |
+
*
|
3587 |
+
* OS X + Chrome (trackpad) - 2 pixel delta (wheelDelta -6)
|
3588 |
+
* OS X + Firefox (trackpad) - 1 pixel delta (wheelDelta N/A)
|
3589 |
+
*
|
3590 |
+
* On other/older browsers.. it's more complicated as there can be multiple and
|
3591 |
+
* also missing delta values.
|
3592 |
+
*
|
3593 |
+
* The 'wheel' event is more standard:
|
3594 |
+
*
|
3595 |
+
* http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents
|
3596 |
+
*
|
3597 |
+
* The basics is that it includes a unit, deltaMode (pixels, lines, pages), and
|
3598 |
+
* deltaX, deltaY and deltaZ. Some browsers provide other values to maintain
|
3599 |
+
* backward compatibility with older events. Those other values help us
|
3600 |
+
* better normalize spin speed. Example of what the browsers provide:
|
3601 |
+
*
|
3602 |
+
* | event.wheelDelta | event.detail
|
3603 |
+
* ------------------+------------------+--------------
|
3604 |
+
* Safari v5/OS X | -120 | 0
|
3605 |
+
* Safari v5/Win7 | -120 | 0
|
3606 |
+
* Chrome v17/OS X | -120 | 0
|
3607 |
+
* Chrome v17/Win7 | -120 | 0
|
3608 |
+
* IE9/Win7 | -120 | undefined
|
3609 |
+
* Firefox v4/OS X | undefined | 1
|
3610 |
+
* Firefox v4/Win7 | undefined | 3
|
3611 |
+
*
|
3612 |
+
*/
|
3613 |
+
function normalizeWheel( /*object*/ event ) /*object*/ {
|
3614 |
+
// Reasonable defaults
|
3615 |
+
var PIXEL_STEP = 10;
|
3616 |
+
var LINE_HEIGHT = 40;
|
3617 |
+
var PAGE_HEIGHT = 800;
|
3618 |
+
|
3619 |
+
var sX = 0, sY = 0, // spinX, spinY
|
3620 |
+
pX = 0, pY = 0; // pixelX, pixelY
|
3621 |
+
|
3622 |
+
// Legacy
|
3623 |
+
if( 'detail' in event ) {
|
3624 |
+
sY = event.detail;
|
3625 |
+
}
|
3626 |
+
if( 'wheelDelta' in event ) {
|
3627 |
+
sY = -event.wheelDelta / 120;
|
3628 |
+
}
|
3629 |
+
if( 'wheelDeltaY' in event ) {
|
3630 |
+
sY = -event.wheelDeltaY / 120;
|
3631 |
+
}
|
3632 |
+
if( 'wheelDeltaX' in event ) {
|
3633 |
+
sX = -event.wheelDeltaX / 120;
|
3634 |
+
}
|
3635 |
+
|
3636 |
+
// side scrolling on FF with DOMMouseScroll
|
3637 |
+
if( 'axis' in event && event.axis === event.HORIZONTAL_AXIS ) {
|
3638 |
+
sX = sY;
|
3639 |
+
sY = 0;
|
3640 |
+
}
|
3641 |
+
|
3642 |
+
pX = sX * PIXEL_STEP;
|
3643 |
+
pY = sY * PIXEL_STEP;
|
3644 |
+
|
3645 |
+
if( 'deltaY' in event ) {
|
3646 |
+
pY = event.deltaY;
|
3647 |
+
}
|
3648 |
+
if( 'deltaX' in event ) {
|
3649 |
+
pX = event.deltaX;
|
3650 |
+
}
|
3651 |
+
|
3652 |
+
if( (pX || pY) && event.deltaMode ) {
|
3653 |
+
if( event.deltaMode === 1 ) { // delta in LINE units
|
3654 |
+
pX *= LINE_HEIGHT;
|
3655 |
+
pY *= LINE_HEIGHT;
|
3656 |
+
} else { // delta in PAGE units
|
3657 |
+
pX *= PAGE_HEIGHT;
|
3658 |
+
pY *= PAGE_HEIGHT;
|
3659 |
+
}
|
3660 |
+
}
|
3661 |
+
|
3662 |
+
// Fall-back if spin cannot be determined
|
3663 |
+
if( pX && !sX ) {
|
3664 |
+
sX = (pX < 1) ? -1 : 1;
|
3665 |
+
}
|
3666 |
+
if( pY && !sY ) {
|
3667 |
+
sY = (pY < 1) ? -1 : 1;
|
3668 |
+
}
|
3669 |
+
|
3670 |
+
return {
|
3671 |
+
spinX: sX,
|
3672 |
+
spinY: sY,
|
3673 |
+
pixelX: pX,
|
3674 |
+
pixelY: pY
|
3675 |
+
};
|
3676 |
+
}
|
3677 |
+
|
3678 |
+
/*=========================
|
3679 |
+
Parallax
|
3680 |
+
===========================*/
|
3681 |
+
function setParallaxTransform(el, progress) {
|
3682 |
+
el = $(el);
|
3683 |
+
var p, pX, pY;
|
3684 |
+
var rtlFactor = s.rtl ? -1 : 1;
|
3685 |
+
|
3686 |
+
p = el.attr('data-swiper-parallax') || '0';
|
3687 |
+
pX = el.attr('data-swiper-parallax-x');
|
3688 |
+
pY = el.attr('data-swiper-parallax-y');
|
3689 |
+
if (pX || pY) {
|
3690 |
+
pX = pX || '0';
|
3691 |
+
pY = pY || '0';
|
3692 |
+
}
|
3693 |
+
else {
|
3694 |
+
if (s.isHorizontal()) {
|
3695 |
+
pX = p;
|
3696 |
+
pY = '0';
|
3697 |
+
}
|
3698 |
+
else {
|
3699 |
+
pY = p;
|
3700 |
+
pX = '0';
|
3701 |
+
}
|
3702 |
+
}
|
3703 |
+
|
3704 |
+
if ((pX).indexOf('%') >= 0) {
|
3705 |
+
pX = parseInt(pX, 10) * progress * rtlFactor + '%';
|
3706 |
+
}
|
3707 |
+
else {
|
3708 |
+
pX = pX * progress * rtlFactor + 'px' ;
|
3709 |
+
}
|
3710 |
+
if ((pY).indexOf('%') >= 0) {
|
3711 |
+
pY = parseInt(pY, 10) * progress + '%';
|
3712 |
+
}
|
3713 |
+
else {
|
3714 |
+
pY = pY * progress + 'px' ;
|
3715 |
+
}
|
3716 |
+
|
3717 |
+
el.transform('translate3d(' + pX + ', ' + pY + ',0px)');
|
3718 |
+
}
|
3719 |
+
s.parallax = {
|
3720 |
+
setTranslate: function () {
|
3721 |
+
s.container.children('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]').each(function(){
|
3722 |
+
setParallaxTransform(this, s.progress);
|
3723 |
+
|
3724 |
+
});
|
3725 |
+
s.slides.each(function () {
|
3726 |
+
var slide = $(this);
|
3727 |
+
slide.find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]').each(function () {
|
3728 |
+
var progress = Math.min(Math.max(slide[0].progress, -1), 1);
|
3729 |
+
setParallaxTransform(this, progress);
|
3730 |
+
});
|
3731 |
+
});
|
3732 |
+
},
|
3733 |
+
setTransition: function (duration) {
|
3734 |
+
if (typeof duration === 'undefined') duration = s.params.speed;
|
3735 |
+
s.container.find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]').each(function(){
|
3736 |
+
var el = $(this);
|
3737 |
+
var parallaxDuration = parseInt(el.attr('data-swiper-parallax-duration'), 10) || duration;
|
3738 |
+
if (duration === 0) parallaxDuration = 0;
|
3739 |
+
el.transition(parallaxDuration);
|
3740 |
+
});
|
3741 |
+
}
|
3742 |
+
};
|
3743 |
+
|
3744 |
+
|
3745 |
+
/*=========================
|
3746 |
+
Zoom
|
3747 |
+
===========================*/
|
3748 |
+
s.zoom = {
|
3749 |
+
// "Global" Props
|
3750 |
+
scale: 1,
|
3751 |
+
currentScale: 1,
|
3752 |
+
isScaling: false,
|
3753 |
+
gesture: {
|
3754 |
+
slide: undefined,
|
3755 |
+
slideWidth: undefined,
|
3756 |
+
slideHeight: undefined,
|
3757 |
+
image: undefined,
|
3758 |
+
imageWrap: undefined,
|
3759 |
+
zoomMax: s.params.zoomMax
|
3760 |
+
},
|
3761 |
+
image: {
|
3762 |
+
isTouched: undefined,
|
3763 |
+
isMoved: undefined,
|
3764 |
+
currentX: undefined,
|
3765 |
+
currentY: undefined,
|
3766 |
+
minX: undefined,
|
3767 |
+
minY: undefined,
|
3768 |
+
maxX: undefined,
|
3769 |
+
maxY: undefined,
|
3770 |
+
width: undefined,
|
3771 |
+
height: undefined,
|
3772 |
+
startX: undefined,
|
3773 |
+
startY: undefined,
|
3774 |
+
touchesStart: {},
|
3775 |
+
touchesCurrent: {}
|
3776 |
+
},
|
3777 |
+
velocity: {
|
3778 |
+
x: undefined,
|
3779 |
+
y: undefined,
|
3780 |
+
prevPositionX: undefined,
|
3781 |
+
prevPositionY: undefined,
|
3782 |
+
prevTime: undefined
|
3783 |
+
},
|
3784 |
+
// Calc Scale From Multi-touches
|
3785 |
+
getDistanceBetweenTouches: function (e) {
|
3786 |
+
if (e.targetTouches.length < 2) return 1;
|
3787 |
+
var x1 = e.targetTouches[0].pageX,
|
3788 |
+
y1 = e.targetTouches[0].pageY,
|
3789 |
+
x2 = e.targetTouches[1].pageX,
|
3790 |
+
y2 = e.targetTouches[1].pageY;
|
3791 |
+
var distance = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
|
3792 |
+
return distance;
|
3793 |
+
},
|
3794 |
+
// Events
|
3795 |
+
onGestureStart: function (e) {
|
3796 |
+
var z = s.zoom;
|
3797 |
+
if (!s.support.gestures) {
|
3798 |
+
if (e.type !== 'touchstart' || e.type === 'touchstart' && e.targetTouches.length < 2) {
|
3799 |
+
return;
|
3800 |
+
}
|
3801 |
+
z.gesture.scaleStart = z.getDistanceBetweenTouches(e);
|
3802 |
+
}
|
3803 |
+
if (!z.gesture.slide || !z.gesture.slide.length) {
|
3804 |
+
z.gesture.slide = $(this);
|
3805 |
+
if (z.gesture.slide.length === 0) z.gesture.slide = s.slides.eq(s.activeIndex);
|
3806 |
+
z.gesture.image = z.gesture.slide.find('img, svg, canvas');
|
3807 |
+
z.gesture.imageWrap = z.gesture.image.parent('.' + s.params.zoomContainerClass);
|
3808 |
+
z.gesture.zoomMax = z.gesture.imageWrap.attr('data-swiper-zoom') || s.params.zoomMax ;
|
3809 |
+
if (z.gesture.imageWrap.length === 0) {
|
3810 |
+
z.gesture.image = undefined;
|
3811 |
+
return;
|
3812 |
+
}
|
3813 |
+
}
|
3814 |
+
z.gesture.image.transition(0);
|
3815 |
+
z.isScaling = true;
|
3816 |
+
},
|
3817 |
+
onGestureChange: function (e) {
|
3818 |
+
var z = s.zoom;
|
3819 |
+
if (!s.support.gestures) {
|
3820 |
+
if (e.type !== 'touchmove' || e.type === 'touchmove' && e.targetTouches.length < 2) {
|
3821 |
+
return;
|
3822 |
+
}
|
3823 |
+
z.gesture.scaleMove = z.getDistanceBetweenTouches(e);
|
3824 |
+
}
|
3825 |
+
if (!z.gesture.image || z.gesture.image.length === 0) return;
|
3826 |
+
if (s.support.gestures) {
|
3827 |
+
z.scale = e.scale * z.currentScale;
|
3828 |
+
}
|
3829 |
+
else {
|
3830 |
+
z.scale = (z.gesture.scaleMove / z.gesture.scaleStart) * z.currentScale;
|
3831 |
+
}
|
3832 |
+
if (z.scale > z.gesture.zoomMax) {
|
3833 |
+
z.scale = z.gesture.zoomMax - 1 + Math.pow((z.scale - z.gesture.zoomMax + 1), 0.5);
|
3834 |
+
}
|
3835 |
+
if (z.scale < s.params.zoomMin) {
|
3836 |
+
z.scale = s.params.zoomMin + 1 - Math.pow((s.params.zoomMin - z.scale + 1), 0.5);
|
3837 |
+
}
|
3838 |
+
z.gesture.image.transform('translate3d(0,0,0) scale(' + z.scale + ')');
|
3839 |
+
},
|
3840 |
+
onGestureEnd: function (e) {
|
3841 |
+
var z = s.zoom;
|
3842 |
+
if (!s.support.gestures) {
|
3843 |
+
if (e.type !== 'touchend' || e.type === 'touchend' && e.changedTouches.length < 2) {
|
3844 |
+
return;
|
3845 |
+
}
|
3846 |
+
}
|
3847 |
+
if (!z.gesture.image || z.gesture.image.length === 0) return;
|
3848 |
+
z.scale = Math.max(Math.min(z.scale, z.gesture.zoomMax), s.params.zoomMin);
|
3849 |
+
z.gesture.image.transition(s.params.speed).transform('translate3d(0,0,0) scale(' + z.scale + ')');
|
3850 |
+
z.currentScale = z.scale;
|
3851 |
+
z.isScaling = false;
|
3852 |
+
if (z.scale === 1) z.gesture.slide = undefined;
|
3853 |
+
},
|
3854 |
+
onTouchStart: function (s, e) {
|
3855 |
+
var z = s.zoom;
|
3856 |
+
if (!z.gesture.image || z.gesture.image.length === 0) return;
|
3857 |
+
if (z.image.isTouched) return;
|
3858 |
+
if (s.device.os === 'android') e.preventDefault();
|
3859 |
+
z.image.isTouched = true;
|
3860 |
+
z.image.touchesStart.x = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;
|
3861 |
+
z.image.touchesStart.y = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;
|
3862 |
+
},
|
3863 |
+
onTouchMove: function (e) {
|
3864 |
+
var z = s.zoom;
|
3865 |
+
if (!z.gesture.image || z.gesture.image.length === 0) return;
|
3866 |
+
s.allowClick = false;
|
3867 |
+
if (!z.image.isTouched || !z.gesture.slide) return;
|
3868 |
+
|
3869 |
+
if (!z.image.isMoved) {
|
3870 |
+
z.image.width = z.gesture.image[0].offsetWidth;
|
3871 |
+
z.image.height = z.gesture.image[0].offsetHeight;
|
3872 |
+
z.image.startX = s.getTranslate(z.gesture.imageWrap[0], 'x') || 0;
|
3873 |
+
z.image.startY = s.getTranslate(z.gesture.imageWrap[0], 'y') || 0;
|
3874 |
+
z.gesture.slideWidth = z.gesture.slide[0].offsetWidth;
|
3875 |
+
z.gesture.slideHeight = z.gesture.slide[0].offsetHeight;
|
3876 |
+
z.gesture.imageWrap.transition(0);
|
3877 |
+
}
|
3878 |
+
// Define if we need image drag
|
3879 |
+
var scaledWidth = z.image.width * z.scale;
|
3880 |
+
var scaledHeight = z.image.height * z.scale;
|
3881 |
+
|
3882 |
+
if (scaledWidth < z.gesture.slideWidth && scaledHeight < z.gesture.slideHeight) return;
|
3883 |
+
|
3884 |
+
z.image.minX = Math.min((z.gesture.slideWidth / 2 - scaledWidth / 2), 0);
|
3885 |
+
z.image.maxX = -z.image.minX;
|
3886 |
+
z.image.minY = Math.min((z.gesture.slideHeight / 2 - scaledHeight / 2), 0);
|
3887 |
+
z.image.maxY = -z.image.minY;
|
3888 |
+
|
3889 |
+
z.image.touchesCurrent.x = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;
|
3890 |
+
z.image.touchesCurrent.y = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;
|
3891 |
+
|
3892 |
+
if (!z.image.isMoved && !z.isScaling) {
|
3893 |
+
if (s.isHorizontal() &&
|
3894 |
+
(Math.floor(z.image.minX) === Math.floor(z.image.startX) && z.image.touchesCurrent.x < z.image.touchesStart.x) ||
|
3895 |
+
(Math.floor(z.image.maxX) === Math.floor(z.image.startX) && z.image.touchesCurrent.x > z.image.touchesStart.x)
|
3896 |
+
) {
|
3897 |
+
z.image.isTouched = false;
|
3898 |
+
return;
|
3899 |
+
}
|
3900 |
+
else if (!s.isHorizontal() &&
|
3901 |
+
(Math.floor(z.image.minY) === Math.floor(z.image.startY) && z.image.touchesCurrent.y < z.image.touchesStart.y) ||
|
3902 |
+
(Math.floor(z.image.maxY) === Math.floor(z.image.startY) && z.image.touchesCurrent.y > z.image.touchesStart.y)
|
3903 |
+
) {
|
3904 |
+
z.image.isTouched = false;
|
3905 |
+
return;
|
3906 |
+
}
|
3907 |
+
}
|
3908 |
+
e.preventDefault();
|
3909 |
+
e.stopPropagation();
|
3910 |
+
|
3911 |
+
z.image.isMoved = true;
|
3912 |
+
z.image.currentX = z.image.touchesCurrent.x - z.image.touchesStart.x + z.image.startX;
|
3913 |
+
z.image.currentY = z.image.touchesCurrent.y - z.image.touchesStart.y + z.image.startY;
|
3914 |
+
|
3915 |
+
if (z.image.currentX < z.image.minX) {
|
3916 |
+
z.image.currentX = z.image.minX + 1 - Math.pow((z.image.minX - z.image.currentX + 1), 0.8);
|
3917 |
+
}
|
3918 |
+
if (z.image.currentX > z.image.maxX) {
|
3919 |
+
z.image.currentX = z.image.maxX - 1 + Math.pow((z.image.currentX - z.image.maxX + 1), 0.8);
|
3920 |
+
}
|
3921 |
+
|
3922 |
+
if (z.image.currentY < z.image.minY) {
|
3923 |
+
z.image.currentY = z.image.minY + 1 - Math.pow((z.image.minY - z.image.currentY + 1), 0.8);
|
3924 |
+
}
|
3925 |
+
if (z.image.currentY > z.image.maxY) {
|
3926 |
+
z.image.currentY = z.image.maxY - 1 + Math.pow((z.image.currentY - z.image.maxY + 1), 0.8);
|
3927 |
+
}
|
3928 |
+
|
3929 |
+
//Velocity
|
3930 |
+
if (!z.velocity.prevPositionX) z.velocity.prevPositionX = z.image.touchesCurrent.x;
|
3931 |
+
if (!z.velocity.prevPositionY) z.velocity.prevPositionY = z.image.touchesCurrent.y;
|
3932 |
+
if (!z.velocity.prevTime) z.velocity.prevTime = Date.now();
|
3933 |
+
z.velocity.x = (z.image.touchesCurrent.x - z.velocity.prevPositionX) / (Date.now() - z.velocity.prevTime) / 2;
|
3934 |
+
z.velocity.y = (z.image.touchesCurrent.y - z.velocity.prevPositionY) / (Date.now() - z.velocity.prevTime) / 2;
|
3935 |
+
if (Math.abs(z.image.touchesCurrent.x - z.velocity.prevPositionX) < 2) z.velocity.x = 0;
|
3936 |
+
if (Math.abs(z.image.touchesCurrent.y - z.velocity.prevPositionY) < 2) z.velocity.y = 0;
|
3937 |
+
z.velocity.prevPositionX = z.image.touchesCurrent.x;
|
3938 |
+
z.velocity.prevPositionY = z.image.touchesCurrent.y;
|
3939 |
+
z.velocity.prevTime = Date.now();
|
3940 |
+
|
3941 |
+
z.gesture.imageWrap.transform('translate3d(' + z.image.currentX + 'px, ' + z.image.currentY + 'px,0)');
|
3942 |
+
},
|
3943 |
+
onTouchEnd: function (s, e) {
|
3944 |
+
var z = s.zoom;
|
3945 |
+
if (!z.gesture.image || z.gesture.image.length === 0) return;
|
3946 |
+
if (!z.image.isTouched || !z.image.isMoved) {
|
3947 |
+
z.image.isTouched = false;
|
3948 |
+
z.image.isMoved = false;
|
3949 |
+
return;
|
3950 |
+
}
|
3951 |
+
z.image.isTouched = false;
|
3952 |
+
z.image.isMoved = false;
|
3953 |
+
var momentumDurationX = 300;
|
3954 |
+
var momentumDurationY = 300;
|
3955 |
+
var momentumDistanceX = z.velocity.x * momentumDurationX;
|
3956 |
+
var newPositionX = z.image.currentX + momentumDistanceX;
|
3957 |
+
var momentumDistanceY = z.velocity.y * momentumDurationY;
|
3958 |
+
var newPositionY = z.image.currentY + momentumDistanceY;
|
3959 |
+
|
3960 |
+
//Fix duration
|
3961 |
+
if (z.velocity.x !== 0) momentumDurationX = Math.abs((newPositionX - z.image.currentX) / z.velocity.x);
|
3962 |
+
if (z.velocity.y !== 0) momentumDurationY = Math.abs((newPositionY - z.image.currentY) / z.velocity.y);
|
3963 |
+
var momentumDuration = Math.max(momentumDurationX, momentumDurationY);
|
3964 |
+
|
3965 |
+
z.image.currentX = newPositionX;
|
3966 |
+
z.image.currentY = newPositionY;
|
3967 |
+
|
3968 |
+
// Define if we need image drag
|
3969 |
+
var scaledWidth = z.image.width * z.scale;
|
3970 |
+
var scaledHeight = z.image.height * z.scale;
|
3971 |
+
z.image.minX = Math.min((z.gesture.slideWidth / 2 - scaledWidth / 2), 0);
|
3972 |
+
z.image.maxX = -z.image.minX;
|
3973 |
+
z.image.minY = Math.min((z.gesture.slideHeight / 2 - scaledHeight / 2), 0);
|
3974 |
+
z.image.maxY = -z.image.minY;
|
3975 |
+
z.image.currentX = Math.max(Math.min(z.image.currentX, z.image.maxX), z.image.minX);
|
3976 |
+
z.image.currentY = Math.max(Math.min(z.image.currentY, z.image.maxY), z.image.minY);
|
3977 |
+
|
3978 |
+
z.gesture.imageWrap.transition(momentumDuration).transform('translate3d(' + z.image.currentX + 'px, ' + z.image.currentY + 'px,0)');
|
3979 |
+
},
|
3980 |
+
onTransitionEnd: function (s) {
|
3981 |
+
var z = s.zoom;
|
3982 |
+
if (z.gesture.slide && s.previousIndex !== s.activeIndex) {
|
3983 |
+
z.gesture.image.transform('translate3d(0,0,0) scale(1)');
|
3984 |
+
z.gesture.imageWrap.transform('translate3d(0,0,0)');
|
3985 |
+
z.gesture.slide = z.gesture.image = z.gesture.imageWrap = undefined;
|
3986 |
+
z.scale = z.currentScale = 1;
|
3987 |
+
}
|
3988 |
+
},
|
3989 |
+
// Toggle Zoom
|
3990 |
+
toggleZoom: function (s, e) {
|
3991 |
+
var z = s.zoom;
|
3992 |
+
if (!z.gesture.slide) {
|
3993 |
+
z.gesture.slide = s.clickedSlide ? $(s.clickedSlide) : s.slides.eq(s.activeIndex);
|
3994 |
+
z.gesture.image = z.gesture.slide.find('img, svg, canvas');
|
3995 |
+
z.gesture.imageWrap = z.gesture.image.parent('.' + s.params.zoomContainerClass);
|
3996 |
+
}
|
3997 |
+
if (!z.gesture.image || z.gesture.image.length === 0) return;
|
3998 |
+
|
3999 |
+
var touchX, touchY, offsetX, offsetY, diffX, diffY, translateX, translateY, imageWidth, imageHeight, scaledWidth, scaledHeight, translateMinX, translateMinY, translateMaxX, translateMaxY, slideWidth, slideHeight;
|
4000 |
+
|
4001 |
+
if (typeof z.image.touchesStart.x === 'undefined' && e) {
|
4002 |
+
touchX = e.type === 'touchend' ? e.changedTouches[0].pageX : e.pageX;
|
4003 |
+
touchY = e.type === 'touchend' ? e.changedTouches[0].pageY : e.pageY;
|
4004 |
+
}
|
4005 |
+
else {
|
4006 |
+
touchX = z.image.touchesStart.x;
|
4007 |
+
touchY = z.image.touchesStart.y;
|
4008 |
+
}
|
4009 |
+
|
4010 |
+
if (z.scale && z.scale !== 1) {
|
4011 |
+
// Zoom Out
|
4012 |
+
z.scale = z.currentScale = 1;
|
4013 |
+
z.gesture.imageWrap.transition(300).transform('translate3d(0,0,0)');
|
4014 |
+
z.gesture.image.transition(300).transform('translate3d(0,0,0) scale(1)');
|
4015 |
+
z.gesture.slide = undefined;
|
4016 |
+
}
|
4017 |
+
else {
|
4018 |
+
// Zoom In
|
4019 |
+
z.scale = z.currentScale = z.gesture.imageWrap.attr('data-swiper-zoom') || s.params.zoomMax;
|
4020 |
+
if (e) {
|
4021 |
+
slideWidth = z.gesture.slide[0].offsetWidth;
|
4022 |
+
slideHeight = z.gesture.slide[0].offsetHeight;
|
4023 |
+
offsetX = z.gesture.slide.offset().left;
|
4024 |
+
offsetY = z.gesture.slide.offset().top;
|
4025 |
+
diffX = offsetX + slideWidth/2 - touchX;
|
4026 |
+
diffY = offsetY + slideHeight/2 - touchY;
|
4027 |
+
|
4028 |
+
imageWidth = z.gesture.image[0].offsetWidth;
|
4029 |
+
imageHeight = z.gesture.image[0].offsetHeight;
|
4030 |
+
scaledWidth = imageWidth * z.scale;
|
4031 |
+
scaledHeight = imageHeight * z.scale;
|
4032 |
+
|
4033 |
+
translateMinX = Math.min((slideWidth / 2 - scaledWidth / 2), 0);
|
4034 |
+
translateMinY = Math.min((slideHeight / 2 - scaledHeight / 2), 0);
|
4035 |
+
translateMaxX = -translateMinX;
|
4036 |
+
translateMaxY = -translateMinY;
|
4037 |
+
|
4038 |
+
translateX = diffX * z.scale;
|
4039 |
+
translateY = diffY * z.scale;
|
4040 |
+
|
4041 |
+
if (translateX < translateMinX) {
|
4042 |
+
translateX = translateMinX;
|
4043 |
+
}
|
4044 |
+
if (translateX > translateMaxX) {
|
4045 |
+
translateX = translateMaxX;
|
4046 |
+
}
|
4047 |
+
|
4048 |
+
if (translateY < translateMinY) {
|
4049 |
+
translateY = translateMinY;
|
4050 |
+
}
|
4051 |
+
if (translateY > translateMaxY) {
|
4052 |
+
translateY = translateMaxY;
|
4053 |
+
}
|
4054 |
+
}
|
4055 |
+
else {
|
4056 |
+
translateX = 0;
|
4057 |
+
translateY = 0;
|
4058 |
+
}
|
4059 |
+
z.gesture.imageWrap.transition(300).transform('translate3d(' + translateX + 'px, ' + translateY + 'px,0)');
|
4060 |
+
z.gesture.image.transition(300).transform('translate3d(0,0,0) scale(' + z.scale + ')');
|
4061 |
+
}
|
4062 |
+
},
|
4063 |
+
// Attach/Detach Events
|
4064 |
+
attachEvents: function (detach) {
|
4065 |
+
var action = detach ? 'off' : 'on';
|
4066 |
+
|
4067 |
+
if (s.params.zoom) {
|
4068 |
+
var target = s.slides;
|
4069 |
+
var passiveListener = s.touchEvents.start === 'touchstart' && s.support.passiveListener && s.params.passiveListeners ? {passive: true, capture: false} : false;
|
4070 |
+
// Scale image
|
4071 |
+
if (s.support.gestures) {
|
4072 |
+
s.slides[action]('gesturestart', s.zoom.onGestureStart, passiveListener);
|
4073 |
+
s.slides[action]('gesturechange', s.zoom.onGestureChange, passiveListener);
|
4074 |
+
s.slides[action]('gestureend', s.zoom.onGestureEnd, passiveListener);
|
4075 |
+
}
|
4076 |
+
else if (s.touchEvents.start === 'touchstart') {
|
4077 |
+
s.slides[action](s.touchEvents.start, s.zoom.onGestureStart, passiveListener);
|
4078 |
+
s.slides[action](s.touchEvents.move, s.zoom.onGestureChange, passiveListener);
|
4079 |
+
s.slides[action](s.touchEvents.end, s.zoom.onGestureEnd, passiveListener);
|
4080 |
+
}
|
4081 |
+
|
4082 |
+
// Move image
|
4083 |
+
s[action]('touchStart', s.zoom.onTouchStart);
|
4084 |
+
s.slides.each(function (index, slide){
|
4085 |
+
if ($(slide).find('.' + s.params.zoomContainerClass).length > 0) {
|
4086 |
+
$(slide)[action](s.touchEvents.move, s.zoom.onTouchMove);
|
4087 |
+
}
|
4088 |
+
});
|
4089 |
+
s[action]('touchEnd', s.zoom.onTouchEnd);
|
4090 |
+
|
4091 |
+
// Scale Out
|
4092 |
+
s[action]('transitionEnd', s.zoom.onTransitionEnd);
|
4093 |
+
if (s.params.zoomToggle) {
|
4094 |
+
s.on('doubleTap', s.zoom.toggleZoom);
|
4095 |
+
}
|
4096 |
+
}
|
4097 |
+
},
|
4098 |
+
init: function () {
|
4099 |
+
s.zoom.attachEvents();
|
4100 |
+
},
|
4101 |
+
destroy: function () {
|
4102 |
+
s.zoom.attachEvents(true);
|
4103 |
+
}
|
4104 |
+
};
|
4105 |
+
|
4106 |
+
/*=========================
|
4107 |
+
Plugins API. Collect all and init all plugins
|
4108 |
+
===========================*/
|
4109 |
+
s._plugins = [];
|
4110 |
+
for (var plugin in s.plugins) {
|
4111 |
+
var p = s.plugins[plugin](s, s.params[plugin]);
|
4112 |
+
if (p) s._plugins.push(p);
|
4113 |
+
}
|
4114 |
+
// Method to call all plugins event/method
|
4115 |
+
s.callPlugins = function (eventName) {
|
4116 |
+
for (var i = 0; i < s._plugins.length; i++) {
|
4117 |
+
if (eventName in s._plugins[i]) {
|
4118 |
+
s._plugins[i][eventName](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
|
4119 |
+
}
|
4120 |
+
}
|
4121 |
+
};
|
4122 |
+
|
4123 |
+
/*=========================
|
4124 |
+
Events/Callbacks/Plugins Emitter
|
4125 |
+
===========================*/
|
4126 |
+
function normalizeEventName (eventName) {
|
4127 |
+
if (eventName.indexOf('on') !== 0) {
|
4128 |
+
if (eventName[0] !== eventName[0].toUpperCase()) {
|
4129 |
+
eventName = 'on' + eventName[0].toUpperCase() + eventName.substring(1);
|
4130 |
+
}
|
4131 |
+
else {
|
4132 |
+
eventName = 'on' + eventName;
|
4133 |
+
}
|
4134 |
+
}
|
4135 |
+
return eventName;
|
4136 |
+
}
|
4137 |
+
s.emitterEventListeners = {
|
4138 |
+
|
4139 |
+
};
|
4140 |
+
s.emit = function (eventName) {
|
4141 |
+
// Trigger callbacks
|
4142 |
+
if (s.params[eventName]) {
|
4143 |
+
s.params[eventName](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
|
4144 |
+
}
|
4145 |
+
var i;
|
4146 |
+
// Trigger events
|
4147 |
+
if (s.emitterEventListeners[eventName]) {
|
4148 |
+
for (i = 0; i < s.emitterEventListeners[eventName].length; i++) {
|
4149 |
+
s.emitterEventListeners[eventName][i](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
|
4150 |
+
}
|
4151 |
+
}
|
4152 |
+
// Trigger plugins
|
4153 |
+
if (s.callPlugins) s.callPlugins(eventName, arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
|
4154 |
+
};
|
4155 |
+
s.on = function (eventName, handler) {
|
4156 |
+
eventName = normalizeEventName(eventName);
|
4157 |
+
if (!s.emitterEventListeners[eventName]) s.emitterEventListeners[eventName] = [];
|
4158 |
+
s.emitterEventListeners[eventName].push(handler);
|
4159 |
+
return s;
|
4160 |
+
};
|
4161 |
+
s.off = function (eventName, handler) {
|
4162 |
+
var i;
|
4163 |
+
eventName = normalizeEventName(eventName);
|
4164 |
+
if (typeof handler === 'undefined') {
|
4165 |
+
// Remove all handlers for such event
|
4166 |
+
s.emitterEventListeners[eventName] = [];
|
4167 |
+
return s;
|
4168 |
+
}
|
4169 |
+
if (!s.emitterEventListeners[eventName] || s.emitterEventListeners[eventName].length === 0) return;
|
4170 |
+
for (i = 0; i < s.emitterEventListeners[eventName].length; i++) {
|
4171 |
+
if(s.emitterEventListeners[eventName][i] === handler) s.emitterEventListeners[eventName].splice(i, 1);
|
4172 |
+
}
|
4173 |
+
return s;
|
4174 |
+
};
|
4175 |
+
s.once = function (eventName, handler) {
|
4176 |
+
eventName = normalizeEventName(eventName);
|
4177 |
+
var _handler = function () {
|
4178 |
+
handler(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]);
|
4179 |
+
s.off(eventName, _handler);
|
4180 |
+
};
|
4181 |
+
s.on(eventName, _handler);
|
4182 |
+
return s;
|
4183 |
+
};
|
4184 |
+
|
4185 |
+
// Accessibility tools
|
4186 |
+
s.a11y = {
|
4187 |
+
makeFocusable: function ($el) {
|
4188 |
+
$el.attr('tabIndex', '0');
|
4189 |
+
return $el;
|
4190 |
+
},
|
4191 |
+
addRole: function ($el, role) {
|
4192 |
+
$el.attr('role', role);
|
4193 |
+
return $el;
|
4194 |
+
},
|
4195 |
+
|
4196 |
+
addLabel: function ($el, label) {
|
4197 |
+
$el.attr('aria-label', label);
|
4198 |
+
return $el;
|
4199 |
+
},
|
4200 |
+
|
4201 |
+
disable: function ($el) {
|
4202 |
+
$el.attr('aria-disabled', true);
|
4203 |
+
return $el;
|
4204 |
+
},
|
4205 |
+
|
4206 |
+
enable: function ($el) {
|
4207 |
+
$el.attr('aria-disabled', false);
|
4208 |
+
return $el;
|
4209 |
+
},
|
4210 |
+
|
4211 |
+
onEnterKey: function (event) {
|
4212 |
+
if (event.keyCode !== 13) return;
|
4213 |
+
if ($(event.target).is(s.params.nextButton)) {
|
4214 |
+
s.onClickNext(event);
|
4215 |
+
if (s.isEnd) {
|
4216 |
+
s.a11y.notify(s.params.lastSlideMessage);
|
4217 |
+
}
|
4218 |
+
else {
|
4219 |
+
s.a11y.notify(s.params.nextSlideMessage);
|
4220 |
+
}
|
4221 |
+
}
|
4222 |
+
else if ($(event.target).is(s.params.prevButton)) {
|
4223 |
+
s.onClickPrev(event);
|
4224 |
+
if (s.isBeginning) {
|
4225 |
+
s.a11y.notify(s.params.firstSlideMessage);
|
4226 |
+
}
|
4227 |
+
else {
|
4228 |
+
s.a11y.notify(s.params.prevSlideMessage);
|
4229 |
+
}
|
4230 |
+
}
|
4231 |
+
if ($(event.target).is('.' + s.params.bulletClass)) {
|
4232 |
+
$(event.target)[0].click();
|
4233 |
+
}
|
4234 |
+
},
|
4235 |
+
|
4236 |
+
liveRegion: $('<span class="' + s.params.notificationClass + '" aria-live="assertive" aria-atomic="true"></span>'),
|
4237 |
+
|
4238 |
+
notify: function (message) {
|
4239 |
+
var notification = s.a11y.liveRegion;
|
4240 |
+
if (notification.length === 0) return;
|
4241 |
+
notification.html('');
|
4242 |
+
notification.html(message);
|
4243 |
+
},
|
4244 |
+
init: function () {
|
4245 |
+
// Setup accessibility
|
4246 |
+
if (s.params.nextButton && s.nextButton && s.nextButton.length > 0) {
|
4247 |
+
s.a11y.makeFocusable(s.nextButton);
|
4248 |
+
s.a11y.addRole(s.nextButton, 'button');
|
4249 |
+
s.a11y.addLabel(s.nextButton, s.params.nextSlideMessage);
|
4250 |
+
}
|
4251 |
+
if (s.params.prevButton && s.prevButton && s.prevButton.length > 0) {
|
4252 |
+
s.a11y.makeFocusable(s.prevButton);
|
4253 |
+
s.a11y.addRole(s.prevButton, 'button');
|
4254 |
+
s.a11y.addLabel(s.prevButton, s.params.prevSlideMessage);
|
4255 |
+
}
|
4256 |
+
|
4257 |
+
$(s.container).append(s.a11y.liveRegion);
|
4258 |
+
},
|
4259 |
+
initPagination: function () {
|
4260 |
+
if (s.params.pagination && s.params.paginationClickable && s.bullets && s.bullets.length) {
|
4261 |
+
s.bullets.each(function () {
|
4262 |
+
var bullet = $(this);
|
4263 |
+
s.a11y.makeFocusable(bullet);
|
4264 |
+
s.a11y.addRole(bullet, 'button');
|
4265 |
+
s.a11y.addLabel(bullet, s.params.paginationBulletMessage.replace(/{{index}}/, bullet.index() + 1));
|
4266 |
+
});
|
4267 |
+
}
|
4268 |
+
},
|
4269 |
+
destroy: function () {
|
4270 |
+
if (s.a11y.liveRegion && s.a11y.liveRegion.length > 0) s.a11y.liveRegion.remove();
|
4271 |
+
}
|
4272 |
+
};
|
4273 |
+
|
4274 |
+
|
4275 |
+
/*=========================
|
4276 |
+
Init/Destroy
|
4277 |
+
===========================*/
|
4278 |
+
s.init = function () {
|
4279 |
+
if (s.params.loop) s.createLoop();
|
4280 |
+
s.updateContainerSize();
|
4281 |
+
s.updateSlidesSize();
|
4282 |
+
s.updatePagination();
|
4283 |
+
if (s.params.scrollbar && s.scrollbar) {
|
4284 |
+
s.scrollbar.set();
|
4285 |
+
if (s.params.scrollbarDraggable) {
|
4286 |
+
s.scrollbar.enableDraggable();
|
4287 |
+
}
|
4288 |
+
}
|
4289 |
+
if (s.params.effect !== 'slide' && s.effects[s.params.effect]) {
|
4290 |
+
if (!s.params.loop) s.updateProgress();
|
4291 |
+
s.effects[s.params.effect].setTranslate();
|
4292 |
+
}
|
4293 |
+
if (s.params.loop) {
|
4294 |
+
s.slideTo(s.params.initialSlide + s.loopedSlides, 0, s.params.runCallbacksOnInit);
|
4295 |
+
}
|
4296 |
+
else {
|
4297 |
+
s.slideTo(s.params.initialSlide, 0, s.params.runCallbacksOnInit);
|
4298 |
+
if (s.params.initialSlide === 0) {
|
4299 |
+
if (s.parallax && s.params.parallax) s.parallax.setTranslate();
|
4300 |
+
if (s.lazy && s.params.lazyLoading) {
|
4301 |
+
s.lazy.load();
|
4302 |
+
s.lazy.initialImageLoaded = true;
|
4303 |
+
}
|
4304 |
+
}
|
4305 |
+
}
|
4306 |
+
s.attachEvents();
|
4307 |
+
if (s.params.observer && s.support.observer) {
|
4308 |
+
s.initObservers();
|
4309 |
+
}
|
4310 |
+
if (s.params.preloadImages && !s.params.lazyLoading) {
|
4311 |
+
s.preloadImages();
|
4312 |
+
}
|
4313 |
+
if (s.params.zoom && s.zoom) {
|
4314 |
+
s.zoom.init();
|
4315 |
+
}
|
4316 |
+
if (s.params.autoplay) {
|
4317 |
+
s.startAutoplay();
|
4318 |
+
}
|
4319 |
+
if (s.params.keyboardControl) {
|
4320 |
+
if (s.enableKeyboardControl) s.enableKeyboardControl();
|
4321 |
+
}
|
4322 |
+
if (s.params.mousewheelControl) {
|
4323 |
+
if (s.enableMousewheelControl) s.enableMousewheelControl();
|
4324 |
+
}
|
4325 |
+
// Deprecated hashnavReplaceState changed to replaceState for use in hashnav and history
|
4326 |
+
if (s.params.hashnavReplaceState) {
|
4327 |
+
s.params.replaceState = s.params.hashnavReplaceState;
|
4328 |
+
}
|
4329 |
+
if (s.params.history) {
|
4330 |
+
if (s.history) s.history.init();
|
4331 |
+
}
|
4332 |
+
if (s.params.hashnav) {
|
4333 |
+
if (s.hashnav) s.hashnav.init();
|
4334 |
+
}
|
4335 |
+
if (s.params.a11y && s.a11y) s.a11y.init();
|
4336 |
+
s.emit('onInit', s);
|
4337 |
+
};
|
4338 |
+
|
4339 |
+
// Cleanup dynamic styles
|
4340 |
+
s.cleanupStyles = function () {
|
4341 |
+
// Container
|
4342 |
+
s.container.removeClass(s.classNames.join(' ')).removeAttr('style');
|
4343 |
+
|
4344 |
+
// Wrapper
|
4345 |
+
s.wrapper.removeAttr('style');
|
4346 |
+
|
4347 |
+
// Slides
|
4348 |
+
if (s.slides && s.slides.length) {
|
4349 |
+
s.slides
|
4350 |
+
.removeClass([
|
4351 |
+
s.params.slideVisibleClass,
|
4352 |
+
s.params.slideActiveClass,
|
4353 |
+
s.params.slideNextClass,
|
4354 |
+
s.params.slidePrevClass
|
4355 |
+
].join(' '))
|
4356 |
+
.removeAttr('style')
|
4357 |
+
.removeAttr('data-swiper-column')
|
4358 |
+
.removeAttr('data-swiper-row');
|
4359 |
+
}
|
4360 |
+
|
4361 |
+
// Pagination/Bullets
|
4362 |
+
if (s.paginationContainer && s.paginationContainer.length) {
|
4363 |
+
s.paginationContainer.removeClass(s.params.paginationHiddenClass);
|
4364 |
+
}
|
4365 |
+
if (s.bullets && s.bullets.length) {
|
4366 |
+
s.bullets.removeClass(s.params.bulletActiveClass);
|
4367 |
+
}
|
4368 |
+
|
4369 |
+
// Buttons
|
4370 |
+
if (s.params.prevButton) $(s.params.prevButton).removeClass(s.params.buttonDisabledClass);
|
4371 |
+
if (s.params.nextButton) $(s.params.nextButton).removeClass(s.params.buttonDisabledClass);
|
4372 |
+
|
4373 |
+
// Scrollbar
|
4374 |
+
if (s.params.scrollbar && s.scrollbar) {
|
4375 |
+
if (s.scrollbar.track && s.scrollbar.track.length) s.scrollbar.track.removeAttr('style');
|
4376 |
+
if (s.scrollbar.drag && s.scrollbar.drag.length) s.scrollbar.drag.removeAttr('style');
|
4377 |
+
}
|
4378 |
+
};
|
4379 |
+
|
4380 |
+
// Destroy
|
4381 |
+
s.destroy = function (deleteInstance, cleanupStyles) {
|
4382 |
+
// Detach evebts
|
4383 |
+
s.detachEvents();
|
4384 |
+
// Stop autoplay
|
4385 |
+
s.stopAutoplay();
|
4386 |
+
// Disable draggable
|
4387 |
+
if (s.params.scrollbar && s.scrollbar) {
|
4388 |
+
if (s.params.scrollbarDraggable) {
|
4389 |
+
s.scrollbar.disableDraggable();
|
4390 |
+
}
|
4391 |
+
}
|
4392 |
+
// Destroy loop
|
4393 |
+
if (s.params.loop) {
|
4394 |
+
s.destroyLoop();
|
4395 |
+
}
|
4396 |
+
// Cleanup styles
|
4397 |
+
if (cleanupStyles) {
|
4398 |
+
s.cleanupStyles();
|
4399 |
+
}
|
4400 |
+
// Disconnect observer
|
4401 |
+
s.disconnectObservers();
|
4402 |
+
|
4403 |
+
// Destroy zoom
|
4404 |
+
if (s.params.zoom && s.zoom) {
|
4405 |
+
s.zoom.destroy();
|
4406 |
+
}
|
4407 |
+
// Disable keyboard/mousewheel
|
4408 |
+
if (s.params.keyboardControl) {
|
4409 |
+
if (s.disableKeyboardControl) s.disableKeyboardControl();
|
4410 |
+
}
|
4411 |
+
if (s.params.mousewheelControl) {
|
4412 |
+
if (s.disableMousewheelControl) s.disableMousewheelControl();
|
4413 |
+
}
|
4414 |
+
// Disable a11y
|
4415 |
+
if (s.params.a11y && s.a11y) s.a11y.destroy();
|
4416 |
+
// Delete history popstate
|
4417 |
+
if (s.params.history && !s.params.replaceState) {
|
4418 |
+
window.removeEventListener('popstate', s.history.setHistoryPopState);
|
4419 |
+
}
|
4420 |
+
if (s.params.hashnav && s.hashnav) {
|
4421 |
+
s.hashnav.destroy();
|
4422 |
+
}
|
4423 |
+
// Destroy callback
|
4424 |
+
s.emit('onDestroy');
|
4425 |
+
// Delete instance
|
4426 |
+
if (deleteInstance !== false) s = null;
|
4427 |
+
};
|
4428 |
+
|
4429 |
+
s.init();
|
4430 |
+
|
4431 |
+
|
4432 |
+
|
4433 |
+
// Return swiper instance
|
4434 |
+
return s;
|
4435 |
+
};
|
4436 |
+
|
4437 |
+
|
4438 |
+
/*==================================================
|
4439 |
+
Prototype
|
4440 |
+
====================================================*/
|
4441 |
+
Swiper.prototype = {
|
4442 |
+
isSafari: (function () {
|
4443 |
+
var ua = navigator.userAgent.toLowerCase();
|
4444 |
+
return (ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0);
|
4445 |
+
})(),
|
4446 |
+
isUiWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent),
|
4447 |
+
isArray: function (arr) {
|
4448 |
+
return Object.prototype.toString.apply(arr) === '[object Array]';
|
4449 |
+
},
|
4450 |
+
/*==================================================
|
4451 |
+
Browser
|
4452 |
+
====================================================*/
|
4453 |
+
browser: {
|
4454 |
+
ie: window.navigator.pointerEnabled || window.navigator.msPointerEnabled,
|
4455 |
+
ieTouch: (window.navigator.msPointerEnabled && window.navigator.msMaxTouchPoints > 1) || (window.navigator.pointerEnabled && window.navigator.maxTouchPoints > 1),
|
4456 |
+
lteIE9: (function() {
|
4457 |
+
// create temporary DIV
|
4458 |
+
var div = document.createElement('div');
|
4459 |
+
// add content to tmp DIV which is wrapped into the IE HTML conditional statement
|
4460 |
+
div.innerHTML = '<!--[if lte IE 9]><i></i><![endif]-->';
|
4461 |
+
// return true / false value based on what will browser render
|
4462 |
+
return div.getElementsByTagName('i').length === 1;
|
4463 |
+
})()
|
4464 |
+
},
|
4465 |
+
/*==================================================
|
4466 |
+
Devices
|
4467 |
+
====================================================*/
|
4468 |
+
device: (function () {
|
4469 |
+
var ua = navigator.userAgent;
|
4470 |
+
var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/);
|
4471 |
+
var ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
|
4472 |
+
var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
|
4473 |
+
var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/);
|
4474 |
+
return {
|
4475 |
+
ios: ipad || iphone || ipod,
|
4476 |
+
android: android
|
4477 |
+
};
|
4478 |
+
})(),
|
4479 |
+
/*==================================================
|
4480 |
+
Feature Detection
|
4481 |
+
====================================================*/
|
4482 |
+
support: {
|
4483 |
+
touch : (window.Modernizr && Modernizr.touch === true) || (function () {
|
4484 |
+
return !!(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch);
|
4485 |
+
})(),
|
4486 |
+
|
4487 |
+
transforms3d : (window.Modernizr && Modernizr.csstransforms3d === true) || (function () {
|
4488 |
+
var div = document.createElement('div').style;
|
4489 |
+
return ('webkitPerspective' in div || 'MozPerspective' in div || 'OPerspective' in div || 'MsPerspective' in div || 'perspective' in div);
|
4490 |
+
})(),
|
4491 |
+
|
4492 |
+
flexbox: (function () {
|
4493 |
+
var div = document.createElement('div').style;
|
4494 |
+
var styles = ('alignItems webkitAlignItems webkitBoxAlign msFlexAlign mozBoxAlign webkitFlexDirection msFlexDirection mozBoxDirection mozBoxOrient webkitBoxDirection webkitBoxOrient').split(' ');
|
4495 |
+
for (var i = 0; i < styles.length; i++) {
|
4496 |
+
if (styles[i] in div) return true;
|
4497 |
+
}
|
4498 |
+
})(),
|
4499 |
+
|
4500 |
+
observer: (function () {
|
4501 |
+
return ('MutationObserver' in window || 'WebkitMutationObserver' in window);
|
4502 |
+
})(),
|
4503 |
+
|
4504 |
+
passiveListener: (function () {
|
4505 |
+
var supportsPassive = false;
|
4506 |
+
try {
|
4507 |
+
var opts = Object.defineProperty({}, 'passive', {
|
4508 |
+
get: function() {
|
4509 |
+
supportsPassive = true;
|
4510 |
+
}
|
4511 |
+
});
|
4512 |
+
window.addEventListener('testPassiveListener', null, opts);
|
4513 |
+
} catch (e) {}
|
4514 |
+
return supportsPassive;
|
4515 |
+
})(),
|
4516 |
+
|
4517 |
+
gestures: (function () {
|
4518 |
+
return 'ongesturestart' in window;
|
4519 |
+
})()
|
4520 |
+
},
|
4521 |
+
/*==================================================
|
4522 |
+
Plugins
|
4523 |
+
====================================================*/
|
4524 |
+
plugins: {}
|
4525 |
+
};
|
4526 |
+
|
4527 |
+
|
4528 |
+
/*===========================
|
4529 |
+
Get Dom libraries
|
4530 |
+
===========================*/
|
4531 |
+
var swiperDomPlugins = ['jQuery', 'Zepto', 'Dom7'];
|
4532 |
+
for (var i = 0; i < swiperDomPlugins.length; i++) {
|
4533 |
+
if (window[swiperDomPlugins[i]]) {
|
4534 |
+
addLibraryPlugin(window[swiperDomPlugins[i]]);
|
4535 |
+
}
|
4536 |
+
}
|
4537 |
+
// Required DOM Plugins
|
4538 |
+
var domLib;
|
4539 |
+
if (typeof Dom7 === 'undefined') {
|
4540 |
+
domLib = window.Dom7 || window.Zepto || window.jQuery;
|
4541 |
+
}
|
4542 |
+
else {
|
4543 |
+
domLib = Dom7;
|
4544 |
+
}
|
4545 |
+
|
4546 |
+
/*===========================
|
4547 |
+
Add .swiper plugin from Dom libraries
|
4548 |
+
===========================*/
|
4549 |
+
function addLibraryPlugin(lib) {
|
4550 |
+
lib.fn.swiper = function (params) {
|
4551 |
+
var firstInstance;
|
4552 |
+
lib(this).each(function () {
|
4553 |
+
var s = new Swiper(this, params);
|
4554 |
+
if (!firstInstance) firstInstance = s;
|
4555 |
+
});
|
4556 |
+
return firstInstance;
|
4557 |
+
};
|
4558 |
+
}
|
4559 |
+
|
4560 |
+
if (domLib) {
|
4561 |
+
if (!('transitionEnd' in domLib.fn)) {
|
4562 |
+
domLib.fn.transitionEnd = function (callback) {
|
4563 |
+
var events = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'],
|
4564 |
+
i, j, dom = this;
|
4565 |
+
function fireCallBack(e) {
|
4566 |
+
/*jshint validthis:true */
|
4567 |
+
if (e.target !== this) return;
|
4568 |
+
callback.call(this, e);
|
4569 |
+
for (i = 0; i < events.length; i++) {
|
4570 |
+
dom.off(events[i], fireCallBack);
|
4571 |
+
}
|
4572 |
+
}
|
4573 |
+
if (callback) {
|
4574 |
+
for (i = 0; i < events.length; i++) {
|
4575 |
+
dom.on(events[i], fireCallBack);
|
4576 |
+
}
|
4577 |
+
}
|
4578 |
+
return this;
|
4579 |
+
};
|
4580 |
+
}
|
4581 |
+
if (!('transform' in domLib.fn)) {
|
4582 |
+
domLib.fn.transform = function (transform) {
|
4583 |
+
for (var i = 0; i < this.length; i++) {
|
4584 |
+
var elStyle = this[i].style;
|
4585 |
+
elStyle.webkitTransform = elStyle.MsTransform = elStyle.msTransform = elStyle.MozTransform = elStyle.OTransform = elStyle.transform = transform;
|
4586 |
+
}
|
4587 |
+
return this;
|
4588 |
+
};
|
4589 |
+
}
|
4590 |
+
if (!('transition' in domLib.fn)) {
|
4591 |
+
domLib.fn.transition = function (duration) {
|
4592 |
+
if (typeof duration !== 'string') {
|
4593 |
+
duration = duration + 'ms';
|
4594 |
+
}
|
4595 |
+
for (var i = 0; i < this.length; i++) {
|
4596 |
+
var elStyle = this[i].style;
|
4597 |
+
elStyle.webkitTransitionDuration = elStyle.MsTransitionDuration = elStyle.msTransitionDuration = elStyle.MozTransitionDuration = elStyle.OTransitionDuration = elStyle.transitionDuration = duration;
|
4598 |
+
}
|
4599 |
+
return this;
|
4600 |
+
};
|
4601 |
+
}
|
4602 |
+
if (!('outerWidth' in domLib.fn)) {
|
4603 |
+
domLib.fn.outerWidth = function (includeMargins) {
|
4604 |
+
if (this.length > 0) {
|
4605 |
+
if (includeMargins)
|
4606 |
+
return this[0].offsetWidth + parseFloat(this.css('margin-right')) + parseFloat(this.css('margin-left'));
|
4607 |
+
else
|
4608 |
+
return this[0].offsetWidth;
|
4609 |
+
}
|
4610 |
+
else return null;
|
4611 |
+
};
|
4612 |
+
}
|
4613 |
+
}
|
4614 |
+
|
4615 |
+
window.Swiper = Swiper;
|
4616 |
+
})();
|
4617 |
+
/*===========================
|
4618 |
+
Swiper AMD Export
|
4619 |
+
===========================*/
|
4620 |
+
if (typeof(module) !== 'undefined')
|
4621 |
+
{
|
4622 |
+
module.exports = window.Swiper;
|
4623 |
+
}
|
4624 |
+
else if (typeof define === 'function' && define.amd) {
|
4625 |
+
define([], function () {
|
4626 |
+
'use strict';
|
4627 |
+
return window.Swiper;
|
4628 |
+
});
|
4629 |
+
}
|
4630 |
+
//# sourceMappingURL=maps/swiper.jquery.js.map
|
assets/velocity/velocity.min.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
/*! VelocityJS.org (1.4.1). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */
|
2 |
+
/*! VelocityJS.org jQuery Shim (1.0.1). (C) 2014 The jQuery Foundation. MIT @license: en.wikipedia.org/wiki/MIT_License. */
|
3 |
+
!function(a){"use strict";function b(a){var b=a.length,d=c.type(a);return"function"!==d&&!c.isWindow(a)&&(!(1!==a.nodeType||!b)||("array"===d||0===b||"number"==typeof b&&b>0&&b-1 in a))}if(!a.jQuery){var c=function(a,b){return new c.fn.init(a,b)};c.isWindow=function(a){return a&&a===a.window},c.type=function(a){return a?"object"==typeof a||"function"==typeof a?e[g.call(a)]||"object":typeof a:a+""},c.isArray=Array.isArray||function(a){return"array"===c.type(a)},c.isPlainObject=function(a){var b;if(!a||"object"!==c.type(a)||a.nodeType||c.isWindow(a))return!1;try{if(a.constructor&&!f.call(a,"constructor")&&!f.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(d){return!1}for(b in a);return void 0===b||f.call(a,b)},c.each=function(a,c,d){var e,f=0,g=a.length,h=b(a);if(d){if(h)for(;f<g&&(e=c.apply(a[f],d),e!==!1);f++);else for(f in a)if(a.hasOwnProperty(f)&&(e=c.apply(a[f],d),e===!1))break}else if(h)for(;f<g&&(e=c.call(a[f],f,a[f]),e!==!1);f++);else for(f in a)if(a.hasOwnProperty(f)&&(e=c.call(a[f],f,a[f]),e===!1))break;return a},c.data=function(a,b,e){if(void 0===e){var f=a[c.expando],g=f&&d[f];if(void 0===b)return g;if(g&&b in g)return g[b]}else if(void 0!==b){var h=a[c.expando]||(a[c.expando]=++c.uuid);return d[h]=d[h]||{},d[h][b]=e,e}},c.removeData=function(a,b){var e=a[c.expando],f=e&&d[e];f&&(b?c.each(b,function(a,b){delete f[b]}):delete d[e])},c.extend=function(){var a,b,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;for("boolean"==typeof h&&(k=h,h=arguments[i]||{},i++),"object"!=typeof h&&"function"!==c.type(h)&&(h={}),i===j&&(h=this,i--);i<j;i++)if(f=arguments[i])for(e in f)f.hasOwnProperty(e)&&(a=h[e],d=f[e],h!==d&&(k&&d&&(c.isPlainObject(d)||(b=c.isArray(d)))?(b?(b=!1,g=a&&c.isArray(a)?a:[]):g=a&&c.isPlainObject(a)?a:{},h[e]=c.extend(k,g,d)):void 0!==d&&(h[e]=d)));return h},c.queue=function(a,d,e){function f(a,c){var d=c||[];return a&&(b(Object(a))?!function(a,b){for(var c=+b.length,d=0,e=a.length;d<c;)a[e++]=b[d++];if(c!==c)for(;void 0!==b[d];)a[e++]=b[d++];return a.length=e,a}(d,"string"==typeof a?[a]:a):[].push.call(d,a)),d}if(a){d=(d||"fx")+"queue";var g=c.data(a,d);return e?(!g||c.isArray(e)?g=c.data(a,d,f(e)):g.push(e),g):g||[]}},c.dequeue=function(a,b){c.each(a.nodeType?[a]:a,function(a,d){b=b||"fx";var e=c.queue(d,b),f=e.shift();"inprogress"===f&&(f=e.shift()),f&&("fx"===b&&e.unshift("inprogress"),f.call(d,function(){c.dequeue(d,b)}))})},c.fn=c.prototype={init:function(a){if(a.nodeType)return this[0]=a,this;throw new Error("Not a DOM node.")},offset:function(){var b=this[0].getBoundingClientRect?this[0].getBoundingClientRect():{top:0,left:0};return{top:b.top+(a.pageYOffset||document.scrollTop||0)-(document.clientTop||0),left:b.left+(a.pageXOffset||document.scrollLeft||0)-(document.clientLeft||0)}},position:function(){function a(a){for(var b=a.offsetParent;b&&"html"!==b.nodeName.toLowerCase()&&b.style&&"static"===b.style.position;)b=b.offsetParent;return b||document}var b=this[0],d=a(b),e=this.offset(),f=/^(?:body|html)$/i.test(d.nodeName)?{top:0,left:0}:c(d).offset();return e.top-=parseFloat(b.style.marginTop)||0,e.left-=parseFloat(b.style.marginLeft)||0,d.style&&(f.top+=parseFloat(d.style.borderTopWidth)||0,f.left+=parseFloat(d.style.borderLeftWidth)||0),{top:e.top-f.top,left:e.left-f.left}}};var d={};c.expando="velocity"+(new Date).getTime(),c.uuid=0;for(var e={},f=e.hasOwnProperty,g=e.toString,h="Boolean Number String Function Array Date RegExp Object Error".split(" "),i=0;i<h.length;i++)e["[object "+h[i]+"]"]=h[i].toLowerCase();c.fn.init.prototype=c.fn,a.Velocity={Utilities:c}}}(window),function(a){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a():"function"==typeof define&&define.amd?define(a):a()}(function(){"use strict";return function(a,b,c,d){function e(a){for(var b=-1,c=a?a.length:0,d=[];++b<c;){var e=a[b];e&&d.push(e)}return d}function f(a){return s.isWrapped(a)?a=[].slice.call(a):s.isNode(a)&&(a=[a]),a}function g(a){var b=o.data(a,"velocity");return null===b?d:b}function h(a,b){var c=g(a);c&&c.delayTimer&&!c.delayPaused&&(c.delayRemaining=c.delay-b+c.delayBegin,c.delayPaused=!0,clearTimeout(c.delayTimer.setTimeout))}function i(a,b){var c=g(a);c&&c.delayTimer&&c.delayPaused&&(c.delayPaused=!1,c.delayTimer.setTimeout=setTimeout(c.delayTimer.next,c.delayRemaining))}function j(a){return function(b){return Math.round(b*a)*(1/a)}}function k(a,c,d,e){function f(a,b){return 1-3*b+3*a}function g(a,b){return 3*b-6*a}function h(a){return 3*a}function i(a,b,c){return((f(b,c)*a+g(b,c))*a+h(b))*a}function j(a,b,c){return 3*f(b,c)*a*a+2*g(b,c)*a+h(b)}function k(b,c){for(var e=0;e<p;++e){var f=j(c,a,d);if(0===f)return c;var g=i(c,a,d)-b;c-=g/f}return c}function l(){for(var b=0;b<t;++b)x[b]=i(b*u,a,d)}function m(b,c,e){var f,g,h=0;do g=c+(e-c)/2,f=i(g,a,d)-b,f>0?e=g:c=g;while(Math.abs(f)>r&&++h<s);return g}function n(b){for(var c=0,e=1,f=t-1;e!==f&&x[e]<=b;++e)c+=u;--e;var g=(b-x[e])/(x[e+1]-x[e]),h=c+g*u,i=j(h,a,d);return i>=q?k(b,h):0===i?h:m(b,c,c+u)}function o(){y=!0,a===c&&d===e||l()}var p=4,q=.001,r=1e-7,s=10,t=11,u=1/(t-1),v="Float32Array"in b;if(4!==arguments.length)return!1;for(var w=0;w<4;++w)if("number"!=typeof arguments[w]||isNaN(arguments[w])||!isFinite(arguments[w]))return!1;a=Math.min(a,1),d=Math.min(d,1),a=Math.max(a,0),d=Math.max(d,0);var x=v?new Float32Array(t):new Array(t),y=!1,z=function(b){return y||o(),a===c&&d===e?b:0===b?0:1===b?1:i(n(b),c,e)};z.getControlPoints=function(){return[{x:a,y:c},{x:d,y:e}]};var A="generateBezier("+[a,c,d,e]+")";return z.toString=function(){return A},z}function l(a,b){var c=a;return s.isString(a)?w.Easings[a]||(c=!1):c=s.isArray(a)&&1===a.length?j.apply(null,a):s.isArray(a)&&2===a.length?x.apply(null,a.concat([b])):!(!s.isArray(a)||4!==a.length)&&k.apply(null,a),c===!1&&(c=w.Easings[w.defaults.easing]?w.defaults.easing:v),c}function m(a){if(a){var b=w.timestamp&&a!==!0?a:r.now(),c=w.State.calls.length;c>1e4&&(w.State.calls=e(w.State.calls),c=w.State.calls.length);for(var f=0;f<c;f++)if(w.State.calls[f]){var h=w.State.calls[f],i=h[0],j=h[2],k=h[3],l=!!k,q=null,t=h[5],u=h[6];if(k||(k=w.State.calls[f][3]=b-16),t){if(t.resume!==!0)continue;k=h[3]=Math.round(b-u-16),h[5]=null}u=h[6]=b-k;for(var v=Math.min(u/j.duration,1),x=0,z=i.length;x<z;x++){var B=i[x],C=B.element;if(g(C)){var D=!1;if(j.display!==d&&null!==j.display&&"none"!==j.display){if("flex"===j.display){var E=["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex"];o.each(E,function(a,b){y.setPropertyValue(C,"display",b)})}y.setPropertyValue(C,"display",j.display)}j.visibility!==d&&"hidden"!==j.visibility&&y.setPropertyValue(C,"visibility",j.visibility);for(var F in B)if(B.hasOwnProperty(F)&&"element"!==F){var G,H=B[F],I=s.isString(H.easing)?w.Easings[H.easing]:H.easing;if(s.isString(H.pattern)){var J=1===v?function(a,b,c){var d=H.endValue[b];return c?Math.round(d):d}:function(a,b,c){var d=H.startValue[b],e=H.endValue[b]-d,f=d+e*I(v,j,e);return c?Math.round(f):f};G=H.pattern.replace(/{(\d+)(!)?}/g,J)}else if(1===v)G=H.endValue;else{var K=H.endValue-H.startValue;G=H.startValue+K*I(v,j,K)}if(!l&&G===H.currentValue)continue;if(H.currentValue=G,"tween"===F)q=G;else{var L;if(y.Hooks.registered[F]){L=y.Hooks.getRoot(F);var M=g(C).rootPropertyValueCache[L];M&&(H.rootPropertyValue=M)}var N=y.setPropertyValue(C,F,H.currentValue+(p<9&&0===parseFloat(G)?"":H.unitType),H.rootPropertyValue,H.scrollData);y.Hooks.registered[F]&&(y.Normalizations.registered[L]?g(C).rootPropertyValueCache[L]=y.Normalizations.registered[L]("extract",null,N[1]):g(C).rootPropertyValueCache[L]=N[1]),"transform"===N[0]&&(D=!0)}}j.mobileHA&&g(C).transformCache.translate3d===d&&(g(C).transformCache.translate3d="(0px, 0px, 0px)",D=!0),D&&y.flushTransformCache(C)}}j.display!==d&&"none"!==j.display&&(w.State.calls[f][2].display=!1),j.visibility!==d&&"hidden"!==j.visibility&&(w.State.calls[f][2].visibility=!1),j.progress&&j.progress.call(h[1],h[1],v,Math.max(0,k+j.duration-b),k,q),1===v&&n(f)}}w.State.isTicking&&A(m)}function n(a,b){if(!w.State.calls[a])return!1;for(var c=w.State.calls[a][0],e=w.State.calls[a][1],f=w.State.calls[a][2],h=w.State.calls[a][4],i=!1,j=0,k=c.length;j<k;j++){var l=c[j].element;b||f.loop||("none"===f.display&&y.setPropertyValue(l,"display",f.display),"hidden"===f.visibility&&y.setPropertyValue(l,"visibility",f.visibility));var m=g(l);if(f.loop!==!0&&(o.queue(l)[1]===d||!/\.velocityQueueEntryFlag/i.test(o.queue(l)[1]))&&m){m.isAnimating=!1,m.rootPropertyValueCache={};var n=!1;o.each(y.Lists.transforms3D,function(a,b){var c=/^scale/.test(b)?1:0,e=m.transformCache[b];m.transformCache[b]!==d&&new RegExp("^\\("+c+"[^.]").test(e)&&(n=!0,delete m.transformCache[b])}),f.mobileHA&&(n=!0,delete m.transformCache.translate3d),n&&y.flushTransformCache(l),y.Values.removeClass(l,"velocity-animating")}if(!b&&f.complete&&!f.loop&&j===k-1)try{f.complete.call(e,e)}catch(p){setTimeout(function(){throw p},1)}h&&f.loop!==!0&&h(e),m&&f.loop===!0&&!b&&(o.each(m.tweensContainer,function(a,b){if(/^rotate/.test(a)&&(parseFloat(b.startValue)-parseFloat(b.endValue))%360===0){var c=b.startValue;b.startValue=b.endValue,b.endValue=c}/^backgroundPosition/.test(a)&&100===parseFloat(b.endValue)&&"%"===b.unitType&&(b.endValue=0,b.startValue=100)}),w(l,"reverse",{loop:!0,delay:f.delay})),f.queue!==!1&&o.dequeue(l,f.queue)}w.State.calls[a]=!1;for(var q=0,r=w.State.calls.length;q<r;q++)if(w.State.calls[q]!==!1){i=!0;break}i===!1&&(w.State.isTicking=!1,delete w.State.calls,w.State.calls=[])}var o,p=function(){if(c.documentMode)return c.documentMode;for(var a=7;a>4;a--){var b=c.createElement("div");if(b.innerHTML="<!--[if IE "+a+"]><span></span><![endif]-->",b.getElementsByTagName("span").length)return b=null,a}return d}(),q=function(){var a=0;return b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame||function(b){var c,d=(new Date).getTime();return c=Math.max(0,16-(d-a)),a=d+c,setTimeout(function(){b(d+c)},c)}}(),r=function(){var a=b.performance||{};if(!a.hasOwnProperty("now")){var c=a.timing&&a.timing.domComplete?a.timing.domComplete:(new Date).getTime();a.now=function(){return(new Date).getTime()-c}}return a}(),s={isNumber:function(a){return"number"==typeof a},isString:function(a){return"string"==typeof a},isArray:Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},isFunction:function(a){return"[object Function]"===Object.prototype.toString.call(a)},isNode:function(a){return a&&a.nodeType},isWrapped:function(a){return a&&s.isNumber(a.length)&&!s.isString(a)&&!s.isFunction(a)&&!s.isNode(a)&&(0===a.length||s.isNode(a[0]))},isSVG:function(a){return b.SVGElement&&a instanceof b.SVGElement},isEmptyObject:function(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}},t=!1;if(a.fn&&a.fn.jquery?(o=a,t=!0):o=b.Velocity.Utilities,p<=8&&!t)throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity.");if(p<=7)return void(jQuery.fn.velocity=jQuery.fn.animate);var u=400,v="swing",w={State:{isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),isAndroid:/Android/i.test(navigator.userAgent),isGingerbread:/Android 2\.3\.[3-7]/i.test(navigator.userAgent),isChrome:b.chrome,isFirefox:/Firefox/i.test(navigator.userAgent),prefixElement:c.createElement("div"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,calls:[],delayedElements:{count:0}},CSS:{},Utilities:o,Redirects:{},Easings:{},Promise:b.Promise,defaults:{queue:"",duration:u,easing:v,begin:d,complete:d,progress:d,display:d,visibility:d,loop:!1,delay:!1,mobileHA:!0,_cacheValues:!0,promiseRejectEmpty:!0},init:function(a){o.data(a,"velocity",{isSVG:s.isSVG(a),isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}})},hook:null,mock:!1,version:{major:1,minor:4,patch:1},debug:!1,timestamp:!0,pauseAll:function(a){var b=(new Date).getTime();o.each(w.State.calls,function(b,c){if(c){if(a!==d&&(c[2].queue!==a||c[2].queue===!1))return!0;c[5]={resume:!1}}}),o.each(w.State.delayedElements,function(a,c){c&&h(c,b)})},resumeAll:function(a){var b=(new Date).getTime();o.each(w.State.calls,function(b,c){if(c){if(a!==d&&(c[2].queue!==a||c[2].queue===!1))return!0;c[5]&&(c[5].resume=!0)}}),o.each(w.State.delayedElements,function(a,c){c&&i(c,b)})}};b.pageYOffset!==d?(w.State.scrollAnchor=b,w.State.scrollPropertyLeft="pageXOffset",w.State.scrollPropertyTop="pageYOffset"):(w.State.scrollAnchor=c.documentElement||c.body.parentNode||c.body,w.State.scrollPropertyLeft="scrollLeft",w.State.scrollPropertyTop="scrollTop");var x=function(){function a(a){return-a.tension*a.x-a.friction*a.v}function b(b,c,d){var e={x:b.x+d.dx*c,v:b.v+d.dv*c,tension:b.tension,friction:b.friction};return{dx:e.v,dv:a(e)}}function c(c,d){var e={dx:c.v,dv:a(c)},f=b(c,.5*d,e),g=b(c,.5*d,f),h=b(c,d,g),i=1/6*(e.dx+2*(f.dx+g.dx)+h.dx),j=1/6*(e.dv+2*(f.dv+g.dv)+h.dv);return c.x=c.x+i*d,c.v=c.v+j*d,c}return function d(a,b,e){var f,g,h,i={x:-1,v:0,tension:null,friction:null},j=[0],k=0,l=1e-4,m=.016;for(a=parseFloat(a)||500,b=parseFloat(b)||20,e=e||null,i.tension=a,i.friction=b,f=null!==e,f?(k=d(a,b),g=k/e*m):g=m;;)if(h=c(h||i,g),j.push(1+h.x),k+=16,!(Math.abs(h.x)>l&&Math.abs(h.v)>l))break;return f?function(a){return j[a*(j.length-1)|0]}:k}}();w.Easings={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},spring:function(a){return 1-Math.cos(4.5*a*Math.PI)*Math.exp(6*-a)}},o.each([["ease",[.25,.1,.25,1]],["ease-in",[.42,0,1,1]],["ease-out",[0,0,.58,1]],["ease-in-out",[.42,0,.58,1]],["easeInSine",[.47,0,.745,.715]],["easeOutSine",[.39,.575,.565,1]],["easeInOutSine",[.445,.05,.55,.95]],["easeInQuad",[.55,.085,.68,.53]],["easeOutQuad",[.25,.46,.45,.94]],["easeInOutQuad",[.455,.03,.515,.955]],["easeInCubic",[.55,.055,.675,.19]],["easeOutCubic",[.215,.61,.355,1]],["easeInOutCubic",[.645,.045,.355,1]],["easeInQuart",[.895,.03,.685,.22]],["easeOutQuart",[.165,.84,.44,1]],["easeInOutQuart",[.77,0,.175,1]],["easeInQuint",[.755,.05,.855,.06]],["easeOutQuint",[.23,1,.32,1]],["easeInOutQuint",[.86,0,.07,1]],["easeInExpo",[.95,.05,.795,.035]],["easeOutExpo",[.19,1,.22,1]],["easeInOutExpo",[1,0,0,1]],["easeInCirc",[.6,.04,.98,.335]],["easeOutCirc",[.075,.82,.165,1]],["easeInOutCirc",[.785,.135,.15,.86]]],function(a,b){w.Easings[b[0]]=k.apply(null,b[1])});var y=w.CSS={RegEx:{isHex:/^#([A-f\d]{3}){1,2}$/i,valueUnwrap:/^[A-z]+\((.*)\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/gi},Lists:{colors:["fill","stroke","stopColor","color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],transformsBase:["translateX","translateY","scale","scaleX","scaleY","skewX","skewY","rotateZ"],transforms3D:["transformPerspective","translateZ","scaleZ","rotateX","rotateY"],units:["%","em","ex","ch","rem","vw","vh","vmin","vmax","cm","mm","Q","in","pc","pt","px","deg","grad","rad","turn","s","ms"],colorNames:{aliceblue:"240,248,255",antiquewhite:"250,235,215",aquamarine:"127,255,212",aqua:"0,255,255",azure:"240,255,255",beige:"245,245,220",bisque:"255,228,196",black:"0,0,0",blanchedalmond:"255,235,205",blueviolet:"138,43,226",blue:"0,0,255",brown:"165,42,42",burlywood:"222,184,135",cadetblue:"95,158,160",chartreuse:"127,255,0",chocolate:"210,105,30",coral:"255,127,80",cornflowerblue:"100,149,237",cornsilk:"255,248,220",crimson:"220,20,60",cyan:"0,255,255",darkblue:"0,0,139",darkcyan:"0,139,139",darkgoldenrod:"184,134,11",darkgray:"169,169,169",darkgrey:"169,169,169",darkgreen:"0,100,0",darkkhaki:"189,183,107",darkmagenta:"139,0,139",darkolivegreen:"85,107,47",darkorange:"255,140,0",darkorchid:"153,50,204",darkred:"139,0,0",darksalmon:"233,150,122",darkseagreen:"143,188,143",darkslateblue:"72,61,139",darkslategray:"47,79,79",darkturquoise:"0,206,209",darkviolet:"148,0,211",deeppink:"255,20,147",deepskyblue:"0,191,255",dimgray:"105,105,105",dimgrey:"105,105,105",dodgerblue:"30,144,255",firebrick:"178,34,34",floralwhite:"255,250,240",forestgreen:"34,139,34",fuchsia:"255,0,255",gainsboro:"220,220,220",ghostwhite:"248,248,255",gold:"255,215,0",goldenrod:"218,165,32",gray:"128,128,128",grey:"128,128,128",greenyellow:"173,255,47",green:"0,128,0",honeydew:"240,255,240",hotpink:"255,105,180",indianred:"205,92,92",indigo:"75,0,130",ivory:"255,255,240",khaki:"240,230,140",lavenderblush:"255,240,245",lavender:"230,230,250",lawngreen:"124,252,0",lemonchiffon:"255,250,205",lightblue:"173,216,230",lightcoral:"240,128,128",lightcyan:"224,255,255",lightgoldenrodyellow:"250,250,210",lightgray:"211,211,211",lightgrey:"211,211,211",lightgreen:"144,238,144",lightpink:"255,182,193",lightsalmon:"255,160,122",lightseagreen:"32,178,170",lightskyblue:"135,206,250",lightslategray:"119,136,153",lightsteelblue:"176,196,222",lightyellow:"255,255,224",limegreen:"50,205,50",lime:"0,255,0",linen:"250,240,230",magenta:"255,0,255",maroon:"128,0,0",mediumaquamarine:"102,205,170",mediumblue:"0,0,205",mediumorchid:"186,85,211",mediumpurple:"147,112,219",mediumseagreen:"60,179,113",mediumslateblue:"123,104,238",mediumspringgreen:"0,250,154",mediumturquoise:"72,209,204",mediumvioletred:"199,21,133",midnightblue:"25,25,112",mintcream:"245,255,250",mistyrose:"255,228,225",moccasin:"255,228,181",navajowhite:"255,222,173",navy:"0,0,128",oldlace:"253,245,230",olivedrab:"107,142,35",olive:"128,128,0",orangered:"255,69,0",orange:"255,165,0",orchid:"218,112,214",palegoldenrod:"238,232,170",palegreen:"152,251,152",paleturquoise:"175,238,238",palevioletred:"219,112,147",papayawhip:"255,239,213",peachpuff:"255,218,185",peru:"205,133,63",pink:"255,192,203",plum:"221,160,221",powderblue:"176,224,230",purple:"128,0,128",red:"255,0,0",rosybrown:"188,143,143",royalblue:"65,105,225",saddlebrown:"139,69,19",salmon:"250,128,114",sandybrown:"244,164,96",seagreen:"46,139,87",seashell:"255,245,238",sienna:"160,82,45",silver:"192,192,192",skyblue:"135,206,235",slateblue:"106,90,205",slategray:"112,128,144",snow:"255,250,250",springgreen:"0,255,127",steelblue:"70,130,180",tan:"210,180,140",teal:"0,128,128",thistle:"216,191,216",tomato:"255,99,71",turquoise:"64,224,208",violet:"238,130,238",wheat:"245,222,179",whitesmoke:"245,245,245",white:"255,255,255",yellowgreen:"154,205,50",yellow:"255,255,0"}},Hooks:{templates:{textShadow:["Color X Y Blur","black 0px 0px 0px"],boxShadow:["Color X Y Blur Spread","black 0px 0px 0px 0px"],clip:["Top Right Bottom Left","0px 0px 0px 0px"],backgroundPosition:["X Y","0% 0%"],transformOrigin:["X Y Z","50% 50% 0px"],perspectiveOrigin:["X Y","50% 50%"]},registered:{},register:function(){for(var a=0;a<y.Lists.colors.length;a++){var b="color"===y.Lists.colors[a]?"0 0 0 1":"255 255 255 1";y.Hooks.templates[y.Lists.colors[a]]=["Red Green Blue Alpha",b]}var c,d,e;if(p)for(c in y.Hooks.templates)if(y.Hooks.templates.hasOwnProperty(c)){d=y.Hooks.templates[c],e=d[0].split(" ");var f=d[1].match(y.RegEx.valueSplit);"Color"===e[0]&&(e.push(e.shift()),f.push(f.shift()),y.Hooks.templates[c]=[e.join(" "),f.join(" ")])}for(c in y.Hooks.templates)if(y.Hooks.templates.hasOwnProperty(c)){d=y.Hooks.templates[c],e=d[0].split(" ");for(var g in e)if(e.hasOwnProperty(g)){var h=c+e[g],i=g;y.Hooks.registered[h]=[c,i]}}},getRoot:function(a){var b=y.Hooks.registered[a];return b?b[0]:a},getUnit:function(a,b){var c=(a.substr(b||0,5).match(/^[a-z%]+/)||[])[0]||"";return c&&y.Lists.units.indexOf(c)>=0?c:""},fixColors:function(a){return a.replace(/(rgba?\(\s*)?(\b[a-z]+\b)/g,function(a,b,c){return y.Lists.colorNames.hasOwnProperty(c)?(b?b:"rgba(")+y.Lists.colorNames[c]+(b?"":",1)"):b+c})},cleanRootPropertyValue:function(a,b){return y.RegEx.valueUnwrap.test(b)&&(b=b.match(y.RegEx.valueUnwrap)[1]),y.Values.isCSSNullValue(b)&&(b=y.Hooks.templates[a][1]),b},extractValue:function(a,b){var c=y.Hooks.registered[a];if(c){var d=c[0],e=c[1];return b=y.Hooks.cleanRootPropertyValue(d,b),b.toString().match(y.RegEx.valueSplit)[e]}return b},injectValue:function(a,b,c){var d=y.Hooks.registered[a];if(d){var e,f,g=d[0],h=d[1];return c=y.Hooks.cleanRootPropertyValue(g,c),e=c.toString().match(y.RegEx.valueSplit),e[h]=b,f=e.join(" ")}return c}},Normalizations:{registered:{clip:function(a,b,c){switch(a){case"name":return"clip";case"extract":var d;return y.RegEx.wrappedValueAlreadyExtracted.test(c)?d=c:(d=c.toString().match(y.RegEx.valueUnwrap),d=d?d[1].replace(/,(\s+)?/g," "):c),d;case"inject":return"rect("+c+")"}},blur:function(a,b,c){switch(a){case"name":return w.State.isFirefox?"filter":"-webkit-filter";case"extract":var d=parseFloat(c);if(!d&&0!==d){var e=c.toString().match(/blur\(([0-9]+[A-z]+)\)/i);d=e?e[1]:0}return d;case"inject":return parseFloat(c)?"blur("+c+")":"none"}},opacity:function(a,b,c){if(p<=8)switch(a){case"name":return"filter";case"extract":var d=c.toString().match(/alpha\(opacity=(.*)\)/i);return c=d?d[1]/100:1;case"inject":return b.style.zoom=1,parseFloat(c)>=1?"":"alpha(opacity="+parseInt(100*parseFloat(c),10)+")"}else switch(a){case"name":return"opacity";case"extract":return c;case"inject":return c}}},register:function(){function a(a,b,c){var d="border-box"===y.getPropertyValue(b,"boxSizing").toString().toLowerCase();if(d===(c||!1)){var e,f,g=0,h="width"===a?["Left","Right"]:["Top","Bottom"],i=["padding"+h[0],"padding"+h[1],"border"+h[0]+"Width","border"+h[1]+"Width"];for(e=0;e<i.length;e++)f=parseFloat(y.getPropertyValue(b,i[e])),isNaN(f)||(g+=f);return c?-g:g}return 0}function b(b,c){return function(d,e,f){switch(d){case"name":return b;case"extract":return parseFloat(f)+a(b,e,c);case"inject":return parseFloat(f)-a(b,e,c)+"px"}}}p&&!(p>9)||w.State.isGingerbread||(y.Lists.transformsBase=y.Lists.transformsBase.concat(y.Lists.transforms3D));for(var c=0;c<y.Lists.transformsBase.length;c++)!function(){var a=y.Lists.transformsBase[c];y.Normalizations.registered[a]=function(b,c,e){switch(b){case"name":return"transform";case"extract":return g(c)===d||g(c).transformCache[a]===d?/^scale/i.test(a)?1:0:g(c).transformCache[a].replace(/[()]/g,"");case"inject":var f=!1;switch(a.substr(0,a.length-1)){case"translate":f=!/(%|px|em|rem|vw|vh|\d)$/i.test(e);break;case"scal":case"scale":w.State.isAndroid&&g(c).transformCache[a]===d&&e<1&&(e=1),f=!/(\d)$/i.test(e);break;case"skew":f=!/(deg|\d)$/i.test(e);break;case"rotate":f=!/(deg|\d)$/i.test(e)}return f||(g(c).transformCache[a]="("+e+")"),g(c).transformCache[a]}}}();for(var e=0;e<y.Lists.colors.length;e++)!function(){var a=y.Lists.colors[e];y.Normalizations.registered[a]=function(b,c,e){switch(b){case"name":return a;case"extract":var f;if(y.RegEx.wrappedValueAlreadyExtracted.test(e))f=e;else{var g,h={black:"rgb(0, 0, 0)",blue:"rgb(0, 0, 255)",gray:"rgb(128, 128, 128)",green:"rgb(0, 128, 0)",red:"rgb(255, 0, 0)",white:"rgb(255, 255, 255)"};/^[A-z]+$/i.test(e)?g=h[e]!==d?h[e]:h.black:y.RegEx.isHex.test(e)?g="rgb("+y.Values.hexToRgb(e).join(" ")+")":/^rgba?\(/i.test(e)||(g=h.black),f=(g||e).toString().match(y.RegEx.valueUnwrap)[1].replace(/,(\s+)?/g," ")}return(!p||p>8)&&3===f.split(" ").length&&(f+=" 1"),f;case"inject":return/^rgb/.test(e)?e:(p<=8?4===e.split(" ").length&&(e=e.split(/\s+/).slice(0,3).join(" ")):3===e.split(" ").length&&(e+=" 1"),(p<=8?"rgb":"rgba")+"("+e.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")")}}}();y.Normalizations.registered.innerWidth=b("width",!0),y.Normalizations.registered.innerHeight=b("height",!0),y.Normalizations.registered.outerWidth=b("width"),y.Normalizations.registered.outerHeight=b("height")}},Names:{camelCase:function(a){return a.replace(/-(\w)/g,function(a,b){return b.toUpperCase()})},SVGAttribute:function(a){var b="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(p||w.State.isAndroid&&!w.State.isChrome)&&(b+="|transform"),new RegExp("^("+b+")$","i").test(a)},prefixCheck:function(a){if(w.State.prefixMatches[a])return[w.State.prefixMatches[a],!0];for(var b=["","Webkit","Moz","ms","O"],c=0,d=b.length;c<d;c++){var e;if(e=0===c?a:b[c]+a.replace(/^\w/,function(a){return a.toUpperCase()}),s.isString(w.State.prefixElement.style[e]))return w.State.prefixMatches[a]=e,[e,!0]}return[a,!1]}},Values:{hexToRgb:function(a){var b,c=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,d=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;return a=a.replace(c,function(a,b,c,d){return b+b+c+c+d+d}),b=d.exec(a),b?[parseInt(b[1],16),parseInt(b[2],16),parseInt(b[3],16)]:[0,0,0]},isCSSNullValue:function(a){return!a||/^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(a)},getUnitType:function(a){return/^(rotate|skew)/i.test(a)?"deg":/(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(a)?"":"px"},getDisplayType:function(a){var b=a&&a.tagName.toString().toLowerCase();return/^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|var|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i.test(b)?"inline":/^(li)$/i.test(b)?"list-item":/^(tr)$/i.test(b)?"table-row":/^(table)$/i.test(b)?"table":/^(tbody)$/i.test(b)?"table-row-group":"block"},addClass:function(a,b){if(a)if(a.classList)a.classList.add(b);else if(s.isString(a.className))a.className+=(a.className.length?" ":"")+b;else{var c=a.getAttribute(p<=7?"className":"class")||"";a.setAttribute("class",c+(c?" ":"")+b)}},removeClass:function(a,b){if(a)if(a.classList)a.classList.remove(b);else if(s.isString(a.className))a.className=a.className.toString().replace(new RegExp("(^|\\s)"+b.split(" ").join("|")+"(\\s|$)","gi")," ");else{var c=a.getAttribute(p<=7?"className":"class")||"";a.setAttribute("class",c.replace(new RegExp("(^|s)"+b.split(" ").join("|")+"(s|$)","gi")," "))}}},getPropertyValue:function(a,c,e,f){function h(a,c){var e=0;if(p<=8)e=o.css(a,c);else{var i=!1;/^(width|height)$/.test(c)&&0===y.getPropertyValue(a,"display")&&(i=!0,y.setPropertyValue(a,"display",y.Values.getDisplayType(a)));var j=function(){i&&y.setPropertyValue(a,"display","none")};if(!f){if("height"===c&&"border-box"!==y.getPropertyValue(a,"boxSizing").toString().toLowerCase()){var k=a.offsetHeight-(parseFloat(y.getPropertyValue(a,"borderTopWidth"))||0)-(parseFloat(y.getPropertyValue(a,"borderBottomWidth"))||0)-(parseFloat(y.getPropertyValue(a,"paddingTop"))||0)-(parseFloat(y.getPropertyValue(a,"paddingBottom"))||0);return j(),k}if("width"===c&&"border-box"!==y.getPropertyValue(a,"boxSizing").toString().toLowerCase()){var l=a.offsetWidth-(parseFloat(y.getPropertyValue(a,"borderLeftWidth"))||0)-(parseFloat(y.getPropertyValue(a,"borderRightWidth"))||0)-(parseFloat(y.getPropertyValue(a,"paddingLeft"))||0)-(parseFloat(y.getPropertyValue(a,"paddingRight"))||0);return j(),l}}var m;m=g(a)===d?b.getComputedStyle(a,null):g(a).computedStyle?g(a).computedStyle:g(a).computedStyle=b.getComputedStyle(a,null),"borderColor"===c&&(c="borderTopColor"),e=9===p&&"filter"===c?m.getPropertyValue(c):m[c],""!==e&&null!==e||(e=a.style[c]),j()}if("auto"===e&&/^(top|right|bottom|left)$/i.test(c)){var n=h(a,"position");("fixed"===n||"absolute"===n&&/top|left/i.test(c))&&(e=o(a).position()[c]+"px")}return e}var i;if(y.Hooks.registered[c]){var j=c,k=y.Hooks.getRoot(j);e===d&&(e=y.getPropertyValue(a,y.Names.prefixCheck(k)[0])),y.Normalizations.registered[k]&&(e=y.Normalizations.registered[k]("extract",a,e)),i=y.Hooks.extractValue(j,e)}else if(y.Normalizations.registered[c]){var l,m;l=y.Normalizations.registered[c]("name",a),"transform"!==l&&(m=h(a,y.Names.prefixCheck(l)[0]),y.Values.isCSSNullValue(m)&&y.Hooks.templates[c]&&(m=y.Hooks.templates[c][1])),i=y.Normalizations.registered[c]("extract",a,m)}if(!/^[\d-]/.test(i)){var n=g(a);if(n&&n.isSVG&&y.Names.SVGAttribute(c))if(/^(height|width)$/i.test(c))try{i=a.getBBox()[c]}catch(q){i=0}else i=a.getAttribute(c);else i=h(a,y.Names.prefixCheck(c)[0])}return y.Values.isCSSNullValue(i)&&(i=0),w.debug>=2&&console.log("Get "+c+": "+i),i},setPropertyValue:function(a,c,d,e,f){var h=c;if("scroll"===c)f.container?f.container["scroll"+f.direction]=d:"Left"===f.direction?b.scrollTo(d,f.alternateValue):b.scrollTo(f.alternateValue,d);else if(y.Normalizations.registered[c]&&"transform"===y.Normalizations.registered[c]("name",a))y.Normalizations.registered[c]("inject",a,d),h="transform",d=g(a).transformCache[c];else{if(y.Hooks.registered[c]){var i=c,j=y.Hooks.getRoot(c);e=e||y.getPropertyValue(a,j),d=y.Hooks.injectValue(i,d,e),c=j}if(y.Normalizations.registered[c]&&(d=y.Normalizations.registered[c]("inject",a,d),c=y.Normalizations.registered[c]("name",a)),h=y.Names.prefixCheck(c)[0],p<=8)try{a.style[h]=d}catch(k){w.debug&&console.log("Browser does not support ["+d+"] for ["+h+"]")}else{var l=g(a);l&&l.isSVG&&y.Names.SVGAttribute(c)?a.setAttribute(c,d):a.style[h]=d}w.debug>=2&&console.log("Set "+c+" ("+h+"): "+d)}return[h,d]},flushTransformCache:function(a){var b="",c=g(a);if((p||w.State.isAndroid&&!w.State.isChrome)&&c&&c.isSVG){var d=function(b){return parseFloat(y.getPropertyValue(a,b))},e={translate:[d("translateX"),d("translateY")],skewX:[d("skewX")],skewY:[d("skewY")],scale:1!==d("scale")?[d("scale"),d("scale")]:[d("scaleX"),d("scaleY")],rotate:[d("rotateZ"),0,0]};o.each(g(a).transformCache,function(a){/^translate/i.test(a)?a="translate":/^scale/i.test(a)?a="scale":/^rotate/i.test(a)&&(a="rotate"),e[a]&&(b+=a+"("+e[a].join(" ")+") ",delete e[a])})}else{var f,h;o.each(g(a).transformCache,function(c){return f=g(a).transformCache[c],"transformPerspective"===c?(h=f,!0):(9===p&&"rotateZ"===c&&(c="rotate"),void(b+=c+f+" "))}),h&&(b="perspective"+h+" "+b)}y.setPropertyValue(a,"transform",b)}};y.Hooks.register(),y.Normalizations.register(),w.hook=function(a,b,c){var e;return a=f(a),o.each(a,function(a,f){if(g(f)===d&&w.init(f),c===d)e===d&&(e=y.getPropertyValue(f,b));else{var h=y.setPropertyValue(f,b,c);"transform"===h[0]&&w.CSS.flushTransformCache(f),e=h}}),e};var z=function(){function a(){return k?A.promise||null:p}function e(a,e){function f(f){var k,n;if(i.begin&&0===C)try{i.begin.call(r,r)}catch(p){setTimeout(function(){throw p},1)}if("scroll"===F){var q,u,x,z=/^x$/i.test(i.axis)?"Left":"Top",D=parseFloat(i.offset)||0;i.container?s.isWrapped(i.container)||s.isNode(i.container)?(i.container=i.container[0]||i.container,q=i.container["scroll"+z],x=q+o(a).position()[z.toLowerCase()]+D):i.container=null:(q=w.State.scrollAnchor[w.State["scrollProperty"+z]],u=w.State.scrollAnchor[w.State["scrollProperty"+("Left"===z?"Top":"Left")]],x=o(a).offset()[z.toLowerCase()]+D),j={scroll:{rootPropertyValue:!1,startValue:q,currentValue:q,endValue:x,unitType:"",easing:i.easing,scrollData:{container:i.container,direction:z,alternateValue:u}},element:a},w.debug&&console.log("tweensContainer (scroll): ",j.scroll,a)}else if("reverse"===F){if(k=g(a),!k)return;if(!k.tweensContainer)return void o.dequeue(a,i.queue);"none"===k.opts.display&&(k.opts.display="auto"),"hidden"===k.opts.visibility&&(k.opts.visibility="visible"),k.opts.loop=!1,k.opts.begin=null,k.opts.complete=null,v.easing||delete i.easing,v.duration||delete i.duration,i=o.extend({},k.opts,i),n=o.extend(!0,{},k?k.tweensContainer:null);for(var E in n)if(n.hasOwnProperty(E)&&"element"!==E){var G=n[E].startValue;n[E].startValue=n[E].currentValue=n[E].endValue,n[E].endValue=G,s.isEmptyObject(v)||(n[E].easing=i.easing),w.debug&&console.log("reverse tweensContainer ("+E+"): "+JSON.stringify(n[E]),a)}j=n}else if("start"===F){k=g(a),k&&k.tweensContainer&&k.isAnimating===!0&&(n=k.tweensContainer);var H=function(b,c){var d,f,g;return s.isFunction(b)&&(b=b.call(a,e,B)),s.isArray(b)?(d=b[0],!s.isArray(b[1])&&/^[\d-]/.test(b[1])||s.isFunction(b[1])||y.RegEx.isHex.test(b[1])?g=b[1]:s.isString(b[1])&&!y.RegEx.isHex.test(b[1])&&w.Easings[b[1]]||s.isArray(b[1])?(f=c?b[1]:l(b[1],i.duration),g=b[2]):g=b[1]||b[2]):d=b,c||(f=f||i.easing),s.isFunction(d)&&(d=d.call(a,e,B)),s.isFunction(g)&&(g=g.call(a,e,B)),[d||0,f,g]},I=function(e,f){var g,l=y.Hooks.getRoot(e),m=!1,p=f[0],q=f[1],r=f[2];if(!(k&&k.isSVG||"tween"===l||y.Names.prefixCheck(l)[1]!==!1||y.Normalizations.registered[l]!==d))return void(w.debug&&console.log("Skipping ["+l+"] due to a lack of browser support."));
|
4 |
+
(i.display!==d&&null!==i.display&&"none"!==i.display||i.visibility!==d&&"hidden"!==i.visibility)&&/opacity|filter/.test(e)&&!r&&0!==p&&(r=0),i._cacheValues&&n&&n[e]?(r===d&&(r=n[e].endValue+n[e].unitType),m=k.rootPropertyValueCache[l]):y.Hooks.registered[e]?r===d?(m=y.getPropertyValue(a,l),r=y.getPropertyValue(a,e,m)):m=y.Hooks.templates[l][1]:r===d&&(r=y.getPropertyValue(a,e));var t,u,v,x=!1,z=function(a,b){var c,d;return d=(b||"0").toString().toLowerCase().replace(/[%A-z]+$/,function(a){return c=a,""}),c||(c=y.Values.getUnitType(a)),[d,c]};if(r!==p&&s.isString(r)&&s.isString(p)){g="";var A=0,B=0,C=[],D=[],E=0,F=0,G=0;for(r=y.Hooks.fixColors(r),p=y.Hooks.fixColors(p);A<r.length&&B<p.length;){var H=r[A],I=p[B];if(/[\d\.]/.test(H)&&/[\d\.]/.test(I)){for(var J=H,K=I,M=".",N=".";++A<r.length;){if(H=r[A],H===M)M="..";else if(!/\d/.test(H))break;J+=H}for(;++B<p.length;){if(I=p[B],I===N)N="..";else if(!/\d/.test(I))break;K+=I}var O=y.Hooks.getUnit(r,A),P=y.Hooks.getUnit(p,B);if(A+=O.length,B+=P.length,O===P)J===K?g+=J+O:(g+="{"+C.length+(F?"!":"")+"}"+O,C.push(parseFloat(J)),D.push(parseFloat(K)));else{var Q=parseFloat(J),R=parseFloat(K);g+=(E<5?"calc":"")+"("+(Q?"{"+C.length+(F?"!":"")+"}":"0")+O+" + "+(R?"{"+(C.length+(Q?1:0))+(F?"!":"")+"}":"0")+P+")",Q&&(C.push(Q),D.push(0)),R&&(C.push(0),D.push(R))}}else{if(H!==I){E=0;break}g+=H,A++,B++,0===E&&"c"===H||1===E&&"a"===H||2===E&&"l"===H||3===E&&"c"===H||E>=4&&"("===H?E++:(E&&E<5||E>=4&&")"===H&&--E<5)&&(E=0),0===F&&"r"===H||1===F&&"g"===H||2===F&&"b"===H||3===F&&"a"===H||F>=3&&"("===H?(3===F&&"a"===H&&(G=1),F++):G&&","===H?++G>3&&(F=G=0):(G&&F<(G?5:4)||F>=(G?4:3)&&")"===H&&--F<(G?5:4))&&(F=G=0)}}A===r.length&&B===p.length||(w.debug&&console.error('Trying to pattern match mis-matched strings ["'+p+'", "'+r+'"]'),g=d),g&&(C.length?(w.debug&&console.log('Pattern found "'+g+'" -> ',C,D,"["+r+","+p+"]"),r=C,p=D,u=v=""):g=d)}g||(t=z(e,r),r=t[0],v=t[1],t=z(e,p),p=t[0].replace(/^([+-\/*])=/,function(a,b){return x=b,""}),u=t[1],r=parseFloat(r)||0,p=parseFloat(p)||0,"%"===u&&(/^(fontSize|lineHeight)$/.test(e)?(p/=100,u="em"):/^scale/.test(e)?(p/=100,u=""):/(Red|Green|Blue)$/i.test(e)&&(p=p/100*255,u="")));var S=function(){var d={myParent:a.parentNode||c.body,position:y.getPropertyValue(a,"position"),fontSize:y.getPropertyValue(a,"fontSize")},e=d.position===L.lastPosition&&d.myParent===L.lastParent,f=d.fontSize===L.lastFontSize;L.lastParent=d.myParent,L.lastPosition=d.position,L.lastFontSize=d.fontSize;var g=100,h={};if(f&&e)h.emToPx=L.lastEmToPx,h.percentToPxWidth=L.lastPercentToPxWidth,h.percentToPxHeight=L.lastPercentToPxHeight;else{var i=k&&k.isSVG?c.createElementNS("http://www.w3.org/2000/svg","rect"):c.createElement("div");w.init(i),d.myParent.appendChild(i),o.each(["overflow","overflowX","overflowY"],function(a,b){w.CSS.setPropertyValue(i,b,"hidden")}),w.CSS.setPropertyValue(i,"position",d.position),w.CSS.setPropertyValue(i,"fontSize",d.fontSize),w.CSS.setPropertyValue(i,"boxSizing","content-box"),o.each(["minWidth","maxWidth","width","minHeight","maxHeight","height"],function(a,b){w.CSS.setPropertyValue(i,b,g+"%")}),w.CSS.setPropertyValue(i,"paddingLeft",g+"em"),h.percentToPxWidth=L.lastPercentToPxWidth=(parseFloat(y.getPropertyValue(i,"width",null,!0))||1)/g,h.percentToPxHeight=L.lastPercentToPxHeight=(parseFloat(y.getPropertyValue(i,"height",null,!0))||1)/g,h.emToPx=L.lastEmToPx=(parseFloat(y.getPropertyValue(i,"paddingLeft"))||1)/g,d.myParent.removeChild(i)}return null===L.remToPx&&(L.remToPx=parseFloat(y.getPropertyValue(c.body,"fontSize"))||16),null===L.vwToPx&&(L.vwToPx=parseFloat(b.innerWidth)/100,L.vhToPx=parseFloat(b.innerHeight)/100),h.remToPx=L.remToPx,h.vwToPx=L.vwToPx,h.vhToPx=L.vhToPx,w.debug>=1&&console.log("Unit ratios: "+JSON.stringify(h),a),h};if(/[\/*]/.test(x))u=v;else if(v!==u&&0!==r)if(0===p)u=v;else{h=h||S();var T=/margin|padding|left|right|width|text|word|letter/i.test(e)||/X$/.test(e)||"x"===e?"x":"y";switch(v){case"%":r*="x"===T?h.percentToPxWidth:h.percentToPxHeight;break;case"px":break;default:r*=h[v+"ToPx"]}switch(u){case"%":r*=1/("x"===T?h.percentToPxWidth:h.percentToPxHeight);break;case"px":break;default:r*=1/h[u+"ToPx"]}}switch(x){case"+":p=r+p;break;case"-":p=r-p;break;case"*":p=r*p;break;case"/":p=r/p}j[e]={rootPropertyValue:m,startValue:r,currentValue:r,endValue:p,unitType:u,easing:q},g&&(j[e].pattern=g),w.debug&&console.log("tweensContainer ("+e+"): "+JSON.stringify(j[e]),a)};for(var J in t)if(t.hasOwnProperty(J)){var K=y.Names.camelCase(J),N=H(t[J]);if(y.Lists.colors.indexOf(K)>=0){var O=N[0],P=N[1],Q=N[2];if(y.RegEx.isHex.test(O)){for(var R=["Red","Green","Blue"],S=y.Values.hexToRgb(O),T=Q?y.Values.hexToRgb(Q):d,U=0;U<R.length;U++){var V=[S[U]];P&&V.push(P),T!==d&&V.push(T[U]),I(K+R[U],V)}continue}}I(K,N)}j.element=a}j.element&&(y.Values.addClass(a,"velocity-animating"),M.push(j),k=g(a),k&&(""===i.queue&&(k.tweensContainer=j,k.opts=i),k.isAnimating=!0),C===B-1?(w.State.calls.push([M,r,i,null,A.resolver,null,0]),w.State.isTicking===!1&&(w.State.isTicking=!0,m())):C++)}var h,i=o.extend({},w.defaults,v),j={};switch(g(a)===d&&w.init(a),parseFloat(i.delay)&&i.queue!==!1&&o.queue(a,i.queue,function(b){w.velocityQueueEntryFlag=!0;var c=w.State.delayedElements.count++;w.State.delayedElements[c]=a;var d=function(a){return function(){w.State.delayedElements[a]=!1,b()}}(c);g(a).delayBegin=(new Date).getTime(),g(a).delay=parseFloat(i.delay),g(a).delayTimer={setTimeout:setTimeout(b,parseFloat(i.delay)),next:d}}),i.duration.toString().toLowerCase()){case"fast":i.duration=200;break;case"normal":i.duration=u;break;case"slow":i.duration=600;break;default:i.duration=parseFloat(i.duration)||1}if(w.mock!==!1&&(w.mock===!0?i.duration=i.delay=1:(i.duration*=parseFloat(w.mock)||1,i.delay*=parseFloat(w.mock)||1)),i.easing=l(i.easing,i.duration),i.begin&&!s.isFunction(i.begin)&&(i.begin=null),i.progress&&!s.isFunction(i.progress)&&(i.progress=null),i.complete&&!s.isFunction(i.complete)&&(i.complete=null),i.display!==d&&null!==i.display&&(i.display=i.display.toString().toLowerCase(),"auto"===i.display&&(i.display=w.CSS.Values.getDisplayType(a))),i.visibility!==d&&null!==i.visibility&&(i.visibility=i.visibility.toString().toLowerCase()),i.mobileHA=i.mobileHA&&w.State.isMobile&&!w.State.isGingerbread,i.queue===!1)if(i.delay){var k=w.State.delayedElements.count++;w.State.delayedElements[k]=a;var n=function(a){return function(){w.State.delayedElements[a]=!1,f()}}(k);g(a).delayBegin=(new Date).getTime(),g(a).delay=parseFloat(i.delay),g(a).delayTimer={setTimeout:setTimeout(f,parseFloat(i.delay)),next:n}}else f();else o.queue(a,i.queue,function(a,b){return b===!0?(A.promise&&A.resolver(r),!0):(w.velocityQueueEntryFlag=!0,void f(a))});""!==i.queue&&"fx"!==i.queue||"inprogress"===o.queue(a)[0]||o.dequeue(a)}var j,k,p,q,r,t,v,x=arguments[0]&&(arguments[0].p||o.isPlainObject(arguments[0].properties)&&!arguments[0].properties.names||s.isString(arguments[0].properties));s.isWrapped(this)?(k=!1,q=0,r=this,p=this):(k=!0,q=1,r=x?arguments[0].elements||arguments[0].e:arguments[0]);var A={promise:null,resolver:null,rejecter:null};if(k&&w.Promise&&(A.promise=new w.Promise(function(a,b){A.resolver=a,A.rejecter=b})),x?(t=arguments[0].properties||arguments[0].p,v=arguments[0].options||arguments[0].o):(t=arguments[q],v=arguments[q+1]),r=f(r),!r)return void(A.promise&&(t&&v&&v.promiseRejectEmpty===!1?A.resolver():A.rejecter()));var B=r.length,C=0;if(!/^(stop|finish|finishAll|pause|resume)$/i.test(t)&&!o.isPlainObject(v)){var D=q+1;v={};for(var E=D;E<arguments.length;E++)s.isArray(arguments[E])||!/^(fast|normal|slow)$/i.test(arguments[E])&&!/^\d/.test(arguments[E])?s.isString(arguments[E])||s.isArray(arguments[E])?v.easing=arguments[E]:s.isFunction(arguments[E])&&(v.complete=arguments[E]):v.duration=arguments[E]}var F;switch(t){case"scroll":F="scroll";break;case"reverse":F="reverse";break;case"pause":var G=(new Date).getTime();return o.each(r,function(a,b){h(b,G)}),o.each(w.State.calls,function(a,b){var c=!1;b&&o.each(b[1],function(a,e){var f=v===d?"":v;return f!==!0&&b[2].queue!==f&&(v!==d||b[2].queue!==!1)||(o.each(r,function(a,d){if(d===e)return b[5]={resume:!1},c=!0,!1}),!c&&void 0)})}),a();case"resume":return o.each(r,function(a,b){i(b,G)}),o.each(w.State.calls,function(a,b){var c=!1;b&&o.each(b[1],function(a,e){var f=v===d?"":v;return f!==!0&&b[2].queue!==f&&(v!==d||b[2].queue!==!1)||(!b[5]||(o.each(r,function(a,d){if(d===e)return b[5].resume=!0,c=!0,!1}),!c&&void 0))})}),a();case"finish":case"finishAll":case"stop":o.each(r,function(a,b){g(b)&&g(b).delayTimer&&(clearTimeout(g(b).delayTimer.setTimeout),g(b).delayTimer.next&&g(b).delayTimer.next(),delete g(b).delayTimer),"finishAll"!==t||v!==!0&&!s.isString(v)||(o.each(o.queue(b,s.isString(v)?v:""),function(a,b){s.isFunction(b)&&b()}),o.queue(b,s.isString(v)?v:"",[]))});var H=[];return o.each(w.State.calls,function(a,b){b&&o.each(b[1],function(c,e){var f=v===d?"":v;return f!==!0&&b[2].queue!==f&&(v!==d||b[2].queue!==!1)||void o.each(r,function(c,d){if(d===e)if((v===!0||s.isString(v))&&(o.each(o.queue(d,s.isString(v)?v:""),function(a,b){s.isFunction(b)&&b(null,!0)}),o.queue(d,s.isString(v)?v:"",[])),"stop"===t){var h=g(d);h&&h.tweensContainer&&f!==!1&&o.each(h.tweensContainer,function(a,b){b.endValue=b.currentValue}),H.push(a)}else"finish"!==t&&"finishAll"!==t||(b[2].duration=1)})})}),"stop"===t&&(o.each(H,function(a,b){n(b,!0)}),A.promise&&A.resolver(r)),a();default:if(!o.isPlainObject(t)||s.isEmptyObject(t)){if(s.isString(t)&&w.Redirects[t]){j=o.extend({},v);var I=j.duration,J=j.delay||0;return j.backwards===!0&&(r=o.extend(!0,[],r).reverse()),o.each(r,function(a,b){parseFloat(j.stagger)?j.delay=J+parseFloat(j.stagger)*a:s.isFunction(j.stagger)&&(j.delay=J+j.stagger.call(b,a,B)),j.drag&&(j.duration=parseFloat(I)||(/^(callout|transition)/.test(t)?1e3:u),j.duration=Math.max(j.duration*(j.backwards?1-a/B:(a+1)/B),.75*j.duration,200)),w.Redirects[t].call(b,b,j||{},a,B,r,A.promise?A:d)}),a()}var K="Velocity: First argument ("+t+") was not a property map, a known action, or a registered redirect. Aborting.";return A.promise?A.rejecter(new Error(K)):console.log(K),a()}F="start"}var L={lastParent:null,lastPosition:null,lastFontSize:null,lastPercentToPxWidth:null,lastPercentToPxHeight:null,lastEmToPx:null,remToPx:null,vwToPx:null,vhToPx:null},M=[];o.each(r,function(a,b){s.isNode(b)&&e(b,a)}),j=o.extend({},w.defaults,v),j.loop=parseInt(j.loop,10);var N=2*j.loop-1;if(j.loop)for(var O=0;O<N;O++){var P={delay:j.delay,progress:j.progress};O===N-1&&(P.display=j.display,P.visibility=j.visibility,P.complete=j.complete),z(r,"reverse",P)}return a()};w=o.extend(z,w),w.animate=z;var A=b.requestAnimationFrame||q;if(!w.State.isMobile&&c.hidden!==d){var B=function(){c.hidden?(A=function(a){return setTimeout(function(){a(!0)},16)},m()):A=b.requestAnimationFrame||q};B(),c.addEventListener("visibilitychange",B)}return a.Velocity=w,a!==b&&(a.fn.velocity=z,a.fn.velocity.defaults=w.defaults),o.each(["Down","Up"],function(a,b){w.Redirects["slide"+b]=function(a,c,e,f,g,h){var i=o.extend({},c),j=i.begin,k=i.complete,l={},m={height:"",marginTop:"",marginBottom:"",paddingTop:"",paddingBottom:""};i.display===d&&(i.display="Down"===b?"inline"===w.CSS.Values.getDisplayType(a)?"inline-block":"block":"none"),i.begin=function(){0===e&&j&&j.call(g,g);for(var c in m)if(m.hasOwnProperty(c)){l[c]=a.style[c];var d=y.getPropertyValue(a,c);m[c]="Down"===b?[d,0]:[0,d]}l.overflow=a.style.overflow,a.style.overflow="hidden"},i.complete=function(){for(var b in l)l.hasOwnProperty(b)&&(a.style[b]=l[b]);e===f-1&&(k&&k.call(g,g),h&&h.resolver(g))},w(a,m,i)}}),o.each(["In","Out"],function(a,b){w.Redirects["fade"+b]=function(a,c,e,f,g,h){var i=o.extend({},c),j=i.complete,k={opacity:"In"===b?1:0};0!==e&&(i.begin=null),e!==f-1?i.complete=null:i.complete=function(){j&&j.call(g,g),h&&h.resolver(g)},i.display===d&&(i.display="In"===b?"auto":"none"),w(this,k,i)}}),w}(window.jQuery||window.Zepto||window,window,window?window.document:void 0)});
|
assets/wavesurfer/wavesurfer.js
CHANGED
@@ -85,6 +85,8 @@ var WaveSurfer = {
|
|
85 |
|
86 |
this.createDrawer();
|
87 |
this.createBackend();
|
|
|
|
|
88 |
},
|
89 |
|
90 |
createDrawer: function () {
|
@@ -199,10 +201,7 @@ var WaveSurfer = {
|
|
199 |
|
200 |
if (!paused) {
|
201 |
this.backend.pause();
|
202 |
-
|
203 |
-
setTimeout(function(){
|
204 |
-
be.play();
|
205 |
-
}, 200);
|
206 |
}
|
207 |
this.params.scrollParent = oldScrollParent;
|
208 |
this.fireEvent('seek', progress);
|
@@ -241,17 +240,26 @@ var WaveSurfer = {
|
|
241 |
* value, and then rest the saved value.
|
242 |
*/
|
243 |
toggleMute: function () {
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
|
|
|
|
|
|
|
|
250 |
// If currently not muted then save current volume,
|
251 |
// turn off the volume and update the mute properties
|
252 |
this.savedVolume = this.backend.getVolume();
|
253 |
this.backend.setVolume(0);
|
254 |
this.isMuted = true;
|
|
|
|
|
|
|
|
|
|
|
255 |
}
|
256 |
},
|
257 |
|
@@ -287,8 +295,9 @@ var WaveSurfer = {
|
|
287 |
this.params.scrollParent = true;
|
288 |
|
289 |
this.drawBuffer();
|
|
|
290 |
|
291 |
-
this.
|
292 |
this.getCurrentTime() / this.getDuration()
|
293 |
);
|
294 |
this.fireEvent('zoom', pxPerSec);
|
@@ -299,7 +308,9 @@ var WaveSurfer = {
|
|
299 |
*/
|
300 |
loadArrayBuffer: function (arraybuffer) {
|
301 |
this.decodeArrayBuffer(arraybuffer, function (data) {
|
302 |
-
this.
|
|
|
|
|
303 |
}.bind(this));
|
304 |
},
|
305 |
|
@@ -337,12 +348,12 @@ var WaveSurfer = {
|
|
337 |
/**
|
338 |
* Loads audio and re-renders the waveform.
|
339 |
*/
|
340 |
-
load: function (url, peaks) {
|
341 |
-
|
342 |
|
343 |
switch (this.params.backend) {
|
344 |
case 'WebAudio': return this.loadBuffer(url, peaks);
|
345 |
-
case 'MediaElement': return this.loadMediaElement(url, peaks);
|
346 |
}
|
347 |
},
|
348 |
|
@@ -375,11 +386,11 @@ var WaveSurfer = {
|
|
375 |
* @param {Array} [peaks] Array of peaks. Required to bypass
|
376 |
* web audio dependency
|
377 |
*/
|
378 |
-
loadMediaElement: function (urlOrElt, peaks) {
|
379 |
var url = urlOrElt;
|
380 |
|
381 |
if (typeof urlOrElt === 'string') {
|
382 |
-
this.backend.load(url, this.mediaContainer, peaks);
|
383 |
} else {
|
384 |
var elt = urlOrElt;
|
385 |
this.backend.loadElt(elt, peaks);
|
@@ -409,6 +420,7 @@ var WaveSurfer = {
|
|
409 |
this.decodeArrayBuffer(arraybuffer, (function (buffer) {
|
410 |
this.backend.buffer = buffer;
|
411 |
this.drawBuffer();
|
|
|
412 |
}).bind(this));
|
413 |
}).bind(this));
|
414 |
}
|
@@ -420,7 +432,8 @@ var WaveSurfer = {
|
|
420 |
this.backend.decodeArrayBuffer(
|
421 |
arraybuffer,
|
422 |
(function (data) {
|
423 |
-
if
|
|
|
424 |
callback(data);
|
425 |
this.arraybuffer = null;
|
426 |
}
|
@@ -486,6 +499,23 @@ var WaveSurfer = {
|
|
486 |
return json;
|
487 |
},
|
488 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
489 |
cancelAjax: function () {
|
490 |
if (this.currentAjax) {
|
491 |
this.currentAjax.xhr.abort();
|
@@ -522,6 +552,7 @@ var WaveSurfer = {
|
|
522 |
this.unAll();
|
523 |
this.backend.destroy();
|
524 |
this.drawer.destroy();
|
|
|
525 |
}
|
526 |
};
|
527 |
|
@@ -683,6 +714,8 @@ WaveSurfer.Observer = {
|
|
683 |
/* Make the main WaveSurfer object an observer */
|
684 |
WaveSurfer.util.extend(WaveSurfer, WaveSurfer.Observer);
|
685 |
|
|
|
|
|
686 |
WaveSurfer.WebAudio = {
|
687 |
scriptBufferSize: 256,
|
688 |
PLAYING_STATE: 0,
|
@@ -694,12 +727,12 @@ WaveSurfer.WebAudio = {
|
|
694 |
},
|
695 |
|
696 |
getAudioContext: function () {
|
697 |
-
if (!
|
698 |
-
|
699 |
window.AudioContext || window.webkitAudioContext
|
700 |
);
|
701 |
}
|
702 |
-
return
|
703 |
},
|
704 |
|
705 |
getOfflineAudioContext: function (sampleRate) {
|
@@ -714,6 +747,7 @@ WaveSurfer.WebAudio = {
|
|
714 |
init: function (params) {
|
715 |
this.params = params;
|
716 |
this.ac = params.audioContext || this.getAudioContext();
|
|
|
717 |
this.lastPlay = this.ac.currentTime;
|
718 |
this.startPosition = 0;
|
719 |
this.scheduledPause = null;
|
@@ -939,6 +973,11 @@ WaveSurfer.WebAudio = {
|
|
939 |
this.gainNode.disconnect();
|
940 |
this.scriptNode.disconnect();
|
941 |
this.analyser.disconnect();
|
|
|
|
|
|
|
|
|
|
|
942 |
},
|
943 |
|
944 |
load: function (buffer) {
|
@@ -1024,6 +1063,10 @@ WaveSurfer.WebAudio = {
|
|
1024 |
|
1025 |
this.source.start(0, start, end - start);
|
1026 |
|
|
|
|
|
|
|
|
|
1027 |
this.setState(this.PLAYING_STATE);
|
1028 |
|
1029 |
this.fireEvent('play');
|
@@ -1108,6 +1151,8 @@ WaveSurfer.WebAudio.state.finished = {
|
|
1108 |
|
1109 |
WaveSurfer.util.extend(WaveSurfer.WebAudio, WaveSurfer.Observer);
|
1110 |
|
|
|
|
|
1111 |
WaveSurfer.MediaElement = Object.create(WaveSurfer.WebAudio);
|
1112 |
|
1113 |
WaveSurfer.util.extend(WaveSurfer.MediaElement, {
|
@@ -1157,14 +1202,15 @@ WaveSurfer.util.extend(WaveSurfer.MediaElement, {
|
|
1157 |
* @param {String} url path to media file
|
1158 |
* @param {HTMLElement} container HTML element
|
1159 |
* @param {Array} peaks array of peak data
|
|
|
1160 |
*/
|
1161 |
-
load: function (url, container, peaks) {
|
1162 |
var my = this;
|
1163 |
|
1164 |
var media = document.createElement(this.mediaType);
|
1165 |
media.controls = this.params.mediaControls;
|
1166 |
media.autoplay = this.params.autoplay || false;
|
1167 |
-
media.preload = 'auto';
|
1168 |
media.src = url;
|
1169 |
media.style.width = '100%';
|
1170 |
|
@@ -1202,6 +1248,12 @@ WaveSurfer.util.extend(WaveSurfer.MediaElement, {
|
|
1202 |
_load: function (media, peaks) {
|
1203 |
var my = this;
|
1204 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1205 |
media.addEventListener('error', function () {
|
1206 |
my.fireEvent('error', 'Error loading media element');
|
1207 |
});
|
@@ -1324,6 +1376,8 @@ WaveSurfer.util.extend(WaveSurfer.MediaElement, {
|
|
1324 |
//For backwards compatibility
|
1325 |
WaveSurfer.AudioElement = WaveSurfer.MediaElement;
|
1326 |
|
|
|
|
|
1327 |
WaveSurfer.Drawer = {
|
1328 |
init: function (container, params) {
|
1329 |
this.container = container;
|
@@ -1363,9 +1417,10 @@ WaveSurfer.Drawer = {
|
|
1363 |
this.setupWrapperEvents();
|
1364 |
},
|
1365 |
|
1366 |
-
handleEvent: function (e) {
|
1367 |
-
e.preventDefault();
|
1368 |
|
|
|
1369 |
var bbox = this.wrapper.getBoundingClientRect();
|
1370 |
|
1371 |
var nominalWidth = this.width;
|
@@ -1374,13 +1429,13 @@ WaveSurfer.Drawer = {
|
|
1374 |
var progress;
|
1375 |
|
1376 |
if (!this.params.fillParent && nominalWidth < parentWidth) {
|
1377 |
-
progress = ((
|
1378 |
|
1379 |
if (progress > 1) {
|
1380 |
progress = 1;
|
1381 |
}
|
1382 |
} else {
|
1383 |
-
progress = ((
|
1384 |
}
|
1385 |
|
1386 |
return progress;
|
@@ -1473,8 +1528,6 @@ WaveSurfer.Drawer = {
|
|
1473 |
},
|
1474 |
|
1475 |
setWidth: function (width) {
|
1476 |
-
if (width == this.width) { return; }
|
1477 |
-
|
1478 |
this.width = width;
|
1479 |
|
1480 |
if (this.params.fillParent || this.params.scrollParent) {
|
@@ -1539,6 +1592,8 @@ WaveSurfer.Drawer = {
|
|
1539 |
|
1540 |
WaveSurfer.util.extend(WaveSurfer.Drawer, WaveSurfer.Observer);
|
1541 |
|
|
|
|
|
1542 |
WaveSurfer.Drawer.Canvas = Object.create(WaveSurfer.Drawer);
|
1543 |
|
1544 |
WaveSurfer.util.extend(WaveSurfer.Drawer.Canvas, {
|
@@ -1637,7 +1692,7 @@ WaveSurfer.util.extend(WaveSurfer.Drawer.Canvas, {
|
|
1637 |
|
1638 |
var absmax = 1;
|
1639 |
if (this.params.normalize) {
|
1640 |
-
absmax =
|
1641 |
}
|
1642 |
|
1643 |
var scale = length / width;
|
@@ -1695,8 +1750,8 @@ WaveSurfer.util.extend(WaveSurfer.Drawer.Canvas, {
|
|
1695 |
|
1696 |
var absmax = 1;
|
1697 |
if (this.params.normalize) {
|
1698 |
-
var max =
|
1699 |
-
var min =
|
1700 |
absmax = -min > max ? -min : max;
|
1701 |
}
|
1702 |
|
@@ -1736,9 +1791,15 @@ WaveSurfer.util.extend(WaveSurfer.Drawer.Canvas, {
|
|
1736 |
this.width * progress
|
1737 |
) / this.params.pixelRatio;
|
1738 |
this.style(this.progressWave, { width: pos + 'px' });
|
|
|
|
|
|
|
|
|
1739 |
}
|
1740 |
});
|
1741 |
|
|
|
|
|
1742 |
WaveSurfer.Drawer.MultiCanvas = Object.create(WaveSurfer.Drawer);
|
1743 |
|
1744 |
WaveSurfer.util.extend(WaveSurfer.Drawer.MultiCanvas, {
|
@@ -1805,8 +1866,8 @@ WaveSurfer.util.extend(WaveSurfer.Drawer.MultiCanvas, {
|
|
1805 |
},
|
1806 |
|
1807 |
addCanvas: function () {
|
1808 |
-
var entry = {}
|
1809 |
-
|
1810 |
|
1811 |
entry.wave = this.wrapper.appendChild(
|
1812 |
this.style(document.createElement('canvas'), {
|
@@ -1843,7 +1904,12 @@ WaveSurfer.util.extend(WaveSurfer.Drawer.MultiCanvas, {
|
|
1843 |
},
|
1844 |
|
1845 |
updateDimensions: function (entry, width, height) {
|
1846 |
-
var elementWidth = Math.round(width / this.params.pixelRatio)
|
|
|
|
|
|
|
|
|
|
|
1847 |
|
1848 |
entry.waveCtx.canvas.width = width;
|
1849 |
entry.waveCtx.canvas.height = height;
|
@@ -1908,11 +1974,6 @@ WaveSurfer.util.extend(WaveSurfer.Drawer.MultiCanvas, {
|
|
1908 |
|
1909 |
var scale = length / width;
|
1910 |
|
1911 |
-
this.canvases[0].waveCtx.fillStyle = this.params.waveColor;
|
1912 |
-
if (this.canvases[0].progressCtx) {
|
1913 |
-
this.canvases[0].progressCtx.fillStyle = this.params.progressColor;
|
1914 |
-
}
|
1915 |
-
|
1916 |
for (var i = 0; i < width; i += step) {
|
1917 |
var h = Math.round(peaks[Math.floor(i * scale)] / absmax * halfH);
|
1918 |
this.fillRect(i + this.halfPixel, halfH - h + offsetY, bar + this.halfPixel, h * 2);
|
@@ -1947,7 +2008,6 @@ WaveSurfer.util.extend(WaveSurfer.Drawer.MultiCanvas, {
|
|
1947 |
var height = this.params.height * this.params.pixelRatio;
|
1948 |
var offsetY = height * channelIndex || 0;
|
1949 |
var halfH = height / 2;
|
1950 |
-
var length = ~~(peaks.length / this.canvases.length / 2);
|
1951 |
|
1952 |
var absmax = 1;
|
1953 |
if (this.params.normalize) {
|
@@ -1956,33 +2016,35 @@ WaveSurfer.util.extend(WaveSurfer.Drawer.MultiCanvas, {
|
|
1956 |
absmax = -min > max ? -min : max;
|
1957 |
}
|
1958 |
|
1959 |
-
this.drawLine(
|
1960 |
|
1961 |
// Always draw a median line
|
1962 |
this.fillRect(0, halfH + offsetY - this.halfPixel, this.width, this.halfPixel);
|
1963 |
},
|
1964 |
|
1965 |
-
drawLine: function (
|
1966 |
for (var index in this.canvases) {
|
1967 |
var entry = this.canvases[index];
|
1968 |
|
1969 |
this.setFillStyles(entry);
|
1970 |
|
1971 |
-
this.drawLineToContext(entry.waveCtx,
|
1972 |
-
this.drawLineToContext(entry.progressCtx,
|
1973 |
}
|
1974 |
},
|
1975 |
|
1976 |
-
drawLineToContext: function (
|
1977 |
if (!ctx) { return; }
|
1978 |
|
|
|
|
|
1979 |
var scale = 1;
|
1980 |
if (this.params.fillParent && this.width != length) {
|
1981 |
-
scale =
|
1982 |
}
|
1983 |
|
1984 |
-
var first =
|
1985 |
-
last =
|
1986 |
|
1987 |
ctx.beginPath();
|
1988 |
ctx.moveTo(this.halfPixel, halfH + offsetY);
|
@@ -2053,6 +2115,8 @@ WaveSurfer.util.extend(WaveSurfer.Drawer.MultiCanvas, {
|
|
2053 |
}
|
2054 |
});
|
2055 |
|
|
|
|
|
2056 |
/* Init from HTML */
|
2057 |
(function () {
|
2058 |
var init = function () {
|
85 |
|
86 |
this.createDrawer();
|
87 |
this.createBackend();
|
88 |
+
|
89 |
+
this.isDestroyed = false;
|
90 |
},
|
91 |
|
92 |
createDrawer: function () {
|
201 |
|
202 |
if (!paused) {
|
203 |
this.backend.pause();
|
204 |
+
this.backend.play();
|
|
|
|
|
|
|
205 |
}
|
206 |
this.params.scrollParent = oldScrollParent;
|
207 |
this.fireEvent('seek', progress);
|
240 |
* value, and then rest the saved value.
|
241 |
*/
|
242 |
toggleMute: function () {
|
243 |
+
this.setMute(!this.isMuted);
|
244 |
+
},
|
245 |
+
|
246 |
+
setMute: function (mute) {
|
247 |
+
// ignore all muting requests if the audio is already in that state
|
248 |
+
if (mute === this.isMuted) {
|
249 |
+
return;
|
250 |
+
}
|
251 |
+
|
252 |
+
if (mute) {
|
253 |
// If currently not muted then save current volume,
|
254 |
// turn off the volume and update the mute properties
|
255 |
this.savedVolume = this.backend.getVolume();
|
256 |
this.backend.setVolume(0);
|
257 |
this.isMuted = true;
|
258 |
+
} else {
|
259 |
+
// If currently muted then restore to the saved volume
|
260 |
+
// and update the mute properties
|
261 |
+
this.backend.setVolume(this.savedVolume);
|
262 |
+
this.isMuted = false;
|
263 |
}
|
264 |
},
|
265 |
|
295 |
this.params.scrollParent = true;
|
296 |
|
297 |
this.drawBuffer();
|
298 |
+
this.drawer.progress(this.backend.getPlayedPercents());
|
299 |
|
300 |
+
this.drawer.recenter(
|
301 |
this.getCurrentTime() / this.getDuration()
|
302 |
);
|
303 |
this.fireEvent('zoom', pxPerSec);
|
308 |
*/
|
309 |
loadArrayBuffer: function (arraybuffer) {
|
310 |
this.decodeArrayBuffer(arraybuffer, function (data) {
|
311 |
+
if (!this.isDestroyed) {
|
312 |
+
this.loadDecodedBuffer(data);
|
313 |
+
}
|
314 |
}.bind(this));
|
315 |
},
|
316 |
|
348 |
/**
|
349 |
* Loads audio and re-renders the waveform.
|
350 |
*/
|
351 |
+
load: function (url, peaks, preload) {
|
352 |
+
this.empty();
|
353 |
|
354 |
switch (this.params.backend) {
|
355 |
case 'WebAudio': return this.loadBuffer(url, peaks);
|
356 |
+
case 'MediaElement': return this.loadMediaElement(url, peaks, preload);
|
357 |
}
|
358 |
},
|
359 |
|
386 |
* @param {Array} [peaks] Array of peaks. Required to bypass
|
387 |
* web audio dependency
|
388 |
*/
|
389 |
+
loadMediaElement: function (urlOrElt, peaks, preload) {
|
390 |
var url = urlOrElt;
|
391 |
|
392 |
if (typeof urlOrElt === 'string') {
|
393 |
+
this.backend.load(url, this.mediaContainer, peaks, preload);
|
394 |
} else {
|
395 |
var elt = urlOrElt;
|
396 |
this.backend.loadElt(elt, peaks);
|
420 |
this.decodeArrayBuffer(arraybuffer, (function (buffer) {
|
421 |
this.backend.buffer = buffer;
|
422 |
this.drawBuffer();
|
423 |
+
this.fireEvent('waveform-ready');
|
424 |
}).bind(this));
|
425 |
}).bind(this));
|
426 |
}
|
432 |
this.backend.decodeArrayBuffer(
|
433 |
arraybuffer,
|
434 |
(function (data) {
|
435 |
+
// Only use the decoded data if we haven't been destroyed or another decode started in the meantime
|
436 |
+
if (!this.isDestroyed && this.arraybuffer == arraybuffer) {
|
437 |
callback(data);
|
438 |
this.arraybuffer = null;
|
439 |
}
|
499 |
return json;
|
500 |
},
|
501 |
|
502 |
+
/**
|
503 |
+
* Save waveform image as data URI.
|
504 |
+
*
|
505 |
+
* The default format is 'image/png'. Other supported types are
|
506 |
+
* 'image/jpeg' and 'image/webp'.
|
507 |
+
*/
|
508 |
+
exportImage: function(format, quality) {
|
509 |
+
if (!format) {
|
510 |
+
format = 'image/png';
|
511 |
+
}
|
512 |
+
if (!quality) {
|
513 |
+
quality = 1;
|
514 |
+
}
|
515 |
+
|
516 |
+
return this.drawer.getImage(format, quality);
|
517 |
+
},
|
518 |
+
|
519 |
cancelAjax: function () {
|
520 |
if (this.currentAjax) {
|
521 |
this.currentAjax.xhr.abort();
|
552 |
this.unAll();
|
553 |
this.backend.destroy();
|
554 |
this.drawer.destroy();
|
555 |
+
this.isDestroyed = true;
|
556 |
}
|
557 |
};
|
558 |
|
714 |
/* Make the main WaveSurfer object an observer */
|
715 |
WaveSurfer.util.extend(WaveSurfer, WaveSurfer.Observer);
|
716 |
|
717 |
+
'use strict';
|
718 |
+
|
719 |
WaveSurfer.WebAudio = {
|
720 |
scriptBufferSize: 256,
|
721 |
PLAYING_STATE: 0,
|
727 |
},
|
728 |
|
729 |
getAudioContext: function () {
|
730 |
+
if (!this.ac) {
|
731 |
+
this.ac = new (
|
732 |
window.AudioContext || window.webkitAudioContext
|
733 |
);
|
734 |
}
|
735 |
+
return this.ac;
|
736 |
},
|
737 |
|
738 |
getOfflineAudioContext: function (sampleRate) {
|
747 |
init: function (params) {
|
748 |
this.params = params;
|
749 |
this.ac = params.audioContext || this.getAudioContext();
|
750 |
+
|
751 |
this.lastPlay = this.ac.currentTime;
|
752 |
this.startPosition = 0;
|
753 |
this.scheduledPause = null;
|
973 |
this.gainNode.disconnect();
|
974 |
this.scriptNode.disconnect();
|
975 |
this.analyser.disconnect();
|
976 |
+
// close the audioContext if it was created by wavesurfer
|
977 |
+
// not passed in as a parameter
|
978 |
+
if (!this.params.audioContext) {
|
979 |
+
this.ac.close();
|
980 |
+
}
|
981 |
},
|
982 |
|
983 |
load: function (buffer) {
|
1063 |
|
1064 |
this.source.start(0, start, end - start);
|
1065 |
|
1066 |
+
if (this.ac.state == 'suspended') {
|
1067 |
+
this.ac.resume && this.ac.resume();
|
1068 |
+
}
|
1069 |
+
|
1070 |
this.setState(this.PLAYING_STATE);
|
1071 |
|
1072 |
this.fireEvent('play');
|
1151 |
|
1152 |
WaveSurfer.util.extend(WaveSurfer.WebAudio, WaveSurfer.Observer);
|
1153 |
|
1154 |
+
'use strict';
|
1155 |
+
|
1156 |
WaveSurfer.MediaElement = Object.create(WaveSurfer.WebAudio);
|
1157 |
|
1158 |
WaveSurfer.util.extend(WaveSurfer.MediaElement, {
|
1202 |
* @param {String} url path to media file
|
1203 |
* @param {HTMLElement} container HTML element
|
1204 |
* @param {Array} peaks array of peak data
|
1205 |
+
* @param {String} preload HTML 5 preload attribute value
|
1206 |
*/
|
1207 |
+
load: function (url, container, peaks, preload) {
|
1208 |
var my = this;
|
1209 |
|
1210 |
var media = document.createElement(this.mediaType);
|
1211 |
media.controls = this.params.mediaControls;
|
1212 |
media.autoplay = this.params.autoplay || false;
|
1213 |
+
media.preload = preload == null ? 'auto' : preload;
|
1214 |
media.src = url;
|
1215 |
media.style.width = '100%';
|
1216 |
|
1248 |
_load: function (media, peaks) {
|
1249 |
var my = this;
|
1250 |
|
1251 |
+
// load must be called manually on iOS, otherwise peaks won't draw
|
1252 |
+
// until a user interaction triggers load --> 'ready' event
|
1253 |
+
if (typeof media.load == 'function') {
|
1254 |
+
media.load();
|
1255 |
+
}
|
1256 |
+
|
1257 |
media.addEventListener('error', function () {
|
1258 |
my.fireEvent('error', 'Error loading media element');
|
1259 |
});
|
1376 |
//For backwards compatibility
|
1377 |
WaveSurfer.AudioElement = WaveSurfer.MediaElement;
|
1378 |
|
1379 |
+
'use strict';
|
1380 |
+
|
1381 |
WaveSurfer.Drawer = {
|
1382 |
init: function (container, params) {
|
1383 |
this.container = container;
|
1417 |
this.setupWrapperEvents();
|
1418 |
},
|
1419 |
|
1420 |
+
handleEvent: function (e, noPrevent) {
|
1421 |
+
!noPrevent && e.preventDefault();
|
1422 |
|
1423 |
+
var clientX = e.targetTouches ? e.targetTouches[0].clientX : e.clientX;
|
1424 |
var bbox = this.wrapper.getBoundingClientRect();
|
1425 |
|
1426 |
var nominalWidth = this.width;
|
1429 |
var progress;
|
1430 |
|
1431 |
if (!this.params.fillParent && nominalWidth < parentWidth) {
|
1432 |
+
progress = ((clientX - bbox.left) * this.params.pixelRatio / nominalWidth) || 0;
|
1433 |
|
1434 |
if (progress > 1) {
|
1435 |
progress = 1;
|
1436 |
}
|
1437 |
} else {
|
1438 |
+
progress = ((clientX - bbox.left + this.wrapper.scrollLeft) / this.wrapper.scrollWidth) || 0;
|
1439 |
}
|
1440 |
|
1441 |
return progress;
|
1528 |
},
|
1529 |
|
1530 |
setWidth: function (width) {
|
|
|
|
|
1531 |
this.width = width;
|
1532 |
|
1533 |
if (this.params.fillParent || this.params.scrollParent) {
|
1592 |
|
1593 |
WaveSurfer.util.extend(WaveSurfer.Drawer, WaveSurfer.Observer);
|
1594 |
|
1595 |
+
'use strict';
|
1596 |
+
|
1597 |
WaveSurfer.Drawer.Canvas = Object.create(WaveSurfer.Drawer);
|
1598 |
|
1599 |
WaveSurfer.util.extend(WaveSurfer.Drawer.Canvas, {
|
1692 |
|
1693 |
var absmax = 1;
|
1694 |
if (this.params.normalize) {
|
1695 |
+
absmax = WaveSurfer.util.max(peaks);
|
1696 |
}
|
1697 |
|
1698 |
var scale = length / width;
|
1750 |
|
1751 |
var absmax = 1;
|
1752 |
if (this.params.normalize) {
|
1753 |
+
var max = WaveSurfer.util.max(peaks);
|
1754 |
+
var min = WaveSurfer.util.min(peaks);
|
1755 |
absmax = -min > max ? -min : max;
|
1756 |
}
|
1757 |
|
1791 |
this.width * progress
|
1792 |
) / this.params.pixelRatio;
|
1793 |
this.style(this.progressWave, { width: pos + 'px' });
|
1794 |
+
},
|
1795 |
+
|
1796 |
+
getImage: function(type, quality) {
|
1797 |
+
return this.waveCc.canvas.toDataURL(type, quality);
|
1798 |
}
|
1799 |
});
|
1800 |
|
1801 |
+
'use strict';
|
1802 |
+
|
1803 |
WaveSurfer.Drawer.MultiCanvas = Object.create(WaveSurfer.Drawer);
|
1804 |
|
1805 |
WaveSurfer.util.extend(WaveSurfer.Drawer.MultiCanvas, {
|
1866 |
},
|
1867 |
|
1868 |
addCanvas: function () {
|
1869 |
+
var entry = {},
|
1870 |
+
leftOffset = this.maxCanvasElementWidth * this.canvases.length;
|
1871 |
|
1872 |
entry.wave = this.wrapper.appendChild(
|
1873 |
this.style(document.createElement('canvas'), {
|
1904 |
},
|
1905 |
|
1906 |
updateDimensions: function (entry, width, height) {
|
1907 |
+
var elementWidth = Math.round(width / this.params.pixelRatio),
|
1908 |
+
totalWidth = Math.round(this.width / this.params.pixelRatio);
|
1909 |
+
|
1910 |
+
// Where the canvas starts and ends in the waveform, represented as a decimal between 0 and 1.
|
1911 |
+
entry.start = (entry.waveCtx.canvas.offsetLeft / totalWidth) || 0;
|
1912 |
+
entry.end = entry.start + elementWidth / totalWidth;
|
1913 |
|
1914 |
entry.waveCtx.canvas.width = width;
|
1915 |
entry.waveCtx.canvas.height = height;
|
1974 |
|
1975 |
var scale = length / width;
|
1976 |
|
|
|
|
|
|
|
|
|
|
|
1977 |
for (var i = 0; i < width; i += step) {
|
1978 |
var h = Math.round(peaks[Math.floor(i * scale)] / absmax * halfH);
|
1979 |
this.fillRect(i + this.halfPixel, halfH - h + offsetY, bar + this.halfPixel, h * 2);
|
2008 |
var height = this.params.height * this.params.pixelRatio;
|
2009 |
var offsetY = height * channelIndex || 0;
|
2010 |
var halfH = height / 2;
|
|
|
2011 |
|
2012 |
var absmax = 1;
|
2013 |
if (this.params.normalize) {
|
2016 |
absmax = -min > max ? -min : max;
|
2017 |
}
|
2018 |
|
2019 |
+
this.drawLine(peaks, absmax, halfH, offsetY);
|
2020 |
|
2021 |
// Always draw a median line
|
2022 |
this.fillRect(0, halfH + offsetY - this.halfPixel, this.width, this.halfPixel);
|
2023 |
},
|
2024 |
|
2025 |
+
drawLine: function (peaks, absmax, halfH, offsetY) {
|
2026 |
for (var index in this.canvases) {
|
2027 |
var entry = this.canvases[index];
|
2028 |
|
2029 |
this.setFillStyles(entry);
|
2030 |
|
2031 |
+
this.drawLineToContext(entry, entry.waveCtx, peaks, absmax, halfH, offsetY);
|
2032 |
+
this.drawLineToContext(entry, entry.progressCtx, peaks, absmax, halfH, offsetY);
|
2033 |
}
|
2034 |
},
|
2035 |
|
2036 |
+
drawLineToContext: function (entry, ctx, peaks, absmax, halfH, offsetY) {
|
2037 |
if (!ctx) { return; }
|
2038 |
|
2039 |
+
var length = peaks.length / 2;
|
2040 |
+
|
2041 |
var scale = 1;
|
2042 |
if (this.params.fillParent && this.width != length) {
|
2043 |
+
scale = this.width / length;
|
2044 |
}
|
2045 |
|
2046 |
+
var first = Math.round(length * entry.start),
|
2047 |
+
last = Math.round(length * entry.end);
|
2048 |
|
2049 |
ctx.beginPath();
|
2050 |
ctx.moveTo(this.halfPixel, halfH + offsetY);
|
2115 |
}
|
2116 |
});
|
2117 |
|
2118 |
+
'use strict';
|
2119 |
+
|
2120 |
/* Init from HTML */
|
2121 |
(function () {
|
2122 |
var init = function () {
|
assets/wavesurfer/wavesurfer.min.js
CHANGED
@@ -1,60 +1,5 @@
|
|
1 |
-
/*! wavesurfer.js 1.
|
2 |
* https://github.com/katspaugh/wavesurfer.js
|
3 |
* @license CC-BY-3.0 */
|
4 |
-
(function(e,a){"function"===typeof define&&define.amd?define("wavesurfer",[],function(){return e.WaveSurfer=a()}):"object"===typeof exports?module.exports=a():e.WaveSurfer=a()})(this,function(){var e={defaultParams:{height:128,waveColor:"#999",progressColor:"#555",cursorColor:"#333",cursorWidth:1,skipLength:2,minPxPerSec:20,pixelRatio:window.devicePixelRatio||screen.deviceXDPI/screen.logicalXDPI,fillParent:!0,scrollParent:!1,hideScrollbar:!1,normalize:!1,audioContext:null,container:null,dragSelection:!0,
|
5 |
-
|
6 |
-
document.querySelector(this.params.mediaContainer):this.params.mediaContainer;if(!this.mediaContainer)throw Error("Media Container element not found");this.savedVolume=0;this.isMuted=!1;this.tmpEvents=[];this.currentAjax=null;this.createDrawer();this.createBackend()},createDrawer:function(){var a=this;this.drawer=Object.create(e.Drawer[this.params.renderer]);this.drawer.init(this.container,this.params);this.drawer.on("redraw",function(){a.drawBuffer();a.drawer.progress(a.backend.getPlayedPercents())});
|
7 |
-
this.drawer.on("click",function(b,c){setTimeout(function(){a.seekTo(c)},0)});this.drawer.on("scroll",function(b){a.fireEvent("scroll",b)})},createBackend:function(){var a=this;this.backend&&this.backend.destroy();"AudioElement"==this.params.backend&&(this.params.backend="MediaElement");"WebAudio"!=this.params.backend||e.WebAudio.supportsWebAudio()||(this.params.backend="MediaElement");this.backend=Object.create(e[this.params.backend]);this.backend.init(this.params);this.backend.on("finish",function(){a.fireEvent("finish")});
|
8 |
-
this.backend.on("play",function(){a.fireEvent("play")});this.backend.on("pause",function(){a.fireEvent("pause")});this.backend.on("audioprocess",function(b){a.drawer.progress(a.backend.getPlayedPercents());a.fireEvent("audioprocess",b)})},getDuration:function(){return this.backend.getDuration()},getCurrentTime:function(){return this.backend.getCurrentTime()},play:function(a,b){this.fireEvent("interaction",this.play.bind(this,a,b));this.backend.play(a,b)},pause:function(){this.backend.pause()},playPause:function(){this.backend.isPaused()?
|
9 |
-
this.play():this.pause()},isPlaying:function(){return!this.backend.isPaused()},skipBackward:function(a){this.skip(-a||-this.params.skipLength)},skipForward:function(a){this.skip(a||this.params.skipLength)},skip:function(a){var b=this.getCurrentTime()||0,c=this.getDuration()||1,b=Math.max(0,Math.min(c,b+(a||0)));this.seekAndCenter(b/c)},seekAndCenter:function(a){this.seekTo(a);this.drawer.recenter(a)},seekTo:function(a){this.fireEvent("interaction",this.seekTo.bind(this,a));var b=this.backend.isPaused(),
|
10 |
-
c=this.params.scrollParent;b&&(this.params.scrollParent=!1);this.backend.seekTo(a*this.getDuration());this.drawer.progress(this.backend.getPlayedPercents());if(!b){this.backend.pause();var d=this.backend;setTimeout(function(){d.play()},200)}this.params.scrollParent=c;this.fireEvent("seek",a)},stop:function(){this.pause();this.seekTo(0);this.drawer.progress(0)},setVolume:function(a){this.backend.setVolume(a)},setPlaybackRate:function(a){this.backend.setPlaybackRate(a)},toggleMute:function(){this.isMuted?
|
11 |
-
(this.backend.setVolume(this.savedVolume),this.isMuted=!1):(this.savedVolume=this.backend.getVolume(),this.backend.setVolume(0),this.isMuted=!0)},toggleScroll:function(){this.params.scrollParent=!this.params.scrollParent;this.drawBuffer()},toggleInteraction:function(){this.params.interact=!this.params.interact},drawBuffer:function(){var a=Math.round(this.getDuration()*this.params.minPxPerSec*this.params.pixelRatio),b=this.drawer.getWidth(),c=a;this.params.fillParent&&(!this.params.scrollParent||a<
|
12 |
-
b)&&(c=b);a=this.backend.getPeaks(c);this.drawer.drawPeaks(a,c);this.fireEvent("redraw",a,c)},zoom:function(a){this.params.minPxPerSec=a;this.params.scrollParent=!0;this.drawBuffer();this.seekAndCenter(this.getCurrentTime()/this.getDuration());this.fireEvent("zoom",a)},loadArrayBuffer:function(a){this.decodeArrayBuffer(a,function(a){this.loadDecodedBuffer(a)}.bind(this))},loadDecodedBuffer:function(a){this.backend.load(a);this.drawBuffer();this.fireEvent("ready")},loadBlob:function(a){var b=this,
|
13 |
-
c=new FileReader;c.addEventListener("progress",function(a){b.onProgress(a)});c.addEventListener("load",function(a){b.loadArrayBuffer(a.target.result)});c.addEventListener("error",function(){b.fireEvent("error","Error reading file")});c.readAsArrayBuffer(a);this.empty()},load:function(a,b){switch(this.params.backend){case "WebAudio":return this.loadBuffer(a,b);case "MediaElement":return this.loadMediaElement(a,b)}},loadBuffer:function(a,b){var c=function(b){b&&this.tmpEvents.push(this.once("ready",
|
14 |
-
b));return this.getArrayBuffer(a,this.loadArrayBuffer.bind(this))}.bind(this);if(b)this.backend.setPeaks(b),this.drawBuffer(),this.tmpEvents.push(this.once("interaction",c));else return c()},loadMediaElement:function(a,b){var c=a;"string"===typeof a?this.backend.load(c,this.mediaContainer,b):(this.backend.loadElt(a,b),c=a.src);this.tmpEvents.push(this.backend.once("canplay",function(){this.drawBuffer();this.fireEvent("ready")}.bind(this)),this.backend.once("error",function(a){this.fireEvent("error",
|
15 |
-
a)}.bind(this)));b?this.backend.setPeaks(b):this.backend.supportsWebAudio()&&this.getArrayBuffer(c,function(a){this.decodeArrayBuffer(a,function(a){this.backend.buffer=a;this.drawBuffer()}.bind(this))}.bind(this))},decodeArrayBuffer:function(a,b){this.arraybuffer=a;this.backend.decodeArrayBuffer(a,function(c){this.arraybuffer==a&&(b(c),this.arraybuffer=null)}.bind(this),this.fireEvent.bind(this,"error","Error decoding audiobuffer"))},getArrayBuffer:function(a,b){var c=this,d=e.util.ajax({url:a,responseType:"arraybuffer"});
|
16 |
-
this.currentAjax=d;this.tmpEvents.push(d.on("progress",function(a){c.onProgress(a)}),d.on("success",function(a,d){b(a);c.currentAjax=null}),d.on("error",function(a){c.fireEvent("error","XHR error: "+a.target.statusText);c.currentAjax=null}));return d},onProgress:function(a){this.fireEvent("loading",Math.round(100*(a.lengthComputable?a.loaded/a.total:a.loaded/(a.loaded+1E6))),a.target)},exportPCM:function(a,b,c){b=b||1E4;c=c||!1;a=this.backend.getPeaks(a||1024,b);a=[].map.call(a,function(a){return Math.round(a*
|
17 |
-
b)/b});a=JSON.stringify(a);c||window.open("data:application/json;charset=utf-8,"+encodeURIComponent(a));return a},cancelAjax:function(){this.currentAjax&&(this.currentAjax.xhr.abort(),this.currentAjax=null)},clearTmpEvents:function(){this.tmpEvents.forEach(function(a){a.un()})},empty:function(){this.backend.isPaused()||(this.stop(),this.backend.disconnectSource());this.cancelAjax();this.clearTmpEvents();this.drawer.progress(0);this.drawer.setWidth(0);this.drawer.drawPeaks({length:this.drawer.getWidth()},
|
18 |
-
0)},destroy:function(){this.fireEvent("destroy");this.cancelAjax();this.clearTmpEvents();this.unAll();this.backend.destroy();this.drawer.destroy()},create:function(a){var b=Object.create(e);b.init(a);return b},util:{extend:function(a){Array.prototype.slice.call(arguments,1).forEach(function(b){Object.keys(b).forEach(function(c){a[c]=b[c]})});return a},min:function(a){var b=Infinity,c;for(c in a)a[c]<b&&(b=a[c]);return b},max:function(a){var b=-Infinity,c;for(c in a)a[c]>b&&(b=a[c]);return b},getId:function(){return"wavesurfer_"+
|
19 |
-
Math.random().toString(32).substring(2)},ajax:function(a){var b=Object.create(e.Observer),c=new XMLHttpRequest,d=!1;c.open(a.method||"GET",a.url,!0);c.responseType=a.responseType||"json";c.addEventListener("progress",function(a){b.fireEvent("progress",a);a.lengthComputable&&a.loaded==a.total&&(d=!0)});c.addEventListener("load",function(a){d||b.fireEvent("progress",a);b.fireEvent("load",a);200==c.status||206==c.status?b.fireEvent("success",c.response,a):b.fireEvent("error",a)});c.addEventListener("error",
|
20 |
-
function(a){b.fireEvent("error",a)});c.send();b.xhr=c;return b}},Observer:{on:function(a,b){this.handlers||(this.handlers={});var c=this.handlers[a];c||(c=this.handlers[a]=[]);c.push(b);return{name:a,callback:b,un:this.un.bind(this,a,b)}},un:function(a,b){if(this.handlers){var c=this.handlers[a];if(c)if(b)for(var d=c.length-1;0<=d;d--)c[d]==b&&c.splice(d,1);else c.length=0}},unAll:function(){this.handlers=null},once:function(a,b){var c=this,d=function(){b.apply(this,arguments);setTimeout(function(){c.un(a,
|
21 |
-
d)},0)};return this.on(a,d)},fireEvent:function(a){if(this.handlers){var b=this.handlers[a],c=Array.prototype.slice.call(arguments,1);b&&b.forEach(function(a){a.apply(null,c)})}}}};e.util.extend(e,e.Observer);e.WebAudio={scriptBufferSize:256,PLAYING_STATE:0,PAUSED_STATE:1,FINISHED_STATE:2,supportsWebAudio:function(){return!(!window.AudioContext&&!window.webkitAudioContext)},getAudioContext:function(){e.WebAudio.audioContext||(e.WebAudio.audioContext=new (window.AudioContext||window.webkitAudioContext));
|
22 |
-
return e.WebAudio.audioContext},getOfflineAudioContext:function(a){e.WebAudio.offlineAudioContext||(e.WebAudio.offlineAudioContext=new (window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,2,a));return e.WebAudio.offlineAudioContext},init:function(a){this.params=a;this.ac=a.audioContext||this.getAudioContext();this.lastPlay=this.ac.currentTime;this.startPosition=0;this.scheduledPause=null;this.states=[Object.create(e.WebAudio.state.playing),Object.create(e.WebAudio.state.paused),Object.create(e.WebAudio.state.finished)];
|
23 |
-
this.createVolumeNode();this.createScriptNode();this.createAnalyserNode();this.setState(this.PAUSED_STATE);this.setPlaybackRate(this.params.audioRate)},disconnectFilters:function(){this.filters&&(this.filters.forEach(function(a){a&&a.disconnect()}),this.filters=null,this.analyser.connect(this.gainNode))},setState:function(a){this.state!==this.states[a]&&(this.state=this.states[a],this.state.init.call(this))},setFilter:function(){this.setFilters([].slice.call(arguments))},setFilters:function(a){this.disconnectFilters();
|
24 |
-
a&&a.length&&(this.filters=a,this.analyser.disconnect(),a.reduce(function(a,c){a.connect(c);return c},this.analyser).connect(this.gainNode))},createScriptNode:function(){this.scriptNode=this.ac.createScriptProcessor?this.ac.createScriptProcessor(this.scriptBufferSize):this.ac.createJavaScriptNode(this.scriptBufferSize);this.scriptNode.connect(this.ac.destination)},addOnAudioProcess:function(){var a=this;this.scriptNode.onaudioprocess=function(){var b=a.getCurrentTime();b>=a.getDuration()?(a.setState(a.FINISHED_STATE),
|
25 |
-
a.fireEvent("pause")):b>=a.scheduledPause?a.pause():a.state===a.states[a.PLAYING_STATE]&&a.fireEvent("audioprocess",b)}},removeOnAudioProcess:function(){this.scriptNode.onaudioprocess=null},createAnalyserNode:function(){this.analyser=this.ac.createAnalyser();this.analyser.connect(this.gainNode)},createVolumeNode:function(){this.gainNode=this.ac.createGain?this.ac.createGain():this.ac.createGainNode();this.gainNode.connect(this.ac.destination)},setVolume:function(a){this.gainNode.gain.value=a},getVolume:function(){return this.gainNode.gain.value},
|
26 |
-
decodeArrayBuffer:function(a,b,c){this.offlineAc||(this.offlineAc=this.getOfflineAudioContext(this.ac?this.ac.sampleRate:44100));this.offlineAc.decodeAudioData(a,function(a){b(a)}.bind(this),c)},setPeaks:function(a){this.peaks=a},getPeaks:function(a){if(this.peaks)return this.peaks;for(var b=this.buffer.length/a,c=~~(b/10)||1,d=this.buffer.numberOfChannels,e=[],f=[],g=0;g<d;g++)for(var l=e[g]=[],k=this.buffer.getChannelData(g),h=0;h<a;h++){for(var m=~~(h*b),t=~~(m+b),q=0,n=0;m<t;m+=c){var r=k[m];
|
27 |
-
r>n&&(n=r);r<q&&(q=r)}l[2*h]=n;l[2*h+1]=q;if(0==g||n>f[2*h])f[2*h]=n;if(0==g||q<f[2*h+1])f[2*h+1]=q}return this.params.splitChannels?e:f},getPlayedPercents:function(){return this.state.getPlayedPercents.call(this)},disconnectSource:function(){this.source&&this.source.disconnect()},destroy:function(){this.isPaused()||this.pause();this.unAll();this.buffer=null;this.disconnectFilters();this.disconnectSource();this.gainNode.disconnect();this.scriptNode.disconnect();this.analyser.disconnect()},load:function(a){this.startPosition=
|
28 |
-
0;this.lastPlay=this.ac.currentTime;this.buffer=a;this.createSource()},createSource:function(){this.disconnectSource();this.source=this.ac.createBufferSource();this.source.start=this.source.start||this.source.noteGrainOn;this.source.stop=this.source.stop||this.source.noteOff;this.source.playbackRate.value=this.playbackRate;this.source.buffer=this.buffer;this.source.connect(this.analyser)},isPaused:function(){return this.state!==this.states[this.PLAYING_STATE]},getDuration:function(){return this.buffer?
|
29 |
-
this.buffer.duration:0},seekTo:function(a,b){if(this.buffer)return this.scheduledPause=null,null==a&&(a=this.getCurrentTime(),a>=this.getDuration()&&(a=0)),null==b&&(b=this.getDuration()),this.startPosition=a,this.lastPlay=this.ac.currentTime,this.state===this.states[this.FINISHED_STATE]&&this.setState(this.PAUSED_STATE),{start:a,end:b}},getPlayedTime:function(){return(this.ac.currentTime-this.lastPlay)*this.playbackRate},play:function(a,b){if(this.buffer){this.createSource();var c=this.seekTo(a,
|
30 |
-
b);a=c.start;this.scheduledPause=b=c.end;this.source.start(0,a,b-a);this.setState(this.PLAYING_STATE);this.fireEvent("play")}},pause:function(){this.scheduledPause=null;this.startPosition+=this.getPlayedTime();this.source&&this.source.stop(0);this.setState(this.PAUSED_STATE);this.fireEvent("pause")},getCurrentTime:function(){return this.state.getCurrentTime.call(this)},setPlaybackRate:function(a){a=a||1;this.isPaused()?this.playbackRate=a:(this.pause(),this.playbackRate=a,this.play())}};e.WebAudio.state=
|
31 |
-
{};e.WebAudio.state.playing={init:function(){this.addOnAudioProcess()},getPlayedPercents:function(){var a=this.getDuration();return this.getCurrentTime()/a||0},getCurrentTime:function(){return this.startPosition+this.getPlayedTime()}};e.WebAudio.state.paused={init:function(){this.removeOnAudioProcess()},getPlayedPercents:function(){var a=this.getDuration();return this.getCurrentTime()/a||0},getCurrentTime:function(){return this.startPosition}};e.WebAudio.state.finished={init:function(){this.removeOnAudioProcess();
|
32 |
-
this.fireEvent("finish")},getPlayedPercents:function(){return 1},getCurrentTime:function(){return this.getDuration()}};e.util.extend(e.WebAudio,e.Observer);e.MediaElement=Object.create(e.WebAudio);e.util.extend(e.MediaElement,{init:function(a){this.params=a;this.media={currentTime:0,duration:0,paused:!0,playbackRate:1,play:function(){},pause:function(){}};this.mediaType=a.mediaType.toLowerCase();this.elementPosition=a.elementPosition;this.setPlaybackRate(this.params.audioRate);this.createTimer()},
|
33 |
-
createTimer:function(){var a=this,b=function(){a.isPaused()||(a.fireEvent("audioprocess",a.getCurrentTime()),(window.requestAnimationFrame||window.webkitRequestAnimationFrame)(b))};this.on("play",b)},load:function(a,b,c){var d=document.createElement(this.mediaType);d.controls=this.params.mediaControls;d.autoplay=this.params.autoplay||!1;d.preload="auto";d.src=a;d.style.width="100%";(a=b.querySelector(this.mediaType))&&b.removeChild(a);b.appendChild(d);this._load(d,c)},loadElt:function(a,b){a.controls=
|
34 |
-
this.params.mediaControls;a.autoplay=this.params.autoplay||!1;this._load(a,b)},_load:function(a,b){var c=this;a.addEventListener("error",function(){c.fireEvent("error","Error loading media element")});a.addEventListener("canplay",function(){c.fireEvent("canplay")});a.addEventListener("ended",function(){c.fireEvent("finish")});this.media=a;this.peaks=b;this.buffer=this.onPlayEnd=null;this.setPlaybackRate(this.playbackRate)},isPaused:function(){return!this.media||this.media.paused},getDuration:function(){var a=
|
35 |
-
this.media.duration;Infinity<=a&&(a=this.media.seekable.end(0));return a},getCurrentTime:function(){return this.media&&this.media.currentTime},getPlayedPercents:function(){return this.getCurrentTime()/this.getDuration()||0},setPlaybackRate:function(a){this.playbackRate=a||1;this.media.playbackRate=this.playbackRate},seekTo:function(a){null!=a&&(this.media.currentTime=a);this.clearPlayEnd()},play:function(a,b){this.seekTo(a);this.media.play();b&&this.setPlayEnd(b);this.fireEvent("play")},pause:function(){this.media&&
|
36 |
-
this.media.pause();this.clearPlayEnd();this.fireEvent("pause")},setPlayEnd:function(a){var b=this;this.onPlayEnd=function(c){c>=a&&(b.pause(),b.seekTo(a))};this.on("audioprocess",this.onPlayEnd)},clearPlayEnd:function(){this.onPlayEnd&&(this.un("audioprocess",this.onPlayEnd),this.onPlayEnd=null)},getPeaks:function(a){return this.buffer?e.WebAudio.getPeaks.call(this,a):this.peaks||[]},getVolume:function(){return this.media.volume},setVolume:function(a){this.media.volume=a},destroy:function(){this.pause();
|
37 |
-
this.unAll();this.media&&this.media.parentNode&&this.media.parentNode.removeChild(this.media);this.media=null}});e.AudioElement=e.MediaElement;e.Drawer={init:function(a,b){this.container=a;this.params=b;this.width=0;this.height=b.height*this.params.pixelRatio;this.lastPos=0;this.initDrawer(b);this.createWrapper();this.createElements()},createWrapper:function(){this.wrapper=this.container.appendChild(document.createElement("wave"));this.style(this.wrapper,{display:"block",position:"relative",userSelect:"none",
|
38 |
-
webkitUserSelect:"none",height:this.params.height+"px"});(this.params.fillParent||this.params.scrollParent)&&this.style(this.wrapper,{width:"100%",overflowX:this.params.hideScrollbar?"hidden":"auto",overflowY:"hidden"});this.setupWrapperEvents()},handleEvent:function(a){a.preventDefault();var b=this.wrapper.getBoundingClientRect(),c=this.width,d=this.getWidth();!this.params.fillParent&&c<d?(a=(a.clientX-b.left)*this.params.pixelRatio/c||0,1<a&&(a=1)):a=(a.clientX-b.left+this.wrapper.scrollLeft)/this.wrapper.scrollWidth||
|
39 |
-
0;return a},setupWrapperEvents:function(){var a=this;this.wrapper.addEventListener("click",function(b){var c=a.wrapper.offsetHeight-a.wrapper.clientHeight;if(0!=c){var d=a.wrapper.getBoundingClientRect();if(b.clientY>=d.bottom-c)return}a.params.interact&&a.fireEvent("click",b,a.handleEvent(b))});this.wrapper.addEventListener("scroll",function(b){a.fireEvent("scroll",b)})},drawPeaks:function(a,b){this.resetScroll();this.setWidth(b);this.params.barWidth?this.drawBars(a):this.drawWave(a)},style:function(a,
|
40 |
-
b){Object.keys(b).forEach(function(c){a.style[c]!==b[c]&&(a.style[c]=b[c])});return a},resetScroll:function(){null!==this.wrapper&&(this.wrapper.scrollLeft=0)},recenter:function(a){this.recenterOnPosition(this.wrapper.scrollWidth*a,!0)},recenterOnPosition:function(a,b){var c=this.wrapper.scrollLeft,d=~~(this.wrapper.clientWidth/2),e=a-d,f=e-c,g=this.wrapper.scrollWidth-this.wrapper.clientWidth;0!=g&&(!b&&-d<=f&&f<d&&(f=Math.max(-5,Math.min(5,f)),e=c+f),e=Math.max(0,Math.min(g,e)),e!=c&&(this.wrapper.scrollLeft=
|
41 |
-
e))},getWidth:function(){return Math.round(this.container.clientWidth*this.params.pixelRatio)},setWidth:function(a){a!=this.width&&(this.width=a,this.params.fillParent||this.params.scrollParent?this.style(this.wrapper,{width:""}):this.style(this.wrapper,{width:~~(this.width/this.params.pixelRatio)+"px"}),this.updateSize())},setHeight:function(a){a!=this.height&&(this.height=a,this.style(this.wrapper,{height:~~(this.height/this.params.pixelRatio)+"px"}),this.updateSize())},progress:function(a){var b=
|
42 |
-
1/this.params.pixelRatio,c=Math.round(a*this.width)*b;if(c<this.lastPos||c-this.lastPos>=b)this.lastPos=c,this.params.scrollParent&&this.params.autoCenter&&this.recenterOnPosition(~~(this.wrapper.scrollWidth*a)),this.updateProgress(a)},destroy:function(){this.unAll();this.wrapper&&(this.container.removeChild(this.wrapper),this.wrapper=null)},initDrawer:function(){},createElements:function(){},updateSize:function(){},drawWave:function(a,b){},clearWave:function(){},updateProgress:function(a){}};e.util.extend(e.Drawer,
|
43 |
-
e.Observer);e.Drawer.Canvas=Object.create(e.Drawer);e.util.extend(e.Drawer.Canvas,{createElements:function(){this.waveCc=this.wrapper.appendChild(this.style(document.createElement("canvas"),{position:"absolute",zIndex:1,left:0,top:0,bottom:0})).getContext("2d");this.progressWave=this.wrapper.appendChild(this.style(document.createElement("wave"),{position:"absolute",zIndex:2,left:0,top:0,bottom:0,overflow:"hidden",width:"0",display:"none",boxSizing:"border-box",borderRightStyle:"solid",borderRightWidth:this.params.cursorWidth+
|
44 |
-
"px",borderRightColor:this.params.cursorColor}));this.params.waveColor!=this.params.progressColor&&(this.progressCc=this.progressWave.appendChild(document.createElement("canvas")).getContext("2d"))},updateSize:function(){var a=Math.round(this.width/this.params.pixelRatio);this.waveCc.canvas.width=this.width;this.waveCc.canvas.height=this.height;this.style(this.waveCc.canvas,{width:a+"px"});this.style(this.progressWave,{display:"block"});this.progressCc&&(this.progressCc.canvas.width=this.width,this.progressCc.canvas.height=
|
45 |
-
this.height,this.style(this.progressCc.canvas,{width:a+"px"}));this.clearWave()},clearWave:function(){this.waveCc.clearRect(0,0,this.width,this.height);this.progressCc&&this.progressCc.clearRect(0,0,this.width,this.height)},drawBars:function(a,b){if(a[0]instanceof Array){var c=a;if(this.params.splitChannels){this.setHeight(c.length*this.params.height*this.params.pixelRatio);c.forEach(this.drawBars,this);return}a=c[0]}[].some.call(a,function(a){return 0>a})&&(a=[].filter.call(a,function(a,b){return 0==
|
46 |
-
b%2}));var d=.5/this.params.pixelRatio,e=this.width,c=this.params.height*this.params.pixelRatio,f=c*b||0,g=c/2,c=a.length,l=this.params.barWidth*this.params.pixelRatio,k=l+Math.max(this.params.pixelRatio,~~(l/2)),h=1;this.params.normalize&&(h=Math.max.apply(Math,a));var m=c/e;this.waveCc.fillStyle=this.params.waveColor;this.progressCc&&(this.progressCc.fillStyle=this.params.progressColor);[this.waveCc,this.progressCc].forEach(function(b){if(b)for(var c=0;c<e;c+=k){var n=Math.round(a[Math.floor(c*
|
47 |
-
m)]/h*g);b.fillRect(c+d,g-n+f,l+d,2*n)}},this)},drawWave:function(a,b){if(a[0]instanceof Array){var c=a;if(this.params.splitChannels){this.setHeight(c.length*this.params.height*this.params.pixelRatio);c.forEach(this.drawWave,this);return}a=c[0]}if(![].some.call(a,function(a){return 0>a})){for(var c=[],d=0,e=a.length;d<e;d++)c[2*d]=a[d],c[2*d+1]=-a[d];a=c}var f=.5/this.params.pixelRatio,c=this.params.height*this.params.pixelRatio,g=c*b||0,l=c/2,k=~~(a.length/2),h=1;this.params.fillParent&&this.width!=
|
48 |
-
k&&(h=this.width/k);var m=1;this.params.normalize&&(c=Math.max.apply(Math,a),d=Math.min.apply(Math,a),m=-d>c?-d:c);this.waveCc.fillStyle=this.params.waveColor;this.progressCc&&(this.progressCc.fillStyle=this.params.progressColor);[this.waveCc,this.progressCc].forEach(function(b){if(b){b.beginPath();b.moveTo(f,l+g);for(var c=0;c<k;c++){var d=Math.round(a[2*c]/m*l);b.lineTo(c*h+f,l-d+g)}for(c=k-1;0<=c;c--)d=Math.round(a[2*c+1]/m*l),b.lineTo(c*h+f,l-d+g);b.closePath();b.fill();b.fillRect(0,l+g-f,this.width,
|
49 |
-
f)}},this)},updateProgress:function(a){this.style(this.progressWave,{width:Math.round(this.width*a)/this.params.pixelRatio+"px"})}});e.Drawer.MultiCanvas=Object.create(e.Drawer);e.util.extend(e.Drawer.MultiCanvas,{initDrawer:function(a){this.maxCanvasWidth=null!=a.maxCanvasWidth?a.maxCanvasWidth:4E3;this.maxCanvasElementWidth=Math.round(this.maxCanvasWidth/this.params.pixelRatio);if(1>=this.maxCanvasWidth)throw"maxCanvasWidth must be greater than 1.";if(1==this.maxCanvasWidth%2)throw"maxCanvasWidth must be an even number.";
|
50 |
-
this.hasProgressCanvas=this.params.waveColor!=this.params.progressColor;this.halfPixel=.5/this.params.pixelRatio;this.canvases=[]},createElements:function(){this.progressWave=this.wrapper.appendChild(this.style(document.createElement("wave"),{position:"absolute",zIndex:2,left:0,top:0,bottom:0,overflow:"hidden",width:"0",display:"none",boxSizing:"border-box",borderRightStyle:"solid",borderRightWidth:this.params.cursorWidth+"px",borderRightColor:this.params.cursorColor}));this.addCanvas()},updateSize:function(){for(var a=
|
51 |
-
Math.ceil(Math.round(this.width/this.params.pixelRatio)/this.maxCanvasElementWidth);this.canvases.length<a;)this.addCanvas();for(;this.canvases.length>a;)this.removeCanvas();for(var b in this.canvases)a=this.maxCanvasWidth+2*Math.ceil(this.params.pixelRatio/2),b==this.canvases.length-1&&(a=this.width-this.maxCanvasWidth*(this.canvases.length-1)),this.updateDimensions(this.canvases[b],a,this.height),this.clearWaveForEntry(this.canvases[b])},addCanvas:function(){var a={},b=this.maxCanvasElementWidth*
|
52 |
-
this.canvases.length;a.wave=this.wrapper.appendChild(this.style(document.createElement("canvas"),{position:"absolute",zIndex:1,left:b+"px",top:0,bottom:0}));a.waveCtx=a.wave.getContext("2d");this.hasProgressCanvas&&(a.progress=this.progressWave.appendChild(this.style(document.createElement("canvas"),{position:"absolute",left:b+"px",top:0,bottom:0})),a.progressCtx=a.progress.getContext("2d"));this.canvases.push(a)},removeCanvas:function(){var a=this.canvases.pop();a.wave.parentElement.removeChild(a.wave);
|
53 |
-
this.hasProgressCanvas&&a.progress.parentElement.removeChild(a.progress)},updateDimensions:function(a,b,c){var d=Math.round(b/this.params.pixelRatio);a.waveCtx.canvas.width=b;a.waveCtx.canvas.height=c;this.style(a.waveCtx.canvas,{width:d+"px"});this.style(this.progressWave,{display:"block"});this.hasProgressCanvas&&(a.progressCtx.canvas.width=b,a.progressCtx.canvas.height=c,this.style(a.progressCtx.canvas,{width:d+"px"}))},clearWave:function(){for(var a in this.canvases)this.clearWaveForEntry(this.canvases[a])},
|
54 |
-
clearWaveForEntry:function(a){a.waveCtx.clearRect(0,0,a.waveCtx.canvas.width,a.waveCtx.canvas.height);this.hasProgressCanvas&&a.progressCtx.clearRect(0,0,a.progressCtx.canvas.width,a.progressCtx.canvas.height)},drawBars:function(a,b){if(a[0]instanceof Array){var c=a;if(this.params.splitChannels){this.setHeight(c.length*this.params.height*this.params.pixelRatio);c.forEach(this.drawBars,this);return}a=c[0]}[].some.call(a,function(a){return 0>a})&&(a=[].filter.call(a,function(a,b){return 0==b%2}));var c=
|
55 |
-
this.width,d=this.params.height*this.params.pixelRatio,p=d*b||0,d=d/2,f=a.length,g=this.params.barWidth*this.params.pixelRatio,l=g+Math.max(this.params.pixelRatio,~~(g/2)),k=1;this.params.normalize&&(k=e.util.max(a));f/=c;this.canvases[0].waveCtx.fillStyle=this.params.waveColor;this.canvases[0].progressCtx&&(this.canvases[0].progressCtx.fillStyle=this.params.progressColor);for(var h=0;h<c;h+=l){var m=Math.round(a[Math.floor(h*f)]/k*d);this.fillRect(h+this.halfPixel,d-m+p,g+this.halfPixel,2*m)}},drawWave:function(a,
|
56 |
-
b){if(a[0]instanceof Array){var c=a;if(this.params.splitChannels){this.setHeight(c.length*this.params.height*this.params.pixelRatio);c.forEach(this.drawWave,this);return}a=c[0]}if(![].some.call(a,function(a){return 0>a})){for(var c=[],d=0,p=a.length;d<p;d++)c[2*d]=a[d],c[2*d+1]=-a[d];a=c}var d=this.params.height*this.params.pixelRatio,c=d*b||0,d=d/2,p=~~(a.length/this.canvases.length/2),f=1;if(this.params.normalize)var f=e.util.max(a),g=e.util.min(a),f=-g>f?-g:f;this.drawLine(p,a,f,d,c);this.fillRect(0,
|
57 |
-
d+c-this.halfPixel,this.width,this.halfPixel)},drawLine:function(a,b,c,d,e){for(var f in this.canvases){var g=this.canvases[f];this.setFillStyles(g);this.drawLineToContext(g.waveCtx,a,f,b,c,d,e);this.drawLineToContext(g.progressCtx,a,f,b,c,d,e)}},drawLineToContext:function(a,b,c,d,e,f,g){if(a){var l=1;this.params.fillParent&&this.width!=b&&(l=a.canvas.width/b);c*=b;b=c+b+1;a.beginPath();a.moveTo(this.halfPixel,f+g);for(var k=c;k<b;k++){var h=Math.round(d[2*k]/e*f);a.lineTo((k-c)*l+this.halfPixel,
|
58 |
-
f-h+g)}for(k=b-1;k>=c;k--)h=Math.round(d[2*k+1]/e*f),a.lineTo((k-c)*l+this.halfPixel,f-h+g);a.closePath();a.fill()}},fillRect:function(a,b,c,d){for(var e in this.canvases){var f=this.canvases[e],g=e*this.maxCanvasWidth,l=Math.max(a,e*this.maxCanvasWidth),k=b,h=Math.min(a+c,e*this.maxCanvasWidth+f.waveCtx.canvas.width),m=b+d;l<h&&(this.setFillStyles(f),this.fillRectToContext(f.waveCtx,l-g,k,h-l,m-k),this.fillRectToContext(f.progressCtx,l-g,k,h-l,m-k))}},fillRectToContext:function(a,b,c,d,e){a&&a.fillRect(b,
|
59 |
-
c,d,e)},setFillStyles:function(a){a.waveCtx.fillStyle=this.params.waveColor;this.hasProgressCanvas&&(a.progressCtx.fillStyle=this.params.progressColor)},updateProgress:function(a){this.style(this.progressWave,{width:Math.round(this.width*a)/this.params.pixelRatio+"px"})}});(function(){var a=function(){var a=document.querySelectorAll("wavesurfer");Array.prototype.forEach.call(a,function(a){var b=e.util.extend({container:a,backend:"MediaElement",mediaControls:!0},a.dataset);a.style.display="block";
|
60 |
-
b=e.create(b);if(a.dataset.peaks)var p=JSON.parse(a.dataset.peaks);b.load(a.dataset.url,p)})};"complete"===document.readyState?a():window.addEventListener("load",a)})();return e});
|
1 |
+
/*! wavesurfer.js 1.2.8 (Fri, 09 Dec 2016 13:08:12 GMT)
|
2 |
* https://github.com/katspaugh/wavesurfer.js
|
3 |
* @license CC-BY-3.0 */
|
4 |
+
!function(a,b){"function"==typeof define&&define.amd?define("wavesurfer",[],function(){return a.WaveSurfer=b()}):"object"==typeof exports?module.exports=b():a.WaveSurfer=b()}(this,function(){"use strict";var a={defaultParams:{height:128,waveColor:"#999",progressColor:"#555",cursorColor:"#333",cursorWidth:1,skipLength:2,minPxPerSec:20,pixelRatio:window.devicePixelRatio||screen.deviceXDPI/screen.logicalXDPI,fillParent:!0,scrollParent:!1,hideScrollbar:!1,normalize:!1,audioContext:null,container:null,dragSelection:!0,loopSelection:!0,audioRate:1,interact:!0,splitChannels:!1,mediaContainer:null,mediaControls:!1,renderer:"Canvas",backend:"WebAudio",mediaType:"audio",autoCenter:!0},init:function(b){if(this.params=a.util.extend({},this.defaultParams,b),this.container="string"==typeof b.container?document.querySelector(this.params.container):this.params.container,!this.container)throw new Error("Container element not found");if(null==this.params.mediaContainer?this.mediaContainer=this.container:"string"==typeof this.params.mediaContainer?this.mediaContainer=document.querySelector(this.params.mediaContainer):this.mediaContainer=this.params.mediaContainer,!this.mediaContainer)throw new Error("Media Container element not found");this.savedVolume=0,this.isMuted=!1,this.tmpEvents=[],this.currentAjax=null,this.createDrawer(),this.createBackend(),this.isDestroyed=!1},createDrawer:function(){var b=this;this.drawer=Object.create(a.Drawer[this.params.renderer]),this.drawer.init(this.container,this.params),this.drawer.on("redraw",function(){b.drawBuffer(),b.drawer.progress(b.backend.getPlayedPercents())}),this.drawer.on("click",function(a,c){setTimeout(function(){b.seekTo(c)},0)}),this.drawer.on("scroll",function(a){b.fireEvent("scroll",a)})},createBackend:function(){var b=this;this.backend&&this.backend.destroy(),"AudioElement"==this.params.backend&&(this.params.backend="MediaElement"),"WebAudio"!=this.params.backend||a.WebAudio.supportsWebAudio()||(this.params.backend="MediaElement"),this.backend=Object.create(a[this.params.backend]),this.backend.init(this.params),this.backend.on("finish",function(){b.fireEvent("finish")}),this.backend.on("play",function(){b.fireEvent("play")}),this.backend.on("pause",function(){b.fireEvent("pause")}),this.backend.on("audioprocess",function(a){b.drawer.progress(b.backend.getPlayedPercents()),b.fireEvent("audioprocess",a)})},getDuration:function(){return this.backend.getDuration()},getCurrentTime:function(){return this.backend.getCurrentTime()},play:function(a,b){this.fireEvent("interaction",this.play.bind(this,a,b)),this.backend.play(a,b)},pause:function(){this.backend.pause()},playPause:function(){this.backend.isPaused()?this.play():this.pause()},isPlaying:function(){return!this.backend.isPaused()},skipBackward:function(a){this.skip(-a||-this.params.skipLength)},skipForward:function(a){this.skip(a||this.params.skipLength)},skip:function(a){var b=this.getCurrentTime()||0,c=this.getDuration()||1;b=Math.max(0,Math.min(c,b+(a||0))),this.seekAndCenter(b/c)},seekAndCenter:function(a){this.seekTo(a),this.drawer.recenter(a)},seekTo:function(a){this.fireEvent("interaction",this.seekTo.bind(this,a));var b=this.backend.isPaused(),c=this.params.scrollParent;b&&(this.params.scrollParent=!1),this.backend.seekTo(a*this.getDuration()),this.drawer.progress(this.backend.getPlayedPercents()),b||(this.backend.pause(),this.backend.play()),this.params.scrollParent=c,this.fireEvent("seek",a)},stop:function(){this.pause(),this.seekTo(0),this.drawer.progress(0)},setVolume:function(a){this.backend.setVolume(a)},setPlaybackRate:function(a){this.backend.setPlaybackRate(a)},toggleMute:function(){this.setMute(!this.isMuted)},setMute:function(a){a!==this.isMuted&&(a?(this.savedVolume=this.backend.getVolume(),this.backend.setVolume(0),this.isMuted=!0):(this.backend.setVolume(this.savedVolume),this.isMuted=!1))},toggleScroll:function(){this.params.scrollParent=!this.params.scrollParent,this.drawBuffer()},toggleInteraction:function(){this.params.interact=!this.params.interact},drawBuffer:function(){var a=Math.round(this.getDuration()*this.params.minPxPerSec*this.params.pixelRatio),b=this.drawer.getWidth(),c=a;this.params.fillParent&&(!this.params.scrollParent||a<b)&&(c=b);var d=this.backend.getPeaks(c);this.drawer.drawPeaks(d,c),this.fireEvent("redraw",d,c)},zoom:function(a){this.params.minPxPerSec=a,this.params.scrollParent=!0,this.drawBuffer(),this.drawer.progress(this.backend.getPlayedPercents()),this.drawer.recenter(this.getCurrentTime()/this.getDuration()),this.fireEvent("zoom",a)},loadArrayBuffer:function(a){this.decodeArrayBuffer(a,function(a){this.isDestroyed||this.loadDecodedBuffer(a)}.bind(this))},loadDecodedBuffer:function(a){this.backend.load(a),this.drawBuffer(),this.fireEvent("ready")},loadBlob:function(a){var b=this,c=new FileReader;c.addEventListener("progress",function(a){b.onProgress(a)}),c.addEventListener("load",function(a){b.loadArrayBuffer(a.target.result)}),c.addEventListener("error",function(){b.fireEvent("error","Error reading file")}),c.readAsArrayBuffer(a),this.empty()},load:function(a,b,c){switch(this.empty(),this.params.backend){case"WebAudio":return this.loadBuffer(a,b);case"MediaElement":return this.loadMediaElement(a,b,c)}},loadBuffer:function(a,b){var c=function(b){return b&&this.tmpEvents.push(this.once("ready",b)),this.getArrayBuffer(a,this.loadArrayBuffer.bind(this))}.bind(this);return b?(this.backend.setPeaks(b),this.drawBuffer(),this.tmpEvents.push(this.once("interaction",c)),void 0):c()},loadMediaElement:function(a,b,c){var d=a;if("string"==typeof a)this.backend.load(d,this.mediaContainer,b,c);else{var e=a;this.backend.loadElt(e,b),d=e.src}this.tmpEvents.push(this.backend.once("canplay",function(){this.drawBuffer(),this.fireEvent("ready")}.bind(this)),this.backend.once("error",function(a){this.fireEvent("error",a)}.bind(this))),b?this.backend.setPeaks(b):this.backend.supportsWebAudio()&&this.getArrayBuffer(d,function(a){this.decodeArrayBuffer(a,function(a){this.backend.buffer=a,this.drawBuffer(),this.fireEvent("waveform-ready")}.bind(this))}.bind(this))},decodeArrayBuffer:function(a,b){this.arraybuffer=a,this.backend.decodeArrayBuffer(a,function(c){this.isDestroyed||this.arraybuffer!=a||(b(c),this.arraybuffer=null)}.bind(this),this.fireEvent.bind(this,"error","Error decoding audiobuffer"))},getArrayBuffer:function(b,c){var d=this,e=a.util.ajax({url:b,responseType:"arraybuffer"});return this.currentAjax=e,this.tmpEvents.push(e.on("progress",function(a){d.onProgress(a)}),e.on("success",function(a,b){c(a),d.currentAjax=null}),e.on("error",function(a){d.fireEvent("error","XHR error: "+a.target.statusText),d.currentAjax=null})),e},onProgress:function(a){if(a.lengthComputable)var b=a.loaded/a.total;else b=a.loaded/(a.loaded+1e6);this.fireEvent("loading",Math.round(100*b),a.target)},exportPCM:function(a,b,c){a=a||1024,b=b||1e4,c=c||!1;var d=this.backend.getPeaks(a,b),e=[].map.call(d,function(a){return Math.round(a*b)/b}),f=JSON.stringify(e);return c||window.open("data:application/json;charset=utf-8,"+encodeURIComponent(f)),f},exportImage:function(a,b){return a||(a="image/png"),b||(b=1),this.drawer.getImage(a,b)},cancelAjax:function(){this.currentAjax&&(this.currentAjax.xhr.abort(),this.currentAjax=null)},clearTmpEvents:function(){this.tmpEvents.forEach(function(a){a.un()})},empty:function(){this.backend.isPaused()||(this.stop(),this.backend.disconnectSource()),this.cancelAjax(),this.clearTmpEvents(),this.drawer.progress(0),this.drawer.setWidth(0),this.drawer.drawPeaks({length:this.drawer.getWidth()},0)},destroy:function(){this.fireEvent("destroy"),this.cancelAjax(),this.clearTmpEvents(),this.unAll(),this.backend.destroy(),this.drawer.destroy(),this.isDestroyed=!0}};return a.create=function(b){var c=Object.create(a);return c.init(b),c},a.util={extend:function(a){var b=Array.prototype.slice.call(arguments,1);return b.forEach(function(b){Object.keys(b).forEach(function(c){a[c]=b[c]})}),a},min:function(a){var b=+(1/0);for(var c in a)a[c]<b&&(b=a[c]);return b},max:function(a){var b=-(1/0);for(var c in a)a[c]>b&&(b=a[c]);return b},getId:function(){return"wavesurfer_"+Math.random().toString(32).substring(2)},ajax:function(b){var c=Object.create(a.Observer),d=new XMLHttpRequest,e=!1;return d.open(b.method||"GET",b.url,!0),d.responseType=b.responseType||"json",d.addEventListener("progress",function(a){c.fireEvent("progress",a),a.lengthComputable&&a.loaded==a.total&&(e=!0)}),d.addEventListener("load",function(a){e||c.fireEvent("progress",a),c.fireEvent("load",a),200==d.status||206==d.status?c.fireEvent("success",d.response,a):c.fireEvent("error",a)}),d.addEventListener("error",function(a){c.fireEvent("error",a)}),d.send(),c.xhr=d,c}},a.Observer={on:function(a,b){this.handlers||(this.handlers={});var c=this.handlers[a];return c||(c=this.handlers[a]=[]),c.push(b),{name:a,callback:b,un:this.un.bind(this,a,b)}},un:function(a,b){if(this.handlers){var c=this.handlers[a];if(c)if(b)for(var d=c.length-1;d>=0;d--)c[d]==b&&c.splice(d,1);else c.length=0}},unAll:function(){this.handlers=null},once:function(a,b){var c=this,d=function(){b.apply(this,arguments),setTimeout(function(){c.un(a,d)},0)};return this.on(a,d)},fireEvent:function(a){if(this.handlers){var b=this.handlers[a],c=Array.prototype.slice.call(arguments,1);b&&b.forEach(function(a){a.apply(null,c)})}}},a.util.extend(a,a.Observer),a.WebAudio={scriptBufferSize:256,PLAYING_STATE:0,PAUSED_STATE:1,FINISHED_STATE:2,supportsWebAudio:function(){return!(!window.AudioContext&&!window.webkitAudioContext)},getAudioContext:function(){return this.ac||(this.ac=new(window.AudioContext||window.webkitAudioContext)),this.ac},getOfflineAudioContext:function(b){return a.WebAudio.offlineAudioContext||(a.WebAudio.offlineAudioContext=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,2,b)),a.WebAudio.offlineAudioContext},init:function(b){this.params=b,this.ac=b.audioContext||this.getAudioContext(),this.lastPlay=this.ac.currentTime,this.startPosition=0,this.scheduledPause=null,this.states=[Object.create(a.WebAudio.state.playing),Object.create(a.WebAudio.state.paused),Object.create(a.WebAudio.state.finished)],this.createVolumeNode(),this.createScriptNode(),this.createAnalyserNode(),this.setState(this.PAUSED_STATE),this.setPlaybackRate(this.params.audioRate)},disconnectFilters:function(){this.filters&&(this.filters.forEach(function(a){a&&a.disconnect()}),this.filters=null,this.analyser.connect(this.gainNode))},setState:function(a){this.state!==this.states[a]&&(this.state=this.states[a],this.state.init.call(this))},setFilter:function(){this.setFilters([].slice.call(arguments))},setFilters:function(a){this.disconnectFilters(),a&&a.length&&(this.filters=a,this.analyser.disconnect(),a.reduce(function(a,b){return a.connect(b),b},this.analyser).connect(this.gainNode))},createScriptNode:function(){this.ac.createScriptProcessor?this.scriptNode=this.ac.createScriptProcessor(this.scriptBufferSize):this.scriptNode=this.ac.createJavaScriptNode(this.scriptBufferSize),this.scriptNode.connect(this.ac.destination)},addOnAudioProcess:function(){var a=this;this.scriptNode.onaudioprocess=function(){var b=a.getCurrentTime();b>=a.getDuration()?(a.setState(a.FINISHED_STATE),a.fireEvent("pause")):b>=a.scheduledPause?a.pause():a.state===a.states[a.PLAYING_STATE]&&a.fireEvent("audioprocess",b)}},removeOnAudioProcess:function(){this.scriptNode.onaudioprocess=null},createAnalyserNode:function(){this.analyser=this.ac.createAnalyser(),this.analyser.connect(this.gainNode)},createVolumeNode:function(){this.ac.createGain?this.gainNode=this.ac.createGain():this.gainNode=this.ac.createGainNode(),this.gainNode.connect(this.ac.destination)},setVolume:function(a){this.gainNode.gain.value=a},getVolume:function(){return this.gainNode.gain.value},decodeArrayBuffer:function(a,b,c){this.offlineAc||(this.offlineAc=this.getOfflineAudioContext(this.ac?this.ac.sampleRate:44100)),this.offlineAc.decodeAudioData(a,function(a){b(a)}.bind(this),c)},setPeaks:function(a){this.peaks=a},getPeaks:function(a){if(this.peaks)return this.peaks;for(var b=this.buffer.length/a,c=~~(b/10)||1,d=this.buffer.numberOfChannels,e=[],f=[],g=0;g<d;g++)for(var h=e[g]=[],i=this.buffer.getChannelData(g),j=0;j<a;j++){for(var k=~~(j*b),l=~~(k+b),m=0,n=0,o=k;o<l;o+=c){var p=i[o];p>n&&(n=p),p<m&&(m=p)}h[2*j]=n,h[2*j+1]=m,(0==g||n>f[2*j])&&(f[2*j]=n),(0==g||m<f[2*j+1])&&(f[2*j+1]=m)}return this.params.splitChannels?e:f},getPlayedPercents:function(){return this.state.getPlayedPercents.call(this)},disconnectSource:function(){this.source&&this.source.disconnect()},destroy:function(){this.isPaused()||this.pause(),this.unAll(),this.buffer=null,this.disconnectFilters(),this.disconnectSource(),this.gainNode.disconnect(),this.scriptNode.disconnect(),this.analyser.disconnect(),this.params.audioContext||this.ac.close()},load:function(a){this.startPosition=0,this.lastPlay=this.ac.currentTime,this.buffer=a,this.createSource()},createSource:function(){this.disconnectSource(),this.source=this.ac.createBufferSource(),this.source.start=this.source.start||this.source.noteGrainOn,this.source.stop=this.source.stop||this.source.noteOff,this.source.playbackRate.value=this.playbackRate,this.source.buffer=this.buffer,this.source.connect(this.analyser)},isPaused:function(){return this.state!==this.states[this.PLAYING_STATE]},getDuration:function(){return this.buffer?this.buffer.duration:0},seekTo:function(a,b){if(this.buffer)return this.scheduledPause=null,null==a&&(a=this.getCurrentTime(),a>=this.getDuration()&&(a=0)),null==b&&(b=this.getDuration()),this.startPosition=a,this.lastPlay=this.ac.currentTime,this.state===this.states[this.FINISHED_STATE]&&this.setState(this.PAUSED_STATE),{start:a,end:b}},getPlayedTime:function(){return(this.ac.currentTime-this.lastPlay)*this.playbackRate},play:function(a,b){if(this.buffer){this.createSource();var c=this.seekTo(a,b);a=c.start,b=c.end,this.scheduledPause=b,this.source.start(0,a,b-a),"suspended"==this.ac.state&&this.ac.resume&&this.ac.resume(),this.setState(this.PLAYING_STATE),this.fireEvent("play")}},pause:function(){this.scheduledPause=null,this.startPosition+=this.getPlayedTime(),this.source&&this.source.stop(0),this.setState(this.PAUSED_STATE),this.fireEvent("pause")},getCurrentTime:function(){return this.state.getCurrentTime.call(this)},setPlaybackRate:function(a){a=a||1,this.isPaused()?this.playbackRate=a:(this.pause(),this.playbackRate=a,this.play())}},a.WebAudio.state={},a.WebAudio.state.playing={init:function(){this.addOnAudioProcess()},getPlayedPercents:function(){var a=this.getDuration();return this.getCurrentTime()/a||0},getCurrentTime:function(){return this.startPosition+this.getPlayedTime()}},a.WebAudio.state.paused={init:function(){this.removeOnAudioProcess()},getPlayedPercents:function(){var a=this.getDuration();return this.getCurrentTime()/a||0},getCurrentTime:function(){return this.startPosition}},a.WebAudio.state.finished={init:function(){this.removeOnAudioProcess(),this.fireEvent("finish")},getPlayedPercents:function(){return 1},getCurrentTime:function(){return this.getDuration()}},a.util.extend(a.WebAudio,a.Observer),a.MediaElement=Object.create(a.WebAudio),a.util.extend(a.MediaElement,{init:function(a){this.params=a,this.media={currentTime:0,duration:0,paused:!0,playbackRate:1,play:function(){},pause:function(){}},this.mediaType=a.mediaType.toLowerCase(),this.elementPosition=a.elementPosition,this.setPlaybackRate(this.params.audioRate),this.createTimer()},createTimer:function(){var a=this,b=function(){if(!a.isPaused()){a.fireEvent("audioprocess",a.getCurrentTime());var c=window.requestAnimationFrame||window.webkitRequestAnimationFrame;c(b)}};this.on("play",b)},load:function(a,b,c,d){var e=document.createElement(this.mediaType);e.controls=this.params.mediaControls,e.autoplay=this.params.autoplay||!1,e.preload=null==d?"auto":d,e.src=a,e.style.width="100%";var f=b.querySelector(this.mediaType);f&&b.removeChild(f),b.appendChild(e),this._load(e,c)},loadElt:function(a,b){var c=a;c.controls=this.params.mediaControls,c.autoplay=this.params.autoplay||!1,this._load(c,b)},_load:function(a,b){var c=this;"function"==typeof a.load&&a.load(),a.addEventListener("error",function(){c.fireEvent("error","Error loading media element")}),a.addEventListener("canplay",function(){c.fireEvent("canplay")}),a.addEventListener("ended",function(){c.fireEvent("finish")}),this.media=a,this.peaks=b,this.onPlayEnd=null,this.buffer=null,this.setPlaybackRate(this.playbackRate)},isPaused:function(){return!this.media||this.media.paused},getDuration:function(){var a=this.media.duration;return a>=1/0&&(a=this.media.seekable.end(0)),a},getCurrentTime:function(){return this.media&&this.media.currentTime},getPlayedPercents:function(){return this.getCurrentTime()/this.getDuration()||0},setPlaybackRate:function(a){this.playbackRate=a||1,this.media.playbackRate=this.playbackRate},seekTo:function(a){null!=a&&(this.media.currentTime=a),this.clearPlayEnd()},play:function(a,b){this.seekTo(a),this.media.play(),b&&this.setPlayEnd(b),this.fireEvent("play")},pause:function(){this.media&&this.media.pause(),this.clearPlayEnd(),this.fireEvent("pause")},setPlayEnd:function(a){var b=this;this.onPlayEnd=function(c){c>=a&&(b.pause(),b.seekTo(a))},this.on("audioprocess",this.onPlayEnd)},clearPlayEnd:function(){this.onPlayEnd&&(this.un("audioprocess",this.onPlayEnd),this.onPlayEnd=null)},getPeaks:function(b){return this.buffer?a.WebAudio.getPeaks.call(this,b):this.peaks||[]},getVolume:function(){return this.media.volume},setVolume:function(a){this.media.volume=a},destroy:function(){this.pause(),this.unAll(),this.media&&this.media.parentNode&&this.media.parentNode.removeChild(this.media),this.media=null}}),a.AudioElement=a.MediaElement,a.Drawer={init:function(a,b){this.container=a,this.params=b,this.width=0,this.height=b.height*this.params.pixelRatio,this.lastPos=0,this.initDrawer(b),this.createWrapper(),this.createElements()},createWrapper:function(){this.wrapper=this.container.appendChild(document.createElement("wave")),this.style(this.wrapper,{display:"block",position:"relative",userSelect:"none",webkitUserSelect:"none",height:this.params.height+"px"}),(this.params.fillParent||this.params.scrollParent)&&this.style(this.wrapper,{width:"100%",overflowX:this.params.hideScrollbar?"hidden":"auto",overflowY:"hidden"}),this.setupWrapperEvents()},handleEvent:function(a,b){!b&&a.preventDefault();var c,d=a.targetTouches?a.targetTouches[0].clientX:a.clientX,e=this.wrapper.getBoundingClientRect(),f=this.width,g=this.getWidth();return!this.params.fillParent&&f<g?(c=(d-e.left)*this.params.pixelRatio/f||0,c>1&&(c=1)):c=(d-e.left+this.wrapper.scrollLeft)/this.wrapper.scrollWidth||0,c},setupWrapperEvents:function(){var a=this;this.wrapper.addEventListener("click",function(b){var c=a.wrapper.offsetHeight-a.wrapper.clientHeight;if(0!=c){var d=a.wrapper.getBoundingClientRect();if(b.clientY>=d.bottom-c)return}a.params.interact&&a.fireEvent("click",b,a.handleEvent(b))}),this.wrapper.addEventListener("scroll",function(b){a.fireEvent("scroll",b)})},drawPeaks:function(a,b){this.resetScroll(),this.setWidth(b),this.params.barWidth?this.drawBars(a):this.drawWave(a)},style:function(a,b){return Object.keys(b).forEach(function(c){a.style[c]!==b[c]&&(a.style[c]=b[c])}),a},resetScroll:function(){null!==this.wrapper&&(this.wrapper.scrollLeft=0)},recenter:function(a){var b=this.wrapper.scrollWidth*a;this.recenterOnPosition(b,!0)},recenterOnPosition:function(a,b){var c=this.wrapper.scrollLeft,d=~~(this.wrapper.clientWidth/2),e=a-d,f=e-c,g=this.wrapper.scrollWidth-this.wrapper.clientWidth;if(0!=g){if(!b&&-d<=f&&f<d){var h=5;f=Math.max(-h,Math.min(h,f)),e=c+f}e=Math.max(0,Math.min(g,e)),e!=c&&(this.wrapper.scrollLeft=e)}},getWidth:function(){return Math.round(this.container.clientWidth*this.params.pixelRatio)},setWidth:function(a){this.width=a,this.params.fillParent||this.params.scrollParent?this.style(this.wrapper,{width:""}):this.style(this.wrapper,{width:~~(this.width/this.params.pixelRatio)+"px"}),this.updateSize()},setHeight:function(a){a!=this.height&&(this.height=a,this.style(this.wrapper,{height:~~(this.height/this.params.pixelRatio)+"px"}),this.updateSize())},progress:function(a){var b=1/this.params.pixelRatio,c=Math.round(a*this.width)*b;if(c<this.lastPos||c-this.lastPos>=b){if(this.lastPos=c,this.params.scrollParent&&this.params.autoCenter){var d=~~(this.wrapper.scrollWidth*a);this.recenterOnPosition(d)}this.updateProgress(a)}},destroy:function(){this.unAll(),this.wrapper&&(this.container.removeChild(this.wrapper),this.wrapper=null)},initDrawer:function(){},createElements:function(){},updateSize:function(){},drawWave:function(a,b){},clearWave:function(){},updateProgress:function(a){}},a.util.extend(a.Drawer,a.Observer),a.Drawer.Canvas=Object.create(a.Drawer),a.util.extend(a.Drawer.Canvas,{createElements:function(){var a=this.wrapper.appendChild(this.style(document.createElement("canvas"),{position:"absolute",zIndex:1,left:0,top:0,bottom:0}));if(this.waveCc=a.getContext("2d"),this.progressWave=this.wrapper.appendChild(this.style(document.createElement("wave"),{position:"absolute",zIndex:2,left:0,top:0,bottom:0,overflow:"hidden",width:"0",display:"none",boxSizing:"border-box",borderRightStyle:"solid",borderRightWidth:this.params.cursorWidth+"px",borderRightColor:this.params.cursorColor})),this.params.waveColor!=this.params.progressColor){var b=this.progressWave.appendChild(document.createElement("canvas"));this.progressCc=b.getContext("2d")}},updateSize:function(){var a=Math.round(this.width/this.params.pixelRatio);this.waveCc.canvas.width=this.width,this.waveCc.canvas.height=this.height,this.style(this.waveCc.canvas,{width:a+"px"}),this.style(this.progressWave,{display:"block"}),this.progressCc&&(this.progressCc.canvas.width=this.width,this.progressCc.canvas.height=this.height,this.style(this.progressCc.canvas,{width:a+"px"})),this.clearWave()},clearWave:function(){this.waveCc.clearRect(0,0,this.width,this.height),this.progressCc&&this.progressCc.clearRect(0,0,this.width,this.height)},drawBars:function(b,c){if(b[0]instanceof Array){var d=b;if(this.params.splitChannels)return this.setHeight(d.length*this.params.height*this.params.pixelRatio),void d.forEach(this.drawBars,this);b=d[0]}var e=[].some.call(b,function(a){return a<0});e&&(b=[].filter.call(b,function(a,b){return b%2==0}));var f=.5/this.params.pixelRatio,g=this.width,h=this.params.height*this.params.pixelRatio,i=h*c||0,j=h/2,k=b.length,l=this.params.barWidth*this.params.pixelRatio,m=Math.max(this.params.pixelRatio,~~(l/2)),n=l+m,o=1;this.params.normalize&&(o=a.util.max(b));var p=k/g;this.waveCc.fillStyle=this.params.waveColor,this.progressCc&&(this.progressCc.fillStyle=this.params.progressColor),[this.waveCc,this.progressCc].forEach(function(a){if(a)for(var c=0;c<g;c+=n){var d=Math.round(b[Math.floor(c*p)]/o*j);a.fillRect(c+f,j-d+i,l+f,2*d)}},this)},drawWave:function(b,c){if(b[0]instanceof Array){var d=b;if(this.params.splitChannels)return this.setHeight(d.length*this.params.height*this.params.pixelRatio),void d.forEach(this.drawWave,this);b=d[0]}var e=[].some.call(b,function(a){return a<0});if(!e){for(var f=[],g=0,h=b.length;g<h;g++)f[2*g]=b[g],f[2*g+1]=-b[g];b=f}var i=.5/this.params.pixelRatio,j=this.params.height*this.params.pixelRatio,k=j*c||0,l=j/2,m=~~(b.length/2),n=1;this.params.fillParent&&this.width!=m&&(n=this.width/m);var o=1;if(this.params.normalize){var p=a.util.max(b),q=a.util.min(b);o=-q>p?-q:p}this.waveCc.fillStyle=this.params.waveColor,this.progressCc&&(this.progressCc.fillStyle=this.params.progressColor),[this.waveCc,this.progressCc].forEach(function(a){if(a){a.beginPath(),a.moveTo(i,l+k);for(var c=0;c<m;c++){var d=Math.round(b[2*c]/o*l);a.lineTo(c*n+i,l-d+k)}for(var c=m-1;c>=0;c--){var d=Math.round(b[2*c+1]/o*l);a.lineTo(c*n+i,l-d+k)}a.closePath(),a.fill(),a.fillRect(0,l+k-i,this.width,i)}},this)},updateProgress:function(a){var b=Math.round(this.width*a)/this.params.pixelRatio;this.style(this.progressWave,{width:b+"px"})},getImage:function(a,b){return this.waveCc.canvas.toDataURL(a,b)}}),a.Drawer.MultiCanvas=Object.create(a.Drawer),a.util.extend(a.Drawer.MultiCanvas,{initDrawer:function(a){if(this.maxCanvasWidth=null!=a.maxCanvasWidth?a.maxCanvasWidth:4e3,this.maxCanvasElementWidth=Math.round(this.maxCanvasWidth/this.params.pixelRatio),this.maxCanvasWidth<=1)throw"maxCanvasWidth must be greater than 1.";if(this.maxCanvasWidth%2==1)throw"maxCanvasWidth must be an even number.";this.hasProgressCanvas=this.params.waveColor!=this.params.progressColor,this.halfPixel=.5/this.params.pixelRatio,this.canvases=[]},createElements:function(){this.progressWave=this.wrapper.appendChild(this.style(document.createElement("wave"),{position:"absolute",zIndex:2,left:0,top:0,bottom:0,overflow:"hidden",width:"0",display:"none",boxSizing:"border-box",borderRightStyle:"solid",borderRightWidth:this.params.cursorWidth+"px",borderRightColor:this.params.cursorColor})),this.addCanvas()},updateSize:function(){for(var a=Math.round(this.width/this.params.pixelRatio),b=Math.ceil(a/this.maxCanvasElementWidth);this.canvases.length<b;)this.addCanvas();for(;this.canvases.length>b;)this.removeCanvas();for(var c in this.canvases){var d=this.maxCanvasWidth+2*Math.ceil(this.params.pixelRatio/2);c==this.canvases.length-1&&(d=this.width-this.maxCanvasWidth*(this.canvases.length-1)),this.updateDimensions(this.canvases[c],d,this.height),this.clearWaveForEntry(this.canvases[c])}},addCanvas:function(){var a={},b=this.maxCanvasElementWidth*this.canvases.length;a.wave=this.wrapper.appendChild(this.style(document.createElement("canvas"),{position:"absolute",zIndex:1,left:b+"px",top:0,bottom:0})),a.waveCtx=a.wave.getContext("2d"),this.hasProgressCanvas&&(a.progress=this.progressWave.appendChild(this.style(document.createElement("canvas"),{position:"absolute",left:b+"px",top:0,bottom:0})),a.progressCtx=a.progress.getContext("2d")),this.canvases.push(a)},removeCanvas:function(){var a=this.canvases.pop();a.wave.parentElement.removeChild(a.wave),this.hasProgressCanvas&&a.progress.parentElement.removeChild(a.progress)},updateDimensions:function(a,b,c){var d=Math.round(b/this.params.pixelRatio),e=Math.round(this.width/this.params.pixelRatio);a.start=a.waveCtx.canvas.offsetLeft/e||0,a.end=a.start+d/e,a.waveCtx.canvas.width=b,a.waveCtx.canvas.height=c,this.style(a.waveCtx.canvas,{width:d+"px"}),this.style(this.progressWave,{display:"block"}),this.hasProgressCanvas&&(a.progressCtx.canvas.width=b,a.progressCtx.canvas.height=c,this.style(a.progressCtx.canvas,{width:d+"px"}))},clearWave:function(){for(var a in this.canvases)this.clearWaveForEntry(this.canvases[a])},clearWaveForEntry:function(a){a.waveCtx.clearRect(0,0,a.waveCtx.canvas.width,a.waveCtx.canvas.height),this.hasProgressCanvas&&a.progressCtx.clearRect(0,0,a.progressCtx.canvas.width,a.progressCtx.canvas.height)},drawBars:function(b,c){if(b[0]instanceof Array){var d=b;if(this.params.splitChannels)return this.setHeight(d.length*this.params.height*this.params.pixelRatio),void d.forEach(this.drawBars,this);b=d[0]}var e=[].some.call(b,function(a){return a<0});e&&(b=[].filter.call(b,function(a,b){return b%2==0}));var f=this.width,g=this.params.height*this.params.pixelRatio,h=g*c||0,i=g/2,j=b.length,k=this.params.barWidth*this.params.pixelRatio,l=Math.max(this.params.pixelRatio,~~(k/2)),m=k+l,n=1;this.params.normalize&&(n=a.util.max(b));for(var o=j/f,p=0;p<f;p+=m){var q=Math.round(b[Math.floor(p*o)]/n*i);this.fillRect(p+this.halfPixel,i-q+h,k+this.halfPixel,2*q)}},drawWave:function(b,c){if(b[0]instanceof Array){var d=b;if(this.params.splitChannels)return this.setHeight(d.length*this.params.height*this.params.pixelRatio),void d.forEach(this.drawWave,this);b=d[0]}var e=[].some.call(b,function(a){return a<0});if(!e){for(var f=[],g=0,h=b.length;g<h;g++)f[2*g]=b[g],f[2*g+1]=-b[g];b=f}var i=this.params.height*this.params.pixelRatio,j=i*c||0,k=i/2,l=1;if(this.params.normalize){var m=a.util.max(b),n=a.util.min(b);l=-n>m?-n:m}this.drawLine(b,l,k,j),this.fillRect(0,k+j-this.halfPixel,this.width,this.halfPixel)},drawLine:function(a,b,c,d){for(var e in this.canvases){var f=this.canvases[e];this.setFillStyles(f),this.drawLineToContext(f,f.waveCtx,a,b,c,d),this.drawLineToContext(f,f.progressCtx,a,b,c,d)}},drawLineToContext:function(a,b,c,d,e,f){if(b){var g=c.length/2,h=1;this.params.fillParent&&this.width!=g&&(h=this.width/g);var i=Math.round(g*a.start),j=Math.round(g*a.end);b.beginPath(),b.moveTo(this.halfPixel,e+f);for(var k=i;k<j;k++){var l=Math.round(c[2*k]/d*e);b.lineTo((k-i)*h+this.halfPixel,e-l+f)}for(var k=j-1;k>=i;k--){var l=Math.round(c[2*k+1]/d*e);b.lineTo((k-i)*h+this.halfPixel,e-l+f)}b.closePath(),b.fill()}},fillRect:function(a,b,c,d){for(var e in this.canvases){var f=this.canvases[e],g=e*this.maxCanvasWidth,h={x1:Math.max(a,e*this.maxCanvasWidth),y1:b,x2:Math.min(a+c,e*this.maxCanvasWidth+f.waveCtx.canvas.width),y2:b+d};h.x1<h.x2&&(this.setFillStyles(f),this.fillRectToContext(f.waveCtx,h.x1-g,h.y1,h.x2-h.x1,h.y2-h.y1),this.fillRectToContext(f.progressCtx,h.x1-g,h.y1,h.x2-h.x1,h.y2-h.y1))}},fillRectToContext:function(a,b,c,d,e){a&&a.fillRect(b,c,d,e)},setFillStyles:function(a){a.waveCtx.fillStyle=this.params.waveColor,this.hasProgressCanvas&&(a.progressCtx.fillStyle=this.params.progressColor)},updateProgress:function(a){var b=Math.round(this.width*a)/this.params.pixelRatio;this.style(this.progressWave,{width:b+"px"})}}),function(){var b=function(){var b=document.querySelectorAll("wavesurfer");Array.prototype.forEach.call(b,function(b){var c=a.util.extend({container:b,backend:"MediaElement",mediaControls:!0},b.dataset);b.style.display="block";var d=a.create(c);if(b.dataset.peaks)var e=JSON.parse(b.dataset.peaks);d.load(b.dataset.url,e)})};"complete"===document.readyState?b():window.addEventListener("load",b)}(),a});
|
5 |
+
//# sourceMappingURL=wavesurfer.min.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/wavesurfer/wavesurfer.min.js.map
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"version":3,"sources":["wavesurfer.js"],"names":["root","factory","define","amd","exports","module","this","WaveSurfer","defaultParams","height","waveColor","progressColor","cursorColor","cursorWidth","skipLength","minPxPerSec","pixelRatio","window","devicePixelRatio","screen","deviceXDPI","logicalXDPI","fillParent","scrollParent","hideScrollbar","normalize","audioContext","container","dragSelection","loopSelection","audioRate","interact","splitChannels","mediaContainer","mediaControls","renderer","backend","mediaType","autoCenter","init","params","util","extend","document","querySelector","Error","savedVolume","isMuted","tmpEvents","currentAjax","createDrawer","createBackend","isDestroyed","my","drawer","Object","create","Drawer","on","drawBuffer","progress","getPlayedPercents","e","setTimeout","seekTo","fireEvent","destroy","WebAudio","supportsWebAudio","time","getDuration","getCurrentTime","play","start","end","bind","pause","playPause","isPaused","isPlaying","skipBackward","seconds","skip","skipForward","offset","position","duration","Math","max","min","seekAndCenter","recenter","paused","oldScrollParent","stop","setVolume","newVolume","setPlaybackRate","rate","toggleMute","setMute","mute","getVolume","toggleScroll","toggleInteraction","nominalWidth","round","parentWidth","getWidth","width","peaks","getPeaks","drawPeaks","zoom","pxPerSec","loadArrayBuffer","arraybuffer","decodeArrayBuffer","data","loadDecodedBuffer","buffer","load","loadBlob","blob","reader","FileReader","addEventListener","onProgress","target","result","readAsArrayBuffer","empty","url","preload","loadBuffer","loadMediaElement","action","push","once","getArrayBuffer","setPeaks","urlOrElt","elt","loadElt","src","err","callback","ajax","responseType","statusText","lengthComputable","percentComplete","loaded","total","exportPCM","length","accuracy","noWindow","arr","map","call","val","json","JSON","stringify","open","encodeURIComponent","exportImage","format","quality","getImage","cancelAjax","xhr","abort","clearTmpEvents","forEach","un","disconnectSource","setWidth","unAll","wavesurfer","dest","sources","Array","prototype","slice","arguments","source","keys","key","values","Infinity","i","getId","random","toString","substring","options","Observer","XMLHttpRequest","fired100","method","status","response","send","event","fn","handlers","name","splice","handler","apply","args","scriptBufferSize","PLAYING_STATE","PAUSED_STATE","FINISHED_STATE","AudioContext","webkitAudioContext","getAudioContext","ac","getOfflineAudioContext","sampleRate","offlineAudioContext","OfflineAudioContext","webkitOfflineAudioContext","lastPlay","currentTime","startPosition","scheduledPause","states","state","playing","finished","createVolumeNode","createScriptNode","createAnalyserNode","setState","disconnectFilters","filters","filter","disconnect","analyser","connect","gainNode","setFilter","setFilters","reduce","prev","curr","createScriptProcessor","scriptNode","createJavaScriptNode","destination","addOnAudioProcess","onaudioprocess","removeOnAudioProcess","createAnalyser","createGain","createGainNode","newGain","gain","value","errback","offlineAc","decodeAudioData","sampleSize","sampleStep","channels","numberOfChannels","splitPeaks","mergedPeaks","c","chan","getChannelData","j","close","createSource","createBufferSource","noteGrainOn","noteOff","playbackRate","getPlayedTime","adjustedTime","resume","MediaElement","media","toLowerCase","elementPosition","createTimer","onAudioProcess","requestAnimationFrame","webkitRequestAnimationFrame","createElement","controls","autoplay","style","prevMedia","removeChild","appendChild","_load","onPlayEnd","seekable","clearPlayEnd","setPlayEnd","volume","parentNode","AudioElement","lastPos","initDrawer","createWrapper","createElements","wrapper","display","userSelect","webkitUserSelect","overflowX","overflowY","setupWrapperEvents","handleEvent","noPrevent","preventDefault","clientX","targetTouches","bbox","getBoundingClientRect","left","scrollLeft","scrollWidth","scrollbarHeight","offsetHeight","clientHeight","clientY","bottom","resetScroll","barWidth","drawBars","drawWave","el","styles","prop","percent","recenterOnPosition","immediate","half","clientWidth","maxScroll","updateSize","setHeight","minPxDelta","pos","newPos","updateProgress","clearWave","Canvas","waveCanvas","zIndex","top","waveCc","getContext","progressWave","overflow","boxSizing","borderRightStyle","borderRightWidth","borderRightColor","progressCanvas","progressCc","canvas","clearRect","channelIndex","hasMinVals","some","_","index","$","offsetY","halfH","bar","gap","step","absmax","scale","fillStyle","cc","h","floor","fillRect","hasMinValues","reflectedPeaks","len","beginPath","moveTo","lineTo","closePath","fill","type","toDataURL","MultiCanvas","maxCanvasWidth","maxCanvasElementWidth","hasProgressCanvas","halfPixel","canvases","addCanvas","totalWidth","requiredCanvases","ceil","removeCanvas","canvasWidth","updateDimensions","clearWaveForEntry","entry","leftOffset","wave","waveCtx","progressCtx","lastEntry","pop","parentElement","elementWidth","offsetLeft","drawLine","setFillStyles","drawLineToContext","ctx","first","last","x","y","intersection","x1","y1","x2","y2","fillRectToContext","containers","querySelectorAll","dataset","parse","readyState"],"mappings":";;;CAAC,SAAUA,EAAMC,GACO,kBAAXC,SAAyBA,OAAOC,IAEzCD,OAAO,gBAAkB,WACvB,MAAQF,GAAiB,WAAIC,MAEH,gBAAZG,SAIhBC,OAAOD,QAAUH,IAEjBD,EAAiB,WAAIC,KAEvBK,KAAM,WAER,YAEA,IAAIC,IACAC,eACIC,OAAgB,IAChBC,UAAgB,OAChBC,cAAgB,OAChBC,YAAgB,OAChBC,YAAgB,EAChBC,WAAgB,EAChBC,YAAgB,GAChBC,WAAgBC,OAAOC,kBAAoBC,OAAOC,WAAaD,OAAOE,YACtEC,YAAgB,EAChBC,cAAgB,EAChBC,eAAgB,EAChBC,WAAgB,EAChBC,aAAgB,KAChBC,UAAgB,KAChBC,eAAgB,EAChBC,eAAgB,EAChBC,UAAgB,EAChBC,UAAgB,EAChBC,eAAgB,EAChBC,eAAgB,KAChBC,eAAgB,EAChBC,SAAgB,SAChBC,QAAgB,WAChBC,UAAgB,QAChBC,YAAgB,GAGpBC,KAAM,SAAUC,GAQZ,GANAlC,KAAKkC,OAASjC,EAAWkC,KAAKC,UAAWpC,KAAKE,cAAegC,GAE7DlC,KAAKqB,UAAY,gBAAmBa,GAAOb,UACvCgB,SAASC,cAActC,KAAKkC,OAAOb,WACnCrB,KAAKkC,OAAOb,WAEXrB,KAAKqB,UACN,KAAM,IAAIkB,OAAM,8BAWpB,IARkC,MAA9BvC,KAAKkC,OAAOP,eACZ3B,KAAK2B,eAAiB3B,KAAKqB,UACiB,gBAA9BrB,MAAKkC,OAAOP,eAC1B3B,KAAK2B,eAAiBU,SAASC,cAActC,KAAKkC,OA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rG,EAAGoG,QAAQxU,MAGtCsE,GAAW3D,KAAKyN,EAAGoG,QAAQlT,IAAKtB,KAIZ,cAAxBnE,SAAS6Y,WACTjZ,IAEAtB,OAAO6G,iBAAiB,OAAQvF,MAIjChC","file":"wavesurfer.min.js","sourceRoot":"/"}
|
config/setup.php
CHANGED
@@ -20,7 +20,7 @@ function gmedia_default_options(){
|
|
20 |
$gm['site_description'] = '';
|
21 |
$gm['mobile_app'] = 0;
|
22 |
|
23 |
-
$gm['modules_update']
|
24 |
|
25 |
$gm['gmedia_post_slug'] = 'gmedia';
|
26 |
$gm['gmedia_exclude_from_search'] = '0';
|
@@ -34,10 +34,19 @@ function gmedia_default_options(){
|
|
34 |
$gm['gmedia_gallery_post_slug'] = 'gmedia-gallery';
|
35 |
$gm['gmedia_gallery_has_archive'] = '0';
|
36 |
$gm['gmedia_gallery_exclude_from_search'] = '0';
|
37 |
-
$gm['preview_bgcolor'] = 'ffffff';
|
38 |
|
39 |
-
$gm['
|
|
|
40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
$gm['uninstall_dropdata'] = 'none'; // can be 'all', 'none', 'db'
|
42 |
|
43 |
$gm['name2title_capitalize'] = '1';
|
@@ -52,7 +61,7 @@ function gmedia_default_options(){
|
|
52 |
|
53 |
$gm['isolation_mode'] = '1';
|
54 |
$gm['shortcode_raw'] = '0';
|
55 |
-
$gm['debug_mode'] =
|
56 |
|
57 |
$gm['endpoint'] = 'gmedia';
|
58 |
$gm['gmediacloud_socialbuttons'] = '1';
|
@@ -73,7 +82,8 @@ function gmedia_default_options(){
|
|
73 |
$gm['thumb'] = array('width' => 300, 'height' => 300, 'quality' => 80, 'crop' => 0);
|
74 |
$gm['image'] = array('width' => 2200, 'height' => 2200, 'quality' => 85, 'crop' => 0);
|
75 |
|
76 |
-
|
|
|
77 |
$gm['license_name'] = '';
|
78 |
$gm['purchase_key'] = '';
|
79 |
$gm['license_key'] = '';
|
20 |
$gm['site_description'] = '';
|
21 |
$gm['mobile_app'] = 0;
|
22 |
|
23 |
+
$gm['modules_update'] = 0;
|
24 |
|
25 |
$gm['gmedia_post_slug'] = 'gmedia';
|
26 |
$gm['gmedia_exclude_from_search'] = '0';
|
34 |
$gm['gmedia_gallery_post_slug'] = 'gmedia-gallery';
|
35 |
$gm['gmedia_gallery_has_archive'] = '0';
|
36 |
$gm['gmedia_gallery_exclude_from_search'] = '0';
|
|
|
37 |
|
38 |
+
$gm['wp_term_related_gmedia'] = '1';
|
39 |
+
$gm['wp_post_related_gmedia'] = '0';
|
40 |
|
41 |
+
$gm['wp_author_related_gmedia'] = '0';
|
42 |
+
$gm['wp_author_related_gmedia_album'] = '1';
|
43 |
+
$gm['wp_author_related_gmedia_gallery'] = '0';
|
44 |
+
|
45 |
+
$gm['preview_bgcolor'] = 'ffffff';
|
46 |
+
|
47 |
+
//$gm['default_gmedia_term_comment_status'] = 'closed'; // can be 'closed', 'open'
|
48 |
+
|
49 |
+
$gm['delete_originals'] = '0';
|
50 |
$gm['uninstall_dropdata'] = 'none'; // can be 'all', 'none', 'db'
|
51 |
|
52 |
$gm['name2title_capitalize'] = '1';
|
61 |
|
62 |
$gm['isolation_mode'] = '1';
|
63 |
$gm['shortcode_raw'] = '0';
|
64 |
+
$gm['debug_mode'] = '';
|
65 |
|
66 |
$gm['endpoint'] = 'gmedia';
|
67 |
$gm['gmediacloud_socialbuttons'] = '1';
|
82 |
$gm['thumb'] = array('width' => 300, 'height' => 300, 'quality' => 80, 'crop' => 0);
|
83 |
$gm['image'] = array('width' => 2200, 'height' => 2200, 'quality' => 85, 'crop' => 0);
|
84 |
|
85 |
+
//$gm['modules_xml'] = 'https://codeasily.com/gmedia_modules/modules_v1.xml';
|
86 |
+
$gm['modules_xml'] = 'https://www.dropbox.com/s/t7oawbuxy1me5gk/modules_v1.xml?dl=1';
|
87 |
$gm['license_name'] = '';
|
88 |
$gm['purchase_key'] = '';
|
89 |
$gm['license_key'] = '';
|
config/update.php
CHANGED
@@ -314,7 +314,7 @@ function gmedia_db_update__0_9_6(){
|
|
314 |
}
|
315 |
|
316 |
function gmedia_db_update__1_8_0(){
|
317 |
-
global $wpdb, $gmDB, $gmGallery;
|
318 |
|
319 |
$info = get_transient('gmediaHeavyJob');
|
320 |
$steps = get_transient('gmediaUpgradeSteps');
|
@@ -349,9 +349,9 @@ function gmedia_db_update__1_8_0(){
|
|
349 |
$i ++;
|
350 |
|
351 |
$description = $gmedia->description;
|
352 |
-
$description =
|
353 |
$title = $gmedia->title;
|
354 |
-
$title =
|
355 |
if($description !== $gmedia->description || $title !== $gmedia->title){
|
356 |
$gmDB->insert_gmedia((array)$gmedia);
|
357 |
}
|
@@ -411,8 +411,8 @@ function gmedia_db_update__1_8_0(){
|
|
411 |
continue;
|
412 |
}
|
413 |
$post_data = array('post_author' => $term->global,
|
414 |
-
'post_content' => $term->description,
|
415 |
-
'post_title' => $term->name,
|
416 |
'post_status' => $term->status,
|
417 |
'post_type' => $term->taxonomy
|
418 |
);
|
@@ -505,7 +505,7 @@ function gmedia_images_update($files){
|
|
505 |
|
506 |
if('image' == $fileinfo['dirname']){
|
507 |
$size = @getimagesize($fileinfo['filepath']);
|
508 |
-
if(!
|
509 |
if(function_exists('memory_get_usage')){
|
510 |
$extensions = array('1' => 'GIF', '2' => 'JPG', '3' => 'PNG', '6' => 'BMP');
|
511 |
switch($extensions[ $size[2] ]){
|
@@ -749,7 +749,7 @@ function gmedia_quite_update(){
|
|
749 |
gmedia_restore_original_images();
|
750 |
}
|
751 |
if(version_compare($current_version, '1.8.08', '<')){
|
752 |
-
if(
|
753 |
@unlink($gmCore->upload['path'] . '/module/mosaic/js/jquery.prettyPhoto-min.js');
|
754 |
@unlink($gmCore->upload['path'] . '/module/mosaic/js/mosaic.js');
|
755 |
}
|
@@ -864,19 +864,26 @@ function gmedia_quite_update(){
|
|
864 |
}
|
865 |
|
866 |
$new_options = $gmCore->array_diff_key_recursive($default_options, $options);
|
|
|
|
|
|
|
|
|
|
|
|
|
867 |
$gmGallery->options = $gmCore->array_replace_recursive($options, $new_options);
|
868 |
update_option('gmediaOptions', $gmGallery->options);
|
|
|
|
|
|
|
|
|
|
|
869 |
|
870 |
$gmCore->delete_folder($gmCore->upload['path'] . '/module/afflux');
|
871 |
$gmCore->delete_folder($gmCore->upload['path'] . '/module/jq-mplayer');
|
872 |
$gmCore->delete_folder($gmCore->upload['path'] . '/module/minima');
|
873 |
$gmCore->delete_folder($gmCore->upload['path'] . '/module/phantom');
|
874 |
$gmCore->delete_folder($gmCore->upload['path'] . '/module/wp-videoplayer');
|
|
|
875 |
|
876 |
-
update_option("gmediaVersion", GMEDIA_VERSION);
|
877 |
-
|
878 |
-
if((int)$gmGallery->options['mobile_app']){
|
879 |
-
$gmCore->app_service('app_updatecron');
|
880 |
-
}
|
881 |
}
|
882 |
}
|
314 |
}
|
315 |
|
316 |
function gmedia_db_update__1_8_0(){
|
317 |
+
global $wpdb, $gmDB, $gmGallery, $gmCore;
|
318 |
|
319 |
$info = get_transient('gmediaHeavyJob');
|
320 |
$steps = get_transient('gmediaUpgradeSteps');
|
349 |
$i ++;
|
350 |
|
351 |
$description = $gmedia->description;
|
352 |
+
$description = $gmCore->mb_convert_encoding_utf8($description);
|
353 |
$title = $gmedia->title;
|
354 |
+
$title = $gmCore->mb_convert_encoding_utf8($title);
|
355 |
if($description !== $gmedia->description || $title !== $gmedia->title){
|
356 |
$gmDB->insert_gmedia((array)$gmedia);
|
357 |
}
|
411 |
continue;
|
412 |
}
|
413 |
$post_data = array('post_author' => $term->global,
|
414 |
+
'post_content' => $gmCore->mb_convert_encoding_utf8($term->description),
|
415 |
+
'post_title' => $gmCore->mb_convert_encoding_utf8($term->name),
|
416 |
'post_status' => $term->status,
|
417 |
'post_type' => $term->taxonomy
|
418 |
);
|
505 |
|
506 |
if('image' == $fileinfo['dirname']){
|
507 |
$size = @getimagesize($fileinfo['filepath']);
|
508 |
+
if(!is_file($fileinfo['filepath_thumb']) && file_is_displayable_image($fileinfo['filepath'])){
|
509 |
if(function_exists('memory_get_usage')){
|
510 |
$extensions = array('1' => 'GIF', '2' => 'JPG', '3' => 'PNG', '6' => 'BMP');
|
511 |
switch($extensions[ $size[2] ]){
|
749 |
gmedia_restore_original_images();
|
750 |
}
|
751 |
if(version_compare($current_version, '1.8.08', '<')){
|
752 |
+
if(is_file($gmCore->upload['path'] . '/module/mosaic/js/mosaic.min.js')){
|
753 |
@unlink($gmCore->upload['path'] . '/module/mosaic/js/jquery.prettyPhoto-min.js');
|
754 |
@unlink($gmCore->upload['path'] . '/module/mosaic/js/mosaic.js');
|
755 |
}
|
864 |
}
|
865 |
|
866 |
$new_options = $gmCore->array_diff_key_recursive($default_options, $options);
|
867 |
+
|
868 |
+
if(version_compare($current_version, '1.9.14', '<')){
|
869 |
+
//$new_options['modules_xml'] = 'https://codeasily.com/gmedia_modules/modules_v1.xml';
|
870 |
+
$new_options['modules_xml'] = 'https://www.dropbox.com/s/t7oawbuxy1me5gk/modules_v1.xml?dl=1';
|
871 |
+
}
|
872 |
+
|
873 |
$gmGallery->options = $gmCore->array_replace_recursive($options, $new_options);
|
874 |
update_option('gmediaOptions', $gmGallery->options);
|
875 |
+
update_option("gmediaVersion", GMEDIA_VERSION);
|
876 |
+
|
877 |
+
if((int)$gmGallery->options['mobile_app']){
|
878 |
+
$gmCore->app_service('app_updatecron');
|
879 |
+
}
|
880 |
|
881 |
$gmCore->delete_folder($gmCore->upload['path'] . '/module/afflux');
|
882 |
$gmCore->delete_folder($gmCore->upload['path'] . '/module/jq-mplayer');
|
883 |
$gmCore->delete_folder($gmCore->upload['path'] . '/module/minima');
|
884 |
$gmCore->delete_folder($gmCore->upload['path'] . '/module/phantom');
|
885 |
$gmCore->delete_folder($gmCore->upload['path'] . '/module/wp-videoplayer');
|
886 |
+
$gmCore->delete_folder($gmCore->upload['path'] . '/module/cubik-lite');
|
887 |
|
|
|
|
|
|
|
|
|
|
|
888 |
}
|
889 |
}
|
config/wp-load.php
CHANGED
@@ -24,13 +24,13 @@ if (! defined('WP_LOAD_PATH')) {
|
|
24 |
preg_match('|^(.*?/)(wp-content)/|i', str_replace('\\', '/', $_SERVER['SCRIPT_FILENAME']), $_m);
|
25 |
$classic_root = $_m[1];
|
26 |
|
27 |
-
if ($path &&
|
28 |
define('WP_LOAD_PATH', $path);
|
29 |
-
} elseif (
|
30 |
define('WP_LOAD_PATH', $classic_root);
|
31 |
} else {
|
32 |
$classic_root = dirname(dirname(dirname(dirname(dirname(str_replace('\\', '/', $_SERVER['SCRIPT_FILENAME'])))))) . '/';
|
33 |
-
if (
|
34 |
define('WP_LOAD_PATH', $classic_root);
|
35 |
} else {
|
36 |
exit("Could not find wp-load.php");
|
24 |
preg_match('|^(.*?/)(wp-content)/|i', str_replace('\\', '/', $_SERVER['SCRIPT_FILENAME']), $_m);
|
25 |
$classic_root = $_m[1];
|
26 |
|
27 |
+
if ($path && is_file($path . 'wp-load.php')) {
|
28 |
define('WP_LOAD_PATH', $path);
|
29 |
+
} elseif (is_file($classic_root . 'wp-load.php')) {
|
30 |
define('WP_LOAD_PATH', $classic_root);
|
31 |
} else {
|
32 |
$classic_root = dirname(dirname(dirname(dirname(dirname(str_replace('\\', '/', $_SERVER['SCRIPT_FILENAME'])))))) . '/';
|
33 |
+
if (is_file($classic_root . 'wp-load.php')) {
|
34 |
define('WP_LOAD_PATH', $classic_root);
|
35 |
} else {
|
36 |
exit("Could not find wp-load.php");
|
grand-media.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Plugin Name: Gmedia Gallery
|
4 |
* Plugin URI: http://wordpress.org/extend/plugins/grand-media/
|
5 |
* Description: Gmedia Gallery - powerful media library plugin for creating beautiful galleries and managing files.
|
6 |
-
* Version: 1.
|
7 |
* Author: Rattus
|
8 |
* Author URI: http://codeasily.com/
|
9 |
-
* Requires at least: 3.
|
10 |
-
* Tested up to: 4.
|
11 |
* Text Domain: grand-media
|
12 |
* Domain Path: /lang
|
13 |
*
|
@@ -42,9 +42,9 @@ if(!class_exists('Gmedia')){
|
|
42 |
*/
|
43 |
class Gmedia{
|
44 |
|
45 |
-
var $version = '1.
|
46 |
var $dbversion = '1.8.0';
|
47 |
-
var $minium_WP = '3.
|
48 |
var $options = '';
|
49 |
var $do_module = array();
|
50 |
var $import_styles = array();
|
@@ -90,7 +90,7 @@ if(!class_exists('Gmedia')){
|
|
90 |
// Register a uninstall hook to remove all tables & option automatic
|
91 |
//register_uninstall_hook( $this->plugin_name, array(__CLASS__, 'uninstall' ) );
|
92 |
|
93 |
-
add_action('wp_enqueue_scripts', array(&$this, 'register_scripts_frontend'));
|
94 |
|
95 |
add_action('admin_enqueue_scripts', array(&$this, 'register_scripts_backend'), 8);
|
96 |
|
@@ -332,17 +332,17 @@ if(!class_exists('Gmedia')){
|
|
332 |
|
333 |
wp_register_script('gmedia-global-backend', $gmCore->gmedia_url . '/admin/assets/js/gmedia.global.js', array('jquery'), '1.8.26');
|
334 |
wp_localize_script('gmedia-global-backend', 'GmediaGallery', array('ajaxurl' => admin_url('admin-ajax.php'),
|
335 |
-
'
|
336 |
'upload_dirurl' => $gmCore->upload['url'],
|
337 |
'plugin_dirurl' => $gmCore->gmedia_url
|
338 |
));
|
339 |
|
340 |
-
wp_register_style('grand-media', $gmCore->gmedia_url . '/admin/assets/css/gmedia.admin.css', array(), '1.
|
341 |
-
wp_register_script('grand-media', $gmCore->gmedia_url . '/admin/assets/js/gmedia.admin.js', array('jquery', 'gmedia-global-backend'), '1.
|
342 |
wp_localize_script('grand-media', 'grandMedia', array('error3' => __('Disable your Popup Blocker and try again.', 'grand-media'),
|
343 |
'download' => __('downloading...', 'grand-media'),
|
344 |
'wait' => __('Working. Wait please.', 'grand-media'),
|
345 |
-
'
|
346 |
));
|
347 |
|
348 |
wp_register_style('gmedia-bootstrap', $gmCore->gmedia_url . '/assets/bootstrap/css/bootstrap.min.css', array(), '3.3.4', 'all');
|
@@ -355,7 +355,7 @@ if(!class_exists('Gmedia')){
|
|
355 |
function register_scripts_frontend(){
|
356 |
global $gmCore, $wp_scripts;
|
357 |
|
358 |
-
wp_register_script('gmedia-global-frontend', $gmCore->gmedia_url . '/assets/gmedia.global.front.js', array('jquery'), '1.
|
359 |
wp_localize_script('gmedia-global-frontend', 'GmediaGallery', array('ajaxurl' => admin_url('admin-ajax.php'),
|
360 |
'nonce' => wp_create_nonce('GmediaGallery'),
|
361 |
'upload_dirurl' => $gmCore->upload['url'],
|
@@ -365,13 +365,18 @@ if(!class_exists('Gmedia')){
|
|
365 |
));
|
366 |
|
367 |
|
|
|
|
|
|
|
|
|
|
|
368 |
if(!wp_script_is('mediaelement', 'registered')){
|
369 |
wp_register_style('mediaelement', $gmCore->gmedia_url . '/assets/mediaelement/mediaelementplayer.min.css', array(), '2.13.0', 'screen');
|
370 |
wp_register_script('mediaelement', $gmCore->gmedia_url . '/assets/mediaelement/mediaelement-and-player.min.js', array('jquery'), '2.13.0', true);
|
371 |
}
|
372 |
|
373 |
if(!wp_script_is('wavesurfer', 'registered')){
|
374 |
-
wp_register_script('wavesurfer', $gmCore->gmedia_url . '/assets/wavesurfer/wavesurfer.min.js', array('jquery'), '1.
|
375 |
}
|
376 |
|
377 |
if(!wp_script_is('swiper', 'registered') || version_compare($wp_scripts->registered['swiper']->ver, '3.4.0', '<')){
|
@@ -381,11 +386,11 @@ if(!class_exists('Gmedia')){
|
|
381 |
wp_register_script('swiper', $gmCore->gmedia_url . '/assets/swiper/swiper.jquery.min.js', array('jquery'), '3.4.0', true);
|
382 |
}
|
383 |
|
384 |
-
if(!wp_script_is('magnific-popup', 'registered') || version_compare($wp_scripts->registered['magnific-popup']->ver, '1.0
|
385 |
wp_deregister_style('magnific-popup');
|
386 |
wp_deregister_script('magnific-popup');
|
387 |
-
wp_register_style('magnific-popup', $gmCore->gmedia_url . '/assets/mag-popup/magnific-popup.css', array(), '1.0
|
388 |
-
wp_register_script('magnific-popup', $gmCore->gmedia_url . '/assets/mag-popup/jquery.magnific-popup.min.js', array('jquery'), '1.0
|
389 |
}
|
390 |
|
391 |
if(!wp_script_is('photoswipe', 'registered') || version_compare($wp_scripts->registered['photoswipe']->ver, '3.0.5', '<=')){
|
@@ -395,11 +400,11 @@ if(!class_exists('Gmedia')){
|
|
395 |
wp_register_script('photoswipe', $gmCore->gmedia_url . '/assets/photoswipe/photoswipe.jquery.min.js', array('jquery'), '3.0.5', true);
|
396 |
}
|
397 |
|
398 |
-
if(!wp_script_is('easing', 'registered') || version_compare($wp_scripts->registered['easing']->ver, '1.3.0', '<')){
|
399 |
wp_deregister_script('easing');
|
400 |
wp_register_script('easing', $gmCore->gmedia_url . '/assets/jq-plugins/jquery.easing.js', array('jquery'), '1.3.0', true);
|
401 |
}
|
402 |
-
if(!wp_script_is('fancybox', 'registered') || version_compare($wp_scripts->registered['fancybox']->ver, '1.3.4', '<')){
|
403 |
if(!defined('FANCYBOX_VERSION')){
|
404 |
wp_deregister_style('fancybox');
|
405 |
wp_register_style('fancybox', $gmCore->gmedia_url . '/assets/fancybox/jquery.fancybox-1.3.4.css', array(), '1.3.4');
|
@@ -432,30 +437,39 @@ if(!class_exists('Gmedia')){
|
|
432 |
function load_module_scripts(){
|
433 |
global $wp_styles;
|
434 |
$deps = array();
|
|
|
435 |
foreach($this->do_module as $m => $module){
|
436 |
$deps = array_merge($deps, explode(',', $module['info']['dependencies']));
|
437 |
$deps = apply_filters('gmedia_module_js_dependencies', $deps, $m);
|
438 |
foreach($deps as $handle){
|
439 |
if(wp_script_is($handle, 'registered')){
|
440 |
-
wp_enqueue_script($handle, $_src = false, $_deps = array('jquery'), $
|
|
|
|
|
|
|
441 |
}
|
442 |
if(wp_style_is($handle, 'registered')){
|
443 |
//wp_print_styles($handle);
|
444 |
-
$this->import_styles[] = $wp_styles->registered[ $handle ]->src;
|
445 |
-
}
|
446 |
-
}
|
447 |
-
$files = glob($module['path'] . '/css/*.css', GLOB_NOSORT);
|
448 |
-
if(!empty($files)){
|
449 |
-
$files = array_map('basename', $files);
|
450 |
-
foreach($files as $file){
|
451 |
-
$this->import_styles[] = "{$module['url']}/css/{$file}";
|
452 |
}
|
453 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
454 |
$files = glob($module['path'] . '/js/*.js', GLOB_NOSORT);
|
455 |
if(!empty($files)){
|
456 |
$files = array_map('basename', $files);
|
457 |
foreach($files as $file){
|
458 |
-
|
|
|
|
|
|
|
|
|
|
|
459 |
}
|
460 |
}
|
461 |
}
|
@@ -464,18 +478,43 @@ if(!class_exists('Gmedia')){
|
|
464 |
add_action('wp_print_head_scripts', array(&$this, 'print_import_styles'), 1);
|
465 |
add_action('wp_print_footer_scripts', array(&$this, 'print_import_styles'), 1);
|
466 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
467 |
}
|
468 |
|
469 |
function print_import_styles(){
|
470 |
if(!empty($this->import_styles)){
|
471 |
-
echo "\n<style type='text/css'>";
|
472 |
foreach($this->import_styles as $src){
|
473 |
if('http' !== substr($src, 0, 4)){
|
474 |
$src = site_url($src);
|
475 |
}
|
476 |
echo "\n@import url('{$src}') all;";
|
477 |
}
|
478 |
-
//echo "\n" . implode("\n", $this->inline_styles);
|
479 |
echo "\n</style>\n";
|
480 |
$this->import_styles = array();
|
481 |
}
|
@@ -575,27 +614,38 @@ if(!class_exists('Gmedia')){
|
|
575 |
'show_in_admin_bar' => true,
|
576 |
'show_in_nav_menus' => false,
|
577 |
'can_export' => false,
|
578 |
-
'has_archive' => (bool)$this->options['gmedia_has_archive'], //'gmedia-library',
|
579 |
'publicly_queryable' => true,
|
580 |
-
'exclude_from_search' => (bool)$this->options['gmedia_exclude_from_search'],
|
581 |
-
'rewrite' => array('slug' => $this->options['gmedia_post_slug'])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
582 |
);
|
583 |
register_post_type('gmedia', $args);
|
584 |
|
585 |
$args['label'] = __('Gmedia Albums', 'grand-media');
|
586 |
$args['show_in_nav_menus'] = true;
|
587 |
$args['hierarchical'] = true;
|
588 |
-
$args['has_archive'] = (bool)$this->options['gmedia_album_has_archive'];
|
589 |
-
$args['exclude_from_search'] = (bool)$this->options['gmedia_album_exclude_from_search'];
|
590 |
$args['rewrite'] = array('slug' => $this->options['gmedia_album_post_slug']);
|
591 |
register_post_type('gmedia_album', $args);
|
592 |
|
593 |
$args['label'] = __('Gmedia Galleries', 'grand-media');
|
594 |
-
$args['has_archive'] = (bool)$this->options['gmedia_gallery_has_archive'];
|
595 |
-
$args['exclude_from_search'] = (bool)$this->options['gmedia_gallery_exclude_from_search'];
|
596 |
$args['rewrite'] = array('slug' => $this->options['gmedia_gallery_post_slug']);
|
597 |
register_post_type('gmedia_gallery', $args);
|
598 |
|
|
|
|
|
599 |
add_filter('get_edit_post_link', array($this, 'gmedia_post_type_edit_link'), 10, 3);
|
600 |
|
601 |
|
@@ -607,20 +657,62 @@ if(!class_exists('Gmedia')){
|
|
607 |
'show_tagcloud' => false,
|
608 |
'rewrite' => array('slug' => 'gmedia-category')
|
609 |
);
|
610 |
-
$args['labels'] = array('name' => _x('Categories', 'Taxonomy General Name', 'grand-media'),
|
611 |
-
'singular_name' => _x('Category', 'Taxonomy Singular Name', 'grand-media'),
|
612 |
-
'menu_name' => __('Categories', 'grand-media')
|
613 |
);
|
614 |
-
register_taxonomy('gmedia_category',
|
615 |
|
616 |
$args['rewrite'] = array('slug' => 'gmedia-tag');
|
617 |
-
$args['labels'] = array('name' => _x('Tags', 'Taxonomy General Name', 'grand-media'),
|
618 |
-
'singular_name' => _x('Tag', 'Taxonomy Singular Name', 'grand-media'),
|
619 |
-
'menu_name' => __('Tags', 'grand-media')
|
620 |
);
|
621 |
-
register_taxonomy('gmedia_tag',
|
622 |
|
623 |
add_filter('wp_link_query_args', array($this, 'exclude_gmedia_from_link_query'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
624 |
}
|
625 |
|
626 |
/**
|
@@ -696,7 +788,7 @@ if(!class_exists('Gmedia')){
|
|
696 |
}
|
697 |
|
698 |
function gm_schedule_update_checks(){
|
699 |
-
$wp_installing = (bool)(defined(
|
700 |
|
701 |
if(!wp_next_scheduled('gmedia_modules_update') && !$wp_installing){
|
702 |
wp_schedule_event(time(), 'daily', 'gmedia_modules_update');
|
3 |
* Plugin Name: Gmedia Gallery
|
4 |
* Plugin URI: http://wordpress.org/extend/plugins/grand-media/
|
5 |
* Description: Gmedia Gallery - powerful media library plugin for creating beautiful galleries and managing files.
|
6 |
+
* Version: 1.9.16
|
7 |
* Author: Rattus
|
8 |
* Author URI: http://codeasily.com/
|
9 |
+
* Requires at least: 3.7
|
10 |
+
* Tested up to: 4.7.3
|
11 |
* Text Domain: grand-media
|
12 |
* Domain Path: /lang
|
13 |
*
|
42 |
*/
|
43 |
class Gmedia{
|
44 |
|
45 |
+
var $version = '1.9.16';
|
46 |
var $dbversion = '1.8.0';
|
47 |
+
var $minium_WP = '3.7';
|
48 |
var $options = '';
|
49 |
var $do_module = array();
|
50 |
var $import_styles = array();
|
90 |
// Register a uninstall hook to remove all tables & option automatic
|
91 |
//register_uninstall_hook( $this->plugin_name, array(__CLASS__, 'uninstall' ) );
|
92 |
|
93 |
+
add_action('wp_enqueue_scripts', array(&$this, 'register_scripts_frontend'), 20);
|
94 |
|
95 |
add_action('admin_enqueue_scripts', array(&$this, 'register_scripts_backend'), 8);
|
96 |
|
332 |
|
333 |
wp_register_script('gmedia-global-backend', $gmCore->gmedia_url . '/admin/assets/js/gmedia.global.js', array('jquery'), '1.8.26');
|
334 |
wp_localize_script('gmedia-global-backend', 'GmediaGallery', array('ajaxurl' => admin_url('admin-ajax.php'),
|
335 |
+
'_wpnonce' => wp_create_nonce('GmediaGallery'),
|
336 |
'upload_dirurl' => $gmCore->upload['url'],
|
337 |
'plugin_dirurl' => $gmCore->gmedia_url
|
338 |
));
|
339 |
|
340 |
+
wp_register_style('grand-media', $gmCore->gmedia_url . '/admin/assets/css/gmedia.admin.css', array(), '1.9.16', 'all');
|
341 |
+
wp_register_script('grand-media', $gmCore->gmedia_url . '/admin/assets/js/gmedia.admin.js', array('jquery', 'gmedia-global-backend'), '1.9.16');
|
342 |
wp_localize_script('grand-media', 'grandMedia', array('error3' => __('Disable your Popup Blocker and try again.', 'grand-media'),
|
343 |
'download' => __('downloading...', 'grand-media'),
|
344 |
'wait' => __('Working. Wait please.', 'grand-media'),
|
345 |
+
'_wpnonce' => wp_create_nonce('GmediaGallery')
|
346 |
));
|
347 |
|
348 |
wp_register_style('gmedia-bootstrap', $gmCore->gmedia_url . '/assets/bootstrap/css/bootstrap.min.css', array(), '3.3.4', 'all');
|
355 |
function register_scripts_frontend(){
|
356 |
global $gmCore, $wp_scripts;
|
357 |
|
358 |
+
wp_register_script('gmedia-global-frontend', $gmCore->gmedia_url . '/assets/gmedia.global.front.js', array('jquery'), '1.9.16');
|
359 |
wp_localize_script('gmedia-global-frontend', 'GmediaGallery', array('ajaxurl' => admin_url('admin-ajax.php'),
|
360 |
'nonce' => wp_create_nonce('GmediaGallery'),
|
361 |
'upload_dirurl' => $gmCore->upload['url'],
|
365 |
));
|
366 |
|
367 |
|
368 |
+
if(!wp_script_is('velocity', 'registered') || version_compare($wp_scripts->registered['velocity']->ver, '1.4.1', '<')){
|
369 |
+
wp_deregister_script('velocity');
|
370 |
+
wp_register_script('velocity', $gmCore->gmedia_url . '/assets/velocity/velocity.min.js', array('jquery'), '1.4.1', true);
|
371 |
+
}
|
372 |
+
|
373 |
if(!wp_script_is('mediaelement', 'registered')){
|
374 |
wp_register_style('mediaelement', $gmCore->gmedia_url . '/assets/mediaelement/mediaelementplayer.min.css', array(), '2.13.0', 'screen');
|
375 |
wp_register_script('mediaelement', $gmCore->gmedia_url . '/assets/mediaelement/mediaelement-and-player.min.js', array('jquery'), '2.13.0', true);
|
376 |
}
|
377 |
|
378 |
if(!wp_script_is('wavesurfer', 'registered')){
|
379 |
+
wp_register_script('wavesurfer', $gmCore->gmedia_url . '/assets/wavesurfer/wavesurfer.min.js', array('jquery'), '1.2.8', true);
|
380 |
}
|
381 |
|
382 |
if(!wp_script_is('swiper', 'registered') || version_compare($wp_scripts->registered['swiper']->ver, '3.4.0', '<')){
|
386 |
wp_register_script('swiper', $gmCore->gmedia_url . '/assets/swiper/swiper.jquery.min.js', array('jquery'), '3.4.0', true);
|
387 |
}
|
388 |
|
389 |
+
if(!wp_script_is('magnific-popup', 'registered') || version_compare($wp_scripts->registered['magnific-popup']->ver, '1.1.0', '<')){
|
390 |
wp_deregister_style('magnific-popup');
|
391 |
wp_deregister_script('magnific-popup');
|
392 |
+
wp_register_style('magnific-popup', $gmCore->gmedia_url . '/assets/mag-popup/magnific-popup.css', array(), '1.1.0', 'screen');
|
393 |
+
wp_register_script('magnific-popup', $gmCore->gmedia_url . '/assets/mag-popup/jquery.magnific-popup.min.js', array('jquery'), '1.1.0', true);
|
394 |
}
|
395 |
|
396 |
if(!wp_script_is('photoswipe', 'registered') || version_compare($wp_scripts->registered['photoswipe']->ver, '3.0.5', '<=')){
|
400 |
wp_register_script('photoswipe', $gmCore->gmedia_url . '/assets/photoswipe/photoswipe.jquery.min.js', array('jquery'), '3.0.5', true);
|
401 |
}
|
402 |
|
403 |
+
if(!wp_script_is('easing', 'registered') || ($wp_scripts->registered['easing']->ver !== false && version_compare($wp_scripts->registered['easing']->ver, '1.3.0', '<'))){
|
404 |
wp_deregister_script('easing');
|
405 |
wp_register_script('easing', $gmCore->gmedia_url . '/assets/jq-plugins/jquery.easing.js', array('jquery'), '1.3.0', true);
|
406 |
}
|
407 |
+
if(!wp_script_is('fancybox', 'registered') || ($wp_scripts->registered['fancybox']->ver !== false && version_compare($wp_scripts->registered['fancybox']->ver, '1.3.4', '<'))){
|
408 |
if(!defined('FANCYBOX_VERSION')){
|
409 |
wp_deregister_style('fancybox');
|
410 |
wp_register_style('fancybox', $gmCore->gmedia_url . '/assets/fancybox/jquery.fancybox-1.3.4.css', array(), '1.3.4');
|
437 |
function load_module_scripts(){
|
438 |
global $wp_styles;
|
439 |
$deps = array();
|
440 |
+
$xmlhttprequest = (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');
|
441 |
foreach($this->do_module as $m => $module){
|
442 |
$deps = array_merge($deps, explode(',', $module['info']['dependencies']));
|
443 |
$deps = apply_filters('gmedia_module_js_dependencies', $deps, $m);
|
444 |
foreach($deps as $handle){
|
445 |
if(wp_script_is($handle, 'registered')){
|
446 |
+
wp_enqueue_script($handle, $_src = false, $_deps = array('jquery'), $this->version, $_in_footer = true);
|
447 |
+
if($xmlhttprequest){
|
448 |
+
wp_print_scripts($handle);
|
449 |
+
}
|
450 |
}
|
451 |
if(wp_style_is($handle, 'registered')){
|
452 |
//wp_print_styles($handle);
|
453 |
+
$this->import_styles[ $handle ] = $wp_styles->registered[ $handle ]->src;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
454 |
}
|
455 |
}
|
456 |
+
// $files = glob($module['path'] . '/css/*.css', GLOB_NOSORT);
|
457 |
+
// if(!empty($files)){
|
458 |
+
// $files = array_map('basename', $files);
|
459 |
+
// foreach($files as $file){
|
460 |
+
// $this->import_styles[] = "{$module['url']}/css/{$file}";
|
461 |
+
// }
|
462 |
+
// }
|
463 |
$files = glob($module['path'] . '/js/*.js', GLOB_NOSORT);
|
464 |
if(!empty($files)){
|
465 |
$files = array_map('basename', $files);
|
466 |
foreach($files as $file){
|
467 |
+
$_ver = isset($module['info']['version'])? $module['info']['version'] : false;
|
468 |
+
$handle = "{$module['name']}_{$file}";
|
469 |
+
wp_enqueue_script($handle, "{$module['url']}/js/{$file}", array('jquery'), $_ver, true);
|
470 |
+
if($xmlhttprequest){
|
471 |
+
wp_print_scripts($handle);
|
472 |
+
}
|
473 |
}
|
474 |
}
|
475 |
}
|
478 |
add_action('wp_print_head_scripts', array(&$this, 'print_import_styles'), 1);
|
479 |
add_action('wp_print_footer_scripts', array(&$this, 'print_import_styles'), 1);
|
480 |
}
|
481 |
+
if($xmlhttprequest){
|
482 |
+
$this->print_import_styles();
|
483 |
+
}
|
484 |
+
}
|
485 |
+
|
486 |
+
/** Return module styles like <style>@import(...)</style>
|
487 |
+
*
|
488 |
+
* @param $module
|
489 |
+
*
|
490 |
+
* @return string
|
491 |
+
*/
|
492 |
+
function load_module_styles($module){
|
493 |
+
$module_styles = '';
|
494 |
+
$files = glob($module['path'] . '/css/*.css', GLOB_NOSORT);
|
495 |
+
if(!empty($files)){
|
496 |
+
$files = array_map('basename', $files);
|
497 |
+
foreach($files as $file){
|
498 |
+
$src = "{$module['url']}/css/{$file}";
|
499 |
+
if('http' !== substr($src, 0, 4)){
|
500 |
+
$src = site_url($src);
|
501 |
+
}
|
502 |
+
$module_styles .= "@import url('{$src}') all;";
|
503 |
+
}
|
504 |
+
}
|
505 |
+
|
506 |
+
return $module_styles;
|
507 |
}
|
508 |
|
509 |
function print_import_styles(){
|
510 |
if(!empty($this->import_styles)){
|
511 |
+
echo "\n<style type='text/css' class='gmedia_assets_style_import'>";
|
512 |
foreach($this->import_styles as $src){
|
513 |
if('http' !== substr($src, 0, 4)){
|
514 |
$src = site_url($src);
|
515 |
}
|
516 |
echo "\n@import url('{$src}') all;";
|
517 |
}
|
|
|
518 |
echo "\n</style>\n";
|
519 |
$this->import_styles = array();
|
520 |
}
|
614 |
'show_in_admin_bar' => true,
|
615 |
'show_in_nav_menus' => false,
|
616 |
'can_export' => false,
|
617 |
+
'has_archive' => (bool)((int)$this->options['gmedia_has_archive']), //'gmedia-library',
|
618 |
'publicly_queryable' => true,
|
619 |
+
'exclude_from_search' => (bool)((int)$this->options['gmedia_exclude_from_search']),
|
620 |
+
'rewrite' => array('slug' => $this->options['gmedia_post_slug']),
|
621 |
+
'map_meta_cap' => true,
|
622 |
+
'capabilities' => array(
|
623 |
+
'read_private_posts' => 'read_private_gmedia_posts',
|
624 |
+
// 'edit_comment' => 'edit_gmedia_comment',
|
625 |
+
// 'moderate_comments' => 'moderate_gmedia_comments',
|
626 |
+
// 'edit_post' => 'edit_gmedia_post',
|
627 |
+
// 'edit_posts' => 'edit_gmedia_posts',
|
628 |
+
'create_posts' => false
|
629 |
+
)
|
630 |
);
|
631 |
register_post_type('gmedia', $args);
|
632 |
|
633 |
$args['label'] = __('Gmedia Albums', 'grand-media');
|
634 |
$args['show_in_nav_menus'] = true;
|
635 |
$args['hierarchical'] = true;
|
636 |
+
$args['has_archive'] = (bool)((int)$this->options['gmedia_album_has_archive']);
|
637 |
+
$args['exclude_from_search'] = (bool)((int)$this->options['gmedia_album_exclude_from_search']);
|
638 |
$args['rewrite'] = array('slug' => $this->options['gmedia_album_post_slug']);
|
639 |
register_post_type('gmedia_album', $args);
|
640 |
|
641 |
$args['label'] = __('Gmedia Galleries', 'grand-media');
|
642 |
+
$args['has_archive'] = (bool)((int)$this->options['gmedia_gallery_has_archive']);
|
643 |
+
$args['exclude_from_search'] = (bool)((int)$this->options['gmedia_gallery_exclude_from_search']);
|
644 |
$args['rewrite'] = array('slug' => $this->options['gmedia_gallery_post_slug']);
|
645 |
register_post_type('gmedia_gallery', $args);
|
646 |
|
647 |
+
add_filter('get_gmedia_metadata', array($this, 'get_gmedia_metadata'), 10, 4);
|
648 |
+
add_filter('get_gmedia_term_metadata', array($this, 'get_gmedia_term_metadata'), 10, 4);
|
649 |
add_filter('get_edit_post_link', array($this, 'gmedia_post_type_edit_link'), 10, 3);
|
650 |
|
651 |
|
657 |
'show_tagcloud' => false,
|
658 |
'rewrite' => array('slug' => 'gmedia-category')
|
659 |
);
|
660 |
+
$args['labels'] = array('name' => _x('Gmedia Categories', 'Taxonomy General Name', 'grand-media'),
|
661 |
+
'singular_name' => _x('Gmedia Category', 'Taxonomy Singular Name', 'grand-media'),
|
662 |
+
'menu_name' => __('Gmedia Categories', 'grand-media')
|
663 |
);
|
664 |
+
register_taxonomy('gmedia_category', null, $args);
|
665 |
|
666 |
$args['rewrite'] = array('slug' => 'gmedia-tag');
|
667 |
+
$args['labels'] = array('name' => _x('Gmedia Tags', 'Taxonomy General Name', 'grand-media'),
|
668 |
+
'singular_name' => _x('Gmedia Tag', 'Taxonomy Singular Name', 'grand-media'),
|
669 |
+
'menu_name' => __('Gmedia Tags', 'grand-media')
|
670 |
);
|
671 |
+
register_taxonomy('gmedia_tag', null, $args);
|
672 |
|
673 |
add_filter('wp_link_query_args', array($this, 'exclude_gmedia_from_link_query'));
|
674 |
+
|
675 |
+
if(!empty($this->options['flush_rewrite_rules'])){
|
676 |
+
unset($this->options['flush_rewrite_rules']);
|
677 |
+
update_option('gmediaOptions', $this->options);
|
678 |
+
flush_rewrite_rules(false);
|
679 |
+
}
|
680 |
+
}
|
681 |
+
|
682 |
+
/**
|
683 |
+
* Get gmedia metadata
|
684 |
+
*
|
685 |
+
* @param $meta
|
686 |
+
* @param $post_ID
|
687 |
+
* @param $meta_key
|
688 |
+
* @param $single
|
689 |
+
*
|
690 |
+
* @return array|string
|
691 |
+
*/
|
692 |
+
function get_gmedia_metadata($meta, $post_ID, $meta_key, $single){
|
693 |
+
global $gmDB;
|
694 |
+
$gmedia_id = get_post_meta($post_ID, '_gmedia_ID', true);
|
695 |
+
$meta = $gmDB->get_metadata('gmedia', $gmedia_id, $meta_key, $single);
|
696 |
+
|
697 |
+
return $meta;
|
698 |
+
}
|
699 |
+
|
700 |
+
/**
|
701 |
+
* Get gmedia term metadata
|
702 |
+
*
|
703 |
+
* @param $meta
|
704 |
+
* @param $post_ID
|
705 |
+
* @param $meta_key
|
706 |
+
* @param $single
|
707 |
+
*
|
708 |
+
* @return array|string
|
709 |
+
*/
|
710 |
+
function get_gmedia_term_metadata($meta, $post_ID, $meta_key, $single){
|
711 |
+
global $gmDB;
|
712 |
+
$gmedia_term_id = get_post_meta($post_ID, '_gmedia_term_ID', true);
|
713 |
+
$meta = $gmDB->get_metadata('gmedia_term', $gmedia_term_id, $meta_key, $single);
|
714 |
+
|
715 |
+
return $meta;
|
716 |
}
|
717 |
|
718 |
/**
|
788 |
}
|
789 |
|
790 |
function gm_schedule_update_checks(){
|
791 |
+
$wp_installing = (bool)(defined('WP_INSTALLING') && WP_INSTALLING);
|
792 |
|
793 |
if(!wp_next_scheduled('gmedia_modules_update') && !$wp_installing){
|
794 |
wp_schedule_event(time(), 'daily', 'gmedia_modules_update');
|
inc/compatibility.php
CHANGED
@@ -7,17 +7,80 @@
|
|
7 |
*
|
8 |
* @return bool
|
9 |
*/
|
10 |
-
if(!defined('ABSPATH'))
|
11 |
-
|
12 |
} // Exit if accessed directly
|
13 |
|
14 |
-
function jetpack_photon_skip_gmedia($skip, $src)
|
15 |
-
{
|
16 |
-
if (strpos($src, GMEDIA_UPLOAD_FOLDER . '/image') !== false) {
|
17 |
return true;
|
18 |
}
|
19 |
|
20 |
return $skip;
|
21 |
}
|
22 |
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
*
|
8 |
* @return bool
|
9 |
*/
|
10 |
+
if(!defined('ABSPATH')){
|
11 |
+
exit;
|
12 |
} // Exit if accessed directly
|
13 |
|
14 |
+
function jetpack_photon_skip_gmedia($skip, $src){
|
15 |
+
if(strpos($src, GMEDIA_UPLOAD_FOLDER . '/image') !== false){
|
|
|
16 |
return true;
|
17 |
}
|
18 |
|
19 |
return $skip;
|
20 |
}
|
21 |
|
22 |
+
/**
|
23 |
+
* WP-SpamShield plugin compatibility
|
24 |
+
* @param $pass
|
25 |
+
*
|
26 |
+
* @return bool
|
27 |
+
*/
|
28 |
+
function wpss_gmedia_check_bypass($pass){
|
29 |
+
global $wp;
|
30 |
+
$is_app = (isset($wp->query_vars['gmedia-app']) && !empty($wp->query_vars['gmedia-app']));
|
31 |
+
if($is_app) {
|
32 |
+
return true;
|
33 |
+
}
|
34 |
+
|
35 |
+
return $pass;
|
36 |
+
}
|
37 |
+
add_filter('wpss_misc_form_spam_check_bypass', 'wpss_gmedia_check_bypass');
|
38 |
+
|
39 |
+
/** Allow Edit Comments for Gmedia Users
|
40 |
+
*
|
41 |
+
* @param $allcaps
|
42 |
+
* @param $caps
|
43 |
+
* @param $args
|
44 |
+
* @param $user
|
45 |
+
*
|
46 |
+
* @return mixed
|
47 |
+
*/
|
48 |
+
function gmedia_user_has_cap($allcaps, $caps, $args, $user){
|
49 |
+
if(is_array($caps) && count($caps)){
|
50 |
+
global $post_id, $gmDB;
|
51 |
+
foreach($caps as $cap){
|
52 |
+
$gmedia = false;
|
53 |
+
if($cap == 'read_private_gmedia_posts'){
|
54 |
+
if($user){
|
55 |
+
$allcaps[$cap] = 1;
|
56 |
+
}
|
57 |
+
} elseif(!empty($allcaps['gmedia_edit_media']) && in_array($cap, array('edit_comment', 'moderate_comments', 'edit_post', 'edit_posts'))){
|
58 |
+
if('moderate_comments' == $cap && !empty($allcaps['moderate_comments'])){
|
59 |
+
return $allcaps;
|
60 |
+
}
|
61 |
+
if('edit_published_posts' == $cap && !empty($allcaps['edit_published_posts'])){
|
62 |
+
return $allcaps;
|
63 |
+
}
|
64 |
+
|
65 |
+
$pid = isset($_REQUEST['p'])? $_REQUEST['p'] : ($post_id? $post_id : false);
|
66 |
+
if(!$pid && isset($_REQUEST['id'])){
|
67 |
+
if(($comment = get_comment($_REQUEST['id']))){
|
68 |
+
$pid = $comment->comment_post_ID;
|
69 |
+
}
|
70 |
+
}
|
71 |
+
if($pid){
|
72 |
+
$gmedia = $gmDB->get_post_gmedia($pid);
|
73 |
+
}
|
74 |
+
if($gmedia && $gmedia->author == $user->ID){
|
75 |
+
$allcaps[$cap] = 1;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
}
|
80 |
+
|
81 |
+
}
|
82 |
+
|
83 |
+
return $allcaps;
|
84 |
+
}
|
85 |
+
add_filter('user_has_cap', 'gmedia_user_has_cap', 10, 4);
|
86 |
+
|
inc/core.php
CHANGED
@@ -147,7 +147,13 @@ class GmediaCore{
|
|
147 |
$uri = admin_url('admin.php');
|
148 |
}
|
149 |
$remove_args = empty($remove_args)? array() : (array)$remove_args;
|
150 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
$new_uri = remove_query_arg($remove_args, $uri);
|
152 |
if(!empty($preserve_args)){
|
153 |
$_add_args = array();
|
@@ -260,11 +266,11 @@ class GmediaCore{
|
|
260 |
* @uses apply_filters() Calls 'gm_get_attachment_image_attributes' hook on attributes array
|
261 |
*
|
262 |
* @param int|object $item Image object.
|
263 |
-
* @param string $size Optional, default is empty string, could be 'thumb', 'original'
|
264 |
* @param bool $cover Optional, try to get cover url
|
265 |
-
* @param bool|string $default Optional, return if no cover
|
266 |
*
|
267 |
-
* @return string img url
|
268 |
*/
|
269 |
function gm_get_media_image($item, $size = '', $cover = true, $default = false){
|
270 |
global $gmDB, $gmGallery;
|
@@ -272,52 +278,81 @@ class GmediaCore{
|
|
272 |
if(!is_object($item)){
|
273 |
$item = $gmDB->get_gmedia($item);
|
274 |
}
|
|
|
|
|
|
|
275 |
if(empty($item)){
|
276 |
-
$image
|
277 |
-
|
278 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
279 |
}
|
280 |
$type = explode('/', $item->mime_type);
|
281 |
-
|
282 |
if('image' == $type[0]){
|
283 |
-
$
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
$
|
291 |
-
|
292 |
-
case 'web':
|
293 |
-
default:
|
294 |
-
$size_folder = '/';
|
295 |
-
break;
|
296 |
}
|
297 |
-
|
298 |
-
|
299 |
-
|
|
|
|
|
|
|
|
|
|
|
300 |
$ext = ltrim(strrchr($item->gmuid, '.'), '.');
|
301 |
if(!$type = wp_ext2type($ext)){
|
302 |
$type = 'application';
|
303 |
}
|
304 |
-
$image
|
|
|
|
|
|
|
|
|
305 |
|
306 |
if($cover){
|
307 |
$cover = $gmDB->get_metadata('gmedia', $item->ID, '_cover', true);
|
308 |
if(!empty($cover)){
|
309 |
if($this->is_digit($cover)){
|
310 |
-
$
|
311 |
-
|
312 |
-
return $cover;
|
313 |
}
|
314 |
-
} elseif(
|
315 |
return $default;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
316 |
}
|
317 |
}
|
318 |
}
|
319 |
|
320 |
-
|
|
|
|
|
|
|
|
|
321 |
}
|
322 |
|
323 |
/**
|
@@ -393,9 +428,9 @@ class GmediaCore{
|
|
393 |
$fileinfo['basename'] = $fileinfo['filename'] . '.' . $fileinfo['extension'];
|
394 |
$fileinfo['title'] = str_replace('_', ' ', esc_sql($title));
|
395 |
if((int)$gmGallery->options['name2title_capitalize']){
|
396 |
-
$fileinfo['title'] =
|
397 |
}
|
398 |
-
$fileinfo['mime_type']
|
399 |
list($dirname) = explode('/', $fileinfo['mime_type']);
|
400 |
$fileinfo['dirname'] = $dirname;
|
401 |
$fileinfo['dirpath'] = $this->upload['path'] . '/' . $gmGallery->options['folder'][ $dirname ];
|
@@ -417,7 +452,7 @@ class GmediaCore{
|
|
417 |
$fileinfo['fileurl_thumb'] = $fileinfo['dirurl_thumb'] . '/' . $fileinfo['basename'];
|
418 |
}
|
419 |
|
420 |
-
if((false !== $exists) &&
|
421 |
$exists = absint($exists) + 1;
|
422 |
$fileinfo = $this->fileinfo($file, $exists);
|
423 |
}
|
@@ -440,17 +475,23 @@ class GmediaCore{
|
|
440 |
$metadata = array();
|
441 |
require_once(ABSPATH . 'wp-admin/includes/image.php');
|
442 |
if(preg_match('!^image/!', $fileinfo['mime_type']) && file_is_displayable_image($fileinfo['filepath'])){
|
443 |
-
$
|
444 |
-
$
|
445 |
-
$imagesize
|
446 |
-
$metadata['
|
447 |
-
$imagesize
|
448 |
-
$metadata['
|
|
|
|
|
|
|
|
|
|
|
|
|
449 |
|
450 |
$metadata['file'] = $this->_gm_relative_upload_path($fileinfo['filepath']);
|
451 |
|
452 |
// fetch additional metadata from exif/iptc
|
453 |
-
$image_meta = $this->wp_read_image_metadata($
|
454 |
if($image_meta){
|
455 |
$metadata['image_meta'] = $image_meta;
|
456 |
}
|
@@ -574,12 +615,13 @@ class GmediaCore{
|
|
574 |
/**
|
575 |
* Generate GmediaCloud page url
|
576 |
*
|
577 |
-
* @param
|
578 |
-
* @param
|
|
|
579 |
*
|
580 |
* @return string
|
581 |
*/
|
582 |
-
function gmcloudlink($id, $type){
|
583 |
$options = get_option('gmediaOptions');
|
584 |
$endpoint = $options['endpoint'];
|
585 |
$hashid = gmedia_hash_id_encode($id, $type);
|
@@ -590,7 +632,7 @@ class GmediaCore{
|
|
590 |
'category' => 'k',
|
591 |
'author' => 'u'
|
592 |
);
|
593 |
-
if(get_option('permalink_structure')){
|
594 |
$cloud_link = home_url(urlencode($endpoint) . "/{$t[$type]}/{$hashid}");
|
595 |
} else{
|
596 |
$cloud_link = add_query_arg(array("$endpoint" => $hashid, 't' => $t[ $type ]), home_url('index.php'));
|
@@ -1236,7 +1278,7 @@ class GmediaCore{
|
|
1236 |
* @return bool|array False on failure. Image metadata array on success.
|
1237 |
*/
|
1238 |
function wp_read_image_metadata($file){
|
1239 |
-
if(!
|
1240 |
return false;
|
1241 |
}
|
1242 |
|
@@ -1543,7 +1585,7 @@ class GmediaCore{
|
|
1543 |
* @return array|boolean Returns array of metadata, if found.
|
1544 |
*/
|
1545 |
function wp_read_video_metadata($file){
|
1546 |
-
if(!
|
1547 |
return false;
|
1548 |
}
|
1549 |
|
@@ -1614,7 +1656,7 @@ class GmediaCore{
|
|
1614 |
* @return array|boolean Returns array of metadata, if found.
|
1615 |
*/
|
1616 |
function wp_read_audio_metadata($file){
|
1617 |
-
if(!
|
1618 |
return false;
|
1619 |
}
|
1620 |
$metadata = array();
|
@@ -1961,12 +2003,13 @@ class GmediaCore{
|
|
1961 |
}
|
1962 |
$is_webimage = true;
|
1963 |
} else{
|
1964 |
-
|
1965 |
$return = array("error" => array("code" => 104, "message" => __("Could not read image size. Invalid image was deleted.", 'grand-media')),
|
1966 |
"id" => $fileinfo['basename_original']
|
1967 |
);
|
1968 |
|
1969 |
return $return;
|
|
|
1970 |
}
|
1971 |
}
|
1972 |
|
@@ -2098,6 +2141,10 @@ class GmediaCore{
|
|
2098 |
"id" => $fileinfo['basename']
|
2099 |
);
|
2100 |
|
|
|
|
|
|
|
|
|
2101 |
return $return;
|
2102 |
} else{
|
2103 |
$return = array("success" => array("code" => 199, "message" => $chunk . '/' . $chunks), "id" => $fileinfo['basename']);
|
@@ -2227,7 +2274,7 @@ class GmediaCore{
|
|
2227 |
if(is_array($_terms['gmedia_album'])){
|
2228 |
$_terms['gmedia_album'] = trim(reset($_terms['gmedia_album']));
|
2229 |
}
|
2230 |
-
} else
|
2231 |
$_terms['gmedia_album'] = '';
|
2232 |
}
|
2233 |
if(isset($_terms['gmedia_category']) && !empty($_terms['gmedia_category'])){
|
@@ -2283,7 +2330,7 @@ class GmediaCore{
|
|
2283 |
}
|
2284 |
$fileinfo = $this->fileinfo($file, $file_suffix);
|
2285 |
|
2286 |
-
if(('skip' === $exists) &&
|
2287 |
echo $prefix . $fileinfo['basename_original'] . ': ' . __('file with the same name already exists', 'grand-media') . $eol;
|
2288 |
continue;
|
2289 |
}
|
@@ -2569,6 +2616,9 @@ class GmediaCore{
|
|
2569 |
|
2570 |
echo $prefix . $fileinfo['basename'] . ': <span class="ok">' . sprintf(__('success (ID #%s)', 'grand-media'), $id) . '</span>' . $eol;
|
2571 |
|
|
|
|
|
|
|
2572 |
if($move){
|
2573 |
@unlink($file);
|
2574 |
}
|
@@ -2595,10 +2645,10 @@ class GmediaCore{
|
|
2595 |
}
|
2596 |
|
2597 |
$fileinfo = $this->fileinfo($gmedia->gmuid);
|
2598 |
-
$file = $fileinfo['dirpath_original'] . '/' . $gmedia->gmuid;
|
2599 |
|
2600 |
-
if(
|
2601 |
-
|
|
|
2602 |
}
|
2603 |
|
2604 |
if('image' == $fileinfo['dirname']){
|
@@ -2612,7 +2662,12 @@ class GmediaCore{
|
|
2612 |
'title' => $gmedia->title,
|
2613 |
'link' => $gmedia->link,
|
2614 |
'description' => $gmedia->description,
|
2615 |
-
'status' => $gmedia->status
|
|
|
|
|
|
|
|
|
|
|
2616 |
);
|
2617 |
|
2618 |
$media_data['author'] = get_current_user_id();
|
@@ -2621,12 +2676,12 @@ class GmediaCore{
|
|
2621 |
$id = $gmDB->insert_gmedia($media_data);
|
2622 |
|
2623 |
$media_metadata = $gmDB->get_metadata('gmedia', $gmedia->ID);
|
2624 |
-
|
2625 |
-
|
2626 |
-
|
2627 |
-
|
2628 |
-
|
2629 |
-
}
|
2630 |
}
|
2631 |
|
2632 |
}
|
@@ -2671,9 +2726,15 @@ class GmediaCore{
|
|
2671 |
$webimg = $gmGallery->options['image'];
|
2672 |
$thumbimg = $gmGallery->options['thumb'];
|
2673 |
|
2674 |
-
$fileinfo
|
|
|
|
|
|
|
|
|
2675 |
|
2676 |
-
|
|
|
|
|
2677 |
|
2678 |
do{
|
2679 |
$extensions = array('1' => 'GIF', '2' => 'JPG', '3' => 'PNG', '6' => 'BMP');
|
@@ -2718,61 +2779,67 @@ class GmediaCore{
|
|
2718 |
|
2719 |
$size_ratio = $size[0] / $size[1];
|
2720 |
|
2721 |
-
$angle
|
2722 |
-
|
2723 |
-
|
2724 |
-
|
2725 |
-
|
2726 |
-
|
2727 |
-
|
2728 |
-
|
2729 |
-
|
2730 |
-
|
2731 |
-
|
2732 |
-
|
2733 |
-
|
2734 |
-
|
2735 |
-
|
|
|
|
|
2736 |
}
|
|
|
|
|
|
|
2737 |
}
|
2738 |
|
2739 |
-
$webimg['resize'] = (($webimg['width'] < $size[0]) || ($webimg['height'] < $size[1]))? true : false;
|
2740 |
$thumbimg['resize'] = (((1 >= $size_ratio) && ($thumbimg['width'] > $size[0])) || ((1 <= $size_ratio) && ($thumbimg['height'] > $size[1])))? false : true;
|
2741 |
|
2742 |
if($webimg['resize'] || $thumbimg['resize'] || $angle){
|
2743 |
|
2744 |
-
$editor = wp_get_image_editor($
|
2745 |
if(is_wp_error($editor)){
|
2746 |
$fail = $fileinfo['basename'] . " (wp_get_image_editor): " . $editor->get_error_message();
|
2747 |
break;
|
2748 |
}
|
2749 |
|
2750 |
-
if($
|
2751 |
-
|
2752 |
-
|
|
|
2753 |
|
2754 |
-
|
2755 |
-
|
2756 |
-
|
2757 |
|
2758 |
-
|
2759 |
-
|
2760 |
-
|
2761 |
-
|
2762 |
-
|
|
|
2763 |
}
|
2764 |
-
}
|
2765 |
|
2766 |
-
|
2767 |
-
|
2768 |
-
|
2769 |
-
|
2770 |
-
|
2771 |
-
|
2772 |
-
|
|
|
|
|
|
|
2773 |
}
|
2774 |
-
} else{
|
2775 |
-
@copy($fileinfo['filepath_original'], $fileinfo['filepath']);
|
2776 |
}
|
2777 |
|
2778 |
// Thumbnail
|
@@ -2798,16 +2865,18 @@ class GmediaCore{
|
|
2798 |
}
|
2799 |
|
2800 |
} else{
|
2801 |
-
|
2802 |
-
|
|
|
|
|
2803 |
}
|
2804 |
|
2805 |
$id = $gmDB->insert_gmedia($gmedia);
|
2806 |
|
2807 |
$new_metadata = $gmDB->generate_gmedia_metadata($id, $fileinfo);
|
|
|
2808 |
$metadata['web'] = $new_metadata['web'];
|
2809 |
$metadata['original'] = $new_metadata['original'];
|
2810 |
-
$metadata['thumb'] = $new_metadata['thumb'];
|
2811 |
|
2812 |
$gmDB->update_metadata($meta_type = 'gmedia', $id, $meta_key = '_metadata', $metadata);
|
2813 |
$gmDB->update_metadata($meta_type = 'gmedia', $id, $meta_key = '_modified', 0);
|
@@ -2955,8 +3024,8 @@ class GmediaCore{
|
|
2955 |
* @param null $modules
|
2956 |
*/
|
2957 |
function modules_update($modules = null){
|
2958 |
-
$wp_installing = (bool)(defined(
|
2959 |
-
if
|
2960 |
return;
|
2961 |
}
|
2962 |
|
@@ -2972,11 +3041,11 @@ class GmediaCore{
|
|
2972 |
|
2973 |
foreach($modules['in'] as $module){
|
2974 |
if(!empty($module['update']) && 'remote' != $module['place']){
|
2975 |
-
$modules_update_count++;
|
2976 |
}
|
2977 |
}
|
2978 |
|
2979 |
-
$gmGallery->options
|
2980 |
$gmGallery->options['modules_update'] = $modules_update_count;
|
2981 |
|
2982 |
update_option('gmediaOptions', $gmGallery->options);
|
@@ -3123,7 +3192,7 @@ class GmediaCore{
|
|
3123 |
$entry['meta_id'] = (int)$entry['meta_id'];
|
3124 |
|
3125 |
$colsm = ('gmedia' == $meta_type)? 6 : 4;
|
3126 |
-
//$delete_nonce = wp_create_nonce( 'gmedia_custom_field', '
|
3127 |
$item = '
|
3128 |
<div class="form-group col-sm-' . $colsm . ' gm-custom-meta-' . $entry['meta_id'] . '">
|
3129 |
<span class="delete-custom-field glyphicon glyphicon-remove pull-right text-danger"></span>
|
@@ -3288,7 +3357,7 @@ class GmediaCore{
|
|
3288 |
continue;
|
3289 |
}
|
3290 |
$key_name = $this->i18n_exif_name($key);
|
3291 |
-
$key_name =
|
3292 |
$value = $this->sanitize_meta_value($value);
|
3293 |
$metadata[ $key ] = array('name' => $key_name, 'value' => $value);
|
3294 |
}
|
@@ -3311,7 +3380,7 @@ class GmediaCore{
|
|
3311 |
continue;
|
3312 |
}
|
3313 |
$key_name = $this->i18n_exif_name($key);
|
3314 |
-
$key_name =
|
3315 |
if(is_array($val)){
|
3316 |
$val = $this->sanitize_meta_value($val);
|
3317 |
}
|
@@ -3502,13 +3571,20 @@ class GmediaCore{
|
|
3502 |
* @return array Gmedia Capabilities
|
3503 |
*/
|
3504 |
function modules_order(){
|
3505 |
-
return array(
|
|
|
3506 |
'phantom-pro' => '',
|
|
|
|
|
|
|
3507 |
'phototravlr' => '',
|
3508 |
'realslider' => '',
|
3509 |
'mosaic' => '',
|
3510 |
'photobox' => '',
|
3511 |
'wavesurfer' => '',
|
|
|
|
|
|
|
3512 |
'photomania' => '',
|
3513 |
'jq-mplayer' => '',
|
3514 |
'wp-videoplayer' => '',
|
@@ -3545,8 +3621,8 @@ class GmediaCore{
|
|
3545 |
$preset = $gmDB->get_term($module);
|
3546 |
if($preset && !is_wp_error($preset)){
|
3547 |
$module = $preset->status;
|
3548 |
-
$module_settings = array($module => (array)maybe_unserialize($preset->description)
|
3549 |
-
);
|
3550 |
} else{
|
3551 |
return $this->getModulePreset($set_module_callback);
|
3552 |
}
|
@@ -3554,14 +3630,15 @@ class GmediaCore{
|
|
3554 |
$preset = $gmDB->get_term('[' . $module . ']', array('taxonomy' => 'gmedia_module', 'global' => '0'));
|
3555 |
if($preset && !is_wp_error($preset)){
|
3556 |
$module = $preset->status;
|
3557 |
-
$module_settings = array($module => (array)maybe_unserialize($preset->description)
|
3558 |
-
);
|
3559 |
} else{
|
3560 |
$module_settings = array($module => array());
|
|
|
3561 |
}
|
3562 |
}
|
3563 |
|
3564 |
-
return array('module' => $module, 'settings' => $module_settings);
|
3565 |
}
|
3566 |
|
3567 |
/**
|
@@ -3612,7 +3689,7 @@ class GmediaCore{
|
|
3612 |
unset($terms[ $key ]);
|
3613 |
}
|
3614 |
}
|
3615 |
-
} else
|
3616 |
global $user_ID;
|
3617 |
foreach($terms as $key => $term){
|
3618 |
if('draft' === $term->status){
|
@@ -3631,6 +3708,37 @@ class GmediaCore{
|
|
3631 |
return $terms;
|
3632 |
}
|
3633 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3634 |
/**
|
3635 |
* Converts IDN in given url address to its ASCII form, also known as punycode, if possible.
|
3636 |
* This function silently returns unmodified address if:
|
@@ -3647,11 +3755,7 @@ class GmediaCore{
|
|
3647 |
$url_host = parse_url($url, PHP_URL_HOST);
|
3648 |
|
3649 |
if((boolean)preg_match('/[\x80-\xFF]/', $url_host)){
|
3650 |
-
|
3651 |
-
$host = mb_convert_encoding($url_host, 'UTF-8');
|
3652 |
-
} else{
|
3653 |
-
$host = $url_host;
|
3654 |
-
}
|
3655 |
if(function_exists('idn_to_ascii')){
|
3656 |
$options = 0;
|
3657 |
if(($punycode = defined('INTL_IDNA_VARIANT_UTS46')? idn_to_ascii($host, $options, INTL_IDNA_VARIANT_UTS46) : idn_to_ascii($host)) !== false){
|
147 |
$uri = admin_url('admin.php');
|
148 |
}
|
149 |
$remove_args = empty($remove_args)? array() : (array)$remove_args;
|
150 |
+
$_wpnonce = array();
|
151 |
+
foreach ($_GET as $key => $value) {
|
152 |
+
if (strpos($key, '_wpnonce') !== false) {
|
153 |
+
$_wpnonce[$key] = $value;
|
154 |
+
}
|
155 |
+
}
|
156 |
+
$remove_args = array_unique(array_merge(array('doing_wp_cron', '_wpnonce', 'do_gmedia', 'did_gmedia', 'do_gmedia_terms', 'did_gmedia_terms', 'ids'), $_wpnonce, $remove_args, array_keys($add_args)));
|
157 |
$new_uri = remove_query_arg($remove_args, $uri);
|
158 |
if(!empty($preserve_args)){
|
159 |
$_add_args = array();
|
266 |
* @uses apply_filters() Calls 'gm_get_attachment_image_attributes' hook on attributes array
|
267 |
*
|
268 |
* @param int|object $item Image object.
|
269 |
+
* @param string $size Optional, default is empty string, could be 'thumb', 'web', 'original'
|
270 |
* @param bool $cover Optional, try to get cover url
|
271 |
+
* @param bool|string $default Optional, return if no cover and if $size != 'all'
|
272 |
*
|
273 |
+
* @return string|array img url for chosen size
|
274 |
*/
|
275 |
function gm_get_media_image($item, $size = '', $cover = true, $default = false){
|
276 |
global $gmDB, $gmGallery;
|
278 |
if(!is_object($item)){
|
279 |
$item = $gmDB->get_gmedia($item);
|
280 |
}
|
281 |
+
if(!$size){
|
282 |
+
$size = 'web';
|
283 |
+
}
|
284 |
if(empty($item)){
|
285 |
+
$image = $default? $default : $this->gmedia_url . '/admin/assets/img/default.png';
|
286 |
+
$images = apply_filters('gm_get_media_image', array('thumb' => $image,
|
287 |
+
'web' => $image,
|
288 |
+
'original' => $image
|
289 |
+
));
|
290 |
+
if('all' == $size){
|
291 |
+
return $images;
|
292 |
+
} else{
|
293 |
+
return $images[ $size ];
|
294 |
+
}
|
295 |
}
|
296 |
$type = explode('/', $item->mime_type);
|
297 |
+
$img_cover = false;
|
298 |
if('image' == $type[0]){
|
299 |
+
$images = array('thumb' => "{$this->upload['url']}/{$gmGallery->options['folder']['image_thumb']}/{$item->gmuid}",
|
300 |
+
'web' => "{$this->upload['url']}/{$gmGallery->options['folder']['image']}/{$item->gmuid}",
|
301 |
+
'original' => "{$this->upload['url']}/{$gmGallery->options['folder']['image_original']}/{$item->gmuid}"
|
302 |
+
);
|
303 |
+
if('all' == $size || 'thumb' == $size){
|
304 |
+
$thumb_path = "{$this->upload['path']}/{$gmGallery->options['folder']['image_thumb']}/{$item->gmuid}";
|
305 |
+
if( !is_file($thumb_path)){
|
306 |
+
$img_cover = true;
|
307 |
+
}
|
|
|
|
|
|
|
|
|
308 |
}
|
309 |
+
if('all' == $size || 'original' == $size){
|
310 |
+
$original_path = "{$this->upload['path']}/{$gmGallery->options['folder']['image_original']}/{$item->gmuid}";
|
311 |
+
if(!is_file($original_path)){
|
312 |
+
$images['original'] = $images['web'];
|
313 |
+
}
|
314 |
+
}
|
315 |
+
}
|
316 |
+
if('image' != $type[0] || $img_cover){
|
317 |
$ext = ltrim(strrchr($item->gmuid, '.'), '.');
|
318 |
if(!$type = wp_ext2type($ext)){
|
319 |
$type = 'application';
|
320 |
}
|
321 |
+
$image = "{$this->gmedia_url}/admin/assets/img/{$type}.png";
|
322 |
+
$images = array('thumb' => $image,
|
323 |
+
'web' => $image,
|
324 |
+
'original' => $image
|
325 |
+
);
|
326 |
|
327 |
if($cover){
|
328 |
$cover = $gmDB->get_metadata('gmedia', $item->ID, '_cover', true);
|
329 |
if(!empty($cover)){
|
330 |
if($this->is_digit($cover)){
|
331 |
+
$images = $this->gm_get_media_image((int)$cover, 'all', false);
|
332 |
+
$images['icon'] = $image;
|
|
|
333 |
}
|
334 |
+
} elseif($default !== false){
|
335 |
return $default;
|
336 |
+
} else {
|
337 |
+
$alb = $gmDB->get_gmedia_terms(array($item->ID), array('gmedia_album'), array('fields' => 'ids'));
|
338 |
+
if(!empty($alb)){
|
339 |
+
$cover = $gmDB->get_metadata('gmedia_term', $alb[0], '_cover', true);
|
340 |
+
if(!empty($cover)){
|
341 |
+
if($this->is_digit($cover)){
|
342 |
+
$images = $this->gm_get_media_image((int)$cover, 'all', false);
|
343 |
+
$images['icon'] = $image;
|
344 |
+
}
|
345 |
+
}
|
346 |
+
}
|
347 |
}
|
348 |
}
|
349 |
}
|
350 |
|
351 |
+
if('all' == $size){
|
352 |
+
return $images;
|
353 |
+
} else{
|
354 |
+
return $images[ $size ];
|
355 |
+
}
|
356 |
}
|
357 |
|
358 |
/**
|
428 |
$fileinfo['basename'] = $fileinfo['filename'] . '.' . $fileinfo['extension'];
|
429 |
$fileinfo['title'] = str_replace('_', ' ', esc_sql($title));
|
430 |
if((int)$gmGallery->options['name2title_capitalize']){
|
431 |
+
$fileinfo['title'] = $this->mb_ucwords_utf8($fileinfo['title']);
|
432 |
}
|
433 |
+
$fileinfo['mime_type'] = (empty($filetype['type']))? 'application/' . $fileinfo['extension'] : $filetype['type'];
|
434 |
list($dirname) = explode('/', $fileinfo['mime_type']);
|
435 |
$fileinfo['dirname'] = $dirname;
|
436 |
$fileinfo['dirpath'] = $this->upload['path'] . '/' . $gmGallery->options['folder'][ $dirname ];
|
452 |
$fileinfo['fileurl_thumb'] = $fileinfo['dirurl_thumb'] . '/' . $fileinfo['basename'];
|
453 |
}
|
454 |
|
455 |
+
if((false !== $exists) && is_file($fileinfo['filepath'])){
|
456 |
$exists = absint($exists) + 1;
|
457 |
$fileinfo = $this->fileinfo($file, $exists);
|
458 |
}
|
475 |
$metadata = array();
|
476 |
require_once(ABSPATH . 'wp-admin/includes/image.php');
|
477 |
if(preg_match('!^image/!', $fileinfo['mime_type']) && file_is_displayable_image($fileinfo['filepath'])){
|
478 |
+
$is_file_original = is_file($fileinfo['filepath_original']);
|
479 |
+
$filepath_original = $is_file_original? $fileinfo['filepath_original'] : $fileinfo['filepath'];
|
480 |
+
$imagesize = getimagesize($fileinfo['filepath_thumb']);
|
481 |
+
$metadata['thumb'] = array('width' => $imagesize[0], 'height' => $imagesize[1]);
|
482 |
+
$imagesize = getimagesize($fileinfo['filepath']);
|
483 |
+
$metadata['web'] = array('width' => $imagesize[0], 'height' => $imagesize[1]);
|
484 |
+
if($is_file_original){
|
485 |
+
$imagesize = getimagesize($filepath_original);
|
486 |
+
$metadata['original'] = array('width' => $imagesize[0], 'height' => $imagesize[1]);
|
487 |
+
} else{
|
488 |
+
$metadata['original'] = $metadata['web'];
|
489 |
+
}
|
490 |
|
491 |
$metadata['file'] = $this->_gm_relative_upload_path($fileinfo['filepath']);
|
492 |
|
493 |
// fetch additional metadata from exif/iptc
|
494 |
+
$image_meta = $this->wp_read_image_metadata($filepath_original);
|
495 |
if($image_meta){
|
496 |
$metadata['image_meta'] = $image_meta;
|
497 |
}
|
615 |
/**
|
616 |
* Generate GmediaCloud page url
|
617 |
*
|
618 |
+
* @param $id
|
619 |
+
* @param $type
|
620 |
+
* @param bool $default
|
621 |
*
|
622 |
* @return string
|
623 |
*/
|
624 |
+
function gmcloudlink($id, $type, $default = false){
|
625 |
$options = get_option('gmediaOptions');
|
626 |
$endpoint = $options['endpoint'];
|
627 |
$hashid = gmedia_hash_id_encode($id, $type);
|
632 |
'category' => 'k',
|
633 |
'author' => 'u'
|
634 |
);
|
635 |
+
if(!$default && get_option('permalink_structure')){
|
636 |
$cloud_link = home_url(urlencode($endpoint) . "/{$t[$type]}/{$hashid}");
|
637 |
} else{
|
638 |
$cloud_link = add_query_arg(array("$endpoint" => $hashid, 't' => $t[ $type ]), home_url('index.php'));
|
1278 |
* @return bool|array False on failure. Image metadata array on success.
|
1279 |
*/
|
1280 |
function wp_read_image_metadata($file){
|
1281 |
+
if(!is_file($file)){
|
1282 |
return false;
|
1283 |
}
|
1284 |
|
1585 |
* @return array|boolean Returns array of metadata, if found.
|
1586 |
*/
|
1587 |
function wp_read_video_metadata($file){
|
1588 |
+
if(!is_file($file)){
|
1589 |
return false;
|
1590 |
}
|
1591 |
|
1656 |
* @return array|boolean Returns array of metadata, if found.
|
1657 |
*/
|
1658 |
function wp_read_audio_metadata($file){
|
1659 |
+
if(!is_file($file)){
|
1660 |
return false;
|
1661 |
}
|
1662 |
$metadata = array();
|
2003 |
}
|
2004 |
$is_webimage = true;
|
2005 |
} else{
|
2006 |
+
/*@unlink($fileinfo['filepath']);
|
2007 |
$return = array("error" => array("code" => 104, "message" => __("Could not read image size. Invalid image was deleted.", 'grand-media')),
|
2008 |
"id" => $fileinfo['basename_original']
|
2009 |
);
|
2010 |
|
2011 |
return $return;
|
2012 |
+
*/
|
2013 |
}
|
2014 |
}
|
2015 |
|
2141 |
"id" => $fileinfo['basename']
|
2142 |
);
|
2143 |
|
2144 |
+
if((int)$gmGallery->options['delete_originals']){
|
2145 |
+
@unlink($fileinfo['filepath_original']);
|
2146 |
+
}
|
2147 |
+
|
2148 |
return $return;
|
2149 |
} else{
|
2150 |
$return = array("success" => array("code" => 199, "message" => $chunk . '/' . $chunks), "id" => $fileinfo['basename']);
|
2274 |
if(is_array($_terms['gmedia_album'])){
|
2275 |
$_terms['gmedia_album'] = trim(reset($_terms['gmedia_album']));
|
2276 |
}
|
2277 |
+
} else{
|
2278 |
$_terms['gmedia_album'] = '';
|
2279 |
}
|
2280 |
if(isset($_terms['gmedia_category']) && !empty($_terms['gmedia_category'])){
|
2330 |
}
|
2331 |
$fileinfo = $this->fileinfo($file, $file_suffix);
|
2332 |
|
2333 |
+
if(('skip' === $exists) && is_file($fileinfo['filepath'])){
|
2334 |
echo $prefix . $fileinfo['basename_original'] . ': ' . __('file with the same name already exists', 'grand-media') . $eol;
|
2335 |
continue;
|
2336 |
}
|
2616 |
|
2617 |
echo $prefix . $fileinfo['basename'] . ': <span class="ok">' . sprintf(__('success (ID #%s)', 'grand-media'), $id) . '</span>' . $eol;
|
2618 |
|
2619 |
+
if((int)$gmGallery->options['delete_originals']){
|
2620 |
+
@unlink($fileinfo['filepath_original']);
|
2621 |
+
}
|
2622 |
if($move){
|
2623 |
@unlink($file);
|
2624 |
}
|
2645 |
}
|
2646 |
|
2647 |
$fileinfo = $this->fileinfo($gmedia->gmuid);
|
|
|
2648 |
|
2649 |
+
if(is_file($fileinfo['dirpath_original'] . '/' . $gmedia->gmuid)){
|
2650 |
+
$file = $fileinfo['dirpath_original'] . '/' . $gmedia->gmuid;
|
2651 |
+
copy($file, $fileinfo['filepath_original']);
|
2652 |
}
|
2653 |
|
2654 |
if('image' == $fileinfo['dirname']){
|
2662 |
'title' => $gmedia->title,
|
2663 |
'link' => $gmedia->link,
|
2664 |
'description' => $gmedia->description,
|
2665 |
+
'status' => $gmedia->status,
|
2666 |
+
'terms' => array(
|
2667 |
+
'gmedia_album' => $gmDB->get_gmedia_terms($gmedia->ID, array('gmedia_album'), array('fields' => 'ids')),
|
2668 |
+
'gmedia_category' => $gmDB->get_gmedia_terms($gmedia->ID, array('gmedia_category'), array('fields' => 'ids')),
|
2669 |
+
'gmedia_tag' => $gmDB->get_gmedia_terms($gmedia->ID, array('gmedia_tag'), array('fields' => 'ids', 'order' => 'term_order'))
|
2670 |
+
)
|
2671 |
);
|
2672 |
|
2673 |
$media_data['author'] = get_current_user_id();
|
2676 |
$id = $gmDB->insert_gmedia($media_data);
|
2677 |
|
2678 |
$media_metadata = $gmDB->get_metadata('gmedia', $gmedia->ID);
|
2679 |
+
foreach($media_metadata as $key => $values){
|
2680 |
+
//if($this->is_protected_meta($key, 'gmedia')){
|
2681 |
+
foreach($values as $val){
|
2682 |
+
$gmDB->add_metadata($meta_type = 'gmedia', $id, $key, $val);
|
2683 |
+
}
|
2684 |
+
//}
|
2685 |
}
|
2686 |
|
2687 |
}
|
2726 |
$webimg = $gmGallery->options['image'];
|
2727 |
$thumbimg = $gmGallery->options['thumb'];
|
2728 |
|
2729 |
+
$fileinfo = $this->fileinfo($item->gmuid, false);
|
2730 |
+
$is_file_original = is_file($fileinfo['filepath_original']);
|
2731 |
+
$filepath_original = $is_file_original? $fileinfo['filepath_original'] : (is_file($fileinfo['filepath'])? $fileinfo['filepath'] : null);
|
2732 |
+
if(!$filepath_original){
|
2733 |
+
$out = array('error' => $this->alert('danger', __('Original file does not exists', 'grand-media')));
|
2734 |
|
2735 |
+
return $out;
|
2736 |
+
}
|
2737 |
+
$size = @getimagesize($filepath_original);
|
2738 |
|
2739 |
do{
|
2740 |
$extensions = array('1' => 'GIF', '2' => 'JPG', '3' => 'PNG', '6' => 'BMP');
|
2779 |
|
2780 |
$size_ratio = $size[0] / $size[1];
|
2781 |
|
2782 |
+
$angle = 0;
|
2783 |
+
if($is_file_original){
|
2784 |
+
$image_meta = @$this->wp_read_image_metadata($filepath_original);
|
2785 |
+
if(!empty($image_meta['orientation'])){
|
2786 |
+
switch($image_meta['orientation']){
|
2787 |
+
case 3:
|
2788 |
+
$angle = 180;
|
2789 |
+
break;
|
2790 |
+
case 6:
|
2791 |
+
$angle = 270;
|
2792 |
+
$size_ratio = $size[1] / $size[0];
|
2793 |
+
break;
|
2794 |
+
case 8:
|
2795 |
+
$angle = 90;
|
2796 |
+
$size_ratio = $size[1] / $size[0];
|
2797 |
+
break;
|
2798 |
+
}
|
2799 |
}
|
2800 |
+
$webimg['resize'] = (($webimg['width'] < $size[0]) || ($webimg['height'] < $size[1]))? true : false;
|
2801 |
+
} else{
|
2802 |
+
$webimg['resize'] = false;
|
2803 |
}
|
2804 |
|
|
|
2805 |
$thumbimg['resize'] = (((1 >= $size_ratio) && ($thumbimg['width'] > $size[0])) || ((1 <= $size_ratio) && ($thumbimg['height'] > $size[1])))? false : true;
|
2806 |
|
2807 |
if($webimg['resize'] || $thumbimg['resize'] || $angle){
|
2808 |
|
2809 |
+
$editor = wp_get_image_editor($filepath_original);
|
2810 |
if(is_wp_error($editor)){
|
2811 |
$fail = $fileinfo['basename'] . " (wp_get_image_editor): " . $editor->get_error_message();
|
2812 |
break;
|
2813 |
}
|
2814 |
|
2815 |
+
if($is_file_original){
|
2816 |
+
if($angle){
|
2817 |
+
$editor->rotate($angle);
|
2818 |
+
}
|
2819 |
|
2820 |
+
if($webimg['resize'] || $angle){
|
2821 |
+
// Web-image
|
2822 |
+
$editor->set_quality($webimg['quality']);
|
2823 |
|
2824 |
+
if($webimg['resize']){
|
2825 |
+
$resized = $editor->resize($webimg['width'], $webimg['height'], $webimg['crop']);
|
2826 |
+
if(is_wp_error($resized)){
|
2827 |
+
$fail = $fileinfo['basename'] . " (" . $resized->get_error_code() . " | editor->resize->webimage({$webimg['width']}, {$webimg['height']}, {$webimg['crop']})): " . $resized->get_error_message();
|
2828 |
+
break;
|
2829 |
+
}
|
2830 |
}
|
|
|
2831 |
|
2832 |
+
$saved = $editor->save($fileinfo['filepath']);
|
2833 |
+
if(is_wp_error($saved)){
|
2834 |
+
$fail = $fileinfo['basename'] . " (" . $saved->get_error_code() . " | editor->save->webimage): " . $saved->get_error_message();
|
2835 |
+
break;
|
2836 |
+
}
|
2837 |
+
if(('JPG' == $extensions[ $size[2] ]) && !(extension_loaded('imagick') || class_exists("Imagick"))){
|
2838 |
+
$this->copy_exif($filepath_original, $fileinfo['filepath']);
|
2839 |
+
}
|
2840 |
+
} else{
|
2841 |
+
@copy($filepath_original, $fileinfo['filepath']);
|
2842 |
}
|
|
|
|
|
2843 |
}
|
2844 |
|
2845 |
// Thumbnail
|
2865 |
}
|
2866 |
|
2867 |
} else{
|
2868 |
+
if($is_file_original){
|
2869 |
+
@copy($filepath_original, $fileinfo['filepath']);
|
2870 |
+
}
|
2871 |
+
@copy($filepath_original, $fileinfo['filepath_thumb']);
|
2872 |
}
|
2873 |
|
2874 |
$id = $gmDB->insert_gmedia($gmedia);
|
2875 |
|
2876 |
$new_metadata = $gmDB->generate_gmedia_metadata($id, $fileinfo);
|
2877 |
+
$metadata['thumb'] = $new_metadata['thumb'];
|
2878 |
$metadata['web'] = $new_metadata['web'];
|
2879 |
$metadata['original'] = $new_metadata['original'];
|
|
|
2880 |
|
2881 |
$gmDB->update_metadata($meta_type = 'gmedia', $id, $meta_key = '_metadata', $metadata);
|
2882 |
$gmDB->update_metadata($meta_type = 'gmedia', $id, $meta_key = '_modified', 0);
|
3024 |
* @param null $modules
|
3025 |
*/
|
3026 |
function modules_update($modules = null){
|
3027 |
+
$wp_installing = (bool)(defined('WP_INSTALLING') && WP_INSTALLING);
|
3028 |
+
if($wp_installing){
|
3029 |
return;
|
3030 |
}
|
3031 |
|
3041 |
|
3042 |
foreach($modules['in'] as $module){
|
3043 |
if(!empty($module['update']) && 'remote' != $module['place']){
|
3044 |
+
$modules_update_count ++;
|
3045 |
}
|
3046 |
}
|
3047 |
|
3048 |
+
$gmGallery->options = get_option('gmediaOptions');
|
3049 |
$gmGallery->options['modules_update'] = $modules_update_count;
|
3050 |
|
3051 |
update_option('gmediaOptions', $gmGallery->options);
|
3192 |
$entry['meta_id'] = (int)$entry['meta_id'];
|
3193 |
|
3194 |
$colsm = ('gmedia' == $meta_type)? 6 : 4;
|
3195 |
+
//$delete_nonce = wp_create_nonce( 'gmedia_custom_field', '_wpnonce_custom_field' );
|
3196 |
$item = '
|
3197 |
<div class="form-group col-sm-' . $colsm . ' gm-custom-meta-' . $entry['meta_id'] . '">
|
3198 |
<span class="delete-custom-field glyphicon glyphicon-remove pull-right text-danger"></span>
|
3357 |
continue;
|
3358 |
}
|
3359 |
$key_name = $this->i18n_exif_name($key);
|
3360 |
+
$key_name = $this->mb_ucwords_utf8(str_replace('_', ' ', $key_name));
|
3361 |
$value = $this->sanitize_meta_value($value);
|
3362 |
$metadata[ $key ] = array('name' => $key_name, 'value' => $value);
|
3363 |
}
|
3380 |
continue;
|
3381 |
}
|
3382 |
$key_name = $this->i18n_exif_name($key);
|
3383 |
+
$key_name = $this->mb_ucwords_utf8(str_replace('_', ' ', $key_name));
|
3384 |
if(is_array($val)){
|
3385 |
$val = $this->sanitize_meta_value($val);
|
3386 |
}
|
3571 |
* @return array Gmedia Capabilities
|
3572 |
*/
|
3573 |
function modules_order(){
|
3574 |
+
return array(
|
3575 |
+
'albumsgrid' => '',
|
3576 |
'phantom-pro' => '',
|
3577 |
+
'albums-stripes' => '',
|
3578 |
+
'cubik' => '',
|
3579 |
+
'desire' => '',
|
3580 |
'phototravlr' => '',
|
3581 |
'realslider' => '',
|
3582 |
'mosaic' => '',
|
3583 |
'photobox' => '',
|
3584 |
'wavesurfer' => '',
|
3585 |
+
'phantom' => '',
|
3586 |
+
'flipgrid' => '',
|
3587 |
+
'cubik-lite' => '',
|
3588 |
'photomania' => '',
|
3589 |
'jq-mplayer' => '',
|
3590 |
'wp-videoplayer' => '',
|
3621 |
$preset = $gmDB->get_term($module);
|
3622 |
if($preset && !is_wp_error($preset)){
|
3623 |
$module = $preset->status;
|
3624 |
+
$module_settings = array($module => (array)maybe_unserialize($preset->description));
|
3625 |
+
$name = trim(str_replace('[' . $module . ']', '', $preset->name));
|
3626 |
} else{
|
3627 |
return $this->getModulePreset($set_module_callback);
|
3628 |
}
|
3630 |
$preset = $gmDB->get_term('[' . $module . ']', array('taxonomy' => 'gmedia_module', 'global' => '0'));
|
3631 |
if($preset && !is_wp_error($preset)){
|
3632 |
$module = $preset->status;
|
3633 |
+
$module_settings = array($module => (array)maybe_unserialize($preset->description));
|
3634 |
+
$name = __('Default Settings', 'grand-media');
|
3635 |
} else{
|
3636 |
$module_settings = array($module => array());
|
3637 |
+
$name = $module;
|
3638 |
}
|
3639 |
}
|
3640 |
|
3641 |
+
return array('module' => $module, 'settings' => $module_settings, 'name' => $name);
|
3642 |
}
|
3643 |
|
3644 |
/**
|
3689 |
unset($terms[ $key ]);
|
3690 |
}
|
3691 |
}
|
3692 |
+
} else{
|
3693 |
global $user_ID;
|
3694 |
foreach($terms as $key => $term){
|
3695 |
if('draft' === $term->status){
|
3708 |
return $terms;
|
3709 |
}
|
3710 |
|
3711 |
+
/**
|
3712 |
+
* mb_convert_encoding alternative function
|
3713 |
+
*
|
3714 |
+
* @param $string
|
3715 |
+
*
|
3716 |
+
* @return string
|
3717 |
+
*/
|
3718 |
+
function mb_convert_encoding_utf8($string){
|
3719 |
+
if(function_exists('mb_convert_encoding')){
|
3720 |
+
$string = mb_convert_encoding($string, 'UTF-8', 'UTF-8');
|
3721 |
+
} else{
|
3722 |
+
$string = htmlspecialchars_decode(utf8_decode(htmlentities($string, ENT_COMPAT, 'utf-8', false)));
|
3723 |
+
}
|
3724 |
+
|
3725 |
+
return $string;
|
3726 |
+
}
|
3727 |
+
|
3728 |
+
/**
|
3729 |
+
* mb_convert_case alternative function
|
3730 |
+
*
|
3731 |
+
* @param $string
|
3732 |
+
*
|
3733 |
+
* @return string
|
3734 |
+
*/
|
3735 |
+
function mb_ucwords_utf8($string){
|
3736 |
+
$string = $this->mb_convert_encoding_utf8($string);
|
3737 |
+
$string = ucwords($string);
|
3738 |
+
|
3739 |
+
return $string;
|
3740 |
+
}
|
3741 |
+
|
3742 |
/**
|
3743 |
* Converts IDN in given url address to its ASCII form, also known as punycode, if possible.
|
3744 |
* This function silently returns unmodified address if:
|
3755 |
$url_host = parse_url($url, PHP_URL_HOST);
|
3756 |
|
3757 |
if((boolean)preg_match('/[\x80-\xFF]/', $url_host)){
|
3758 |
+
$host = $this->mb_convert_encoding_utf8($url_host);
|
|
|
|
|
|
|
|
|
3759 |
if(function_exists('idn_to_ascii')){
|
3760 |
$options = 0;
|
3761 |
if(($punycode = defined('INTL_IDNA_VARIANT_UTS46')? idn_to_ascii($host, $options, INTL_IDNA_VARIANT_UTS46) : idn_to_ascii($host)) !== false){
|
inc/db.connect.php
CHANGED
@@ -307,7 +307,12 @@ class GmediaDB{
|
|
307 |
return '';
|
308 |
}
|
309 |
$params = $_GET;
|
310 |
-
|
|
|
|
|
|
|
|
|
|
|
311 |
$new_query_string = http_build_query($params);
|
312 |
//$self = admin_url( 'admin.php?' . $new_query_string );
|
313 |
$self = '?' . $new_query_string;
|
@@ -381,11 +386,11 @@ class GmediaDB{
|
|
381 |
$object = wp_parse_args($object, $defaults);
|
382 |
if(isset($object['title'])){
|
383 |
$object['title'] = strip_tags($object['title'], '<span>');
|
384 |
-
$object['title'] =
|
385 |
}
|
386 |
if(isset($object['description'])){
|
387 |
$object['description'] = $gmCore->clean_input($object['description']);
|
388 |
-
$object['description'] =
|
389 |
}
|
390 |
if(isset($object['link'])){
|
391 |
$object['link'] = esc_url_raw($object['link']);
|
@@ -640,7 +645,6 @@ class GmediaDB{
|
|
640 |
|
641 |
/**
|
642 |
* Re
|
307 |
return '';
|
308 |
}
|
309 |
$params = $_GET;
|
310 |
+
foreach ($params as $key => $value) {
|
311 |
+
if (strpos($key, '_wpnonce') !== false) {
|
312 |
+
unset($params[$key]);
|
313 |
+
}
|
314 |
+
}
|
315 |
+
unset($params['pager'], $params['do_gmedia'], $params['did_gmedia'], $params['do_gmedia_terms'], $params['did_gmedia_terms'], $params['ids'], $params['doing_wp_cron']);
|
316 |
$new_query_string = http_build_query($params);
|
317 |
//$self = admin_url( 'admin.php?' . $new_query_string );
|
318 |
$self = '?' . $new_query_string;
|
386 |
$object = wp_parse_args($object, $defaults);
|
387 |
if(isset($object['title'])){
|
388 |
$object['title'] = strip_tags($object['title'], '<span>');
|
389 |
+
$object['title'] = $gmCore->mb_convert_encoding_utf8($object['title']);
|
390 |
}
|
391 |
if(isset($object['description'])){
|
392 |
$object['description'] = $gmCore->clean_input($object['description']);
|
393 |
+
$object['description'] = $gmCore->mb_convert_encoding_utf8($object['description']);
|
394 |
}
|
395 |
if(isset($object['link'])){
|
396 |
$object['link'] = esc_url_raw($object['link']);
|
645 |
|
646 |
/**
|
647 |
* Re
|