Version Description
- Added: Download button functionality related to the filters.
- Added: Gutenberg integration.
- Added: Recreate thumbnails, set and reset watermark functions actions by Ajax ( part to part by limit 50 ) in options.
- Added: Images sorting functionality in gallery edit page.
- Changed: Moved Slideshow view inline javascript to js file.
- Changed: Remove static css from Slideshow view.
- Changed: Check GD2 library availability.
- Changed: Thumbnail titles styles in thumbnail view.
- Changed: Design of filters in thumbnail view.
- Improved: Open lightbox faster.
- Improved: How to use.
- Fixed: Add shortcode functionality on Beaver, Elementor, SiteOrigin and Visual Composer builders.
- Fixed: Bug on setting watermark.
- Fixed: Conflict with "Fast Velocity Minify".
- Fixed: Filmstrip image ordering
- Fixed: Bug on searched images delete in admin.
- Fixed: Conflict Wordpress.com hosting.
- Fixed: Search logic when the image title contains several words and when you add space before searched word.
- Fixed: Bug on scroll load.
- Fixed: Add items to gallery group in IE.
- Fixed: Slideshow widget bug.
- Fixed: Importing to many images from Media library.
Download this release
Release Info
Developer | webdorado |
Plugin | Photo Gallery by WD – Responsive Photo Gallery |
Version | 1.4.13 |
Comparing to | |
See all releases |
Code changes from version 1.4.12 to 1.4.13
- admin/controllers/Albums.php +3 -3
- admin/controllers/Galleries.php +16 -113
- admin/controllers/Options.php +77 -55
- admin/controllers/Themes.php +6 -6
- admin/models/Albums.php +2 -2
- admin/models/Galleries.php +137 -184
- admin/models/Options.php +29 -0
- admin/models/Themes.php +64 -5
- admin/models/Uninstall.php +2 -2
- admin/views/AddTags.php +2 -2
- admin/views/AdminView.php +30 -2
- admin/views/Albums.php +12 -50
- admin/views/Albumsgalleries.php +4 -4
- admin/views/Editimage.php +71 -91
- admin/views/Galleries.php +61 -85
- admin/views/Options.php +31 -21
- admin/views/Shortcode.php +22 -13
- admin/views/Themes.php +10 -4
- admin/views/Uninstall.php +2 -2
- css/bwg_frontend.css +586 -18
- css/bwg_tables.css +29 -9
- css/sumoselect.css +125 -80
- filemanager/UploadHandler.php +51 -76
- filemanager/controller.php +6 -10
- filemanager/js/default.js +90 -51
- framework/BWGOptions.php +29 -23
- framework/WDWLibrary.php +276 -73
- framework/howto/data.php +145 -0
- framework/howto/howto.php +407 -0
- framework/howto/screenshots/0_1.png +0 -0
- framework/howto/screenshots/0_2.png +0 -0
- framework/howto/screenshots/0_3.png +0 -0
- framework/howto/screenshots/1_1.png +0 -0
- framework/howto/screenshots/1_2.png +0 -0
- framework/howto/screenshots/2_2.png +0 -0
- frontend/controllers/BWGControllerAlbum_compact_preview.php +2 -5
- frontend/controllers/BWGControllerAlbum_extended_preview.php +2 -4
- frontend/controllers/BWGControllerAlbum_masonry_preview.php +2 -5
- frontend/controllers/BWGControllerBlog_style.php +2 -5
- frontend/controllers/BWGControllerCarousel.php +2 -5
- frontend/controllers/BWGControllerDownload_gallery.php +11 -1
- frontend/controllers/BWGControllerImage_browser.php +2 -5
- frontend/controllers/BWGControllerThumbnails_masonry.php +2 -5
- frontend/controllers/BWGControllerThumbnails_mosaic.php +1 -4
- frontend/controllers/BWGControllerWidget.php +1 -1
- frontend/controllers/controller.php +5 -10
- frontend/models/BWGModelGalleryBox.php +55 -7
- frontend/models/BWGModelWidget.php +1 -1
- frontend/models/model.php +17 -6
- frontend/views/BWGViewAlbum_compact_preview.php +58 -21
- frontend/views/BWGViewAlbum_extended_preview.php +60 -23
- frontend/views/BWGViewGalleryBox.php +141 -125
- frontend/views/BWGViewImage_browser.php +20 -17
- frontend/views/BWGViewSlideshow.php +84 -609
- frontend/views/BWGViewThumbnails.php +70 -56
- frontend/views/view.php +76 -57
- insert.php +2 -2
- js/bwg.js +265 -107
- js/bwg_editor_button.js +3 -1
- js/bwg_embed.js +1 -1
- js/bwg_frontend.js +1133 -319
- js/bwg_gallery_box.js +44 -27
- js/bwg_shortcode.js +12 -12
- js/jquery.fullscreen-0.4.1.js +17 -17
- js/jquery.sumoselect.min.js +762 -3
- js/jscolor/jscolor.js +28 -30
- js/tw-gb/block.js +2 -2
- photo-gallery.php +164 -56
- readme.txt +27 -1
- update.php +1 -1
admin/controllers/Albums.php
CHANGED
@@ -66,8 +66,8 @@ class AlbumsController_bwg {
|
|
66 |
public function execute() {
|
67 |
$task = WDWLibrary::get('task');
|
68 |
$id = (int)WDWLibrary::get('current_id', 0);
|
69 |
-
if (method_exists($this, $task)) {
|
70 |
-
if ($task != 'edit'
|
71 |
check_admin_referer(BWG()->nonce, BWG()->nonce);
|
72 |
}
|
73 |
$action = WDWLibrary::get('bulk_action', -1);
|
@@ -125,7 +125,7 @@ class AlbumsController_bwg {
|
|
125 |
*
|
126 |
* @param $task
|
127 |
*/
|
128 |
-
public function bulk_action($task) {
|
129 |
$message = 0;
|
130 |
$successfully_updated = 0;
|
131 |
$url_arg = array('page' => $this->page, 'task' => 'display');
|
66 |
public function execute() {
|
67 |
$task = WDWLibrary::get('task');
|
68 |
$id = (int)WDWLibrary::get('current_id', 0);
|
69 |
+
if ($task != 'display' && method_exists($this, $task)) {
|
70 |
+
if ($task != 'edit') {
|
71 |
check_admin_referer(BWG()->nonce, BWG()->nonce);
|
72 |
}
|
73 |
$action = WDWLibrary::get('bulk_action', -1);
|
125 |
*
|
126 |
* @param $task
|
127 |
*/
|
128 |
+
public function bulk_action($task = '') {
|
129 |
$message = 0;
|
130 |
$successfully_updated = 0;
|
131 |
$url_arg = array('page' => $this->page, 'task' => 'display');
|
admin/controllers/Galleries.php
CHANGED
@@ -21,7 +21,6 @@ class GalleriesController_bwg {
|
|
21 |
* @var array $actions
|
22 |
*/
|
23 |
private $actions = array();
|
24 |
-
private $image_actions = array();
|
25 |
|
26 |
public function __construct() {
|
27 |
// Allowed upload mime_types.
|
@@ -45,63 +44,6 @@ class GalleriesController_bwg {
|
|
45 |
),
|
46 |
);
|
47 |
|
48 |
-
$this->image_actions = array(
|
49 |
-
'image_resize' => array(
|
50 |
-
'title' => __('Resize', BWG()->prefix),
|
51 |
-
'bulk_action' => __('resized', BWG()->prefix),
|
52 |
-
),
|
53 |
-
'image_recreate_thumbnail' => array(
|
54 |
-
'title' => __('Recreate thumbnail', BWG()->prefix),
|
55 |
-
'bulk_action' => __('recreated', BWG()->prefix),
|
56 |
-
),
|
57 |
-
'image_rotate_left' => array(
|
58 |
-
'title' => __('Rotate left', BWG()->prefix),
|
59 |
-
'bulk_action' => __('rotated left', BWG()->prefix),
|
60 |
-
),
|
61 |
-
'image_rotate_right' => array(
|
62 |
-
'title' => __('Rotate right', BWG()->prefix),
|
63 |
-
'bulk_action' => __('rotated right', BWG()->prefix),
|
64 |
-
),
|
65 |
-
'image_set_watermark' => array(
|
66 |
-
'title' => __('Set watermark', BWG()->prefix),
|
67 |
-
'bulk_action' => __('edited', BWG()->prefix),
|
68 |
-
),
|
69 |
-
'image_reset' => array(
|
70 |
-
'title' => __('Reset', BWG()->prefix),
|
71 |
-
'bulk_action' => __('reset', BWG()->prefix),
|
72 |
-
),
|
73 |
-
'image_edit' => array(
|
74 |
-
'title' => __('Edit info', BWG()->prefix),
|
75 |
-
'bulk_action' => __('edited', BWG()->prefix),
|
76 |
-
),
|
77 |
-
'image_add_tag' => array(
|
78 |
-
'title' => __('Add tag', BWG()->prefix),
|
79 |
-
'bulk_action' => __('edited', BWG()->prefix),
|
80 |
-
),
|
81 |
-
'image_publish' => array(
|
82 |
-
'title' => __('Publish', BWG()->prefix),
|
83 |
-
'bulk_action' => __('published', BWG()->prefix),
|
84 |
-
),
|
85 |
-
'image_unpublish' => array(
|
86 |
-
'title' => __('Unpublish', BWG()->prefix),
|
87 |
-
'bulk_action' => __('unpublished', BWG()->prefix),
|
88 |
-
),
|
89 |
-
'image_delete' => array(
|
90 |
-
'title' => __('Delete', BWG()->prefix),
|
91 |
-
'bulk_action' => __('deleted', BWG()->prefix),
|
92 |
-
),
|
93 |
-
);
|
94 |
-
if ( function_exists('BWGEC') ) {
|
95 |
-
$this->image_actions['set_image_pricelist'] = array(
|
96 |
-
'title' => __('Add pricelist', BWG()->prefix),
|
97 |
-
'bulk_action' => __('edited', BWG()->prefix),
|
98 |
-
);
|
99 |
-
$this->image_actions['remove_pricelist_all'] = array(
|
100 |
-
'title' => __('Remove pricelist', BWG()->prefix),
|
101 |
-
'bulk_action' => __('edited', BWG()->prefix),
|
102 |
-
);
|
103 |
-
}
|
104 |
-
|
105 |
$user = get_current_user_id();
|
106 |
$screen = get_current_screen();
|
107 |
$option = $screen->get_option('per_page', 'option');
|
@@ -118,8 +60,8 @@ class GalleriesController_bwg {
|
|
118 |
public function execute() {
|
119 |
$task = WDWLibrary::get('task');
|
120 |
$id = (int) WDWLibrary::get('current_id', 0);
|
121 |
-
if ( method_exists($this, $task) ) {
|
122 |
-
if ( $task != 'edit'
|
123 |
check_admin_referer(BWG()->nonce, BWG()->nonce);
|
124 |
}
|
125 |
$action = WDWLibrary::get('bulk_action', -1);
|
@@ -365,10 +307,15 @@ class GalleriesController_bwg {
|
|
365 |
$params['gallery_type'] = ($params['row']->gallery_type == 'instagram' || $params['row']->gallery_type == 'instagram_post') ? 'instagram' : (($params['row']->gallery_type == 'facebook_post' || $params['row']->gallery_type == 'facebook') ? 'facebook' : '');
|
366 |
|
367 |
// Image display params.
|
368 |
-
$params['actions'] =
|
369 |
$params['page_url'] = $params['form_action'];
|
370 |
-
$
|
371 |
-
$
|
|
|
|
|
|
|
|
|
|
|
372 |
$params['items_per_page'] = $this->items_per_page;
|
373 |
$page = (int) WDWLibrary::get('paged', 1);
|
374 |
$page_num = $page ? ($page - 1) * $params['items_per_page'] : 0;
|
@@ -387,8 +334,9 @@ class GalleriesController_bwg {
|
|
387 |
* Save.
|
388 |
*
|
389 |
* @param $id
|
|
|
390 |
*/
|
391 |
-
public function save( $id, $all = FALSE ) {
|
392 |
// Save gallery and images.
|
393 |
$data = $this->model->save();
|
394 |
$message = array('gallery_message' => $data['saved'], 'image_message' => '');
|
@@ -407,61 +355,16 @@ class GalleriesController_bwg {
|
|
407 |
/**
|
408 |
* Bulk actions for images.
|
409 |
*
|
410 |
-
* @param $image_action
|
411 |
*/
|
412 |
public function image_bulk_action($image_action) {
|
413 |
// Save gallery and images.
|
414 |
-
$data = $this->model->save();
|
415 |
-
|
416 |
-
$message = array();
|
417 |
-
$successfully_updated = 0;
|
418 |
-
|
419 |
-
$check = WDWLibrary::get('check', '');
|
420 |
-
$all = WDWLibrary::get('check_all_items', FALSE);
|
421 |
-
|
422 |
-
if ( method_exists($this->model, $image_action) ) {
|
423 |
-
if ( $all ) {
|
424 |
-
$message['image_message'] = $this->model->$image_action(0, $data['id'], TRUE);
|
425 |
-
}
|
426 |
-
else {
|
427 |
-
if ( $check ) {
|
428 |
-
foreach ( $check as $image_id ) {
|
429 |
-
if ( strpos($image_id, 'pr_') === FALSE ) {
|
430 |
-
$message['image_message'] = $this->model->$image_action($image_id, $data['id']);
|
431 |
-
if ( $message['image_message'] == 6 ) {
|
432 |
-
// Action set watermark with none watermark type.
|
433 |
-
break;
|
434 |
-
}
|
435 |
-
elseif ( $message['image_message'] != 2 ) {
|
436 |
-
// Increase successfully updated items count, if action doesn't failed.
|
437 |
-
$successfully_updated++;
|
438 |
-
}
|
439 |
-
}
|
440 |
-
}
|
441 |
-
}
|
442 |
-
if ( $successfully_updated ) {
|
443 |
-
$message['image_message'] = sprintf(_n('%s item successfully %s.', '%s items successfully %s.', $successfully_updated, BWG()->prefix), $successfully_updated, $this->image_actions[$image_action]['bulk_action']);
|
444 |
-
}
|
445 |
-
}
|
446 |
-
}
|
447 |
|
448 |
$this->edit($data['id'], $message);
|
449 |
}
|
450 |
|
451 |
-
// ToDo: remove
|
452 |
-
public function save_old() {
|
453 |
-
|
454 |
-
$msg = __("Item Succesfully Saved.", BWG()->prefix);
|
455 |
-
if ( function_exists('BWGEC') ) {
|
456 |
-
$not_set_items = $this->check_pricelist();
|
457 |
-
if ( empty($not_set_items) === FALSE ) {
|
458 |
-
$msg .= __(" Selected pricelist item longest dimension greater than some original images dimensions.", BWG()->prefix);
|
459 |
-
}
|
460 |
-
}
|
461 |
-
echo WDWLibrary::message($msg, 'wd_updated');
|
462 |
-
$this->display();
|
463 |
-
}
|
464 |
-
|
465 |
public function check_pricelist() {
|
466 |
global $wpdb;
|
467 |
$gallery_id = isset($_POST['current_id']) ? $_POST['current_id'] : 0;
|
@@ -470,7 +373,7 @@ class GalleriesController_bwg {
|
|
470 |
$rows = $wpdb->get_results('SELECT T_IMAGES.thumb_url, T_PRICELISTS.item_longest_dimension, T_IMAGES.id FROM ' . $wpdb->prefix . 'bwg_image AS T_IMAGES LEFT JOIN ( SELECT MAX(item_longest_dimension) AS item_longest_dimension, pricelist_id FROM ' . $wpdb->prefix . 'wdpg_ecommerce_pricelist_items AS T_PRICELIST_ITEMS LEFT JOIN ' . $wpdb->prefix . 'wdpg_ecommerce_pricelists AS T_PRICELISTS ON T_PRICELIST_ITEMS.pricelist_id = T_PRICELISTS.id WHERE T_PRICELISTS.sections LIKE "%downloads%" GROUP BY pricelist_id) AS T_PRICELISTS ON T_IMAGES.pricelist_id = T_PRICELISTS.pricelist_id WHERE T_IMAGES.gallery_id="' . $gallery_id . '"');
|
471 |
foreach ( $rows as $row ) {
|
472 |
if ( $row->item_longest_dimension ) {
|
473 |
-
$file_path = str_replace("thumb", ".original", htmlspecialchars_decode(
|
474 |
list($img_width) = @getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));
|
475 |
if ( $row->item_longest_dimension > $img_width ) {
|
476 |
$not_set_items[] = $row->id;
|
21 |
* @var array $actions
|
22 |
*/
|
23 |
private $actions = array();
|
|
|
24 |
|
25 |
public function __construct() {
|
26 |
// Allowed upload mime_types.
|
44 |
),
|
45 |
);
|
46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
$user = get_current_user_id();
|
48 |
$screen = get_current_screen();
|
49 |
$option = $screen->get_option('per_page', 'option');
|
60 |
public function execute() {
|
61 |
$task = WDWLibrary::get('task');
|
62 |
$id = (int) WDWLibrary::get('current_id', 0);
|
63 |
+
if ( $task != 'display' && method_exists($this, $task) ) {
|
64 |
+
if ( $task != 'edit' ) {
|
65 |
check_admin_referer(BWG()->nonce, BWG()->nonce);
|
66 |
}
|
67 |
$action = WDWLibrary::get('bulk_action', -1);
|
307 |
$params['gallery_type'] = ($params['row']->gallery_type == 'instagram' || $params['row']->gallery_type == 'instagram_post') ? 'instagram' : (($params['row']->gallery_type == 'facebook_post' || $params['row']->gallery_type == 'facebook') ? 'facebook' : '');
|
308 |
|
309 |
// Image display params.
|
310 |
+
$params['actions'] = WDWLibrary::image_actions();
|
311 |
$params['page_url'] = $params['form_action'];
|
312 |
+
$order_by = WDWLibrary::get('order_by', 'order_asc');
|
313 |
+
if ( !array_key_exists($order_by, WDWLibrary::admin_images_ordering_choices())) {
|
314 |
+
$order_by = 'order_asc';
|
315 |
+
}
|
316 |
+
$order_by = explode('_', $order_by);
|
317 |
+
$params['order'] = $order_by[1];
|
318 |
+
$params['orderby'] = $order_by[0];
|
319 |
$params['items_per_page'] = $this->items_per_page;
|
320 |
$page = (int) WDWLibrary::get('paged', 1);
|
321 |
$page_num = $page ? ($page - 1) * $params['items_per_page'] : 0;
|
334 |
* Save.
|
335 |
*
|
336 |
* @param $id
|
337 |
+
* @param boolean $all
|
338 |
*/
|
339 |
+
public function save( $id = 0, $all = FALSE ) {
|
340 |
// Save gallery and images.
|
341 |
$data = $this->model->save();
|
342 |
$message = array('gallery_message' => $data['saved'], 'image_message' => '');
|
355 |
/**
|
356 |
* Bulk actions for images.
|
357 |
*
|
358 |
+
* @param string $image_action
|
359 |
*/
|
360 |
public function image_bulk_action($image_action) {
|
361 |
// Save gallery and images.
|
362 |
+
$data = $this->model->save($image_action);
|
363 |
+
$message = array('image_message' => $data['image_message']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
364 |
|
365 |
$this->edit($data['id'], $message);
|
366 |
}
|
367 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
368 |
public function check_pricelist() {
|
369 |
global $wpdb;
|
370 |
$gallery_id = isset($_POST['current_id']) ? $_POST['current_id'] : 0;
|
373 |
$rows = $wpdb->get_results('SELECT T_IMAGES.thumb_url, T_PRICELISTS.item_longest_dimension, T_IMAGES.id FROM ' . $wpdb->prefix . 'bwg_image AS T_IMAGES LEFT JOIN ( SELECT MAX(item_longest_dimension) AS item_longest_dimension, pricelist_id FROM ' . $wpdb->prefix . 'wdpg_ecommerce_pricelist_items AS T_PRICELIST_ITEMS LEFT JOIN ' . $wpdb->prefix . 'wdpg_ecommerce_pricelists AS T_PRICELISTS ON T_PRICELIST_ITEMS.pricelist_id = T_PRICELISTS.id WHERE T_PRICELISTS.sections LIKE "%downloads%" GROUP BY pricelist_id) AS T_PRICELISTS ON T_IMAGES.pricelist_id = T_PRICELISTS.pricelist_id WHERE T_IMAGES.gallery_id="' . $gallery_id . '"');
|
374 |
foreach ( $rows as $row ) {
|
375 |
if ( $row->item_longest_dimension ) {
|
376 |
+
$file_path = str_replace("thumb", ".original", htmlspecialchars_decode(BWG()->upload_dir . $row->thumb_url, ENT_COMPAT | ENT_QUOTES));
|
377 |
list($img_width) = @getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));
|
378 |
if ( $row->item_longest_dimension > $img_width ) {
|
379 |
$not_set_items[] = $row->id;
|
admin/controllers/Options.php
CHANGED
@@ -86,12 +86,19 @@ class OptionsController_bwg {
|
|
86 |
|
87 |
$params['row'] = $row;
|
88 |
$params['page'] = $this->page;
|
89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
$params['instagram_reset_href'] = add_query_arg( array(
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
|
|
95 |
$this->view->display($params);
|
96 |
}
|
97 |
|
@@ -103,6 +110,11 @@ class OptionsController_bwg {
|
|
103 |
public function reset( $params = array() ) {
|
104 |
$params['row'] = new WD_BWG_Options(true);
|
105 |
$params['page'] = $this->page;
|
|
|
|
|
|
|
|
|
|
|
106 |
$params['instagram_return_url'] = 'https://api.instagram.com/oauth/authorize/?client_id=54da896cf80343ecb0e356ac5479d9ec&scope=basic+public_content&redirect_uri=http://api.web-dorado.com/instagram/?return_url=' . urlencode( admin_url('admin.php?page=options_bwg')) . '&response_type=token';
|
107 |
$params['instagram_reset_href'] = add_query_arg( array(
|
108 |
'page' => $this->page,
|
@@ -136,6 +148,7 @@ class OptionsController_bwg {
|
|
136 |
if (isset($_POST['old_images_directory'])) {
|
137 |
$row->old_images_directory = esc_html(stripslashes($_POST['old_images_directory']));
|
138 |
}
|
|
|
139 |
if (isset($_POST['images_directory'])) {
|
140 |
$row->images_directory = esc_html(stripslashes($_POST['images_directory']));
|
141 |
if (!is_dir(ABSPATH . $row->images_directory) || (is_dir(ABSPATH . $row->images_directory . '/photo-gallery') && $row->old_images_directory && $row->old_images_directory != $row->images_directory)) {
|
@@ -151,19 +164,12 @@ class OptionsController_bwg {
|
|
151 |
else {
|
152 |
$upload_dir = wp_upload_dir();
|
153 |
if (!is_dir($upload_dir['basedir'] . '/photo-gallery')) {
|
154 |
-
mkdir($upload_dir['basedir'] . '/photo-gallery',
|
155 |
}
|
156 |
$row->images_directory = str_replace(ABSPATH, '', $upload_dir['basedir']);
|
157 |
}
|
158 |
}
|
159 |
}
|
160 |
-
else {
|
161 |
-
$upload_dir = wp_upload_dir();
|
162 |
-
if (!is_dir($upload_dir['basedir'] . '/photo-gallery')) {
|
163 |
-
mkdir($upload_dir['basedir'] . '/photo-gallery', 0777);
|
164 |
-
}
|
165 |
-
$row->images_directory = str_replace(ABSPATH, '', $upload_dir['basedir']);
|
166 |
-
}
|
167 |
|
168 |
foreach ($row as $name => $value) {
|
169 |
if ($name == 'autoupdate_interval') {
|
@@ -177,78 +183,94 @@ class OptionsController_bwg {
|
|
177 |
}
|
178 |
|
179 |
$save = update_option('wd_bwg_options', json_encode($row), 'no');
|
180 |
-
|
181 |
-
$this->image_set_watermark();
|
182 |
-
}
|
183 |
if (isset($_POST['recreate']) && $_POST['recreate'] == "resize_image_thumb") {
|
184 |
$this->resize_image_thumb();
|
185 |
echo WDWLibrary::message_id(0, __('All thumbnails are successfully recreated.', BWG()->prefix));
|
186 |
}
|
187 |
|
188 |
-
if ($save) {
|
|
|
189 |
if ($row->old_images_directory && $row->old_images_directory != $row->images_directory) {
|
190 |
rename(ABSPATH . $row->old_images_directory . '/photo-gallery', ABSPATH . $row->images_directory . '/photo-gallery');
|
191 |
}
|
|
|
192 |
if (!is_dir(ABSPATH . $row->images_directory . '/photo-gallery')) {
|
193 |
-
mkdir(ABSPATH . $row->images_directory . '/photo-gallery',
|
194 |
}
|
195 |
else {
|
196 |
echo WDWLibrary::message_id(0, __('Item Succesfully Saved.', BWG()->prefix));
|
197 |
}
|
198 |
|
199 |
-
|
200 |
-
refresh filter according to new time interval,
|
201 |
-
then add new schedule with the same hook name
|
202 |
-
*/
|
203 |
wp_clear_scheduled_hook( 'bwg_schedule_event_hook' );
|
|
|
204 |
remove_filter( 'cron_schedules', array(BWG(), 'autoupdate_interval') );
|
205 |
add_filter( 'cron_schedules', array(BWG(), 'autoupdate_interval') );
|
|
|
206 |
wp_schedule_event( time(), 'bwg_autoupdate_interval', 'bwg_schedule_event_hook' );
|
207 |
}
|
208 |
}
|
209 |
|
210 |
-
public function image_set_watermark() {
|
211 |
-
|
212 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
}
|
214 |
|
215 |
-
public function image_recover_all($params) {
|
216 |
-
WDWLibrary::
|
217 |
-
|
218 |
-
$this->display($params);
|
219 |
}
|
220 |
|
221 |
-
public function resize_image_thumb() {
|
222 |
global $wpdb;
|
223 |
-
|
224 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
225 |
foreach ($img_ids as $img_id) {
|
226 |
if ( preg_match('/EMBED/', $img_id->filetype) == 1 ) {
|
227 |
continue;
|
228 |
}
|
229 |
-
$file_path = str_replace("thumb", ".original", htmlspecialchars_decode(
|
230 |
-
$new_file_path = htmlspecialchars_decode(
|
231 |
-
$
|
232 |
-
if ( ! is_wp_error( $image ) ) {
|
233 |
-
$image_size = $image->get_size();
|
234 |
-
$img_width = $image_size[ 'width' ];
|
235 |
-
$img_height = $image_size[ 'height' ];
|
236 |
-
if ( !$img_width || !$img_height ) {
|
237 |
-
continue;
|
238 |
-
}
|
239 |
-
$max_width = BWG()->options->upload_thumb_width;
|
240 |
-
$max_height = BWG()->options->upload_thumb_height;
|
241 |
-
$scale = min(
|
242 |
-
$max_width / $img_width,
|
243 |
-
$max_height / $img_height
|
244 |
-
);
|
245 |
-
$new_width = $img_width * $scale;
|
246 |
-
$new_height = $img_height * $scale;
|
247 |
-
|
248 |
-
$image->set_quality( BWG()->options->image_quality );
|
249 |
-
$image->resize( $new_width, $new_height, false );
|
250 |
-
$image->save( $new_file_path );
|
251 |
-
}
|
252 |
}
|
253 |
}
|
254 |
}
|
86 |
|
87 |
$params['row'] = $row;
|
88 |
$params['page'] = $this->page;
|
89 |
+
$params['imgcount'] = $this->model->get_image_count();
|
90 |
+
$params['options_url_ajax'] = add_query_arg( array(
|
91 |
+
'action' => 'options_' . BWG()->prefix,
|
92 |
+
BWG()->nonce => wp_create_nonce(BWG()->nonce),
|
93 |
+
), admin_url('admin-ajax.php') );
|
94 |
+
|
95 |
+
$params['instagram_return_url'] = 'https://api.instagram.com/oauth/authorize/?client_id=54da896cf80343ecb0e356ac5479d9ec&scope=basic+public_content&redirect_uri=http://api.web-dorado.com/instagram/?return_url=' . urlencode( admin_url('admin.php?page=options_bwg')) . '&response_type=token';
|
96 |
$params['instagram_reset_href'] = add_query_arg( array(
|
97 |
+
'page' => $this->page,
|
98 |
+
'task' => 'reset_instagram_access_token',
|
99 |
+
BWG()->nonce => wp_create_nonce(BWG()->nonce),
|
100 |
+
), admin_url('admin.php') );
|
101 |
+
|
102 |
$this->view->display($params);
|
103 |
}
|
104 |
|
110 |
public function reset( $params = array() ) {
|
111 |
$params['row'] = new WD_BWG_Options(true);
|
112 |
$params['page'] = $this->page;
|
113 |
+
$params['imgcount'] = $this->model->get_image_count();
|
114 |
+
$params['options_url_ajax'] = add_query_arg( array(
|
115 |
+
'action' => 'options_' . BWG()->prefix,
|
116 |
+
BWG()->nonce => wp_create_nonce(BWG()->nonce),
|
117 |
+
), admin_url('admin-ajax.php') );
|
118 |
$params['instagram_return_url'] = 'https://api.instagram.com/oauth/authorize/?client_id=54da896cf80343ecb0e356ac5479d9ec&scope=basic+public_content&redirect_uri=http://api.web-dorado.com/instagram/?return_url=' . urlencode( admin_url('admin.php?page=options_bwg')) . '&response_type=token';
|
119 |
$params['instagram_reset_href'] = add_query_arg( array(
|
120 |
'page' => $this->page,
|
148 |
if (isset($_POST['old_images_directory'])) {
|
149 |
$row->old_images_directory = esc_html(stripslashes($_POST['old_images_directory']));
|
150 |
}
|
151 |
+
|
152 |
if (isset($_POST['images_directory'])) {
|
153 |
$row->images_directory = esc_html(stripslashes($_POST['images_directory']));
|
154 |
if (!is_dir(ABSPATH . $row->images_directory) || (is_dir(ABSPATH . $row->images_directory . '/photo-gallery') && $row->old_images_directory && $row->old_images_directory != $row->images_directory)) {
|
164 |
else {
|
165 |
$upload_dir = wp_upload_dir();
|
166 |
if (!is_dir($upload_dir['basedir'] . '/photo-gallery')) {
|
167 |
+
mkdir($upload_dir['basedir'] . '/photo-gallery', 0755);
|
168 |
}
|
169 |
$row->images_directory = str_replace(ABSPATH, '', $upload_dir['basedir']);
|
170 |
}
|
171 |
}
|
172 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
|
174 |
foreach ($row as $name => $value) {
|
175 |
if ($name == 'autoupdate_interval') {
|
183 |
}
|
184 |
|
185 |
$save = update_option('wd_bwg_options', json_encode($row), 'no');
|
186 |
+
|
|
|
|
|
187 |
if (isset($_POST['recreate']) && $_POST['recreate'] == "resize_image_thumb") {
|
188 |
$this->resize_image_thumb();
|
189 |
echo WDWLibrary::message_id(0, __('All thumbnails are successfully recreated.', BWG()->prefix));
|
190 |
}
|
191 |
|
192 |
+
if ( $save ) {
|
193 |
+
// Move images folder to the new direction if image directory has been changed.
|
194 |
if ($row->old_images_directory && $row->old_images_directory != $row->images_directory) {
|
195 |
rename(ABSPATH . $row->old_images_directory . '/photo-gallery', ABSPATH . $row->images_directory . '/photo-gallery');
|
196 |
}
|
197 |
+
|
198 |
if (!is_dir(ABSPATH . $row->images_directory . '/photo-gallery')) {
|
199 |
+
mkdir(ABSPATH . $row->images_directory . '/photo-gallery', 0755);
|
200 |
}
|
201 |
else {
|
202 |
echo WDWLibrary::message_id(0, __('Item Succesfully Saved.', BWG()->prefix));
|
203 |
}
|
204 |
|
205 |
+
// Clear hook for scheduled events.
|
|
|
|
|
|
|
206 |
wp_clear_scheduled_hook( 'bwg_schedule_event_hook' );
|
207 |
+
// Refresh filter according to new time interval.
|
208 |
remove_filter( 'cron_schedules', array(BWG(), 'autoupdate_interval') );
|
209 |
add_filter( 'cron_schedules', array(BWG(), 'autoupdate_interval') );
|
210 |
+
// Then add new schedule with the same hook name.
|
211 |
wp_schedule_event( time(), 'bwg_autoupdate_interval', 'bwg_schedule_event_hook' );
|
212 |
}
|
213 |
}
|
214 |
|
215 |
+
public function image_set_watermark($params = array()) {
|
216 |
+
$limitstart = WDWLibrary::get('limitstart');
|
217 |
+
|
218 |
+
/* Update options only first time of the loop */
|
219 |
+
if ( $limitstart == 0 ) {
|
220 |
+
$update_options = array(
|
221 |
+
'built_in_watermark_type' => WDWLibrary::get('built_in_watermark_type'),
|
222 |
+
'built_in_watermark_position' => WDWLibrary::get('built_in_watermark_position')
|
223 |
+
);
|
224 |
+
if ( $update_options['built_in_watermark_type'] == 'text' ){
|
225 |
+
$update_options['built_in_watermark_text'] = WDWLibrary::get('built_in_watermark_text');
|
226 |
+
$update_options['built_in_watermark_font_size'] = WDWLibrary::get('built_in_watermark_font_size');
|
227 |
+
$update_options['built_in_watermark_font'] = WDWLibrary::get('built_in_watermark_font');
|
228 |
+
$update_options['built_in_watermark_color'] = WDWLibrary::get('built_in_watermark_color');
|
229 |
+
}
|
230 |
+
else {
|
231 |
+
$update_options['built_in_watermark_size'] = WDWLibrary::get('built_in_watermark_size');
|
232 |
+
$update_options['built_in_watermark_url'] = WDWLibrary::get('built_in_watermark_url');
|
233 |
+
}
|
234 |
+
$this->model->update_options_by_key( $update_options );
|
235 |
+
}
|
236 |
+
|
237 |
+
$error = false;
|
238 |
+
list($width_watermark, $height_watermark, $type_watermark) = getimagesize( $update_options['built_in_watermark_url'] );
|
239 |
+
if ( $update_options['built_in_watermark_type'] == 'image' && ( empty($width_watermark) OR empty($height_watermark) OR empty($type_watermark)) ) {
|
240 |
+
$error = true;
|
241 |
+
$message = WDWLibrary::message_id(0, __('Watermark could not be set. The image URL is incorrect.', $this->prefix), 'error');
|
242 |
+
}
|
243 |
+
if ( $error === false ) {
|
244 |
+
WDWLibrary::bwg_image_set_watermark( 0, 0, $limitstart );
|
245 |
+
$message = WDWLibrary::message_id(0, __('All images are successfully watermarked.', $this->prefix), 'updated');
|
246 |
+
}
|
247 |
+
$json_data = array('error' => $error, 'message' => $message);
|
248 |
+
echo json_encode($json_data); die();
|
249 |
}
|
250 |
|
251 |
+
public function image_recover_all($params = array()) {
|
252 |
+
$limitstart = WDWLibrary::get('limitstart');
|
253 |
+
WDWLibrary::bwg_image_recover_all(0, $limitstart);
|
|
|
254 |
}
|
255 |
|
256 |
+
public function resize_image_thumb($params = array()) {
|
257 |
global $wpdb;
|
258 |
+
$max_width = WDWLibrary::get('img_option_width');
|
259 |
+
$max_height = WDWLibrary::get('img_option_height');
|
260 |
+
$limitstart = WDWLibrary::get('limitstart');
|
261 |
+
|
262 |
+
/* Update options only first time of the loop */
|
263 |
+
if ( $limitstart == 0 ) {
|
264 |
+
$this->model->update_options_by_key( array('upload_thumb_width' => $max_width,'upload_thumb_height' => $max_height ) );
|
265 |
+
}
|
266 |
+
$img_ids = $wpdb->get_results('SELECT id, thumb_url, filetype FROM ' . $wpdb->prefix . 'bwg_image LIMIT 50 OFFSET ' . $limitstart);
|
267 |
foreach ($img_ids as $img_id) {
|
268 |
if ( preg_match('/EMBED/', $img_id->filetype) == 1 ) {
|
269 |
continue;
|
270 |
}
|
271 |
+
$file_path = str_replace("thumb", ".original", htmlspecialchars_decode(BWG()->upload_dir . $img_id->thumb_url, ENT_COMPAT | ENT_QUOTES));
|
272 |
+
$new_file_path = htmlspecialchars_decode(BWG()->upload_dir . $img_id->thumb_url, ENT_COMPAT | ENT_QUOTES);
|
273 |
+
WDWLibrary::resize_image($file_path, $new_file_path, $max_width, $max_height);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
}
|
275 |
}
|
276 |
}
|
admin/controllers/Themes.php
CHANGED
@@ -61,8 +61,8 @@ class ThemesController_bwg {
|
|
61 |
public function execute() {
|
62 |
$task = WDWLibrary::get('task');
|
63 |
$id = (int) WDWLibrary::get('current_id', 0);
|
64 |
-
if ( method_exists($this, $task) ) {
|
65 |
-
if ( $task != 'add' && $task != 'edit'
|
66 |
check_admin_referer(BWG()->nonce, BWG()->nonce);
|
67 |
}
|
68 |
$action = WDWLibrary::get('bulk_action', -1);
|
@@ -224,9 +224,9 @@ class ThemesController_bwg {
|
|
224 |
* @param bool $bulk
|
225 |
*/
|
226 |
public function edit( $id = 0, $bulk = FALSE ) {
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
if (!isset($row->container_margin)) {
|
231 |
$row->container_margin = 1;
|
232 |
}
|
@@ -321,7 +321,7 @@ public function edit( $id = 0, $bulk = FALSE ) {
|
|
321 |
'square' => __('Square', BWG()->prefix),
|
322 |
);
|
323 |
|
324 |
-
|
325 |
|
326 |
$params = array(
|
327 |
'id' => $id,
|
61 |
public function execute() {
|
62 |
$task = WDWLibrary::get('task');
|
63 |
$id = (int) WDWLibrary::get('current_id', 0);
|
64 |
+
if ( $task != 'display' && method_exists($this, $task) ) {
|
65 |
+
if ( $task != 'add' && $task != 'edit' ) {
|
66 |
check_admin_referer(BWG()->nonce, BWG()->nonce);
|
67 |
}
|
68 |
$action = WDWLibrary::get('bulk_action', -1);
|
224 |
* @param bool $bulk
|
225 |
*/
|
226 |
public function edit( $id = 0, $bulk = FALSE ) {
|
227 |
+
$reset = WDWLibrary::get('reset', FALSE);
|
228 |
+
// Get Theme data.
|
229 |
+
$row = $this->model->get_row_data($id, $reset);
|
230 |
if (!isset($row->container_margin)) {
|
231 |
$row->container_margin = 1;
|
232 |
}
|
321 |
'square' => __('Square', BWG()->prefix),
|
322 |
);
|
323 |
|
324 |
+
$active_tab = WDWLibrary::get('active_tab','Thumbnail');
|
325 |
|
326 |
$params = array(
|
327 |
'id' => $id,
|
admin/models/Albums.php
CHANGED
@@ -445,10 +445,10 @@ class AlbumsModel_bwg {
|
|
445 |
foreach ( $results as $result ) {
|
446 |
$preview_image = BWG()->plugin_url . '/images/no-image.png';
|
447 |
if ( !empty($result->preview_image) ) {
|
448 |
-
$preview_image =
|
449 |
}
|
450 |
if ( !empty($result->random_preview_image) ) {
|
451 |
-
$preview_image =
|
452 |
if ( WDWLibrary::check_external_link($result->random_preview_image) ) {
|
453 |
$preview_image = $result->random_preview_image;
|
454 |
}
|
445 |
foreach ( $results as $result ) {
|
446 |
$preview_image = BWG()->plugin_url . '/images/no-image.png';
|
447 |
if ( !empty($result->preview_image) ) {
|
448 |
+
$preview_image = BWG()->upload_url . $result->preview_image;
|
449 |
}
|
450 |
if ( !empty($result->random_preview_image) ) {
|
451 |
+
$preview_image = BWG()->upload_url . $result->random_preview_image;
|
452 |
if ( WDWLibrary::check_external_link($result->random_preview_image) ) {
|
453 |
$preview_image = $result->random_preview_image;
|
454 |
}
|
admin/models/Galleries.php
CHANGED
@@ -46,11 +46,16 @@ class GalleriesModel_bwg {
|
|
46 |
}
|
47 |
if ( !$total ) {
|
48 |
$rows = $wpdb->get_results($query);
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
}
|
50 |
else {
|
51 |
$rows = $wpdb->get_var($query);
|
52 |
}
|
53 |
-
|
54 |
return $rows;
|
55 |
}
|
56 |
|
@@ -127,6 +132,7 @@ class GalleriesModel_bwg {
|
|
127 |
*/
|
128 |
public function get_image_rows_data($gallery_id, $params, $total = FALSE) {
|
129 |
global $wpdb;
|
|
|
130 |
$order = $params['order'];
|
131 |
$orderby = $params['orderby'];
|
132 |
$page_per = $params['items_per_page'];
|
@@ -169,7 +175,7 @@ class GalleriesModel_bwg {
|
|
169 |
foreach ( $rows as $value ) {
|
170 |
$value->not_set_items = 0;
|
171 |
if ( $value->item_longest_dimension && strpos($value->sections, "downloads") !== FALSE ) {
|
172 |
-
$file_path = str_replace("thumb", ".original", htmlspecialchars_decode(
|
173 |
list($img_width) = @getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));
|
174 |
if ( $value->item_longest_dimension > $img_width ) {
|
175 |
$value->not_set_items = 1;
|
@@ -177,10 +183,6 @@ class GalleriesModel_bwg {
|
|
177 |
}
|
178 |
}
|
179 |
}
|
180 |
-
|
181 |
-
if ( !$rows ) {
|
182 |
-
$rows = array();
|
183 |
-
}
|
184 |
$rows['template'] = new stdClass();
|
185 |
$rows['template']->id = "tempid";
|
186 |
$rows['template']->gallery_id = $gallery_id;
|
@@ -205,11 +207,14 @@ class GalleriesModel_bwg {
|
|
205 |
$rows['template']->pricelist_id = 0;
|
206 |
$rows['template']->priselist_name = '';
|
207 |
$rows['template']->not_set_items = 0;
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
|
|
|
|
|
|
213 |
}
|
214 |
}
|
215 |
else {
|
@@ -262,10 +267,10 @@ class GalleriesModel_bwg {
|
|
262 |
public function get_row_data( $id ) {
|
263 |
if ( $id != 0 ) {
|
264 |
if ( !current_user_can('manage_options') && BWG()->options->gallery_role ) {
|
265 |
-
$where = " WHERE author=" . get_current_user_id();
|
266 |
}
|
267 |
else {
|
268 |
-
$where = " WHERE author>=0 ";
|
269 |
}
|
270 |
global $wpdb;
|
271 |
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM `' . $wpdb->prefix . 'bwg_gallery`' . $where . ' AND id="%d"', $id));
|
@@ -296,15 +301,18 @@ class GalleriesModel_bwg {
|
|
296 |
/**
|
297 |
* Save.
|
298 |
*
|
299 |
-
* @param
|
300 |
*
|
301 |
* @return array
|
302 |
*/
|
303 |
-
public function save($
|
304 |
$gallery_id = $this->save_db();
|
305 |
-
$
|
306 |
-
|
307 |
-
|
|
|
|
|
|
|
308 |
}
|
309 |
|
310 |
/**
|
@@ -325,7 +333,7 @@ class GalleriesModel_bwg {
|
|
325 |
if ( $preview_image == '' ) {
|
326 |
if ( $id != 0 ) {
|
327 |
$random_preview_image = $wpdb->get_var($wpdb->prepare("SELECT random_preview_image FROM " . $wpdb->prefix . "bwg_gallery WHERE id='%d'", $id));
|
328 |
-
if ( $random_preview_image == '' || !file_exists(
|
329 |
$random_preview_image = $wpdb->get_var($wpdb->prepare("SELECT thumb_url FROM " . $wpdb->prefix . "bwg_image WHERE gallery_id='%d' ORDER BY `order`", $id));
|
330 |
}
|
331 |
if ( empty($random_preview_image) ) {
|
@@ -394,19 +402,26 @@ class GalleriesModel_bwg {
|
|
394 |
* Save Images.
|
395 |
*
|
396 |
* @param int $gallery_id
|
|
|
397 |
*
|
398 |
-
* @return
|
399 |
*/
|
400 |
-
public function save_image_db( $gallery_id = 0 ) {
|
401 |
global $wpdb;
|
402 |
$image_ids = WDWLibrary::get('ids_string', '');
|
403 |
$image_id_array = explode(',', $image_ids);
|
404 |
$save = TRUE;
|
405 |
$author = get_current_user_id();
|
|
|
|
|
|
|
406 |
foreach ( $image_id_array as $image_id ) {
|
407 |
if ( $image_id ) {
|
408 |
$filename = WDWLibrary::get('input_filename_' . $image_id, '');
|
409 |
$image_url = WDWLibrary::get('image_url_' . $image_id, '');
|
|
|
|
|
|
|
410 |
$thumb_url = WDWLibrary::get('thumb_url_' . $image_id, '');
|
411 |
$description = WDWLibrary::get('image_description_' . $image_id, '');
|
412 |
$alt = WDWLibrary::get('image_alt_text_' . $image_id, '');
|
@@ -429,6 +444,7 @@ class GalleriesModel_bwg {
|
|
429 |
'resolution' => $resolution,
|
430 |
'order' => $order,
|
431 |
);
|
|
|
432 |
if ( strpos($image_id, 'pr_') !== FALSE ) {
|
433 |
if ( !WDWLibrary::check_external_link($image_url) ) {
|
434 |
$image_url = wp_normalize_path($image_url);
|
@@ -450,9 +466,6 @@ class GalleriesModel_bwg {
|
|
450 |
);
|
451 |
$save = $wpdb->insert($wpdb->prefix . 'bwg_image', $data);
|
452 |
$new_image_id = $wpdb->insert_id;
|
453 |
-
if ( isset($_POST['check']) && in_array($image_id, $_POST['check']) ) {
|
454 |
-
$_POST['check'][] = $new_image_id;
|
455 |
-
}
|
456 |
if ( isset($_POST['image_current_id']) && (esc_html($_POST['image_current_id']) == $image_id) ) {
|
457 |
$_POST['image_current_id'] = $new_image_id;
|
458 |
}
|
@@ -461,6 +474,7 @@ class GalleriesModel_bwg {
|
|
461 |
else {
|
462 |
$save = $wpdb->update($wpdb->prefix . 'bwg_image', $data, array( 'id' => $image_id ));
|
463 |
}
|
|
|
464 |
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'bwg_image_tag WHERE image_id="%d" AND gallery_id="%d"', $image_id, $gallery_id));
|
465 |
if ( $save !== FALSE ) {
|
466 |
$tag_id_array = explode(',', $tags_ids);
|
@@ -479,14 +493,29 @@ class GalleriesModel_bwg {
|
|
479 |
}
|
480 |
}
|
481 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
482 |
}
|
483 |
}
|
484 |
-
|
485 |
-
|
|
|
|
|
486 |
}
|
487 |
-
|
488 |
-
|
|
|
|
|
|
|
489 |
}
|
|
|
|
|
|
|
|
|
490 |
}
|
491 |
|
492 |
/**
|
@@ -571,6 +600,10 @@ class GalleriesModel_bwg {
|
|
571 |
}
|
572 |
$where = 'WHERE gallery_id=' . $gallery_id;
|
573 |
$where .= ($all ? '' : ' AND id=' . $id);
|
|
|
|
|
|
|
|
|
574 |
$image_where = ($all ? '' : ' WHERE image_id=' . $id);
|
575 |
|
576 |
$delete = $wpdb->query('DELETE FROM `' . $wpdb->prefix . 'bwg_image`' . $where);
|
@@ -624,6 +657,10 @@ class GalleriesModel_bwg {
|
|
624 |
}
|
625 |
$where = ' WHERE gallery_id=' . $gallery_id;
|
626 |
$where .= ($all ? '' : ' AND id=' . $id);
|
|
|
|
|
|
|
|
|
627 |
$updated = $wpdb->query('UPDATE `' . $wpdb->prefix . 'bwg_image` SET published=1' . $where);
|
628 |
|
629 |
$message = 2;
|
@@ -649,6 +686,10 @@ class GalleriesModel_bwg {
|
|
649 |
}
|
650 |
$where = ' WHERE gallery_id=' . $gallery_id;
|
651 |
$where .= ($all ? '' : ' AND id=' . $id);
|
|
|
|
|
|
|
|
|
652 |
$updated = $wpdb->query('UPDATE `' . $wpdb->prefix . 'bwg_image` SET published=0' . $where);
|
653 |
|
654 |
$message = 2;
|
@@ -696,12 +737,17 @@ class GalleriesModel_bwg {
|
|
696 |
* @return int
|
697 |
*/
|
698 |
public function image_set_watermark($id, $gallery_id = 0, $all = FALSE) {
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
|
|
|
|
|
|
|
|
|
|
705 |
}
|
706 |
|
707 |
/**
|
@@ -747,12 +793,16 @@ class GalleriesModel_bwg {
|
|
747 |
$gallery_id = (int) WDWLibrary::get('current_id', 0);
|
748 |
}
|
749 |
$where = ( ($gallery_id) ? ' `gallery_id` = ' . $gallery_id . ($image_id ? ' AND `id` = ' . $image_id : '' ) : 1 );
|
|
|
|
|
|
|
|
|
750 |
$images_data = $wpdb->get_results( 'SELECT id, image_url, thumb_url FROM `' . $wpdb->prefix . 'bwg_image` WHERE ' . $where );
|
751 |
@ini_set('memory_limit', '-1');
|
752 |
foreach ( $images_data as $image_data ) {
|
753 |
$image_data->image_url = stripcslashes($image_data->image_url);
|
754 |
-
$filename = htmlspecialchars_decode(
|
755 |
-
$thumb_filename = htmlspecialchars_decode(
|
756 |
list($width_rotate, $height_rotate, $type_rotate) = getimagesize($filename);
|
757 |
if ( $edit_type == '270' || $edit_type == '90' ) {
|
758 |
if ( $type_rotate == 2 ) {
|
@@ -831,56 +881,14 @@ class GalleriesModel_bwg {
|
|
831 |
}
|
832 |
$where = ( ($gallery_id) ? ' `gallery_id` = ' . $gallery_id . ( $image_id ? ' AND `id` = ' . $image_id : '' ) : 1 );
|
833 |
$img_ids = $wpdb->get_results( 'SELECT id, thumb_url FROM `' . $wpdb->prefix . 'bwg_image` WHERE ' . $where );
|
|
|
|
|
|
|
|
|
834 |
foreach ( $img_ids as $img_id ) {
|
835 |
-
$file_path = str_replace("thumb", ".original", htmlspecialchars_decode(
|
836 |
-
$new_file_path = htmlspecialchars_decode(
|
837 |
-
|
838 |
-
if ( !$img_width || !$img_height ) {
|
839 |
-
continue;
|
840 |
-
}
|
841 |
-
$max_width = BWG()->options->upload_thumb_width;
|
842 |
-
$max_height = BWG()->options->upload_thumb_height;
|
843 |
-
$scale = min($max_width / $img_width, $max_height / $img_height);
|
844 |
-
@ini_set('memory_limit', '-1');
|
845 |
-
if ( !function_exists('imagecreatetruecolor') ) {
|
846 |
-
error_log('Function not found: imagecreatetruecolor');
|
847 |
-
|
848 |
-
return FALSE;
|
849 |
-
}
|
850 |
-
$new_width = $img_width * $scale;
|
851 |
-
$new_height = $img_height * $scale;
|
852 |
-
$dst_x = 0;
|
853 |
-
$dst_y = 0;
|
854 |
-
$new_img = @imagecreatetruecolor($new_width, $new_height);
|
855 |
-
switch ( $type ) {
|
856 |
-
case 2:
|
857 |
-
$src_img = @imagecreatefromjpeg($file_path);
|
858 |
-
$write_image = 'imagejpeg';
|
859 |
-
$image_quality = BWG()->options->jpeg_quality;
|
860 |
-
break;
|
861 |
-
case 1:
|
862 |
-
@imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0));
|
863 |
-
$src_img = @imagecreatefromgif($file_path);
|
864 |
-
$write_image = 'imagegif';
|
865 |
-
$image_quality = NULL;
|
866 |
-
break;
|
867 |
-
case 3:
|
868 |
-
@imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0));
|
869 |
-
@imagealphablending($new_img, FALSE);
|
870 |
-
@imagesavealpha($new_img, TRUE);
|
871 |
-
$src_img = @imagecreatefrompng($file_path);
|
872 |
-
$write_image = 'imagepng';
|
873 |
-
$image_quality = BWG()->options->png_quality;
|
874 |
-
break;
|
875 |
-
default:
|
876 |
-
$src_img = NULL;
|
877 |
-
break;
|
878 |
-
}
|
879 |
-
$src_img && @imagecopyresampled($new_img, $src_img, $dst_x, $dst_y, 0, 0, $new_width, $new_height, $img_width, $img_height) && $write_image($new_img, $new_file_path, $image_quality);
|
880 |
-
// Free up memory (imagedestroy does not delete files):
|
881 |
-
@imagedestroy($src_img);
|
882 |
-
@imagedestroy($new_img);
|
883 |
-
@ini_restore('memory_limit');
|
884 |
}
|
885 |
WDWLibrary::update_image_modified_date( $where );
|
886 |
|
@@ -904,11 +912,19 @@ class GalleriesModel_bwg {
|
|
904 |
}
|
905 |
$image_width = (int) WDWLibrary::get('image_width', 1600);
|
906 |
$image_height = (int) WDWLibrary::get('image_height', 1200);
|
907 |
-
$where =
|
908 |
-
$
|
|
|
|
|
|
|
|
|
|
|
909 |
if ( !empty($images) ) {
|
910 |
foreach ( $images as $image ) {
|
911 |
-
$
|
|
|
|
|
|
|
912 |
}
|
913 |
}
|
914 |
WDWLibrary::update_image_modified_date( $where );
|
@@ -916,92 +932,6 @@ class GalleriesModel_bwg {
|
|
916 |
return 24;
|
917 |
}
|
918 |
|
919 |
-
/**
|
920 |
-
* Create scaled image.
|
921 |
-
*
|
922 |
-
* @param $file_path
|
923 |
-
* @param int $max_width
|
924 |
-
* @param int $max_height
|
925 |
-
* @param bool $crop
|
926 |
-
*
|
927 |
-
* @return bool
|
928 |
-
*/
|
929 |
-
public function scaled_image( $file_path, $max_width = 0, $max_height = 0, $crop = FALSE ) {
|
930 |
-
$file_path = htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES);
|
931 |
-
if ( !function_exists('getimagesize') ) {
|
932 |
-
error_log('Function not found: getimagesize');
|
933 |
-
|
934 |
-
return FALSE;
|
935 |
-
}
|
936 |
-
list($img_width, $img_height, $type) = @getimagesize($file_path);
|
937 |
-
if ( !$img_width || !$img_height ) {
|
938 |
-
return FALSE;
|
939 |
-
}
|
940 |
-
$scale = min($max_width / $img_width, $max_height / $img_height);
|
941 |
-
@ini_set('memory_limit', '-1');
|
942 |
-
if ( ($scale >= 1) || (($max_width === 0) && ($max_height === 0)) ) {
|
943 |
-
// if ($file_path !== $new_file_path) {
|
944 |
-
// return copy($file_path, $new_file_path);
|
945 |
-
// }
|
946 |
-
return TRUE;
|
947 |
-
}
|
948 |
-
if ( !function_exists('imagecreatetruecolor') ) {
|
949 |
-
error_log('Function not found: imagecreatetruecolor');
|
950 |
-
|
951 |
-
return FALSE;
|
952 |
-
}
|
953 |
-
if ( !$crop ) {
|
954 |
-
$new_width = $img_width * $scale;
|
955 |
-
$new_height = $img_height * $scale;
|
956 |
-
$dst_x = 0;
|
957 |
-
$dst_y = 0;
|
958 |
-
$new_img = @imagecreatetruecolor($new_width, $new_height);
|
959 |
-
}
|
960 |
-
else {
|
961 |
-
if ( ($img_width / $img_height) >= ($max_width / $max_height) ) {
|
962 |
-
$new_width = $img_width / ($img_height / $max_height);
|
963 |
-
$new_height = $max_height;
|
964 |
-
}
|
965 |
-
else {
|
966 |
-
$new_width = $max_width;
|
967 |
-
$new_height = $img_height / ($img_width / $max_width);
|
968 |
-
}
|
969 |
-
$dst_x = 0 - ($new_width - $max_width) / 2;
|
970 |
-
$dst_y = 0 - ($new_height - $max_height) / 2;
|
971 |
-
$new_img = @imagecreatetruecolor($max_width, $max_height);
|
972 |
-
}
|
973 |
-
switch ( $type ) {
|
974 |
-
case 2:
|
975 |
-
$src_img = @imagecreatefromjpeg($file_path);
|
976 |
-
$write_image = 'imagejpeg';
|
977 |
-
$image_quality = BWG()->options->jpeg_quality;
|
978 |
-
break;
|
979 |
-
case 1:
|
980 |
-
@imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0));
|
981 |
-
$src_img = @imagecreatefromgif($file_path);
|
982 |
-
$write_image = 'imagegif';
|
983 |
-
$image_quality = NULL;
|
984 |
-
break;
|
985 |
-
case 3:
|
986 |
-
@imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0));
|
987 |
-
@imagealphablending($new_img, FALSE);
|
988 |
-
@imagesavealpha($new_img, TRUE);
|
989 |
-
$src_img = @imagecreatefrompng($file_path);
|
990 |
-
$write_image = 'imagepng';
|
991 |
-
$image_quality = BWG()->options->png_quality;
|
992 |
-
break;
|
993 |
-
default:
|
994 |
-
$src_img = NULL;
|
995 |
-
}
|
996 |
-
$success = $src_img && @imagecopyresampled($new_img, $src_img, $dst_x, $dst_y, 0, 0, $new_width, $new_height, $img_width, $img_height) && $write_image($new_img, $file_path, $image_quality);
|
997 |
-
// Free up memory (imagedestroy does not delete files):
|
998 |
-
@imagedestroy($src_img);
|
999 |
-
@imagedestroy($new_img);
|
1000 |
-
@ini_restore('memory_limit');
|
1001 |
-
|
1002 |
-
return $success;
|
1003 |
-
}
|
1004 |
-
|
1005 |
/**
|
1006 |
* Edit image alt/description/redirect URL.
|
1007 |
*
|
@@ -1015,7 +945,12 @@ class GalleriesModel_bwg {
|
|
1015 |
if ( $gallery_id == 0 ) {
|
1016 |
$gallery_id = (int) WDWLibrary::get('current_id', 0);
|
1017 |
}
|
1018 |
-
$where =
|
|
|
|
|
|
|
|
|
|
|
1019 |
$title = WDWLibrary::get('title', '');
|
1020 |
$desc = WDWLibrary::get('desc', '');
|
1021 |
$redirecturl = WDWLibrary::get('redirecturl', '');
|
@@ -1025,19 +960,29 @@ class GalleriesModel_bwg {
|
|
1025 |
'description' => $desc,
|
1026 |
'redirect_url' => $redirecturl
|
1027 |
), $where);
|
|
|
1028 |
|
1029 |
-
|
|
|
|
|
|
|
|
|
1030 |
}
|
1031 |
|
1032 |
public function image_add_tag($id, $gallery_id = 0, $all = FALSE) {
|
1033 |
-
$image_id = ($all ? 0 : $id);
|
1034 |
if ( $gallery_id == 0 ) {
|
1035 |
$gallery_id = (int) WDWLibrary::get('current_id', 0);
|
1036 |
}
|
1037 |
$tag_ids = WDWLibrary::get('added_tags_id', '');
|
1038 |
$tag_ids_array = explode(',', $tag_ids);
|
1039 |
global $wpdb;
|
1040 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
1041 |
foreach ( $images as $image ) {
|
1042 |
foreach ( $tag_ids_array as $tag_id ) {
|
1043 |
if ( $tag_id ) {
|
@@ -1068,9 +1013,15 @@ class GalleriesModel_bwg {
|
|
1068 |
if ( $gallery_id == 0 ) {
|
1069 |
$gallery_id = (int) WDWLibrary::get('current_id', 0);
|
1070 |
}
|
1071 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
1072 |
foreach ($image_ids_col as $image_id) {
|
1073 |
-
$file_path = str_replace("thumb", ".original", htmlspecialchars_decode(
|
1074 |
list($img_width) = @getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));
|
1075 |
if ($item_longest_dimension > $img_width && $img_width) {
|
1076 |
$not_set_items[] = $image_id . "-" . $item_longest_dimension;
|
@@ -1097,10 +1048,12 @@ class GalleriesModel_bwg {
|
|
1097 |
if ( $gallery_id == 0 ) {
|
1098 |
$gallery_id = (int) WDWLibrary::get('current_id', 0);
|
1099 |
}
|
1100 |
-
$
|
1101 |
-
$
|
1102 |
-
|
1103 |
-
|
|
|
1104 |
}
|
|
|
1105 |
}
|
1106 |
}
|
46 |
}
|
47 |
if ( !$total ) {
|
48 |
$rows = $wpdb->get_results($query);
|
49 |
+
if ( !empty($rows) ) {
|
50 |
+
foreach ( $rows as $row ) {
|
51 |
+
$row->preview_image = WDWLibrary::image_url_version($row->preview_image, $row->modified_date);
|
52 |
+
$row->random_preview_image = WDWLibrary::image_url_version($row->random_preview_image, $row->modified_date);
|
53 |
+
}
|
54 |
+
}
|
55 |
}
|
56 |
else {
|
57 |
$rows = $wpdb->get_var($query);
|
58 |
}
|
|
|
59 |
return $rows;
|
60 |
}
|
61 |
|
132 |
*/
|
133 |
public function get_image_rows_data($gallery_id, $params, $total = FALSE) {
|
134 |
global $wpdb;
|
135 |
+
$rows = array();
|
136 |
$order = $params['order'];
|
137 |
$orderby = $params['orderby'];
|
138 |
$page_per = $params['items_per_page'];
|
175 |
foreach ( $rows as $value ) {
|
176 |
$value->not_set_items = 0;
|
177 |
if ( $value->item_longest_dimension && strpos($value->sections, "downloads") !== FALSE ) {
|
178 |
+
$file_path = str_replace("thumb", ".original", htmlspecialchars_decode(BWG()->upload_dir . $value->thumb_url, ENT_COMPAT | ENT_QUOTES));
|
179 |
list($img_width) = @getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));
|
180 |
if ( $value->item_longest_dimension > $img_width ) {
|
181 |
$value->not_set_items = 1;
|
183 |
}
|
184 |
}
|
185 |
}
|
|
|
|
|
|
|
|
|
186 |
$rows['template'] = new stdClass();
|
187 |
$rows['template']->id = "tempid";
|
188 |
$rows['template']->gallery_id = $gallery_id;
|
207 |
$rows['template']->pricelist_id = 0;
|
208 |
$rows['template']->priselist_name = '';
|
209 |
$rows['template']->not_set_items = 0;
|
210 |
+
$rows['template']->modified_date = '';
|
211 |
+
|
212 |
+
foreach ( $rows as $value ) {
|
213 |
+
$value->tags = $this->get_tag_rows_data($value->id);
|
214 |
+
$value->pure_image_url = $value->image_url;
|
215 |
+
$value->pure_thumb_url = $value->thumb_url;
|
216 |
+
$value->image_url = WDWLibrary::image_url_version($value->image_url, $value->modified_date);
|
217 |
+
$value->thumb_url = WDWLibrary::image_url_version($value->thumb_url, $value->modified_date);
|
218 |
}
|
219 |
}
|
220 |
else {
|
267 |
public function get_row_data( $id ) {
|
268 |
if ( $id != 0 ) {
|
269 |
if ( !current_user_can('manage_options') && BWG()->options->gallery_role ) {
|
270 |
+
$where = " WHERE author = " . get_current_user_id();
|
271 |
}
|
272 |
else {
|
273 |
+
$where = " WHERE author >= 0 ";
|
274 |
}
|
275 |
global $wpdb;
|
276 |
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM `' . $wpdb->prefix . 'bwg_gallery`' . $where . ' AND id="%d"', $id));
|
301 |
/**
|
302 |
* Save.
|
303 |
*
|
304 |
+
* @param string $image_action
|
305 |
*
|
306 |
* @return array
|
307 |
*/
|
308 |
+
public function save($image_action = '') {
|
309 |
$gallery_id = $this->save_db();
|
310 |
+
$data = $this->save_image_db( $gallery_id, $image_action );
|
311 |
+
return array(
|
312 |
+
'id' => $gallery_id,
|
313 |
+
'saved' => (($gallery_id === FALSE || $data['images_saved'] === FALSE) ? FALSE : TRUE),
|
314 |
+
'image_message' => $data['image_message'],
|
315 |
+
);
|
316 |
}
|
317 |
|
318 |
/**
|
333 |
if ( $preview_image == '' ) {
|
334 |
if ( $id != 0 ) {
|
335 |
$random_preview_image = $wpdb->get_var($wpdb->prepare("SELECT random_preview_image FROM " . $wpdb->prefix . "bwg_gallery WHERE id='%d'", $id));
|
336 |
+
if ( $random_preview_image == '' || !file_exists(BWG()->upload_dir . $random_preview_image) ) {
|
337 |
$random_preview_image = $wpdb->get_var($wpdb->prepare("SELECT thumb_url FROM " . $wpdb->prefix . "bwg_image WHERE gallery_id='%d' ORDER BY `order`", $id));
|
338 |
}
|
339 |
if ( empty($random_preview_image) ) {
|
402 |
* Save Images.
|
403 |
*
|
404 |
* @param int $gallery_id
|
405 |
+
* @param string $image_action
|
406 |
*
|
407 |
+
* @return array
|
408 |
*/
|
409 |
+
public function save_image_db( $gallery_id = 0, $image_action = '' ) {
|
410 |
global $wpdb;
|
411 |
$image_ids = WDWLibrary::get('ids_string', '');
|
412 |
$image_id_array = explode(',', $image_ids);
|
413 |
$save = TRUE;
|
414 |
$author = get_current_user_id();
|
415 |
+
$all = WDWLibrary::get('check_all_items', FALSE);
|
416 |
+
$image_message = '';
|
417 |
+
$checked_items_count = WDWLibrary::get('checked_items_count', 0);
|
418 |
foreach ( $image_id_array as $image_id ) {
|
419 |
if ( $image_id ) {
|
420 |
$filename = WDWLibrary::get('input_filename_' . $image_id, '');
|
421 |
$image_url = WDWLibrary::get('image_url_' . $image_id, '');
|
422 |
+
if ( !WDWLibrary::check_external_link($image_url) && !file_exists(html_entity_decode(BWG()->upload_dir . $image_url, ENT_COMPAT | ENT_QUOTES)) ) {
|
423 |
+
continue;
|
424 |
+
}
|
425 |
$thumb_url = WDWLibrary::get('thumb_url_' . $image_id, '');
|
426 |
$description = WDWLibrary::get('image_description_' . $image_id, '');
|
427 |
$alt = WDWLibrary::get('image_alt_text_' . $image_id, '');
|
444 |
'resolution' => $resolution,
|
445 |
'order' => $order,
|
446 |
);
|
447 |
+
$temp_image_id = $image_id;
|
448 |
if ( strpos($image_id, 'pr_') !== FALSE ) {
|
449 |
if ( !WDWLibrary::check_external_link($image_url) ) {
|
450 |
$image_url = wp_normalize_path($image_url);
|
466 |
);
|
467 |
$save = $wpdb->insert($wpdb->prefix . 'bwg_image', $data);
|
468 |
$new_image_id = $wpdb->insert_id;
|
|
|
|
|
|
|
469 |
if ( isset($_POST['image_current_id']) && (esc_html($_POST['image_current_id']) == $image_id) ) {
|
470 |
$_POST['image_current_id'] = $new_image_id;
|
471 |
}
|
474 |
else {
|
475 |
$save = $wpdb->update($wpdb->prefix . 'bwg_image', $data, array( 'id' => $image_id ));
|
476 |
}
|
477 |
+
|
478 |
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'bwg_image_tag WHERE image_id="%d" AND gallery_id="%d"', $image_id, $gallery_id));
|
479 |
if ( $save !== FALSE ) {
|
480 |
$tag_id_array = explode(',', $tags_ids);
|
493 |
}
|
494 |
}
|
495 |
}
|
496 |
+
if ( $image_action
|
497 |
+
&& !$all
|
498 |
+
&& method_exists($this, $image_action)
|
499 |
+
&& isset($_POST['check_' . $temp_image_id]) ) {
|
500 |
+
$this->$image_action($image_id, $gallery_id);
|
501 |
+
}
|
502 |
}
|
503 |
}
|
504 |
+
|
505 |
+
if ( $image_action && $checked_items_count ) {
|
506 |
+
$actions = WDWLibrary::image_actions();
|
507 |
+
$image_message = sprintf(_n('%s item successfully %s.', '%s items successfully %s.', $checked_items_count, BWG()->prefix), $checked_items_count, $actions[$image_action]['bulk_action']);
|
508 |
}
|
509 |
+
|
510 |
+
if ( $all
|
511 |
+
&& $image_action
|
512 |
+
&& method_exists($this, $image_action) ) {
|
513 |
+
$image_message = $this->$image_action(0, $gallery_id, TRUE);
|
514 |
}
|
515 |
+
|
516 |
+
$images_saved = ($save !== FALSE) ? TRUE : FALSE;
|
517 |
+
|
518 |
+
return array( 'images_saved' => $images_saved, 'image_message' => $image_message );
|
519 |
}
|
520 |
|
521 |
/**
|
600 |
}
|
601 |
$where = 'WHERE gallery_id=' . $gallery_id;
|
602 |
$where .= ($all ? '' : ' AND id=' . $id);
|
603 |
+
$search = WDWLibrary::get('s', '');
|
604 |
+
if ( $search ) {
|
605 |
+
$where .= ' AND `filename` LIKE "%' . $search . '%"';
|
606 |
+
}
|
607 |
$image_where = ($all ? '' : ' WHERE image_id=' . $id);
|
608 |
|
609 |
$delete = $wpdb->query('DELETE FROM `' . $wpdb->prefix . 'bwg_image`' . $where);
|
657 |
}
|
658 |
$where = ' WHERE gallery_id=' . $gallery_id;
|
659 |
$where .= ($all ? '' : ' AND id=' . $id);
|
660 |
+
$search = WDWLibrary::get('s', '');
|
661 |
+
if ( $search ) {
|
662 |
+
$where .= ' AND `filename` LIKE "%' . $search . '%"';
|
663 |
+
}
|
664 |
$updated = $wpdb->query('UPDATE `' . $wpdb->prefix . 'bwg_image` SET published=1' . $where);
|
665 |
|
666 |
$message = 2;
|
686 |
}
|
687 |
$where = ' WHERE gallery_id=' . $gallery_id;
|
688 |
$where .= ($all ? '' : ' AND id=' . $id);
|
689 |
+
$search = WDWLibrary::get('s', '');
|
690 |
+
if ( $search ) {
|
691 |
+
$where .= ' AND `filename` LIKE "%' . $search . '%"';
|
692 |
+
}
|
693 |
$updated = $wpdb->query('UPDATE `' . $wpdb->prefix . 'bwg_image` SET published=0' . $where);
|
694 |
|
695 |
$message = 2;
|
737 |
* @return int
|
738 |
*/
|
739 |
public function image_set_watermark($id, $gallery_id = 0, $all = FALSE) {
|
740 |
+
$options = new WD_BWG_Options();
|
741 |
+
list($width_watermark, $height_watermark, $type_watermark) = getimagesize( $options->built_in_watermark_url );
|
742 |
+
if ( empty($width_watermark) OR empty($height_watermark) OR empty($type_watermark)) {
|
743 |
+
$message_id = 26;
|
744 |
+
} else {
|
745 |
+
if ( $gallery_id == 0 ) {
|
746 |
+
$gallery_id = (int) WDWLibrary::get('current_id', 0);
|
747 |
+
}
|
748 |
+
$message_id = WDWLibrary::bwg_image_set_watermark($gallery_id, ($all ? 0 : $id));
|
749 |
+
}
|
750 |
+
return $message_id;
|
751 |
}
|
752 |
|
753 |
/**
|
793 |
$gallery_id = (int) WDWLibrary::get('current_id', 0);
|
794 |
}
|
795 |
$where = ( ($gallery_id) ? ' `gallery_id` = ' . $gallery_id . ($image_id ? ' AND `id` = ' . $image_id : '' ) : 1 );
|
796 |
+
$search = WDWLibrary::get('s', '');
|
797 |
+
if ( $search ) {
|
798 |
+
$where .= ' AND `filename` LIKE "%' . $search . '%"';
|
799 |
+
}
|
800 |
$images_data = $wpdb->get_results( 'SELECT id, image_url, thumb_url FROM `' . $wpdb->prefix . 'bwg_image` WHERE ' . $where );
|
801 |
@ini_set('memory_limit', '-1');
|
802 |
foreach ( $images_data as $image_data ) {
|
803 |
$image_data->image_url = stripcslashes($image_data->image_url);
|
804 |
+
$filename = htmlspecialchars_decode(BWG()->upload_dir . $image_data->image_url, ENT_COMPAT | ENT_QUOTES);
|
805 |
+
$thumb_filename = htmlspecialchars_decode(BWG()->upload_dir . $image_data->thumb_url, ENT_COMPAT | ENT_QUOTES);
|
806 |
list($width_rotate, $height_rotate, $type_rotate) = getimagesize($filename);
|
807 |
if ( $edit_type == '270' || $edit_type == '90' ) {
|
808 |
if ( $type_rotate == 2 ) {
|
881 |
}
|
882 |
$where = ( ($gallery_id) ? ' `gallery_id` = ' . $gallery_id . ( $image_id ? ' AND `id` = ' . $image_id : '' ) : 1 );
|
883 |
$img_ids = $wpdb->get_results( 'SELECT id, thumb_url FROM `' . $wpdb->prefix . 'bwg_image` WHERE ' . $where );
|
884 |
+
$search = WDWLibrary::get('s', '');
|
885 |
+
if ( $search ) {
|
886 |
+
$where .= ' AND `filename` LIKE "%' . $search . '%"';
|
887 |
+
}
|
888 |
foreach ( $img_ids as $img_id ) {
|
889 |
+
$file_path = str_replace("thumb", ".original", htmlspecialchars_decode(BWG()->upload_dir . $img_id->thumb_url, ENT_COMPAT | ENT_QUOTES));
|
890 |
+
$new_file_path = htmlspecialchars_decode(BWG()->upload_dir . $img_id->thumb_url, ENT_COMPAT | ENT_QUOTES);
|
891 |
+
WDWLibrary::resize_image($file_path, $new_file_path, BWG()->options->upload_thumb_width, BWG()->options->upload_thumb_height);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
892 |
}
|
893 |
WDWLibrary::update_image_modified_date( $where );
|
894 |
|
912 |
}
|
913 |
$image_width = (int) WDWLibrary::get('image_width', 1600);
|
914 |
$image_height = (int) WDWLibrary::get('image_height', 1200);
|
915 |
+
$where = ' gallery_id=' . $gallery_id;
|
916 |
+
$where .= ($all ? '' : ' AND id=' . $id);
|
917 |
+
$search = WDWLibrary::get('s', '');
|
918 |
+
if ( $search ) {
|
919 |
+
$where .= ' AND `filename` LIKE "%' . $search . '%"';
|
920 |
+
}
|
921 |
+
$images = $wpdb->get_results('SELECT * FROM `' . $wpdb->prefix . 'bwg_image` WHERE ' . $where );
|
922 |
if ( !empty($images) ) {
|
923 |
foreach ( $images as $image ) {
|
924 |
+
$file_path = BWG()->upload_dir . $image->image_url;
|
925 |
+
$thumb_filename = BWG()->upload_dir . $image->thumb_url;
|
926 |
+
$original_filename = str_replace('/thumb/', '/.original/', $thumb_filename);
|
927 |
+
WDWLibrary::resize_image($original_filename, $file_path, $image_width, $image_height);
|
928 |
}
|
929 |
}
|
930 |
WDWLibrary::update_image_modified_date( $where );
|
932 |
return 24;
|
933 |
}
|
934 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
935 |
/**
|
936 |
* Edit image alt/description/redirect URL.
|
937 |
*
|
945 |
if ( $gallery_id == 0 ) {
|
946 |
$gallery_id = (int) WDWLibrary::get('current_id', 0);
|
947 |
}
|
948 |
+
$where = ' WHERE gallery_id=' . $gallery_id;
|
949 |
+
$where .= ($all ? '' : ' AND id=' . $id);
|
950 |
+
$search = WDWLibrary::get('s', '');
|
951 |
+
if ( $search ) {
|
952 |
+
$where .= ' AND `filename` LIKE "%' . $search . '%"';
|
953 |
+
}
|
954 |
$title = WDWLibrary::get('title', '');
|
955 |
$desc = WDWLibrary::get('desc', '');
|
956 |
$redirecturl = WDWLibrary::get('redirecturl', '');
|
960 |
'description' => $desc,
|
961 |
'redirect_url' => $redirecturl
|
962 |
), $where);
|
963 |
+
$updated = $wpdb->query('UPDATE `' . $wpdb->prefix . 'bwg_image` SET `alt`="' . $title . '", `description`="' . $desc . '", `redirect_url`="' . $redirecturl . '"' . $where);
|
964 |
|
965 |
+
$message = 2;
|
966 |
+
if ( $updated !== FALSE ) {
|
967 |
+
$message = 25;
|
968 |
+
}
|
969 |
+
return $message;
|
970 |
}
|
971 |
|
972 |
public function image_add_tag($id, $gallery_id = 0, $all = FALSE) {
|
|
|
973 |
if ( $gallery_id == 0 ) {
|
974 |
$gallery_id = (int) WDWLibrary::get('current_id', 0);
|
975 |
}
|
976 |
$tag_ids = WDWLibrary::get('added_tags_id', '');
|
977 |
$tag_ids_array = explode(',', $tag_ids);
|
978 |
global $wpdb;
|
979 |
+
$where = ' WHERE gallery_id=' . $gallery_id;
|
980 |
+
$where .= ($all ? '' : ' AND id=' . $id);
|
981 |
+
$search = WDWLibrary::get('s', '');
|
982 |
+
if ( $search ) {
|
983 |
+
$where .= ' AND `filename` LIKE "%' . $search . '%"';
|
984 |
+
}
|
985 |
+
$images = $wpdb->get_results('SELECT * FROM `' . $wpdb->prefix . 'bwg_image`' . $where);
|
986 |
foreach ( $images as $image ) {
|
987 |
foreach ( $tag_ids_array as $tag_id ) {
|
988 |
if ( $tag_id ) {
|
1013 |
if ( $gallery_id == 0 ) {
|
1014 |
$gallery_id = (int) WDWLibrary::get('current_id', 0);
|
1015 |
}
|
1016 |
+
$where = ' WHERE gallery_id=' . $gallery_id;
|
1017 |
+
$where .= ($all ? '' : ' AND id=' . $id);
|
1018 |
+
$search = WDWLibrary::get('s', '');
|
1019 |
+
if ( $search ) {
|
1020 |
+
$where .= ' AND `filename` LIKE "%' . $search . '%"';
|
1021 |
+
}
|
1022 |
+
$image_ids_col = $wpdb->get_col('SELECT id FROM `' . $wpdb->prefix . 'bwg_image`' . $where);
|
1023 |
foreach ($image_ids_col as $image_id) {
|
1024 |
+
$file_path = str_replace("thumb", ".original", htmlspecialchars_decode(BWG()->upload_dir . $_POST['thumb_url_' . $image_id], ENT_COMPAT | ENT_QUOTES));
|
1025 |
list($img_width) = @getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));
|
1026 |
if ($item_longest_dimension > $img_width && $img_width) {
|
1027 |
$not_set_items[] = $image_id . "-" . $item_longest_dimension;
|
1048 |
if ( $gallery_id == 0 ) {
|
1049 |
$gallery_id = (int) WDWLibrary::get('current_id', 0);
|
1050 |
}
|
1051 |
+
$where = ' WHERE gallery_id=' . $gallery_id;
|
1052 |
+
$where .= ($all ? '' : ' AND id=' . $id);
|
1053 |
+
$search = WDWLibrary::get('s', '');
|
1054 |
+
if ( $search ) {
|
1055 |
+
$where .= ' AND `filename` LIKE "%' . $search . '%"';
|
1056 |
}
|
1057 |
+
$wpdb->query('UPDATE `' . $wpdb->prefix . 'bwg_image` SET pricelist_id=0' . $where);
|
1058 |
}
|
1059 |
}
|
admin/models/Options.php
CHANGED
@@ -17,4 +17,33 @@ class OptionsModel_bwg {
|
|
17 |
$upd = update_option('wd_bwg_options', json_encode($row));
|
18 |
return $upd;
|
19 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
}
|
17 |
$upd = update_option('wd_bwg_options', json_encode($row));
|
18 |
return $upd;
|
19 |
}
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Get images count.
|
23 |
+
*
|
24 |
+
* @return int $imgcount
|
25 |
+
*/
|
26 |
+
public function get_image_count() {
|
27 |
+
global $wpdb;
|
28 |
+
$imgcount = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "bwg_image");
|
29 |
+
return $imgcount;
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Update gallery options by key.
|
34 |
+
*
|
35 |
+
* @param $data_params
|
36 |
+
*/
|
37 |
+
public function update_options_by_key( $data_params = array() ) {
|
38 |
+
$options = get_option( 'wd_bwg_options' );
|
39 |
+
if ($options) {
|
40 |
+
$options = json_decode( $options );
|
41 |
+
|
42 |
+
foreach( $data_params as $key => $value ) {
|
43 |
+
$options->$key = $value;
|
44 |
+
}
|
45 |
+
update_option( 'wd_bwg_options', json_encode($options), 'yes' );
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
}
|
admin/models/Themes.php
CHANGED
@@ -46,7 +46,7 @@ class ThemesModel_bwg {
|
|
46 |
|
47 |
public function get_row_data($id, $reset = FALSE) {
|
48 |
global $wpdb;
|
49 |
-
if ($id != 0) {
|
50 |
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'bwg_theme WHERE id="%d"', $id));
|
51 |
$themes = json_decode($row->options);
|
52 |
foreach ($themes as $key => $value) {
|
@@ -227,8 +227,8 @@ class ThemesModel_bwg {
|
|
227 |
if (!isset($row->blog_style_gal_title_align)) {
|
228 |
$row->blog_style_gal_title_align = 'center';
|
229 |
}
|
230 |
-
if ($reset) {
|
231 |
-
if (!$row->default_theme) {
|
232 |
$row_id = $row->id;
|
233 |
$row_name = $row->name;
|
234 |
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'bwg_theme WHERE default_theme="%d"', 1));
|
@@ -392,7 +392,6 @@ class ThemesModel_bwg {
|
|
392 |
if (!isset($row->image_browser_gal_title_align)) {
|
393 |
$row->image_browser_gal_title_align = 'center';
|
394 |
}
|
395 |
-
|
396 |
if (!isset($row->blog_style_gal_title_font_color)) {
|
397 |
$row->blog_style_gal_title_font_color = 'CCCCCC';
|
398 |
}
|
@@ -414,9 +413,39 @@ class ThemesModel_bwg {
|
|
414 |
if (!isset($row->blog_style_gal_title_align)) {
|
415 |
$row->blog_style_gal_title_align = 'center';
|
416 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
417 |
}
|
418 |
else {
|
419 |
-
$theme_defaults = '{"thumb_margin":"4","container_margin":"1","thumb_padding":"0","thumb_border_radius":"0","thumb_border_width":0,"thumb_border_style":"none","thumb_border_color":"CCCCCC","thumb_bg_color":"FFFFFF","thumbs_bg_color":"FFFFFF","thumb_bg_transparent":0,"thumb_box_shadow":"","thumb_transparent":100,"thumb_align":"center","thumb_hover_effect":"zoom","thumb_hover_effect_value":"1.08","thumb_transition":1,"thumb_title_margin":"2px","thumb_title_font_style":"Ubuntu","thumb_title_pos":"bottom","thumb_title_font_color":"CCCCCC","thumb_title_shadow":"0px 0px 0px #888888","thumb_title_font_size":16,"thumb_title_font_weight":"bold","thumb_gal_title_font_color":"CCCCCC","thumb_gal_title_font_style":"segoe ui","thumb_gal_title_font_size":16,"thumb_gal_title_font_weight":"bold","thumb_gal_title_margin":"2px","thumb_gal_title_shadow":"0px 0px 0px #888888","thumb_gal_title_align":"center","page_nav_position":"bottom","page_nav_align":"center","page_nav_number":0,"page_nav_font_size":12,"page_nav_font_style":"segoe ui","page_nav_font_color":"666666","page_nav_font_weight":"bold","page_nav_border_width":1,"page_nav_border_style":"solid","page_nav_border_color":"E3E3E3","page_nav_border_radius":"0","page_nav_margin":"0","page_nav_padding":"3px 6px","page_nav_button_bg_color":"FFFFFF","page_nav_button_bg_transparent":100,"page_nav_box_shadow":"0","page_nav_button_transition":1,"page_nav_button_text":0,"lightbox_ctrl_btn_pos":"bottom","lightbox_ctrl_btn_align":"center","lightbox_ctrl_btn_height":20,"lightbox_ctrl_btn_margin_top":10,"lightbox_ctrl_btn_margin_left":7,"lightbox_ctrl_btn_transparent":100,"lightbox_ctrl_btn_color":"808080","lightbox_toggle_btn_height":20,"lightbox_toggle_btn_width":100,"lightbox_ctrl_cont_bg_color":"FFFFFF","lightbox_ctrl_cont_border_radius":4,"lightbox_ctrl_cont_transparent":85,"lightbox_close_btn_bg_color":"FFFFFF","lightbox_close_btn_border_radius":"16px","lightbox_close_btn_border_width":2,"lightbox_close_btn_border_style":"none","lightbox_close_btn_border_color":"FFFFFF","lightbox_close_btn_box_shadow":"0","lightbox_close_btn_color":"808080","lightbox_close_btn_size":20,"lightbox_close_btn_width":30,"lightbox_close_btn_height":30,"lightbox_close_btn_top":"-20","lightbox_close_btn_right":"-15","lightbox_close_btn_full_color":"000000","lightbox_close_btn_transparent":60,"lightbox_rl_btn_bg_color":"FFFFFF","lightbox_rl_btn_transparent":"60","lightbox_rl_btn_border_radius":"20px","lightbox_rl_btn_border_width":0,"lightbox_rl_btn_border_style":"none","lightbox_rl_btn_border_color":"FFFFFF","lightbox_rl_btn_box_shadow":"","lightbox_rl_btn_color":"ADADAD","lightbox_rl_btn_height":35,"lightbox_rl_btn_width":35,"lightbox_rl_btn_size":25,"lightbox_close_rl_btn_hover_color":"808080","lightbox_comment_pos":"left","lightbox_comment_width":350,"lightbox_comment_bg_color":"FFFFFF","lightbox_comment_font_color":"7A7A7A","lightbox_comment_font_style":"Ubuntu","lightbox_comment_font_size":12,"lightbox_comment_button_bg_color":"2F2F2F","lightbox_comment_button_border_color":"666666","lightbox_comment_button_border_width":1,"lightbox_comment_button_border_style":"none","lightbox_comment_button_border_radius":"7px","lightbox_comment_button_padding":"10px 10px","lightbox_comment_input_bg_color":"F7F8F9","lightbox_comment_input_border_color":"EBEBEB","lightbox_comment_input_border_width":2,"lightbox_comment_input_border_style":"none","lightbox_comment_input_border_radius":"7px","lightbox_comment_input_padding":"5px","lightbox_comment_separator_width":20,"lightbox_comment_separator_style":"none","lightbox_comment_separator_color":"383838","lightbox_comment_author_font_size":14,"lightbox_comment_date_font_size":10,"lightbox_comment_body_font_size":12,"lightbox_comment_share_button_color":"808080","lightbox_filmstrip_rl_bg_color":"EBEBEB","lightbox_filmstrip_rl_btn_size":20,"lightbox_filmstrip_rl_btn_color":"808080","lightbox_filmstrip_thumb_margin":"0 1px","lightbox_filmstrip_thumb_border_width":1,"lightbox_filmstrip_thumb_border_style":"none","lightbox_filmstrip_thumb_border_color":"000000","lightbox_filmstrip_thumb_border_radius":"0","lightbox_filmstrip_thumb_deactive_transparent":80,"lightbox_filmstrip_pos":"bottom","lightbox_filmstrip_thumb_active_border_width":0,"lightbox_filmstrip_thumb_active_border_color":"FFFFFF","lightbox_overlay_bg_transparent":60,"lightbox_bg_color":"FFFFFF","lightbox_overlay_bg_color":"EEEEEE","lightbox_rl_btn_style":"fa-angle","lightbox_bg_transparent":100,"blog_style_margin":"2px","blog_style_padding":"0","blog_style_border_radius":"0","blog_style_border_width":1,"blog_style_border_style":"solid","blog_style_border_color":"F5F5F5","blog_style_bg_color":"FFFFFF","blog_style_transparent":80,"blog_style_box_shadow":"","blog_style_align":"center","blog_style_share_buttons_margin":"5px auto 10px auto","blog_style_share_buttons_border_radius":"0","blog_style_share_buttons_border_width":0,"blog_style_share_buttons_border_style":"none","blog_style_share_buttons_border_color":"000000","blog_style_share_buttons_bg_color":"FFFFFF","blog_style_share_buttons_align":"right","blog_style_img_font_size":16,"blog_style_img_font_family":"segoe ui","blog_style_img_font_color":"000000","blog_style_share_buttons_font_size":20,"blog_style_share_buttons_color":"B3AFAF","blog_style_share_buttons_bg_transparent":0,"blog_style_gal_title_font_color":"CCCCCC","blog_style_gal_title_font_style":"segoe ui","blog_style_gal_title_font_size":16,"blog_style_gal_title_font_weight":"bold","blog_style_gal_title_margin":"2px","blog_style_gal_title_shadow":"0px 0px 0px #888888","blog_style_gal_title_align":"center","image_browser_margin":"2px auto","image_browser_padding":"4px","image_browser_border_radius":"0","image_browser_border_width":1,"image_browser_border_style":"none","image_browser_border_color":"F5F5F5","image_browser_bg_color":"EBEBEB","image_browser_box_shadow":"","image_browser_transparent":80,"image_browser_align":"center","image_browser_image_description_margin":"0px 5px 0px 5px","image_browser_image_description_padding":"8px 8px 8px 8px","image_browser_image_description_border_radius":"0","image_browser_image_description_border_width":1,"image_browser_image_description_border_style":"none","image_browser_image_description_border_color":"FFFFFF","image_browser_image_description_bg_color":"EBEBEB","image_browser_image_description_align":"center","image_browser_img_font_size":15,"image_browser_img_font_family":"Ubuntu","image_browser_img_font_color":"000000","image_browser_full_padding":"4px","image_browser_full_border_radius":"0","image_browser_full_border_width":2,"image_browser_full_border_style":"none","image_browser_full_border_color":"F7F7F7","image_browser_full_bg_color":"F5F5F5","image_browser_full_transparent":90,"image_browser_image_title_align":"top","image_browser_gal_title_font_color":"CCCCCC","image_browser_gal_title_font_style":"segoe ui","image_browser_gal_title_font_size":16,"image_browser_gal_title_font_weight":"bold","image_browser_gal_title_margin":"2px","image_browser_gal_title_shadow":"0px 0px 0px #888888","image_browser_gal_title_align":"center","album_compact_title_margin":"2px","album_compact_thumb_margin":2,"album_compact_back_padding":"0","album_compact_thumb_padding":0,"album_compact_thumb_border_radius":"0","album_compact_thumb_border_width":0,"album_compact_title_font_style":"segoe ui","album_compact_back_font_color":"000000","album_compact_title_font_color":"FFFFFF","album_compact_title_shadow":"0px 0px 0px #888888","album_compact_thumb_bg_transparent":0,"album_compact_thumb_box_shadow":"0px 0px 0px #888888","album_compact_thumb_transition":1,"album_compact_thumb_border_style":"none","album_compact_thumb_border_color":"CCCCCC","album_compact_thumb_bg_color":"FFFFFF","album_compact_back_font_weight":"bold","album_compact_back_font_size":16,"album_compact_back_font_style":"segoe ui","album_compact_thumb_title_pos":"bottom","album_compact_thumbs_bg_color":"FFFFFF","album_compact_title_font_size":16,"album_compact_title_font_weight":"bold","album_compact_thumb_align":"center","album_compact_thumb_hover_effect":"scale","album_compact_thumb_transparent":100,"album_compact_thumb_hover_effect_value":"1.08","album_compact_gal_title_font_color":"CCCCCC","album_compact_gal_title_font_style":"segoe ui","album_compact_gal_title_font_size":16,"album_compact_gal_title_font_weight":"bold","album_compact_gal_title_margin":"2px","album_compact_gal_title_shadow":"0px 0px 0px #888888","album_compact_gal_title_align":"center","album_extended_thumb_margin":2,"album_extended_thumb_padding":0,"album_extended_thumb_border_radius":"0","album_extended_thumb_border_width":0,"album_extended_thumb_border_style":"none","album_extended_thumb_border_color":"CCCCCC","album_extended_thumb_bg_color":"FFFFFF","album_extended_thumbs_bg_color":"FFFFFF","album_extended_thumb_bg_transparent":0,"album_extended_thumb_box_shadow":"","album_extended_thumb_transparent":100,"album_extended_thumb_align":"left","album_extended_thumb_hover_effect":"scale","album_extended_thumb_hover_effect_value":"1.08","album_extended_thumb_transition":1,"album_extended_back_font_color":"000000","album_extended_back_font_style":"segoe ui","album_extended_back_font_size":20,"album_extended_back_font_weight":"bold","album_extended_back_padding":"0","album_extended_div_bg_color":"FFFFFF","album_extended_div_bg_transparent":0,"album_extended_div_border_radius":"0 0 0 0","album_extended_div_margin":"0 0 5px 0","album_extended_div_padding":10,"album_extended_div_separator_width":1,"album_extended_div_separator_style":"solid","album_extended_div_separator_color":"E0E0E0","album_extended_thumb_div_bg_color":"FFFFFF","album_extended_thumb_div_border_radius":"0","album_extended_thumb_div_border_width":1,"album_extended_thumb_div_border_style":"solid","album_extended_thumb_div_border_color":"E8E8E8","album_extended_thumb_div_padding":"5px","album_extended_text_div_bg_color":"FFFFFF","album_extended_text_div_border_radius":"0","album_extended_text_div_border_width":1,"album_extended_text_div_border_style":"solid","album_extended_text_div_border_color":"E8E8E8","album_extended_text_div_padding":"5px","album_extended_title_span_border_width":1,"album_extended_title_span_border_style":"none","album_extended_title_span_border_color":"CCCCCC","album_extended_title_font_color":"000000","album_extended_title_font_style":"segoe ui","album_extended_title_font_size":16,"album_extended_title_font_weight":"bold","album_extended_title_margin_bottom":2,"album_extended_title_padding":"2px","album_extended_desc_span_border_width":1,"album_extended_desc_span_border_style":"none","album_extended_desc_span_border_color":"CCCCCC","album_extended_desc_font_color":"000000","album_extended_desc_font_style":"segoe ui","album_extended_desc_font_size":14,"album_extended_desc_font_weight":"normal","album_extended_desc_padding":"2px","album_extended_desc_more_color":"F2D22E","album_extended_desc_more_size":12,"album_extended_gal_title_font_color":"CCCCCC","album_extended_gal_title_font_style":"segoe ui","album_extended_gal_title_font_size":16,"album_extended_gal_title_font_weight":"bold","album_extended_gal_title_margin":"2px","album_extended_gal_title_shadow":"0px 0px 0px #888888","album_extended_gal_title_align":"center","slideshow_cont_bg_color":"F2F2F2","slideshow_close_btn_transparent":100,"slideshow_rl_btn_bg_color":"FFFFFF","slideshow_rl_btn_border_radius":"20px","slideshow_rl_btn_border_width":0,"slideshow_rl_btn_border_style":"none","slideshow_rl_btn_border_color":"FFFFFF","slideshow_rl_btn_box_shadow":"0px 0px 0px #000000","slideshow_rl_btn_color":"D6D6D6","slideshow_rl_btn_height":37,"slideshow_rl_btn_size":12,"slideshow_rl_btn_width":37,"slideshow_close_rl_btn_hover_color":"BABABA","slideshow_filmstrip_pos":"bottom","slideshow_filmstrip_thumb_border_width":0,"slideshow_filmstrip_thumb_border_style":"none","slideshow_filmstrip_thumb_border_color":"000000","slideshow_filmstrip_thumb_border_radius":"0","slideshow_filmstrip_thumb_margin":"0px 2px 0 0 ","slideshow_filmstrip_thumb_active_border_width":0,"slideshow_filmstrip_thumb_active_border_color":"FFFFFF","slideshow_filmstrip_thumb_deactive_transparent":100,"slideshow_filmstrip_rl_bg_color":"F2F2F2","slideshow_filmstrip_rl_btn_color":"BABABA","slideshow_filmstrip_rl_btn_size":20,"slideshow_title_font_size":16,"slideshow_title_font":"segoe ui","slideshow_title_color":"FFFFFF","slideshow_title_opacity":70,"slideshow_title_border_radius":"5px","slideshow_title_background_color":"000000","slideshow_title_padding":"0 0 0 0","slideshow_description_font_size":14,"slideshow_description_font":"segoe ui","slideshow_description_color":"FFFFFF","slideshow_description_opacity":70,"slideshow_description_border_radius":"0","slideshow_description_background_color":"000000","slideshow_description_padding":"5px 10px 5px 10px","slideshow_dots_width":12,"slideshow_dots_height":12,"slideshow_dots_border_radius":"5px","slideshow_dots_background_color":"F2D22E","slideshow_dots_margin":3,"slideshow_dots_active_background_color":"FFFFFF","slideshow_dots_active_border_width":1,"slideshow_dots_active_border_color":"000000","slideshow_play_pause_btn_size":35,"slideshow_rl_btn_style":"fa-chevron","masonry_thumb_padding":"2","masonry_thumb_border_radius":"0","masonry_thumb_border_width":"0","masonry_thumb_border_style":"none","masonry_thumb_border_color":"CCCCCC","masonry_thumbs_bg_color":"FFFFFF","masonry_thumb_bg_transparent":"0","masonry_thumb_transparent":"100","masonry_thumb_align":"center","masonry_thumb_hover_effect":"scale","masonry_thumb_hover_effect_value":"1.08","masonry_thumb_transition":"1","masonry_thumb_gal_title_font_color":"CCCCCC","masonry_thumb_gal_title_font_style":"segoe ui","masonry_thumb_gal_title_font_size":16,"masonry_thumb_gal_title_font_weight":"bold","masonry_thumb_gal_title_margin":"2px","masonry_thumb_gal_title_shadow":"0px 0px 0px #888888","masonry_thumb_gal_title_align":"center","mosaic_thumb_padding":"2","mosaic_thumb_border_radius":"0","mosaic_thumb_border_width":"0","mosaic_thumb_border_style":"none","mosaic_thumb_border_color":"CCCCCC","mosaic_thumbs_bg_color":"FFFFFF","mosaic_thumb_bg_transparent":"0","mosaic_thumb_transparent":"100","mosaic_thumb_align":"center","mosaic_thumb_hover_effect":"scale","mosaic_thumb_hover_effect_value":"1.08","mosaic_thumb_title_margin":"2px","mosaic_thumb_title_font_style":"segoe ui","mosaic_thumb_title_font_color":"CCCCCC","mosaic_thumb_title_shadow":"0px 0px 0px #888888","mosaic_thumb_title_font_size":16,"mosaic_thumb_title_font_weight":"bold","mosaic_thumb_gal_title_font_color":"CCCCCC","mosaic_thumb_gal_title_font_style":"segoe ui","mosaic_thumb_gal_title_font_size":16,"mosaic_thumb_gal_title_font_weight":"bold","mosaic_thumb_gal_title_margin":"2px","mosaic_thumb_gal_title_shadow":"0px 0px 0px #888888","mosaic_thumb_gal_title_align":"center","lightbox_info_pos":"bottom","lightbox_info_align":"left","lightbox_info_bg_color":"FFFFFF","lightbox_info_bg_transparent":"70","lightbox_info_border_width":"1","lightbox_info_border_style":"none","lightbox_info_border_color":"000000","lightbox_info_border_radius":"0px","lightbox_info_padding":"10px 7px 44px 10px","lightbox_info_margin":"10px 10px -5px 10px","lightbox_title_color":"808080","lightbox_title_font_style":"Ubuntu","lightbox_title_font_weight":"bold","lightbox_title_font_size":"16","lightbox_description_color":"B0B0B0","lightbox_description_font_style":"Ubuntu","lightbox_description_font_weight":"bold","lightbox_description_font_size":"13","lightbox_rate_pos":"top","lightbox_rate_align":"left","lightbox_rate_icon":"star","lightbox_rate_color":"F9D062","lightbox_rate_size":"20","lightbox_rate_stars_count":"5","lightbox_rate_padding":"15px","lightbox_rate_hover_color":"F7B50E","lightbox_hit_pos":"bottom","lightbox_hit_align":"left","lightbox_hit_bg_color":"000000","lightbox_hit_bg_transparent":"70","lightbox_hit_border_width":"1","lightbox_hit_border_style":"none","lightbox_hit_border_color":"000000","lightbox_hit_border_radius":"5px","lightbox_hit_padding":"5px","lightbox_hit_margin":"0 5px","lightbox_hit_color":"FFFFFF","lightbox_hit_font_style":"segoe ui","lightbox_hit_font_weight":"normal","lightbox_hit_font_size":"14","masonry_description_font_size":12,"masonry_description_color":"CCCCCC","masonry_description_font_style":"segoe ui","album_masonry_back_font_color":"000000","album_masonry_back_font_style":"segoe ui","album_masonry_back_font_size":16,"album_masonry_back_font_weight":"bold","album_masonry_back_padding":"0","album_masonry_title_font_color":"CCCCCC","album_masonry_title_font_style":"segoe ui","album_masonry_thumb_title_pos":"bottom","album_masonry_title_font_size":16,"album_masonry_title_font_weight":"bold","album_masonry_title_margin":"","album_masonry_title_shadow":"0px 0px 0px #888888","album_masonry_thumb_margin":0,"album_masonry_thumb_padding":0,"album_masonry_thumb_border_radius":"0","album_masonry_thumb_border_width":0,"album_masonry_thumb_border_style":"none","album_masonry_thumb_border_color":"CCCCCC","album_masonry_thumb_bg_color":"FFFFFF","album_masonry_thumbs_bg_color":"FFFFFF","album_masonry_thumb_bg_transparent":0,"album_masonry_thumb_box_shadow":"","album_masonry_thumb_transparent":100,"album_masonry_thumb_align":"center","album_masonry_thumb_hover_effect":"scale","album_masonry_thumb_hover_effect_value":"1.08","album_masonry_thumb_transition":1,"album_masonry_gal_title_font_color":"CCCCCC","album_masonry_gal_title_font_style":"segoe ui","album_masonry_gal_title_font_size":16,"album_masonry_gal_title_font_weight":"bold","album_masonry_gal_title_margin":"2px","album_masonry_gal_title_shadow":"0px 0px 0px #888888","album_masonry_gal_title_align":"center","carousel_cont_bg_color":"000000","carousel_cont_btn_transparent":0,"carousel_close_btn_transparent":50,"carousel_rl_btn_bg_color":"FFFFFF","carousel_rl_btn_border_radius":"20px","carousel_rl_btn_border_width":0,"carousel_rl_btn_border_style":"none","carousel_rl_btn_border_color":"FFFFFF","carousel_rl_btn_color":"303030","carousel_rl_btn_height":35,"carousel_rl_btn_size":15,"carousel_play_pause_btn_size":25,"carousel_rl_btn_width":35,"carousel_close_rl_btn_hover_color":"191919","carousel_rl_btn_style":"fa-chevron","carousel_mergin_bottom":"0.5","carousel_font_family":"arial","carousel_feature_border_width":2,"carousel_feature_border_style":"none","carousel_feature_border_color":"5D204F","carousel_caption_background_color":"000000","carousel_caption_bottom":0,"carousel_caption_p_mergin":0,"carousel_caption_p_pedding":5,"carousel_caption_p_font_weight":"bold","carousel_caption_p_font_size":14,"carousel_caption_p_color":"FFFFFF","carousel_title_opacity":100,"carousel_title_border_radius":"5px","mosaic_thumb_transition":"1"}';
|
420 |
$theme_defaults = json_decode($theme_defaults);
|
421 |
foreach ($theme_defaults as $key => $value) {
|
422 |
$row->$key = $value;
|
@@ -611,6 +640,36 @@ class ThemesModel_bwg {
|
|
611 |
if (!isset($row->blog_style_gal_title_align)) {
|
612 |
$row->blog_style_gal_title_align = 'center';
|
613 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
614 |
}
|
615 |
return $row;
|
616 |
}
|
46 |
|
47 |
public function get_row_data($id, $reset = FALSE) {
|
48 |
global $wpdb;
|
49 |
+
if ( $id != 0 ) {
|
50 |
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'bwg_theme WHERE id="%d"', $id));
|
51 |
$themes = json_decode($row->options);
|
52 |
foreach ($themes as $key => $value) {
|
227 |
if (!isset($row->blog_style_gal_title_align)) {
|
228 |
$row->blog_style_gal_title_align = 'center';
|
229 |
}
|
230 |
+
if ( $reset ) {
|
231 |
+
if ( !$row->default_theme ) {
|
232 |
$row_id = $row->id;
|
233 |
$row_name = $row->name;
|
234 |
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'bwg_theme WHERE default_theme="%d"', 1));
|
392 |
if (!isset($row->image_browser_gal_title_align)) {
|
393 |
$row->image_browser_gal_title_align = 'center';
|
394 |
}
|
|
|
395 |
if (!isset($row->blog_style_gal_title_font_color)) {
|
396 |
$row->blog_style_gal_title_font_color = 'CCCCCC';
|
397 |
}
|
413 |
if (!isset($row->blog_style_gal_title_align)) {
|
414 |
$row->blog_style_gal_title_align = 'center';
|
415 |
}
|
416 |
+
if ( $row->thumb_hover_effect ) {
|
417 |
+
$row->thumb_hover_effect = 'zoom';
|
418 |
+
}
|
419 |
+
if ( $row->thumb_hover_effect_value ) {
|
420 |
+
$row->thumb_hover_effect_value = '1.08';
|
421 |
+
}
|
422 |
+
if ( $row->thumb_bg_color ) {
|
423 |
+
$row->thumb_bg_color = '000000';
|
424 |
+
}
|
425 |
+
if ( $row->thumb_title_font_color ) {
|
426 |
+
$row->thumb_title_font_color = '323A45';
|
427 |
+
}
|
428 |
+
if ( $row->thumb_title_font_color_hover ) {
|
429 |
+
$row->thumb_title_font_color_hover = 'FFFFFF';
|
430 |
+
}
|
431 |
+
if ( $row->thumb_title_shadow ) {
|
432 |
+
$row->thumb_title_shadow = '';
|
433 |
+
}
|
434 |
+
if ( $row->thumb_gal_title_font_color ) {
|
435 |
+
$row->thumb_gal_title_font_color = '000000';
|
436 |
+
}
|
437 |
+
if ( $row->thumb_gal_title_font_style ) {
|
438 |
+
$row->thumb_gal_title_font_style = 'Ubuntu';
|
439 |
+
}
|
440 |
+
if ( $row->thumb_gal_title_font_size ) {
|
441 |
+
$row->thumb_gal_title_font_size = '18';
|
442 |
+
}
|
443 |
+
if ( $row->thumb_gal_title_shadow ) {
|
444 |
+
$row->thumb_gal_title_shadow = '';
|
445 |
+
}
|
446 |
}
|
447 |
else {
|
448 |
+
$theme_defaults = '{"thumb_margin":"4","container_margin":"1","thumb_padding":"0","thumb_border_radius":"0","thumb_border_width":0,"thumb_border_style":"none","thumb_border_color":"CCCCCC","thumb_bg_color":"000000","thumbs_bg_color":"FFFFFF","thumb_bg_transparent":0,"thumb_box_shadow":"","thumb_transparent":100,"thumb_align":"center","thumb_hover_effect":"zoom","thumb_hover_effect_value":"1.08","thumb_transition":1,"thumb_title_margin":"2px","thumb_title_font_style":"Ubuntu","thumb_title_pos":"bottom","thumb_title_font_color":"323A45","thumb_title_font_color_hover":"FFFFFF","thumb_title_shadow":"","thumb_title_font_size":16,"thumb_title_font_weight":"bold","thumb_gal_title_font_color":"000000","thumb_gal_title_font_style":"Ubuntu","thumb_gal_title_font_size":18,"thumb_gal_title_font_weight":"bold","thumb_gal_title_margin":"2px","thumb_gal_title_shadow":"","thumb_gal_title_align":"center","page_nav_position":"bottom","page_nav_align":"center","page_nav_number":0,"page_nav_font_size":12,"page_nav_font_style":"segoe ui","page_nav_font_color":"666666","page_nav_font_weight":"bold","page_nav_border_width":1,"page_nav_border_style":"solid","page_nav_border_color":"E3E3E3","page_nav_border_radius":"0","page_nav_margin":"0","page_nav_padding":"3px 6px","page_nav_button_bg_color":"FFFFFF","page_nav_button_bg_transparent":100,"page_nav_box_shadow":"0","page_nav_button_transition":1,"page_nav_button_text":0,"lightbox_ctrl_btn_pos":"bottom","lightbox_ctrl_btn_align":"center","lightbox_ctrl_btn_height":20,"lightbox_ctrl_btn_margin_top":10,"lightbox_ctrl_btn_margin_left":7,"lightbox_ctrl_btn_transparent":100,"lightbox_ctrl_btn_color":"808080","lightbox_toggle_btn_height":20,"lightbox_toggle_btn_width":100,"lightbox_ctrl_cont_bg_color":"FFFFFF","lightbox_ctrl_cont_border_radius":4,"lightbox_ctrl_cont_transparent":85,"lightbox_close_btn_bg_color":"FFFFFF","lightbox_close_btn_border_radius":"16px","lightbox_close_btn_border_width":2,"lightbox_close_btn_border_style":"none","lightbox_close_btn_border_color":"FFFFFF","lightbox_close_btn_box_shadow":"0","lightbox_close_btn_color":"808080","lightbox_close_btn_size":20,"lightbox_close_btn_width":30,"lightbox_close_btn_height":30,"lightbox_close_btn_top":"-20","lightbox_close_btn_right":"-15","lightbox_close_btn_full_color":"000000","lightbox_close_btn_transparent":60,"lightbox_rl_btn_bg_color":"FFFFFF","lightbox_rl_btn_transparent":"60","lightbox_rl_btn_border_radius":"20px","lightbox_rl_btn_border_width":0,"lightbox_rl_btn_border_style":"none","lightbox_rl_btn_border_color":"FFFFFF","lightbox_rl_btn_box_shadow":"","lightbox_rl_btn_color":"ADADAD","lightbox_rl_btn_height":35,"lightbox_rl_btn_width":35,"lightbox_rl_btn_size":25,"lightbox_close_rl_btn_hover_color":"808080","lightbox_comment_pos":"left","lightbox_comment_width":350,"lightbox_comment_bg_color":"FFFFFF","lightbox_comment_font_color":"7A7A7A","lightbox_comment_font_style":"Ubuntu","lightbox_comment_font_size":12,"lightbox_comment_button_bg_color":"2F2F2F","lightbox_comment_button_border_color":"666666","lightbox_comment_button_border_width":1,"lightbox_comment_button_border_style":"none","lightbox_comment_button_border_radius":"7px","lightbox_comment_button_padding":"10px 10px","lightbox_comment_input_bg_color":"F7F8F9","lightbox_comment_input_border_color":"EBEBEB","lightbox_comment_input_border_width":2,"lightbox_comment_input_border_style":"none","lightbox_comment_input_border_radius":"7px","lightbox_comment_input_padding":"5px","lightbox_comment_separator_width":20,"lightbox_comment_separator_style":"none","lightbox_comment_separator_color":"383838","lightbox_comment_author_font_size":14,"lightbox_comment_date_font_size":10,"lightbox_comment_body_font_size":12,"lightbox_comment_share_button_color":"808080","lightbox_filmstrip_rl_bg_color":"EBEBEB","lightbox_filmstrip_rl_btn_size":20,"lightbox_filmstrip_rl_btn_color":"808080","lightbox_filmstrip_thumb_margin":"0 1px","lightbox_filmstrip_thumb_border_width":1,"lightbox_filmstrip_thumb_border_style":"none","lightbox_filmstrip_thumb_border_color":"000000","lightbox_filmstrip_thumb_border_radius":"0","lightbox_filmstrip_thumb_deactive_transparent":80,"lightbox_filmstrip_pos":"bottom","lightbox_filmstrip_thumb_active_border_width":0,"lightbox_filmstrip_thumb_active_border_color":"FFFFFF","lightbox_overlay_bg_transparent":60,"lightbox_bg_color":"FFFFFF","lightbox_overlay_bg_color":"EEEEEE","lightbox_rl_btn_style":"fa-angle","lightbox_bg_transparent":100,"blog_style_margin":"2px","blog_style_padding":"0","blog_style_border_radius":"0","blog_style_border_width":1,"blog_style_border_style":"solid","blog_style_border_color":"F5F5F5","blog_style_bg_color":"FFFFFF","blog_style_transparent":80,"blog_style_box_shadow":"","blog_style_align":"center","blog_style_share_buttons_margin":"5px auto 10px auto","blog_style_share_buttons_border_radius":"0","blog_style_share_buttons_border_width":0,"blog_style_share_buttons_border_style":"none","blog_style_share_buttons_border_color":"000000","blog_style_share_buttons_bg_color":"FFFFFF","blog_style_share_buttons_align":"right","blog_style_img_font_size":16,"blog_style_img_font_family":"segoe ui","blog_style_img_font_color":"000000","blog_style_share_buttons_font_size":20,"blog_style_share_buttons_color":"B3AFAF","blog_style_share_buttons_bg_transparent":0,"blog_style_gal_title_font_color":"CCCCCC","blog_style_gal_title_font_style":"segoe ui","blog_style_gal_title_font_size":16,"blog_style_gal_title_font_weight":"bold","blog_style_gal_title_margin":"2px","blog_style_gal_title_shadow":"0px 0px 0px #888888","blog_style_gal_title_align":"center","image_browser_margin":"2px auto","image_browser_padding":"4px","image_browser_border_radius":"0","image_browser_border_width":1,"image_browser_border_style":"none","image_browser_border_color":"F5F5F5","image_browser_bg_color":"EBEBEB","image_browser_box_shadow":"","image_browser_transparent":80,"image_browser_align":"center","image_browser_image_description_margin":"0px 5px 0px 5px","image_browser_image_description_padding":"8px 8px 8px 8px","image_browser_image_description_border_radius":"0","image_browser_image_description_border_width":1,"image_browser_image_description_border_style":"none","image_browser_image_description_border_color":"FFFFFF","image_browser_image_description_bg_color":"EBEBEB","image_browser_image_description_align":"center","image_browser_img_font_size":15,"image_browser_img_font_family":"Ubuntu","image_browser_img_font_color":"000000","image_browser_full_padding":"4px","image_browser_full_border_radius":"0","image_browser_full_border_width":2,"image_browser_full_border_style":"none","image_browser_full_border_color":"F7F7F7","image_browser_full_bg_color":"F5F5F5","image_browser_full_transparent":90,"image_browser_image_title_align":"top","image_browser_gal_title_font_color":"CCCCCC","image_browser_gal_title_font_style":"segoe ui","image_browser_gal_title_font_size":16,"image_browser_gal_title_font_weight":"bold","image_browser_gal_title_margin":"2px","image_browser_gal_title_shadow":"0px 0px 0px #888888","image_browser_gal_title_align":"center","album_compact_title_margin":"2px","album_compact_thumb_margin":2,"album_compact_back_padding":"0","album_compact_thumb_padding":0,"album_compact_thumb_border_radius":"0","album_compact_thumb_border_width":0,"album_compact_title_font_style":"segoe ui","album_compact_back_font_color":"000000","album_compact_title_font_color":"FFFFFF","album_compact_title_shadow":"0px 0px 0px #888888","album_compact_thumb_bg_transparent":0,"album_compact_thumb_box_shadow":"0px 0px 0px #888888","album_compact_thumb_transition":1,"album_compact_thumb_border_style":"none","album_compact_thumb_border_color":"CCCCCC","album_compact_thumb_bg_color":"FFFFFF","album_compact_back_font_weight":"bold","album_compact_back_font_size":16,"album_compact_back_font_style":"segoe ui","album_compact_thumb_title_pos":"bottom","album_compact_thumbs_bg_color":"FFFFFF","album_compact_title_font_size":16,"album_compact_title_font_weight":"bold","album_compact_thumb_align":"center","album_compact_thumb_hover_effect":"scale","album_compact_thumb_transparent":100,"album_compact_thumb_hover_effect_value":"1.08","album_compact_gal_title_font_color":"CCCCCC","album_compact_gal_title_font_style":"segoe ui","album_compact_gal_title_font_size":16,"album_compact_gal_title_font_weight":"bold","album_compact_gal_title_margin":"2px","album_compact_gal_title_shadow":"0px 0px 0px #888888","album_compact_gal_title_align":"center","album_extended_thumb_margin":2,"album_extended_thumb_padding":0,"album_extended_thumb_border_radius":"0","album_extended_thumb_border_width":0,"album_extended_thumb_border_style":"none","album_extended_thumb_border_color":"CCCCCC","album_extended_thumb_bg_color":"FFFFFF","album_extended_thumbs_bg_color":"FFFFFF","album_extended_thumb_bg_transparent":0,"album_extended_thumb_box_shadow":"","album_extended_thumb_transparent":100,"album_extended_thumb_align":"left","album_extended_thumb_hover_effect":"scale","album_extended_thumb_hover_effect_value":"1.08","album_extended_thumb_transition":1,"album_extended_back_font_color":"000000","album_extended_back_font_style":"segoe ui","album_extended_back_font_size":20,"album_extended_back_font_weight":"bold","album_extended_back_padding":"0","album_extended_div_bg_color":"FFFFFF","album_extended_div_bg_transparent":0,"album_extended_div_border_radius":"0 0 0 0","album_extended_div_margin":"0 0 5px 0","album_extended_div_padding":10,"album_extended_div_separator_width":1,"album_extended_div_separator_style":"solid","album_extended_div_separator_color":"E0E0E0","album_extended_thumb_div_bg_color":"FFFFFF","album_extended_thumb_div_border_radius":"0","album_extended_thumb_div_border_width":1,"album_extended_thumb_div_border_style":"solid","album_extended_thumb_div_border_color":"E8E8E8","album_extended_thumb_div_padding":"5px","album_extended_text_div_bg_color":"FFFFFF","album_extended_text_div_border_radius":"0","album_extended_text_div_border_width":1,"album_extended_text_div_border_style":"solid","album_extended_text_div_border_color":"E8E8E8","album_extended_text_div_padding":"5px","album_extended_title_span_border_width":1,"album_extended_title_span_border_style":"none","album_extended_title_span_border_color":"CCCCCC","album_extended_title_font_color":"000000","album_extended_title_font_style":"segoe ui","album_extended_title_font_size":16,"album_extended_title_font_weight":"bold","album_extended_title_margin_bottom":2,"album_extended_title_padding":"2px","album_extended_desc_span_border_width":1,"album_extended_desc_span_border_style":"none","album_extended_desc_span_border_color":"CCCCCC","album_extended_desc_font_color":"000000","album_extended_desc_font_style":"segoe ui","album_extended_desc_font_size":14,"album_extended_desc_font_weight":"normal","album_extended_desc_padding":"2px","album_extended_desc_more_color":"F2D22E","album_extended_desc_more_size":12,"album_extended_gal_title_font_color":"CCCCCC","album_extended_gal_title_font_style":"segoe ui","album_extended_gal_title_font_size":16,"album_extended_gal_title_font_weight":"bold","album_extended_gal_title_margin":"2px","album_extended_gal_title_shadow":"0px 0px 0px #888888","album_extended_gal_title_align":"center","slideshow_cont_bg_color":"F2F2F2","slideshow_close_btn_transparent":100,"slideshow_rl_btn_bg_color":"FFFFFF","slideshow_rl_btn_border_radius":"20px","slideshow_rl_btn_border_width":0,"slideshow_rl_btn_border_style":"none","slideshow_rl_btn_border_color":"FFFFFF","slideshow_rl_btn_box_shadow":"","slideshow_rl_btn_color":"D6D6D6","slideshow_rl_btn_height":37,"slideshow_rl_btn_size":12,"slideshow_rl_btn_width":37,"slideshow_close_rl_btn_hover_color":"BABABA","slideshow_filmstrip_pos":"bottom","slideshow_filmstrip_thumb_border_width":0,"slideshow_filmstrip_thumb_border_style":"none","slideshow_filmstrip_thumb_border_color":"000000","slideshow_filmstrip_thumb_border_radius":"0","slideshow_filmstrip_thumb_margin":"0px 2px 0 0 ","slideshow_filmstrip_thumb_active_border_width":0,"slideshow_filmstrip_thumb_active_border_color":"FFFFFF","slideshow_filmstrip_thumb_deactive_transparent":100,"slideshow_filmstrip_rl_bg_color":"F2F2F2","slideshow_filmstrip_rl_btn_color":"BABABA","slideshow_filmstrip_rl_btn_size":20,"slideshow_title_font_size":16,"slideshow_title_font":"segoe ui","slideshow_title_color":"FFFFFF","slideshow_title_opacity":70,"slideshow_title_border_radius":"5px","slideshow_title_background_color":"000000","slideshow_title_padding":"0 0 0 0","slideshow_description_font_size":14,"slideshow_description_font":"segoe ui","slideshow_description_color":"FFFFFF","slideshow_description_opacity":70,"slideshow_description_border_radius":"0","slideshow_description_background_color":"000000","slideshow_description_padding":"5px 10px 5px 10px","slideshow_dots_width":12,"slideshow_dots_height":12,"slideshow_dots_border_radius":"5px","slideshow_dots_background_color":"F2D22E","slideshow_dots_margin":3,"slideshow_dots_active_background_color":"FFFFFF","slideshow_dots_active_border_width":1,"slideshow_dots_active_border_color":"000000","slideshow_play_pause_btn_size":35,"slideshow_rl_btn_style":"fa-chevron","masonry_thumb_padding":"2","masonry_thumb_border_radius":"0","masonry_thumb_border_width":"0","masonry_thumb_border_style":"none","masonry_thumb_border_color":"CCCCCC","masonry_thumbs_bg_color":"FFFFFF","masonry_thumb_bg_transparent":"0","masonry_thumb_transparent":"100","masonry_thumb_align":"center","masonry_thumb_hover_effect":"scale","masonry_thumb_hover_effect_value":"1.08","masonry_thumb_transition":"1","masonry_thumb_gal_title_font_color":"CCCCCC","masonry_thumb_gal_title_font_style":"segoe ui","masonry_thumb_gal_title_font_size":16,"masonry_thumb_gal_title_font_weight":"bold","masonry_thumb_gal_title_margin":"2px","masonry_thumb_gal_title_shadow":"0px 0px 0px #888888","masonry_thumb_gal_title_align":"center","mosaic_thumb_padding":"2","mosaic_thumb_border_radius":"0","mosaic_thumb_border_width":"0","mosaic_thumb_border_style":"none","mosaic_thumb_border_color":"CCCCCC","mosaic_thumbs_bg_color":"FFFFFF","mosaic_thumb_bg_transparent":"0","mosaic_thumb_transparent":"100","mosaic_thumb_align":"center","mosaic_thumb_hover_effect":"scale","mosaic_thumb_hover_effect_value":"1.08","mosaic_thumb_title_margin":"2px","mosaic_thumb_title_font_style":"segoe ui","mosaic_thumb_title_font_color":"CCCCCC","mosaic_thumb_title_shadow":"0px 0px 0px #888888","mosaic_thumb_title_font_size":16,"mosaic_thumb_title_font_weight":"bold","mosaic_thumb_gal_title_font_color":"CCCCCC","mosaic_thumb_gal_title_font_style":"segoe ui","mosaic_thumb_gal_title_font_size":16,"mosaic_thumb_gal_title_font_weight":"bold","mosaic_thumb_gal_title_margin":"2px","mosaic_thumb_gal_title_shadow":"0px 0px 0px #888888","mosaic_thumb_gal_title_align":"center","lightbox_info_pos":"bottom","lightbox_info_align":"left","lightbox_info_bg_color":"FFFFFF","lightbox_info_bg_transparent":"70","lightbox_info_border_width":"1","lightbox_info_border_style":"none","lightbox_info_border_color":"000000","lightbox_info_border_radius":"0px","lightbox_info_padding":"10px 7px 44px 10px","lightbox_info_margin":"10px 10px -5px 10px","lightbox_title_color":"808080","lightbox_title_font_style":"Ubuntu","lightbox_title_font_weight":"bold","lightbox_title_font_size":"16","lightbox_description_color":"B0B0B0","lightbox_description_font_style":"Ubuntu","lightbox_description_font_weight":"bold","lightbox_description_font_size":"13","lightbox_rate_pos":"top","lightbox_rate_align":"left","lightbox_rate_icon":"star","lightbox_rate_color":"F9D062","lightbox_rate_size":"20","lightbox_rate_stars_count":"5","lightbox_rate_padding":"15px","lightbox_rate_hover_color":"F7B50E","lightbox_hit_pos":"bottom","lightbox_hit_align":"left","lightbox_hit_bg_color":"000000","lightbox_hit_bg_transparent":"70","lightbox_hit_border_width":"1","lightbox_hit_border_style":"none","lightbox_hit_border_color":"000000","lightbox_hit_border_radius":"5px","lightbox_hit_padding":"5px","lightbox_hit_margin":"0 5px","lightbox_hit_color":"FFFFFF","lightbox_hit_font_style":"segoe ui","lightbox_hit_font_weight":"normal","lightbox_hit_font_size":"14","masonry_description_font_size":12,"masonry_description_color":"CCCCCC","masonry_description_font_style":"segoe ui","album_masonry_back_font_color":"000000","album_masonry_back_font_style":"segoe ui","album_masonry_back_font_size":16,"album_masonry_back_font_weight":"bold","album_masonry_back_padding":"0","album_masonry_title_font_color":"CCCCCC","album_masonry_title_font_style":"segoe ui","album_masonry_thumb_title_pos":"bottom","album_masonry_title_font_size":16,"album_masonry_title_font_weight":"bold","album_masonry_title_margin":"","album_masonry_title_shadow":"0px 0px 0px #888888","album_masonry_thumb_margin":0,"album_masonry_thumb_padding":0,"album_masonry_thumb_border_radius":"0","album_masonry_thumb_border_width":0,"album_masonry_thumb_border_style":"none","album_masonry_thumb_border_color":"CCCCCC","album_masonry_thumb_bg_color":"FFFFFF","album_masonry_thumbs_bg_color":"FFFFFF","album_masonry_thumb_bg_transparent":0,"album_masonry_thumb_box_shadow":"","album_masonry_thumb_transparent":100,"album_masonry_thumb_align":"center","album_masonry_thumb_hover_effect":"scale","album_masonry_thumb_hover_effect_value":"1.08","album_masonry_thumb_transition":1,"album_masonry_gal_title_font_color":"CCCCCC","album_masonry_gal_title_font_style":"segoe ui","album_masonry_gal_title_font_size":16,"album_masonry_gal_title_font_weight":"bold","album_masonry_gal_title_margin":"2px","album_masonry_gal_title_shadow":"0px 0px 0px #888888","album_masonry_gal_title_align":"center","carousel_cont_bg_color":"000000","carousel_cont_btn_transparent":0,"carousel_close_btn_transparent":50,"carousel_rl_btn_bg_color":"FFFFFF","carousel_rl_btn_border_radius":"20px","carousel_rl_btn_border_width":0,"carousel_rl_btn_border_style":"none","carousel_rl_btn_border_color":"FFFFFF","carousel_rl_btn_color":"303030","carousel_rl_btn_height":35,"carousel_rl_btn_size":15,"carousel_play_pause_btn_size":25,"carousel_rl_btn_width":35,"carousel_close_rl_btn_hover_color":"191919","carousel_rl_btn_style":"fa-chevron","carousel_mergin_bottom":"0.5","carousel_font_family":"arial","carousel_feature_border_width":2,"carousel_feature_border_style":"none","carousel_feature_border_color":"5D204F","carousel_caption_background_color":"000000","carousel_caption_bottom":0,"carousel_caption_p_mergin":0,"carousel_caption_p_pedding":5,"carousel_caption_p_font_weight":"bold","carousel_caption_p_font_size":14,"carousel_caption_p_color":"FFFFFF","carousel_title_opacity":100,"carousel_title_border_radius":"5px","mosaic_thumb_transition":"1"}';
|
449 |
$theme_defaults = json_decode($theme_defaults);
|
450 |
foreach ($theme_defaults as $key => $value) {
|
451 |
$row->$key = $value;
|
640 |
if (!isset($row->blog_style_gal_title_align)) {
|
641 |
$row->blog_style_gal_title_align = 'center';
|
642 |
}
|
643 |
+
if ( $row->thumb_hover_effect ) {
|
644 |
+
$row->thumb_hover_effect = 'zoom';
|
645 |
+
}
|
646 |
+
if ( $row->thumb_hover_effect_value ) {
|
647 |
+
$row->thumb_hover_effect_value = '1.08';
|
648 |
+
}
|
649 |
+
if ( $row->thumb_bg_color ) {
|
650 |
+
$row->thumb_bg_color = '000000';
|
651 |
+
}
|
652 |
+
if ( $row->thumb_title_font_color ) {
|
653 |
+
$row->thumb_title_font_color = '323A45';
|
654 |
+
}
|
655 |
+
if ( !isset($row->thumb_title_font_color_hover) ) {
|
656 |
+
$row->thumb_title_font_color_hover = 'FFFFFF';
|
657 |
+
}
|
658 |
+
if ( $row->thumb_title_shadow ) {
|
659 |
+
$row->thumb_title_shadow = '';
|
660 |
+
}
|
661 |
+
if ( $row->thumb_gal_title_font_color ) {
|
662 |
+
$row->thumb_gal_title_font_color = '000000';
|
663 |
+
}
|
664 |
+
if ( $row->thumb_gal_title_font_style ) {
|
665 |
+
$row->thumb_gal_title_font_style = 'Ubuntu';
|
666 |
+
}
|
667 |
+
if ( $row->thumb_gal_title_font_size ) {
|
668 |
+
$row->thumb_gal_title_font_size = '18';
|
669 |
+
}
|
670 |
+
if ( $row->thumb_gal_title_shadow ) {
|
671 |
+
$row->thumb_gal_title_shadow = '';
|
672 |
+
}
|
673 |
}
|
674 |
return $row;
|
675 |
}
|
admin/models/Uninstall.php
CHANGED
@@ -25,8 +25,8 @@ class UninstallModel_bwg {
|
|
25 |
}
|
26 |
|
27 |
if (BWG()->upload_dir) {
|
28 |
-
if (is_dir(
|
29 |
-
delfiles(
|
30 |
}
|
31 |
}
|
32 |
}
|
25 |
}
|
26 |
|
27 |
if (BWG()->upload_dir) {
|
28 |
+
if (is_dir(BWG()->upload_dir)) {
|
29 |
+
delfiles(BWG()->upload_dir);
|
30 |
}
|
31 |
}
|
32 |
}
|
admin/views/AddTags.php
CHANGED
@@ -12,7 +12,7 @@ class AddTagsView_bwg extends AdminView_bwg {
|
|
12 |
*
|
13 |
* @param $params
|
14 |
*/
|
15 |
-
public function display( $params ) {
|
16 |
ob_start();
|
17 |
$params['page_url'] = add_query_arg(array(
|
18 |
'action' => 'addTags_' . BWG()->prefix,
|
@@ -40,7 +40,7 @@ class AddTagsView_bwg extends AdminView_bwg {
|
|
40 |
*
|
41 |
* @param $params
|
42 |
*/
|
43 |
-
public function body( $params ) {
|
44 |
?>
|
45 |
<div class="wd-table-container">
|
46 |
<?php
|
12 |
*
|
13 |
* @param $params
|
14 |
*/
|
15 |
+
public function display( $params = array() ) {
|
16 |
ob_start();
|
17 |
$params['page_url'] = add_query_arg(array(
|
18 |
'action' => 'addTags_' . BWG()->prefix,
|
40 |
*
|
41 |
* @param $params
|
42 |
*/
|
43 |
+
public function body( $params = array() ) {
|
44 |
?>
|
45 |
<div class="wd-table-container">
|
46 |
<?php
|
admin/views/AdminView.php
CHANGED
@@ -63,7 +63,7 @@ class AdminView_bwg {
|
|
63 |
*
|
64 |
* @return string Title html.
|
65 |
*/
|
66 |
-
protected function title($params) {
|
67 |
$title = !empty($params['title']) ? $params['title'] : '';
|
68 |
$title_class = !empty($params['title_class']) ? $params['title_class'] : '';
|
69 |
$title_name = !empty($params['title_name']) ? $params['title_name'] : '';
|
@@ -149,6 +149,29 @@ class AdminView_bwg {
|
|
149 |
return ob_get_clean();
|
150 |
}
|
151 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
/**
|
153 |
* Search.
|
154 |
*
|
@@ -160,6 +183,11 @@ class AdminView_bwg {
|
|
160 |
ob_start();
|
161 |
?>
|
162 |
<p class="search-box">
|
|
|
|
|
|
|
|
|
|
|
163 |
<input name="s" value="<?php echo $search; ?>" type="search" onkeypress="return input_search(event, this)" />
|
164 |
<input class="button" value="<?php echo __('Search', BWG()->prefix) . ' ' . ( !empty( $params['search_item_name'] ) ? $params['search_item_name'] : '' ); ?>" type="button" onclick="search(this)" />
|
165 |
</p>
|
@@ -289,7 +317,7 @@ class AdminView_bwg {
|
|
289 |
<?php
|
290 |
foreach ( $actions as $key => $action ) {
|
291 |
?>
|
292 |
-
<option value="<?php echo $key; ?>"
|
293 |
<?php
|
294 |
}
|
295 |
?>
|
63 |
*
|
64 |
* @return string Title html.
|
65 |
*/
|
66 |
+
protected function title($params = array()) {
|
67 |
$title = !empty($params['title']) ? $params['title'] : '';
|
68 |
$title_class = !empty($params['title_class']) ? $params['title_class'] : '';
|
69 |
$title_name = !empty($params['title_name']) ? $params['title_name'] : '';
|
149 |
return ob_get_clean();
|
150 |
}
|
151 |
|
152 |
+
/**
|
153 |
+
* Sorting.
|
154 |
+
*
|
155 |
+
* @param array $params
|
156 |
+
* @return string
|
157 |
+
*/
|
158 |
+
protected function sorting() {
|
159 |
+
$options = WDWLibrary::admin_images_ordering_choices();
|
160 |
+
ob_start();
|
161 |
+
?>
|
162 |
+
<select name="order_by" onchange="bwg_sort_images(this.value);">
|
163 |
+
<?php
|
164 |
+
foreach ( $options as $key => $option ) {
|
165 |
+
?>
|
166 |
+
<option value="<?php echo $key; ?>"><?php echo $option; ?></option>
|
167 |
+
<?php
|
168 |
+
}
|
169 |
+
?>
|
170 |
+
</select>
|
171 |
+
<?php
|
172 |
+
return ob_get_clean();
|
173 |
+
}
|
174 |
+
|
175 |
/**
|
176 |
* Search.
|
177 |
*
|
183 |
ob_start();
|
184 |
?>
|
185 |
<p class="search-box">
|
186 |
+
<?php
|
187 |
+
if (isset($params['sorting']) && $params['sorting']) {
|
188 |
+
echo $this->sorting();
|
189 |
+
}
|
190 |
+
?>
|
191 |
<input name="s" value="<?php echo $search; ?>" type="search" onkeypress="return input_search(event, this)" />
|
192 |
<input class="button" value="<?php echo __('Search', BWG()->prefix) . ' ' . ( !empty( $params['search_item_name'] ) ? $params['search_item_name'] : '' ); ?>" type="button" onclick="search(this)" />
|
193 |
</p>
|
317 |
<?php
|
318 |
foreach ( $actions as $key => $action ) {
|
319 |
?>
|
320 |
+
<option value="<?php echo $key; ?>" <?php echo isset($action['disabled']) ? $action['disabled'] : ''; ?>><?php echo $action['title']; ?></option>
|
321 |
<?php
|
322 |
}
|
323 |
?>
|
admin/views/Albums.php
CHANGED
@@ -9,7 +9,7 @@ class AlbumsView_bwg extends AdminView_bwg {
|
|
9 |
*
|
10 |
* @param $params
|
11 |
*/
|
12 |
-
public function display( $params ) {
|
13 |
ob_start();
|
14 |
echo $this->body($params);
|
15 |
// Pass the content to form.
|
@@ -27,7 +27,7 @@ class AlbumsView_bwg extends AdminView_bwg {
|
|
27 |
*
|
28 |
* @param $params
|
29 |
*/
|
30 |
-
public function body( $params ) {
|
31 |
echo $this->title( array(
|
32 |
'title' => $params['page_title'],
|
33 |
'title_class' => 'wd-header',
|
@@ -73,10 +73,10 @@ class AlbumsView_bwg extends AdminView_bwg {
|
|
73 |
$preview_url = WDWLibrary::get_custom_post_permalink( array('slug' => $row->slug, 'post_type' => 'album' ));
|
74 |
$preview_image = BWG()->plugin_url . '/images/no-image.png';
|
75 |
if ( !empty($row->preview_image) ) {
|
76 |
-
$preview_image =
|
77 |
}
|
78 |
if ( !empty($row->random_preview_image)) {
|
79 |
-
$preview_image =
|
80 |
if ( WDWLibrary::check_external_link($row->random_preview_image) ) {
|
81 |
$preview_image = $row->random_preview_image;
|
82 |
}
|
@@ -133,7 +133,7 @@ class AlbumsView_bwg extends AdminView_bwg {
|
|
133 |
*
|
134 |
* @return string html.
|
135 |
*/
|
136 |
-
public function edit( $params ) {
|
137 |
wp_enqueue_script('jquery-ui-sortable');
|
138 |
wp_admin_css('thickbox');
|
139 |
wp_enqueue_media();
|
@@ -155,11 +155,11 @@ class AlbumsView_bwg extends AdminView_bwg {
|
|
155 |
*
|
156 |
* @param $params
|
157 |
*/
|
158 |
-
public function edit_body( $params ) {
|
159 |
-
|
160 |
wp_enqueue_script('thickbox');
|
161 |
$row = $params['row'];
|
162 |
-
$enable_wp_editor = isset(BWG()->options->enable_wp_editor) ? BWG()->options->enable_wp_editor :
|
163 |
?>
|
164 |
<div class="bwg-page-header">
|
165 |
<div class="wd-page-title wd-header">
|
@@ -168,11 +168,7 @@ class AlbumsView_bwg extends AdminView_bwg {
|
|
168 |
<div class="bwg-page-actions">
|
169 |
<?php
|
170 |
if ( $params['shortcode_id'] ) {
|
171 |
-
|
172 |
-
<button class="button button-secondary button-large" onclick="how_to_use(); return false;">
|
173 |
-
<?php _e('How to use', BWG()->prefix); ?>
|
174 |
-
</button>
|
175 |
-
<?php
|
176 |
}
|
177 |
?>
|
178 |
<button class="button button-primary button-large" onclick="if (spider_check_required('name', 'Title')) {return false;}; spider_set_input_value('task', 'save')">
|
@@ -204,7 +200,7 @@ class AlbumsView_bwg extends AdminView_bwg {
|
|
204 |
<a href="<?php echo $params['add_preview_image_action']; ?>" id="button_preview_image" class="button wd-preview-image-btn thickbox thickbox-preview <?php echo ($row->preview_image == '') ? 'bwg_not-preview-image' : '' ?>" title="<?php _e('Add Preview Image', BWG()->prefix); ?>" onclick="return false;" style="<?php echo !empty($row->preview_image)?'display:none;':'' ?>">
|
205 |
<span class="dashicons dashicons-camera"></span><?php _e('Add', BWG()->prefix); ?>
|
206 |
</a>
|
207 |
-
<img id="img_preview_image" src="<?php echo $row->preview_image ? (
|
208 |
<span id="delete_preview_image" class="spider_delete_img dashicons dashicons-no-alt" onclick="spider_remove_url('button_preview_image', 'preview_image', 'delete_preview_image', 'img_preview_image')" style="<?php echo empty($row->preview_image)?'display:none;':'' ?>"></span>
|
209 |
<input type="hidden" id="preview_image" name="preview_image" value="<?php echo $row->preview_image; ?>"/>
|
210 |
<p class="description"><?php _e('Add a preview image, which will be displayed as the cover image of the gallery group when it is published in a parent gallery group.', BWG()->prefix); ?></p>
|
@@ -264,40 +260,6 @@ class AlbumsView_bwg extends AdminView_bwg {
|
|
264 |
</div>
|
265 |
</div>
|
266 |
</div>
|
267 |
-
<?php if ( $params['shortcode_id'] ) { ?>
|
268 |
-
<div class="wd-table-row wd-table-col-100 wd-table-col-left">
|
269 |
-
<div class="wd-box-section">
|
270 |
-
<div class="postbox closed how_to_postbox">
|
271 |
-
<button class="button-link handlediv" type="button" aria-expanded="true">
|
272 |
-
<span class="screen-reader-text"><?php _e('Toggle panel:', BWG()->prefix); ?></span>
|
273 |
-
<span class="toggle-indicator" aria-hidden="false"></span>
|
274 |
-
</button>
|
275 |
-
<h2 class="hndle">
|
276 |
-
<span><?php _e('How to use', BWG()->prefix); ?></span>
|
277 |
-
</h2>
|
278 |
-
<div class="inside">
|
279 |
-
<div class="howto_container">
|
280 |
-
<div class="howto_content">
|
281 |
-
<h2><?php _e('Page or Post editor', BWG()->prefix); ?></h2>
|
282 |
-
<h4><?php _e('Insert it into an existing post with the button.', BWG()->prefix); ?></h4>
|
283 |
-
<img src="<?php echo BWG()->plugin_url . '/images/wp-publish.png'; ?>" alt="<?php _e('Post editor', BWG()->prefix); ?>" />
|
284 |
-
</div>
|
285 |
-
<div class="howto_content">
|
286 |
-
<h2><?php _e('PHP code', BWG()->prefix); ?></h2>
|
287 |
-
<h4><?php _e('Copy and paste the PHP code into your template file.', BWG()->prefix); ?></h4>
|
288 |
-
<input type="text" class="bwg_howto_phpcode" value="<?php photo_gallery(<?php echo $params['shortcode_id']; ?>); ?>" onclick="spider_select_value(this)" size="17" readonly="readonly" />
|
289 |
-
</div>
|
290 |
-
<div class="howto_content">
|
291 |
-
<h2><?php _e('Widget', BWG()->prefix); ?></h2>
|
292 |
-
<h4><?php _e('Insert as Widget.', BWG()->prefix); ?></h4>
|
293 |
-
<img src="<?php echo BWG()->plugin_url . '/images/wp-widget.png'; ?>" alt="<?php _e('Widget', BWG()->prefix); ?>" />
|
294 |
-
</div>
|
295 |
-
</div>
|
296 |
-
</div>
|
297 |
-
</div>
|
298 |
-
</div>
|
299 |
-
</div>
|
300 |
-
<?php } ?>
|
301 |
</div>
|
302 |
<div class="wd-table">
|
303 |
<div class="wd-table-col wd-table-col-100 meta-box-sortables">
|
@@ -309,7 +271,7 @@ class AlbumsView_bwg extends AdminView_bwg {
|
|
309 |
<?php
|
310 |
foreach ($params['albums_galleries'] as $item) {
|
311 |
$item->published = !$item->published ? 'dashicons-hidden' : 'hidden';
|
312 |
-
$item->preview_image = 'background-image:url(
|
313 |
echo $this->albumgallery_template($item);
|
314 |
}
|
315 |
$template = new stdClass();
|
@@ -348,7 +310,7 @@ class AlbumsView_bwg extends AdminView_bwg {
|
|
348 |
}
|
349 |
?>
|
350 |
<div class="bwg_subtab connectedSortable <?php echo 'bwg_subtab_' . $albumgallery_row->published; ?>" data-id="<?php echo $albumgallery_row->alb_gal_id; ?>" data-is-album="<?php echo $albumgallery_row->is_album; ?>" data-status="<?php echo $albumgallery_row->published; ?>">
|
351 |
-
<div
|
352 |
<div class="tab_buttons">
|
353 |
<div class="handle_wrap">
|
354 |
<span class="bwg_move dashicons dashicons-move" title="<?php _e('Drag to re-order', BWG()->prefix); ?>"></span>
|
9 |
*
|
10 |
* @param $params
|
11 |
*/
|
12 |
+
public function display( $params = array() ) {
|
13 |
ob_start();
|
14 |
echo $this->body($params);
|
15 |
// Pass the content to form.
|
27 |
*
|
28 |
* @param $params
|
29 |
*/
|
30 |
+
public function body( $params = array() ) {
|
31 |
echo $this->title( array(
|
32 |
'title' => $params['page_title'],
|
33 |
'title_class' => 'wd-header',
|
73 |
$preview_url = WDWLibrary::get_custom_post_permalink( array('slug' => $row->slug, 'post_type' => 'album' ));
|
74 |
$preview_image = BWG()->plugin_url . '/images/no-image.png';
|
75 |
if ( !empty($row->preview_image) ) {
|
76 |
+
$preview_image = BWG()->upload_url . $row->preview_image;
|
77 |
}
|
78 |
if ( !empty($row->random_preview_image)) {
|
79 |
+
$preview_image = BWG()->upload_url . $row->random_preview_image;
|
80 |
if ( WDWLibrary::check_external_link($row->random_preview_image) ) {
|
81 |
$preview_image = $row->random_preview_image;
|
82 |
}
|
133 |
*
|
134 |
* @return string html.
|
135 |
*/
|
136 |
+
public function edit( $params = array() ) {
|
137 |
wp_enqueue_script('jquery-ui-sortable');
|
138 |
wp_admin_css('thickbox');
|
139 |
wp_enqueue_media();
|
155 |
*
|
156 |
* @param $params
|
157 |
*/
|
158 |
+
public function edit_body( $params = array() ) {
|
159 |
+
wp_enqueue_style('thickbox');
|
160 |
wp_enqueue_script('thickbox');
|
161 |
$row = $params['row'];
|
162 |
+
$enable_wp_editor = isset(BWG()->options->enable_wp_editor) ? BWG()->options->enable_wp_editor : 0;
|
163 |
?>
|
164 |
<div class="bwg-page-header">
|
165 |
<div class="wd-page-title wd-header">
|
168 |
<div class="bwg-page-actions">
|
169 |
<?php
|
170 |
if ( $params['shortcode_id'] ) {
|
171 |
+
require BWG()->plugin_dir . '/framework/howto/howto.php';
|
|
|
|
|
|
|
|
|
172 |
}
|
173 |
?>
|
174 |
<button class="button button-primary button-large" onclick="if (spider_check_required('name', 'Title')) {return false;}; spider_set_input_value('task', 'save')">
|
200 |
<a href="<?php echo $params['add_preview_image_action']; ?>" id="button_preview_image" class="button wd-preview-image-btn thickbox thickbox-preview <?php echo ($row->preview_image == '') ? 'bwg_not-preview-image' : '' ?>" title="<?php _e('Add Preview Image', BWG()->prefix); ?>" onclick="return false;" style="<?php echo !empty($row->preview_image)?'display:none;':'' ?>">
|
201 |
<span class="dashicons dashicons-camera"></span><?php _e('Add', BWG()->prefix); ?>
|
202 |
</a>
|
203 |
+
<img id="img_preview_image" src="<?php echo $row->preview_image ? (BWG()->upload_url . $row->preview_image) : ''; ?>" style="<?php echo empty($row->preview_image)?'display:none;':'' ?>"/>
|
204 |
<span id="delete_preview_image" class="spider_delete_img dashicons dashicons-no-alt" onclick="spider_remove_url('button_preview_image', 'preview_image', 'delete_preview_image', 'img_preview_image')" style="<?php echo empty($row->preview_image)?'display:none;':'' ?>"></span>
|
205 |
<input type="hidden" id="preview_image" name="preview_image" value="<?php echo $row->preview_image; ?>"/>
|
206 |
<p class="description"><?php _e('Add a preview image, which will be displayed as the cover image of the gallery group when it is published in a parent gallery group.', BWG()->prefix); ?></p>
|
260 |
</div>
|
261 |
</div>
|
262 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
263 |
</div>
|
264 |
<div class="wd-table">
|
265 |
<div class="wd-table-col wd-table-col-100 meta-box-sortables">
|
271 |
<?php
|
272 |
foreach ($params['albums_galleries'] as $item) {
|
273 |
$item->published = !$item->published ? 'dashicons-hidden' : 'hidden';
|
274 |
+
$item->preview_image = 'style="background-image:url("'. $item->preview_image .'")"';
|
275 |
echo $this->albumgallery_template($item);
|
276 |
}
|
277 |
$template = new stdClass();
|
310 |
}
|
311 |
?>
|
312 |
<div class="bwg_subtab connectedSortable <?php echo 'bwg_subtab_' . $albumgallery_row->published; ?>" data-id="<?php echo $albumgallery_row->alb_gal_id; ?>" data-is-album="<?php echo $albumgallery_row->is_album; ?>" data-status="<?php echo $albumgallery_row->published; ?>">
|
313 |
+
<div <?php echo $albumgallery_row->preview_image; ?> class="tab_image">
|
314 |
<div class="tab_buttons">
|
315 |
<div class="handle_wrap">
|
316 |
<span class="bwg_move dashicons dashicons-move" title="<?php _e('Drag to re-order', BWG()->prefix); ?>"></span>
|
admin/views/Albumsgalleries.php
CHANGED
@@ -21,7 +21,7 @@ class AlbumsgalleriesView_bwg extends AdminView_bwg {
|
|
21 |
*
|
22 |
* @param $params
|
23 |
*/
|
24 |
-
public function display( $params ) {
|
25 |
ob_start();
|
26 |
$params['page_url'] = add_query_arg(array(
|
27 |
'action' => 'albumsgalleries_' . BWG()->prefix,
|
@@ -51,7 +51,7 @@ class AlbumsgalleriesView_bwg extends AdminView_bwg {
|
|
51 |
*
|
52 |
* @param $params
|
53 |
*/
|
54 |
-
public function body( $params ) {
|
55 |
?>
|
56 |
<div id="loading_div"></div>
|
57 |
<div class="wd-table-container">
|
@@ -86,10 +86,10 @@ class AlbumsgalleriesView_bwg extends AdminView_bwg {
|
|
86 |
$alternate = (!isset($alternate) || $alternate == '') ? 'class="alternate"' : '';
|
87 |
$preview_image = BWG()->plugin_url . '/images/no-image.png';
|
88 |
if ( !empty($row->preview_image) ) {
|
89 |
-
$preview_image =
|
90 |
}
|
91 |
if ( !empty($row->random_preview_image)) {
|
92 |
-
$preview_image =
|
93 |
if ( WDWLibrary::check_external_link($row->random_preview_image) ) {
|
94 |
$preview_image = $row->random_preview_image;
|
95 |
}
|
21 |
*
|
22 |
* @param $params
|
23 |
*/
|
24 |
+
public function display( $params = array() ) {
|
25 |
ob_start();
|
26 |
$params['page_url'] = add_query_arg(array(
|
27 |
'action' => 'albumsgalleries_' . BWG()->prefix,
|
51 |
*
|
52 |
* @param $params
|
53 |
*/
|
54 |
+
public function body( $params = array() ) {
|
55 |
?>
|
56 |
<div id="loading_div"></div>
|
57 |
<div class="wd-table-container">
|
86 |
$alternate = (!isset($alternate) || $alternate == '') ? 'class="alternate"' : '';
|
87 |
$preview_image = BWG()->plugin_url . '/images/no-image.png';
|
88 |
if ( !empty($row->preview_image) ) {
|
89 |
+
$preview_image = BWG()->upload_url . $row->preview_image;
|
90 |
}
|
91 |
if ( !empty($row->random_preview_image)) {
|
92 |
+
$preview_image = BWG()->upload_url . $row->random_preview_image;
|
93 |
if ( WDWLibrary::check_external_link($row->random_preview_image) ) {
|
94 |
$preview_image = $row->random_preview_image;
|
95 |
}
|
admin/views/Editimage.php
CHANGED
@@ -13,8 +13,9 @@ class EditimageView_bwg {
|
|
13 |
|
14 |
$instagram_post_width = (int) WDWLibrary::get('instagram_post_width', $image_width);
|
15 |
$instagram_post_height = (int) WDWLibrary::get('instagram_post_height', $image_height);
|
16 |
-
|
17 |
-
|
|
|
18 |
if ( $image_height / ($instagram_post_height + $FeedbackSocialProofHeight) < $image_width / $instagram_post_width ) {
|
19 |
$instagram_post_width = ($image_height - $FeedbackSocialProofHeight) * $instagram_post_width / $instagram_post_height + 16;
|
20 |
$instagram_post_height = $image_height;
|
@@ -29,12 +30,12 @@ class EditimageView_bwg {
|
|
29 |
$facebook_post = WDWLibrary::get('FACEBOOK_POST', '0');
|
30 |
$fb_post_url = WDWLibrary::get('fb_post_url', '');
|
31 |
$app_id = BWG()->options->facebook_app_id;
|
32 |
-
|
33 |
<div id="loading_div"></div>
|
34 |
<div id="wd-content" style="width:100%; height:100%;">
|
35 |
<div id="bwg_container_for_media_1" style="width:100%; height:100%; margin:0 auto; text-align:center; vertical-align:middle;">
|
36 |
<?php if ( !$facebook_post ) { ?>
|
37 |
-
<img id="image_display" src="<?php echo
|
38 |
<?php }
|
39 |
else { ?>
|
40 |
<div id="fb-root"></div>
|
@@ -86,8 +87,8 @@ class EditimageView_bwg {
|
|
86 |
}
|
87 |
}
|
88 |
}
|
89 |
-
|
90 |
-
|
91 |
});
|
92 |
</script>
|
93 |
<?php
|
@@ -100,6 +101,7 @@ class EditimageView_bwg {
|
|
100 |
$popup_height = ((int) (isset($_GET['height']) ? esc_html($_GET['height']) : '500')) - 50;
|
101 |
$image_height = $popup_height - 40;
|
102 |
$image_id = (isset($_GET['image_id']) ? esc_html($_GET['image_id']) : '0');
|
|
|
103 |
?>
|
104 |
<div style="display:table; width:100%; height:<?php echo $popup_height; ?>px;">
|
105 |
<div style="display:table-cell; text-align:center; vertical-align:middle;">
|
@@ -107,8 +109,8 @@ class EditimageView_bwg {
|
|
107 |
</div>
|
108 |
</div>
|
109 |
<script>
|
110 |
-
var image_url = "<?php echo
|
111 |
-
window.document.getElementById("thumb_view").src = image_url + "
|
112 |
</script>
|
113 |
<?php
|
114 |
die();
|
@@ -127,12 +129,13 @@ class EditimageView_bwg {
|
|
127 |
$y = (isset($_POST['y']) ? (int) $_POST['y'] : 0);
|
128 |
$w = (isset($_POST['w']) ? (int) $_POST['w'] : 0);
|
129 |
$h = (isset($_POST['h']) ? (int) $_POST['h'] : 0);
|
|
|
130 |
if ( isset($_GET['image_url']) ) {
|
131 |
$image_data = new stdClass();
|
132 |
$image_data->image_url = (isset($_GET['image_url']) ? esc_html(stripcslashes($_GET['image_url'])) : '');
|
133 |
$image_data->thumb_url = (isset($_GET['thumb_url']) ? esc_html(stripcslashes($_GET['thumb_url'])) : '');
|
134 |
-
$filename = htmlspecialchars_decode(
|
135 |
-
$thumb_filename = htmlspecialchars_decode(
|
136 |
$form_action = add_query_arg(array(
|
137 |
'action' => 'editimage_' . BWG()->prefix,
|
138 |
'type' => 'crop',
|
@@ -146,8 +149,8 @@ class EditimageView_bwg {
|
|
146 |
}
|
147 |
else {
|
148 |
$image_data->image_url = stripslashes($image_data->image_url);
|
149 |
-
$filename = htmlspecialchars_decode(
|
150 |
-
$thumb_filename = htmlspecialchars_decode(
|
151 |
$form_action = add_query_arg(array(
|
152 |
'action' => 'editimage_' . BWG()->prefix,
|
153 |
'type' => 'crop',
|
@@ -157,9 +160,15 @@ class EditimageView_bwg {
|
|
157 |
'TB_iframe' => '1',
|
158 |
), admin_url('admin-ajax.php'));
|
159 |
}
|
|
|
160 |
@ini_set('memory_limit', '-1');
|
161 |
list($width_orig, $height_orig, $type_orig) = getimagesize($filename);
|
162 |
if ( $edit_type == 'crop' ) {
|
|
|
|
|
|
|
|
|
|
|
163 |
if ( $type_orig == 2 ) {
|
164 |
$img_r = imagecreatefromjpeg($filename);
|
165 |
$dst_r = ImageCreateTrueColor($thumb_width, $thumb_height);
|
@@ -200,8 +209,9 @@ class EditimageView_bwg {
|
|
200 |
</div>
|
201 |
<?php
|
202 |
}
|
203 |
-
|
204 |
-
|
|
|
205 |
}
|
206 |
@ini_restore('memory_limit');
|
207 |
wp_print_scripts('jquery');
|
@@ -287,12 +297,12 @@ class EditimageView_bwg {
|
|
287 |
<strong><?php echo __('Select the area for the thumbnail.', BWG()->prefix); ?></strong></div><?php
|
288 |
}
|
289 |
?>
|
290 |
-
<div class="thumb_preview_td" style="padding: 5px;">
|
291 |
-
<input type="checkbox" id="chb" onclick="spider_crop_ratio()" checked="checked">
|
292 |
-
<label for="chb"><?php _e('Keep aspect ratio', BWG()->prefix); ?></label>
|
293 |
-
</div>
|
294 |
<form method="post" id="crop_image" action="<?php echo $form_action; ?>">
|
295 |
<?php wp_nonce_field('editimage_' . BWG()->prefix, 'bwg_nonce'); ?>
|
|
|
|
|
|
|
|
|
296 |
<div style="height:<?php echo $popup_height - 60; ?>px; width:<?php echo $popup_width; ?>px; margin: 5px auto;">
|
297 |
<div id="crop_button">
|
298 |
<img title="Crop" class="spider_crop" onclick="spider_crop('crop', 'crop_image')" src="<?php echo BWG()->plugin_url . '/images/crop.png'; ?>" />
|
@@ -300,11 +310,11 @@ class EditimageView_bwg {
|
|
300 |
<table style="height: inherit; top: 80px; position: absolute; width: inherit; margin: 0 auto;">
|
301 |
<tr>
|
302 |
<td class="thumb_preview_td" style="vertical-align: middle; width: <?php echo ($popup_width - $thumb_width) - 40; ?>px;">
|
303 |
-
<img id="image_view" src="<?php echo
|
304 |
</td>
|
305 |
<td class="thumb_preview_td" style="width:<?php echo $thumb_width + 20; ?>px;">
|
306 |
<div class="thumb_preview">
|
307 |
-
<img id="thumb_image_preview" src="<?php echo
|
308 |
</div>
|
309 |
</td>
|
310 |
</tr>
|
@@ -334,11 +344,10 @@ class EditimageView_bwg {
|
|
334 |
document.getElementById("edit_type").value = type;
|
335 |
document.getElementById(form_id).submit();
|
336 |
}
|
337 |
-
|
338 |
var image_src = window.parent.document.getElementById("image_thumb_<?php echo $image_id; ?>").src;
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
spider_crop_fix("<?php echo $thumb_width * 300 / $thumb_height; ?>", "<?php echo 300; ?>");
|
343 |
});
|
344 |
|
@@ -384,11 +393,18 @@ class EditimageView_bwg {
|
|
384 |
jQuery('#crop_button').hide();
|
385 |
jQuery('#croped_message').show();
|
386 |
var thumb_width = parseInt('<?php echo $thumb_width * 300 / $thumb_height; ?>');
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
392 |
}
|
393 |
</script>
|
394 |
<?php
|
@@ -403,48 +419,11 @@ class EditimageView_bwg {
|
|
403 |
$image_data->image_url = (isset($_GET['image_url']) ? esc_html(stripcslashes($_GET['image_url'])) : '');
|
404 |
$image_data->thumb_url = (isset($_GET['thumb_url']) ? esc_html(stripcslashes($_GET['thumb_url'])) : '');
|
405 |
}
|
406 |
-
$filename = htmlspecialchars_decode(
|
407 |
-
$thumb_filename = htmlspecialchars_decode(
|
408 |
-
|
409 |
-
|
410 |
-
$
|
411 |
-
$thumb_height = $height_orig / $percent;
|
412 |
-
@ini_set('memory_limit', '-1');
|
413 |
-
if ( $type_orig == 2 ) {
|
414 |
-
$img_r = imagecreatefromjpeg($filename);
|
415 |
-
$dst_r = ImageCreateTrueColor($thumb_width, $thumb_height);
|
416 |
-
imagecopyresampled($dst_r, $img_r, 0, 0, 0, 0, $thumb_width, $thumb_height, $width_orig, $height_orig);
|
417 |
-
imagejpeg($dst_r, $thumb_filename, BWG()->options->jpeg_quality);
|
418 |
-
imagedestroy($img_r);
|
419 |
-
imagedestroy($dst_r);
|
420 |
-
}
|
421 |
-
elseif ( $type_orig == 3 ) {
|
422 |
-
$img_r = imagecreatefrompng($filename);
|
423 |
-
$dst_r = ImageCreateTrueColor($thumb_width, $thumb_height);
|
424 |
-
imageColorAllocateAlpha($dst_r, 0, 0, 0, 127);
|
425 |
-
imagealphablending($dst_r, FALSE);
|
426 |
-
imagesavealpha($dst_r, TRUE);
|
427 |
-
imagecopyresampled($dst_r, $img_r, 0, 0, 0, 0, $thumb_width, $thumb_height, $width_orig, $height_orig);
|
428 |
-
imagealphablending($dst_r, FALSE);
|
429 |
-
imagesavealpha($dst_r, TRUE);
|
430 |
-
imagepng($dst_r, $thumb_filename, BWG()->options->png_quality);
|
431 |
-
imagedestroy($img_r);
|
432 |
-
imagedestroy($dst_r);
|
433 |
-
}
|
434 |
-
elseif ( $type_orig == 1 ) {
|
435 |
-
$img_r = imagecreatefromgif($filename);
|
436 |
-
$dst_r = ImageCreateTrueColor($thumb_width, $thumb_height);
|
437 |
-
imageColorAllocateAlpha($dst_r, 0, 0, 0, 127);
|
438 |
-
imagealphablending($dst_r, FALSE);
|
439 |
-
imagesavealpha($dst_r, TRUE);
|
440 |
-
imagecopyresampled($dst_r, $img_r, 0, 0, 0, 0, $thumb_width, $thumb_height, $width_orig, $height_orig);
|
441 |
-
imagealphablending($dst_r, FALSE);
|
442 |
-
imagesavealpha($dst_r, TRUE);
|
443 |
-
imagegif($dst_r, $thumb_filename);
|
444 |
-
imagedestroy($img_r);
|
445 |
-
imagedestroy($dst_r);
|
446 |
-
}
|
447 |
-
@ini_restore('memory_limit');
|
448 |
}
|
449 |
|
450 |
public function rotate($image_data = array()) {
|
@@ -456,12 +435,13 @@ class EditimageView_bwg {
|
|
456 |
$edit_type = (isset($_POST['edit_type']) ? esc_html($_POST['edit_type']) : '');
|
457 |
$brightness_val = (isset($_POST['brightness_val']) ? esc_html($_POST['brightness_val']) : 0);
|
458 |
$contrast_val = (isset($_POST['contrast_val']) ? esc_html($_POST['contrast_val']) : 0);
|
|
|
|
|
459 |
if ( isset($_GET['image_url']) ) {
|
460 |
-
$image_data = new stdClass();
|
461 |
$image_data->image_url = (isset($_GET['image_url']) ? esc_html(stripcslashes($_GET['image_url'])) : '');
|
462 |
$image_data->thumb_url = (isset($_GET['thumb_url']) ? esc_html(stripcslashes($_GET['thumb_url'])) : '');
|
463 |
-
$filename = htmlspecialchars_decode(
|
464 |
-
$thumb_filename = htmlspecialchars_decode(
|
465 |
$form_action = add_query_arg(array(
|
466 |
'action' => 'editimage_' . BWG()->prefix,
|
467 |
'type' => 'rotate',
|
@@ -475,8 +455,8 @@ class EditimageView_bwg {
|
|
475 |
}
|
476 |
else {
|
477 |
$image_data->image_url = stripcslashes($image_data->image_url);
|
478 |
-
$filename = htmlspecialchars_decode(
|
479 |
-
$thumb_filename = htmlspecialchars_decode(
|
480 |
$form_action = add_query_arg(array(
|
481 |
'action' => 'editimage_' . BWG()->prefix,
|
482 |
'type' => 'rotate',
|
@@ -486,6 +466,7 @@ class EditimageView_bwg {
|
|
486 |
'TB_iframe' => '1',
|
487 |
), admin_url('admin-ajax.php'));
|
488 |
}
|
|
|
489 |
@ini_set('memory_limit', '-1');
|
490 |
list($width_rotate, $height_rotate, $type_rotate) = getimagesize($filename);
|
491 |
if ( $edit_type == '270' || $edit_type == '90' ) {
|
@@ -574,7 +555,6 @@ class EditimageView_bwg {
|
|
574 |
if ( imagecopyresampled($imgdest, $imgsrc, 0, 0, $src_x, $src_y, $width, $height, $src_width, $src_height) ) {
|
575 |
return $imgdest;
|
576 |
}
|
577 |
-
|
578 |
return $imgsrc;
|
579 |
}
|
580 |
|
@@ -775,10 +755,12 @@ class EditimageView_bwg {
|
|
775 |
$this->recover_image($id, $thumb_width, $thumb_height);
|
776 |
}
|
777 |
@ini_restore('memory_limit');
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
|
|
|
|
782 |
wp_print_scripts('jquery');
|
783 |
wp_print_scripts('jquery-ui-widget');
|
784 |
wp_print_scripts('jquery-ui-slider');
|
@@ -829,7 +811,7 @@ class EditimageView_bwg {
|
|
829 |
<div class="img_cont" style="height:<?php echo $popup_height - 40; ?>px;">
|
830 |
<div class="img_main_cont">
|
831 |
<div class="last_cont">
|
832 |
-
<img class="bwg_preview_image" src="<?php echo
|
833 |
</div>
|
834 |
</div>
|
835 |
<div class="cont_bright_cont">
|
@@ -838,8 +820,7 @@ class EditimageView_bwg {
|
|
838 |
<div class="bwg_opt_cont">
|
839 |
<img title="Options" src="<?php echo BWG()->plugin_url . '/images/effects/option.png'; ?>" />
|
840 |
</div>
|
841 |
-
<div id="brightness_contrast"
|
842 |
-
-->
|
843 |
<div class="brightness_part">
|
844 |
<div class="brightness_part_1">
|
845 |
<div class="brightness_butt">
|
@@ -857,8 +838,7 @@ class EditimageView_bwg {
|
|
857 |
</div>
|
858 |
</div>
|
859 |
</div>
|
860 |
-
</div
|
861 |
-
-->
|
862 |
<div class="contrast_part">
|
863 |
<div class="contrast_part_1">
|
864 |
<div class="contrast_part_slider">
|
@@ -876,8 +856,8 @@ class EditimageView_bwg {
|
|
876 |
</div>
|
877 |
</div>
|
878 |
</div>
|
879 |
-
</div
|
880 |
-
|
881 |
</div>
|
882 |
</div>
|
883 |
</div>
|
@@ -930,15 +910,15 @@ class EditimageView_bwg {
|
|
930 |
document.getElementById("edit_type").value = type;
|
931 |
document.getElementById(form_id).submit();
|
932 |
}
|
933 |
-
|
934 |
if (window.parent.document.getElementById("image_thumb_pr_<?php echo $image_id; ?>") != null) {
|
935 |
var image_src = window.parent.document.getElementById("image_thumb_pr_<?php echo $image_id; ?>").src;
|
936 |
-
window.parent.document.getElementById("image_thumb_pr_<?php echo $image_id; ?>").src = image_src + "
|
937 |
}
|
938 |
else {
|
939 |
var image_src = window.parent.document.getElementById("image_thumb_<?php echo $image_id; ?>").src;
|
940 |
-
window.parent.document.getElementById("image_thumb_<?php echo $image_id; ?>").src = image_src + "
|
941 |
}
|
|
|
942 |
jQuery(document).ready(function () {
|
943 |
jQuery(".bwg_opt_cont").click(function () {
|
944 |
if (jQuery('#brightness_contrast').height() == 0) {
|
13 |
|
14 |
$instagram_post_width = (int) WDWLibrary::get('instagram_post_width', $image_width);
|
15 |
$instagram_post_height = (int) WDWLibrary::get('instagram_post_height', $image_height);
|
16 |
+
$modified_date = WDWLibrary::get('modified_date', '');
|
17 |
+
$FeedbackSocialProofHeight = 132;
|
18 |
+
if ( $instagram_post_width ) {
|
19 |
if ( $image_height / ($instagram_post_height + $FeedbackSocialProofHeight) < $image_width / $instagram_post_width ) {
|
20 |
$instagram_post_width = ($image_height - $FeedbackSocialProofHeight) * $instagram_post_width / $instagram_post_height + 16;
|
21 |
$instagram_post_height = $image_height;
|
30 |
$facebook_post = WDWLibrary::get('FACEBOOK_POST', '0');
|
31 |
$fb_post_url = WDWLibrary::get('fb_post_url', '');
|
32 |
$app_id = BWG()->options->facebook_app_id;
|
33 |
+
?>
|
34 |
<div id="loading_div"></div>
|
35 |
<div id="wd-content" style="width:100%; height:100%;">
|
36 |
<div id="bwg_container_for_media_1" style="width:100%; height:100%; margin:0 auto; text-align:center; vertical-align:middle;">
|
37 |
<?php if ( !$facebook_post ) { ?>
|
38 |
+
<img id="image_display" src="<?php echo BWG()->upload_url . WDWLibrary::image_url_version($image_url, $modified_date); ?>" style="max-width:100%; max-height:100%" />
|
39 |
<?php }
|
40 |
else { ?>
|
41 |
<div id="fb-root"></div>
|
87 |
}
|
88 |
}
|
89 |
}
|
90 |
+
jQuery(window).load(function() {
|
91 |
+
jQuery('#loading_div', window.parent.document).hide();
|
92 |
});
|
93 |
</script>
|
94 |
<?php
|
101 |
$popup_height = ((int) (isset($_GET['height']) ? esc_html($_GET['height']) : '500')) - 50;
|
102 |
$image_height = $popup_height - 40;
|
103 |
$image_id = (isset($_GET['image_id']) ? esc_html($_GET['image_id']) : '0');
|
104 |
+
$modified_date = WDWLibrary::get('modified_date', '');
|
105 |
?>
|
106 |
<div style="display:table; width:100%; height:<?php echo $popup_height; ?>px;">
|
107 |
<div style="display:table-cell; text-align:center; vertical-align:middle;">
|
109 |
</div>
|
110 |
</div>
|
111 |
<script>
|
112 |
+
var image_url = "<?php echo BWG()->upload_url; ?>" + window.parent.document.getElementById("thumb_url_<?php echo $image_id; ?>").value;
|
113 |
+
window.document.getElementById("thumb_view").src = image_url + "<?php echo $modified_date ? '?bwg=' . $modified_date : ''; ?>";
|
114 |
</script>
|
115 |
<?php
|
116 |
die();
|
129 |
$y = (isset($_POST['y']) ? (int) $_POST['y'] : 0);
|
130 |
$w = (isset($_POST['w']) ? (int) $_POST['w'] : 0);
|
131 |
$h = (isset($_POST['h']) ? (int) $_POST['h'] : 0);
|
132 |
+
$modified_date = time();
|
133 |
if ( isset($_GET['image_url']) ) {
|
134 |
$image_data = new stdClass();
|
135 |
$image_data->image_url = (isset($_GET['image_url']) ? esc_html(stripcslashes($_GET['image_url'])) : '');
|
136 |
$image_data->thumb_url = (isset($_GET['thumb_url']) ? esc_html(stripcslashes($_GET['thumb_url'])) : '');
|
137 |
+
$filename = htmlspecialchars_decode(BWG()->upload_dir . $image_data->image_url, ENT_COMPAT | ENT_QUOTES);
|
138 |
+
$thumb_filename = htmlspecialchars_decode(BWG()->upload_dir . $image_data->thumb_url, ENT_COMPAT | ENT_QUOTES);
|
139 |
$form_action = add_query_arg(array(
|
140 |
'action' => 'editimage_' . BWG()->prefix,
|
141 |
'type' => 'crop',
|
149 |
}
|
150 |
else {
|
151 |
$image_data->image_url = stripslashes($image_data->image_url);
|
152 |
+
$filename = htmlspecialchars_decode(BWG()->upload_dir . $image_data->image_url, ENT_COMPAT | ENT_QUOTES);
|
153 |
+
$thumb_filename = htmlspecialchars_decode(BWG()->upload_dir . $image_data->thumb_url, ENT_COMPAT | ENT_QUOTES);
|
154 |
$form_action = add_query_arg(array(
|
155 |
'action' => 'editimage_' . BWG()->prefix,
|
156 |
'type' => 'crop',
|
160 |
'TB_iframe' => '1',
|
161 |
), admin_url('admin-ajax.php'));
|
162 |
}
|
163 |
+
$image_data->image_url = WDWLibrary::image_url_version($image_data->image_url, $modified_date);
|
164 |
@ini_set('memory_limit', '-1');
|
165 |
list($width_orig, $height_orig, $type_orig) = getimagesize($filename);
|
166 |
if ( $edit_type == 'crop' ) {
|
167 |
+
if( ! $aspect_ratio ) {
|
168 |
+
$scale = min( $w / $width_orig, $h / $height_orig );
|
169 |
+
$thumb_width = $w * $scale;
|
170 |
+
$thumb_height = $h * $scale;
|
171 |
+
}
|
172 |
if ( $type_orig == 2 ) {
|
173 |
$img_r = imagecreatefromjpeg($filename);
|
174 |
$dst_r = ImageCreateTrueColor($thumb_width, $thumb_height);
|
209 |
</div>
|
210 |
<?php
|
211 |
}
|
212 |
+
$where = ' `id` = ' . $image_id;
|
213 |
+
$updated_image = WDWLibrary::update_image_modified_date( $where );
|
214 |
+
$image_data->image_url = WDWLibrary::image_url_version($image_data->image_url, $updated_image['modified_date']);
|
215 |
}
|
216 |
@ini_restore('memory_limit');
|
217 |
wp_print_scripts('jquery');
|
297 |
<strong><?php echo __('Select the area for the thumbnail.', BWG()->prefix); ?></strong></div><?php
|
298 |
}
|
299 |
?>
|
|
|
|
|
|
|
|
|
300 |
<form method="post" id="crop_image" action="<?php echo $form_action; ?>">
|
301 |
<?php wp_nonce_field('editimage_' . BWG()->prefix, 'bwg_nonce'); ?>
|
302 |
+
<div class="thumb_preview_td" style="padding: 5px;">
|
303 |
+
<input type="checkbox" id="chb" name="aspect_ratio" value="1" checked="checked" onclick="spider_crop_ratio()">
|
304 |
+
<label for="chb"><?php _e('Keep aspect ratio', BWG()->prefix); ?></label>
|
305 |
+
</div>
|
306 |
<div style="height:<?php echo $popup_height - 60; ?>px; width:<?php echo $popup_width; ?>px; margin: 5px auto;">
|
307 |
<div id="crop_button">
|
308 |
<img title="Crop" class="spider_crop" onclick="spider_crop('crop', 'crop_image')" src="<?php echo BWG()->plugin_url . '/images/crop.png'; ?>" />
|
310 |
<table style="height: inherit; top: 80px; position: absolute; width: inherit; margin: 0 auto;">
|
311 |
<tr>
|
312 |
<td class="thumb_preview_td" style="vertical-align: middle; width: <?php echo ($popup_width - $thumb_width) - 40; ?>px;">
|
313 |
+
<img id="image_view" src="<?php echo BWG()->upload_url . $image_data->image_url; ?>" style="max-width:<?php echo $image_width; ?>px; max-height:<?php echo $image_height; ?>px;" />
|
314 |
</td>
|
315 |
<td class="thumb_preview_td" style="width:<?php echo $thumb_width + 20; ?>px;">
|
316 |
<div class="thumb_preview">
|
317 |
+
<img id="thumb_image_preview" src="<?php echo BWG()->upload_url . $image_data->image_url; ?>">
|
318 |
</div>
|
319 |
</td>
|
320 |
</tr>
|
344 |
document.getElementById("edit_type").value = type;
|
345 |
document.getElementById(form_id).submit();
|
346 |
}
|
|
|
347 |
var image_src = window.parent.document.getElementById("image_thumb_<?php echo $image_id; ?>").src;
|
348 |
+
window.parent.document.getElementById("image_thumb_<?php echo $image_id; ?>").src = image_src + "<?php echo isset($updated_image['modified_date']) && $updated_image['modified_date'] ? '?bwg=' . $updated_image['modified_date'] : ''; ?>";
|
349 |
+
|
350 |
+
jQuery(window).load(function () {
|
351 |
spider_crop_fix("<?php echo $thumb_width * 300 / $thumb_height; ?>", "<?php echo 300; ?>");
|
352 |
});
|
353 |
|
393 |
jQuery('#crop_button').hide();
|
394 |
jQuery('#croped_message').show();
|
395 |
var thumb_width = parseInt('<?php echo $thumb_width * 300 / $thumb_height; ?>');
|
396 |
+
var thumb_height = 300;
|
397 |
+
var width = (thumb_width / c.w);
|
398 |
+
var height = (thumb_height / c.h);
|
399 |
+
var left = -c.x * (thumb_width / c.w);
|
400 |
+
var top = -c.y * (thumb_height / c.h);
|
401 |
+
//TODO broken style on preview.
|
402 |
+
if ( !jQuery('#chb').is(':checked') ) {
|
403 |
+
}
|
404 |
+
jQuery('#thumb_image_preview').css("margin-left", left + "px");
|
405 |
+
jQuery('#thumb_image_preview').css("margin-top", top + "px");
|
406 |
+
jQuery('#thumb_image_preview').css("width", width * jQuery('#image_view').width() + "px");
|
407 |
+
jQuery('#thumb_image_preview').css("height", height * jQuery('#image_view').height() + "px");
|
408 |
}
|
409 |
</script>
|
410 |
<?php
|
419 |
$image_data->image_url = (isset($_GET['image_url']) ? esc_html(stripcslashes($_GET['image_url'])) : '');
|
420 |
$image_data->thumb_url = (isset($_GET['thumb_url']) ? esc_html(stripcslashes($_GET['thumb_url'])) : '');
|
421 |
}
|
422 |
+
$filename = htmlspecialchars_decode(BWG()->upload_dir . $image_data->image_url, ENT_COMPAT | ENT_QUOTES);
|
423 |
+
$thumb_filename = htmlspecialchars_decode(BWG()->upload_dir . $image_data->thumb_url, ENT_COMPAT | ENT_QUOTES);
|
424 |
+
$original_filename = str_replace('/thumb/', '/.original/', $thumb_filename);
|
425 |
+
WDWLibrary::resize_image($original_filename, $filename, BWG()->options->upload_img_width, BWG()->options->upload_img_height);
|
426 |
+
WDWLibrary::resize_image($original_filename, $thumb_filename, BWG()->options->upload_thumb_width, BWG()->options->upload_thumb_height);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
427 |
}
|
428 |
|
429 |
public function rotate($image_data = array()) {
|
435 |
$edit_type = (isset($_POST['edit_type']) ? esc_html($_POST['edit_type']) : '');
|
436 |
$brightness_val = (isset($_POST['brightness_val']) ? esc_html($_POST['brightness_val']) : 0);
|
437 |
$contrast_val = (isset($_POST['contrast_val']) ? esc_html($_POST['contrast_val']) : 0);
|
438 |
+
$image_data = new stdClass();
|
439 |
+
$modified_date = time();
|
440 |
if ( isset($_GET['image_url']) ) {
|
|
|
441 |
$image_data->image_url = (isset($_GET['image_url']) ? esc_html(stripcslashes($_GET['image_url'])) : '');
|
442 |
$image_data->thumb_url = (isset($_GET['thumb_url']) ? esc_html(stripcslashes($_GET['thumb_url'])) : '');
|
443 |
+
$filename = htmlspecialchars_decode(BWG()->upload_dir . $image_data->image_url, ENT_COMPAT | ENT_QUOTES);
|
444 |
+
$thumb_filename = htmlspecialchars_decode(BWG()->upload_dir . $image_data->thumb_url, ENT_COMPAT | ENT_QUOTES);
|
445 |
$form_action = add_query_arg(array(
|
446 |
'action' => 'editimage_' . BWG()->prefix,
|
447 |
'type' => 'rotate',
|
455 |
}
|
456 |
else {
|
457 |
$image_data->image_url = stripcslashes($image_data->image_url);
|
458 |
+
$filename = htmlspecialchars_decode(BWG()->upload_dir . $image_data->image_url, ENT_COMPAT | ENT_QUOTES);
|
459 |
+
$thumb_filename = htmlspecialchars_decode(BWG()->upload_dir . $image_data->thumb_url, ENT_COMPAT | ENT_QUOTES);
|
460 |
$form_action = add_query_arg(array(
|
461 |
'action' => 'editimage_' . BWG()->prefix,
|
462 |
'type' => 'rotate',
|
466 |
'TB_iframe' => '1',
|
467 |
), admin_url('admin-ajax.php'));
|
468 |
}
|
469 |
+
$image_data->image_url = WDWLibrary::image_url_version($image_data->image_url, $modified_date);
|
470 |
@ini_set('memory_limit', '-1');
|
471 |
list($width_rotate, $height_rotate, $type_rotate) = getimagesize($filename);
|
472 |
if ( $edit_type == '270' || $edit_type == '90' ) {
|
555 |
if ( imagecopyresampled($imgdest, $imgsrc, 0, 0, $src_x, $src_y, $width, $height, $src_width, $src_height) ) {
|
556 |
return $imgdest;
|
557 |
}
|
|
|
558 |
return $imgsrc;
|
559 |
}
|
560 |
|
755 |
$this->recover_image($id, $thumb_width, $thumb_height);
|
756 |
}
|
757 |
@ini_restore('memory_limit');
|
758 |
+
if ( !empty($edit_type) ) {
|
759 |
+
$where = ' `id` = ' . $image_id;
|
760 |
+
$updated_image = WDWLibrary::update_image_modified_date( $where );
|
761 |
+
$image_data->image_url = WDWLibrary::image_url_version($image_data->image_url, $updated_image['modified_date']);
|
762 |
+
$image_data->thumb_url = WDWLibrary::image_url_version($image_data->thumb_url, $updated_image['modified_date']);
|
763 |
+
}
|
764 |
wp_print_scripts('jquery');
|
765 |
wp_print_scripts('jquery-ui-widget');
|
766 |
wp_print_scripts('jquery-ui-slider');
|
811 |
<div class="img_cont" style="height:<?php echo $popup_height - 40; ?>px;">
|
812 |
<div class="img_main_cont">
|
813 |
<div class="last_cont">
|
814 |
+
<img class="bwg_preview_image" src="<?php echo BWG()->upload_url . $image_data->image_url; ?>" style="max-width: <?php echo $image_width; ?>px; max-height: <?php echo $image_height; ?>px;" />
|
815 |
</div>
|
816 |
</div>
|
817 |
<div class="cont_bright_cont">
|
820 |
<div class="bwg_opt_cont">
|
821 |
<img title="Options" src="<?php echo BWG()->plugin_url . '/images/effects/option.png'; ?>" />
|
822 |
</div>
|
823 |
+
<div id="brightness_contrast">
|
|
|
824 |
<div class="brightness_part">
|
825 |
<div class="brightness_part_1">
|
826 |
<div class="brightness_butt">
|
838 |
</div>
|
839 |
</div>
|
840 |
</div>
|
841 |
+
</div>
|
|
|
842 |
<div class="contrast_part">
|
843 |
<div class="contrast_part_1">
|
844 |
<div class="contrast_part_slider">
|
856 |
</div>
|
857 |
</div>
|
858 |
</div>
|
859 |
+
</div>
|
860 |
+
</div>
|
861 |
</div>
|
862 |
</div>
|
863 |
</div>
|
910 |
document.getElementById("edit_type").value = type;
|
911 |
document.getElementById(form_id).submit();
|
912 |
}
|
|
|
913 |
if (window.parent.document.getElementById("image_thumb_pr_<?php echo $image_id; ?>") != null) {
|
914 |
var image_src = window.parent.document.getElementById("image_thumb_pr_<?php echo $image_id; ?>").src;
|
915 |
+
window.parent.document.getElementById("image_thumb_pr_<?php echo $image_id; ?>").src = image_src + "<?php echo isset($updated_image['modified_date']) && $updated_image['modified_date'] ? '?bwg=' . $updated_image['modified_date'] : ''; ?>";
|
916 |
}
|
917 |
else {
|
918 |
var image_src = window.parent.document.getElementById("image_thumb_<?php echo $image_id; ?>").src;
|
919 |
+
window.parent.document.getElementById("image_thumb_<?php echo $image_id; ?>").src = image_src + "<?php echo isset($updated_image['modified_date']) && $updated_image['modified_date'] ? '?bwg=' . $updated_image['modified_date'] : ''; ?>";
|
920 |
}
|
921 |
+
|
922 |
jQuery(document).ready(function () {
|
923 |
jQuery(".bwg_opt_cont").click(function () {
|
924 |
if (jQuery('#brightness_contrast').height() == 0) {
|
admin/views/Galleries.php
CHANGED
@@ -9,7 +9,7 @@ class GalleriesView_bwg extends AdminView_bwg {
|
|
9 |
*
|
10 |
* @param $params
|
11 |
*/
|
12 |
-
public function display( $params ) {
|
13 |
ob_start();
|
14 |
echo $this->body($params);
|
15 |
$form_attr = array(
|
@@ -26,7 +26,7 @@ class GalleriesView_bwg extends AdminView_bwg {
|
|
26 |
*
|
27 |
* @param $params
|
28 |
*/
|
29 |
-
public function body( $params ) {
|
30 |
echo $this->title(array(
|
31 |
'title' => $params['page_title'],
|
32 |
'title_class' => 'wd-header',
|
@@ -74,10 +74,10 @@ class GalleriesView_bwg extends AdminView_bwg {
|
|
74 |
$preview_url = WDWLibrary::get_custom_post_permalink( array('slug' => $row->slug, 'post_type' => 'gallery' ));
|
75 |
$preview_image = BWG()->plugin_url . '/images/no-image.png';
|
76 |
if ( !empty($row->preview_image) ) {
|
77 |
-
$preview_image =
|
78 |
}
|
79 |
if ( !empty($row->random_preview_image)) {
|
80 |
-
$preview_image =
|
81 |
if ( WDWLibrary::check_external_link($row->random_preview_image) ) {
|
82 |
$preview_image = $row->random_preview_image;
|
83 |
}
|
@@ -134,7 +134,7 @@ class GalleriesView_bwg extends AdminView_bwg {
|
|
134 |
*
|
135 |
* @return string html
|
136 |
*/
|
137 |
-
public function edit( $params ) {
|
138 |
wp_enqueue_style('thickbox');
|
139 |
wp_enqueue_script('thickbox');
|
140 |
wp_enqueue_media();
|
@@ -162,10 +162,10 @@ class GalleriesView_bwg extends AdminView_bwg {
|
|
162 |
*
|
163 |
* @param $params
|
164 |
*/
|
165 |
-
public function edit_body( $params ) {
|
166 |
$row = $params['row'];
|
167 |
$current_id = $params['id'];
|
168 |
-
$enable_wp_editor = isset(BWG()->options->enable_wp_editor) ? BWG()->options->enable_wp_editor :
|
169 |
?>
|
170 |
<div class="gal-msg wd-hide">
|
171 |
<?php
|
@@ -187,11 +187,7 @@ class GalleriesView_bwg extends AdminView_bwg {
|
|
187 |
<div class="bwg-page-actions">
|
188 |
<?php
|
189 |
if ( $params['shortcode_id'] ) {
|
190 |
-
|
191 |
-
<button class="button button-secondary button-large" onclick="how_to_use(); return false;">
|
192 |
-
<?php _e('How to use', BWG()->prefix); ?>
|
193 |
-
</button>
|
194 |
-
<?php
|
195 |
}
|
196 |
?>
|
197 |
<button class="button button-primary button-large" onclick="if (spider_check_required('name', 'Title') || bwg_check_instagram_gallery_input('<?php echo BWG()->options->instagram_access_token ?>') ) {return false;};
|
@@ -236,7 +232,7 @@ class GalleriesView_bwg extends AdminView_bwg {
|
|
236 |
<input type="hidden" id="preview_image" name="preview_image" value="<?php echo $row->preview_image; ?>" style="display: inline-block;" />
|
237 |
<img id="img_preview_image"
|
238 |
style="<?php echo empty($row->preview_image) ? 'display:none;' : '' ?>"
|
239 |
-
src="<?php echo $row->preview_image ? (
|
240 |
<span id="delete_preview_image" class="spider_delete_img dashicons dashicons-no-alt" onclick="spider_remove_url('button_preview_image', 'preview_image', 'delete_preview_image', 'img_preview_image')" style="<?php echo empty($row->preview_image) ? 'display:none;' : '' ?>"></span>
|
241 |
<p class="description"><?php _e('Add a preview image, which will be displayed as the cover image of the gallery when it is published in a gallery group.', BWG()->prefix); ?></p>
|
242 |
</div>
|
@@ -365,47 +361,13 @@ class GalleriesView_bwg extends AdminView_bwg {
|
|
365 |
</div>
|
366 |
</div>
|
367 |
</div>
|
368 |
-
<div class="wd-table-row wd-table-col-100 wd-table-col-left wd-howtouse-cont">
|
369 |
-
<?php if ( $params['shortcode_id'] ) { ?>
|
370 |
-
<div class="wd-box-section">
|
371 |
-
<div class="postbox closed how_to_postbox">
|
372 |
-
<button class="button-link handlediv" type="button" aria-expanded="true">
|
373 |
-
<span class="screen-reader-text"><?php _e('Toggle panel:', BWG()->prefix); ?></span>
|
374 |
-
<span class="toggle-indicator" aria-hidden="false"></span>
|
375 |
-
</button>
|
376 |
-
<h2 class="hndle">
|
377 |
-
<span><?php _e('How to use', BWG()->prefix); ?></span>
|
378 |
-
</h2>
|
379 |
-
<div class="inside">
|
380 |
-
<div class="howto_container">
|
381 |
-
<div class="howto_content">
|
382 |
-
<h2><?php _e('Page or Post editor', BWG()->prefix); ?></h2>
|
383 |
-
<h4><?php _e('Insert it into an existing post with the button.', BWG()->prefix); ?></h4>
|
384 |
-
<img src="<?php echo BWG()->plugin_url . '/images/wp-publish.png'; ?>" alt="<?php _e('Post editor', BWG()->prefix); ?>" />
|
385 |
-
</div>
|
386 |
-
<div class="howto_content">
|
387 |
-
<h2><?php _e('PHP code', BWG()->prefix); ?></h2>
|
388 |
-
<h4><?php _e('Copy and paste the PHP code into your template file.', BWG()->prefix); ?></h4>
|
389 |
-
<input type="text" class="bwg_howto_phpcode" value="<?php photo_gallery(<?php echo $params['shortcode_id']; ?>); ?>" onclick="spider_select_value(this)" size="17" readonly="readonly" />
|
390 |
-
</div>
|
391 |
-
<div class="howto_content">
|
392 |
-
<h2><?php _e('Widget', BWG()->prefix); ?></h2>
|
393 |
-
<h4><?php _e('Insert as Widget.', BWG()->prefix); ?></h4>
|
394 |
-
<img src="<?php echo BWG()->plugin_url . '/images/wp-widget.png'; ?>" alt="<?php _e('Widget', BWG()->prefix); ?>" />
|
395 |
-
</div>
|
396 |
-
</div>
|
397 |
-
</div>
|
398 |
-
</div>
|
399 |
-
</div>
|
400 |
-
<?php } ?>
|
401 |
-
</div>
|
402 |
</div>
|
403 |
<?php echo $this->image_display($params); ?>
|
404 |
<div id="loading_div" class="bwg_show"></div>
|
405 |
<?php
|
406 |
}
|
407 |
|
408 |
-
public function image_display( $params ) {
|
409 |
$ids_string = '';
|
410 |
?>
|
411 |
<div class="buttons_div_left">
|
@@ -580,7 +542,12 @@ class GalleriesView_bwg extends AdminView_bwg {
|
|
580 |
echo WDWLibrary::message_id(0, __('You have unsaved changes.', BWG()->prefix), 'notice notice-warning');
|
581 |
?>
|
582 |
</div>
|
583 |
-
|
|
|
|
|
|
|
|
|
|
|
584 |
<div class="tablenav top">
|
585 |
<?php
|
586 |
echo $this->bulk_actions($params['actions'], TRUE, 'image_bulk_action');
|
@@ -590,7 +557,19 @@ class GalleriesView_bwg extends AdminView_bwg {
|
|
590 |
<table id="images_table" class="images_table adminlist table table-striped wp-list-table widefat fixed pages media">
|
591 |
<thead>
|
592 |
<td class="col_drag" data-page-number="<?php echo $params['page_num']; ?>">
|
593 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
594 |
</td>
|
595 |
<td id="cb" class="column-cb check-column">
|
596 |
<label class="screen-reader-text" for="cb-select-all-1"><?php _e('Filename', BWG()->prefix); ?></label>
|
@@ -620,46 +599,43 @@ class GalleriesView_bwg extends AdminView_bwg {
|
|
620 |
$is_embed_instagram_post = preg_match('/INSTAGRAM_POST/', $row->filetype) == 1 ? TRUE : FALSE;
|
621 |
$instagram_post_width = 'temp_instagram_post_width';
|
622 |
$instagram_post_height = 'temp_instagram_post_height';
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
}
|
649 |
-
$image_link = add_query_arg(array(
|
650 |
'instagram_post_width' => $instagram_post_width,
|
651 |
'instagram_post_height' => $instagram_post_height,
|
652 |
), $image_link);
|
653 |
-
|
654 |
$image_link = add_query_arg(array('TB_iframe' => '1'), $image_link);
|
655 |
$edit_link = add_query_arg(array('type' => 'rotate', 'TB_iframe' => '1'), $link);
|
656 |
$crop_link = add_query_arg(array('type' => 'crop', 'TB_iframe' => '1'), $link);
|
657 |
-
$image_url = (!$is_embed ?
|
658 |
$add_tag_url = add_query_arg(array('image_id' => $row->id, 'TB_iframe' => '1'), $params['add_tags_action']);
|
659 |
?>
|
660 |
<tr id="tr_<?php echo $row->id; ?>" class="<?php echo $alternate; ?><?php echo $temp ? ' wd-template wd-hide' : ''; ?>">
|
661 |
-
<th class="
|
662 |
-
<div title="<?php _e('Drag to re-order', BWG()->prefix); ?>" class="wd-drag handle dashicons dashicons-move"></div>
|
663 |
<input class="wd-hide wd-order" id="order_input_<?php echo $row->id; ?>" name="order_input_<?php echo $row->id; ?>" type="text" size="1" value="<?php echo $row->order; ?>" />
|
664 |
</th>
|
665 |
<th class="check-column">
|
@@ -686,8 +662,8 @@ class GalleriesView_bwg extends AdminView_bwg {
|
|
686 |
<?php } ?>
|
687 |
</strong>
|
688 |
<div class="row-actions">
|
689 |
-
<span class="wd-image-actions <?php echo ( !$is_embed && ( $params['gallery_type'] == '' ) ? '' : ' wd-hide' ); ?>"><a class="<?php echo (BWG()->is_demo ? '' : 'thickbox thickbox-preview'); ?>" href="<?php echo (BWG()->is_demo ? 'javascript:alert(\'' . addslashes(__('This option is disabled in demo.', BWG()->prefix)) . '\');' : $edit_link); ?>"><?php _e('Edit', BWG()->prefix); ?></a> |</span>
|
690 |
-
<span class="wd-image-actions <?php echo ( !$is_embed && ( $params['gallery_type'] == '' ) ? '' : ' wd-hide' ); ?>"><a class="<?php echo (BWG()->is_demo ? '' : 'thickbox thickbox-preview'); ?>" href="<?php echo (BWG()->is_demo ? 'javascript:alert(\'' . addslashes(__('This option is disabled in demo.', BWG()->prefix)) . '\');' : $crop_link); ?>"><?php _e('Crop', BWG()->prefix); ?></a> |</span>
|
691 |
<span class="wd-image-actions <?php echo ( !$is_embed && ( $params['gallery_type'] == '' ) ? '' : ' wd-hide' ); ?>"><a onclick="<?php echo (BWG()->is_demo ? 'alert(\'' . addslashes(__('This option is disabled in demo.', BWG()->prefix)) . '\');' : 'if (confirm(\'' . addslashes(__('Do you want to reset the image?', BWG()->prefix)) . '\')) { spider_set_input_value(\'ajax_task\', \'image_reset\'); spider_set_input_value(\'image_current_id\', \'' . $row->id . '\'); spider_ajax_save(\'bwg_gallery\'); } return false;'); ?>"><?php _e('Reset', BWG()->prefix); ?></a> |</span>
|
692 |
<span><a onclick="spider_set_input_value('ajax_task', 'image_<?php echo $row->published ? 'unpublish' : 'publish'; ?>');
|
693 |
spider_set_input_value('image_current_id', '<?php echo $row->id; ?>');
|
@@ -750,8 +726,8 @@ class GalleriesView_bwg extends AdminView_bwg {
|
|
750 |
</div>
|
751 |
|
752 |
<input type="hidden" value="<?php echo $tags_id_string; ?>" id="tags_<?php echo $row->id; ?>" name="tags_<?php echo $row->id; ?>" />
|
753 |
-
<input type="hidden" id="image_url_<?php echo $row->id; ?>" name="image_url_<?php echo $row->id; ?>" value="<?php echo $row->
|
754 |
-
<input type="hidden" id="thumb_url_<?php echo $row->id; ?>" name="thumb_url_<?php echo $row->id; ?>" value="<?php echo $row->
|
755 |
<input type="hidden" id="input_filename_<?php echo $row->id; ?>" name="input_filename_<?php echo $row->id; ?>" value="<?php echo $row->filename; ?>" />
|
756 |
<input type="hidden" id="input_date_modified_<?php echo $row->id; ?>" name="input_date_modified_<?php echo $row->id; ?>" value="<?php echo $row->date; ?>" />
|
757 |
<input type="hidden" id="input_resolution_<?php echo $row->id; ?>" name="input_resolution_<?php echo $row->id; ?>" value="<?php echo $row->resolution; ?>" />
|
9 |
*
|
10 |
* @param $params
|
11 |
*/
|
12 |
+
public function display( $params = array() ) {
|
13 |
ob_start();
|
14 |
echo $this->body($params);
|
15 |
$form_attr = array(
|
26 |
*
|
27 |
* @param $params
|
28 |
*/
|
29 |
+
public function body( $params = array() ) {
|
30 |
echo $this->title(array(
|
31 |
'title' => $params['page_title'],
|
32 |
'title_class' => 'wd-header',
|
74 |
$preview_url = WDWLibrary::get_custom_post_permalink( array('slug' => $row->slug, 'post_type' => 'gallery' ));
|
75 |
$preview_image = BWG()->plugin_url . '/images/no-image.png';
|
76 |
if ( !empty($row->preview_image) ) {
|
77 |
+
$preview_image = BWG()->upload_url . $row->preview_image;
|
78 |
}
|
79 |
if ( !empty($row->random_preview_image)) {
|
80 |
+
$preview_image = BWG()->upload_url . $row->random_preview_image;
|
81 |
if ( WDWLibrary::check_external_link($row->random_preview_image) ) {
|
82 |
$preview_image = $row->random_preview_image;
|
83 |
}
|
134 |
*
|
135 |
* @return string html
|
136 |
*/
|
137 |
+
public function edit( $params = array() ) {
|
138 |
wp_enqueue_style('thickbox');
|
139 |
wp_enqueue_script('thickbox');
|
140 |
wp_enqueue_media();
|
162 |
*
|
163 |
* @param $params
|
164 |
*/
|
165 |
+
public function edit_body( $params = array() ) {
|
166 |
$row = $params['row'];
|
167 |
$current_id = $params['id'];
|
168 |
+
$enable_wp_editor = isset(BWG()->options->enable_wp_editor) ? BWG()->options->enable_wp_editor : 0;
|
169 |
?>
|
170 |
<div class="gal-msg wd-hide">
|
171 |
<?php
|
187 |
<div class="bwg-page-actions">
|
188 |
<?php
|
189 |
if ( $params['shortcode_id'] ) {
|
190 |
+
require BWG()->plugin_dir . '/framework/howto/howto.php';
|
|
|
|
|
|
|
|
|
191 |
}
|
192 |
?>
|
193 |
<button class="button button-primary button-large" onclick="if (spider_check_required('name', 'Title') || bwg_check_instagram_gallery_input('<?php echo BWG()->options->instagram_access_token ?>') ) {return false;};
|
232 |
<input type="hidden" id="preview_image" name="preview_image" value="<?php echo $row->preview_image; ?>" style="display: inline-block;" />
|
233 |
<img id="img_preview_image"
|
234 |
style="<?php echo empty($row->preview_image) ? 'display:none;' : '' ?>"
|
235 |
+
src="<?php echo $row->preview_image ? (BWG()->upload_url . $row->preview_image) : ''; ?>" />
|
236 |
<span id="delete_preview_image" class="spider_delete_img dashicons dashicons-no-alt" onclick="spider_remove_url('button_preview_image', 'preview_image', 'delete_preview_image', 'img_preview_image')" style="<?php echo empty($row->preview_image) ? 'display:none;' : '' ?>"></span>
|
237 |
<p class="description"><?php _e('Add a preview image, which will be displayed as the cover image of the gallery when it is published in a gallery group.', BWG()->prefix); ?></p>
|
238 |
</div>
|
361 |
</div>
|
362 |
</div>
|
363 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
364 |
</div>
|
365 |
<?php echo $this->image_display($params); ?>
|
366 |
<div id="loading_div" class="bwg_show"></div>
|
367 |
<?php
|
368 |
}
|
369 |
|
370 |
+
public function image_display( $params = array() ) {
|
371 |
$ids_string = '';
|
372 |
?>
|
373 |
<div class="buttons_div_left">
|
542 |
echo WDWLibrary::message_id(0, __('You have unsaved changes.', BWG()->prefix), 'notice notice-warning');
|
543 |
?>
|
544 |
</div>
|
545 |
+
<div class="sorting-msg wd-hide">
|
546 |
+
<?php
|
547 |
+
echo WDWLibrary::message_id(0, __('This sorting does not affect the published galleries. You can change the ordering on frontend by editing gallery shortcode or Photo Gallery Options.', BWG()->prefix), 'notice notice-warning');
|
548 |
+
?>
|
549 |
+
</div>
|
550 |
+
<?php echo $this->search(array('sorting' => true)); ?>
|
551 |
<div class="tablenav top">
|
552 |
<?php
|
553 |
echo $this->bulk_actions($params['actions'], TRUE, 'image_bulk_action');
|
557 |
<table id="images_table" class="images_table adminlist table table-striped wp-list-table widefat fixed pages media">
|
558 |
<thead>
|
559 |
<td class="col_drag" data-page-number="<?php echo $params['page_num']; ?>">
|
560 |
+
<?php if ($params['orderby'] == 'order') { ?>
|
561 |
+
<select title="<?php _e('Show order column', BWG()->prefix); ?>" onchange="wd_showhide_weights(true);return false;">
|
562 |
+
<option><?php _e('Drag&Drop', BWG()->prefix); ?></option>
|
563 |
+
<option><?php _e('Numerate', BWG()->prefix); ?></option>
|
564 |
+
</select>
|
565 |
+
<?php
|
566 |
+
}
|
567 |
+
else {
|
568 |
+
?>
|
569 |
+
<?php _e('Ordering', BWG()->prefix); ?>
|
570 |
+
<?php
|
571 |
+
}
|
572 |
+
?>
|
573 |
</td>
|
574 |
<td id="cb" class="column-cb check-column">
|
575 |
<label class="screen-reader-text" for="cb-select-all-1"><?php _e('Filename', BWG()->prefix); ?></label>
|
599 |
$is_embed_instagram_post = preg_match('/INSTAGRAM_POST/', $row->filetype) == 1 ? TRUE : FALSE;
|
600 |
$instagram_post_width = 'temp_instagram_post_width';
|
601 |
$instagram_post_height = 'temp_instagram_post_height';
|
602 |
+
$link = add_query_arg(array(
|
603 |
+
'action' => 'editimage_' . BWG()->prefix,
|
604 |
+
'type' => 'display',
|
605 |
+
'modified_date' => $row->modified_date,
|
606 |
+
'image_url' => urlencode($row->pure_image_url),
|
607 |
+
'thumb_url' => urlencode($row->pure_thumb_url),
|
608 |
+
'image_id' => $row->id,
|
609 |
+
'width' => '800',
|
610 |
+
'height' => '500',
|
611 |
+
BWG()->nonce => wp_create_nonce('editimage_' . BWG()->prefix),
|
612 |
+
), admin_url('admin-ajax.php'));
|
613 |
+
$image_link = add_query_arg(array(
|
614 |
+
'type' => 'display',
|
615 |
+
'FACEBOOK_POST' => ($temp ? 'tempis_facebook_post' : $is_facebook_post),
|
616 |
+
'fb_post_url' => ($temp ? 'tempfb_post_url' : $fb_post_url),
|
617 |
+
), $link);
|
618 |
+
if ( $is_embed_instagram_post ) {
|
619 |
+
$image_resolution = explode(' x ', $row->resolution);
|
620 |
+
if ( is_array($image_resolution) ) {
|
621 |
+
$instagram_post_width = $image_resolution[0];
|
622 |
+
$instagram_post_height = explode(' ', $image_resolution[1]);
|
623 |
+
$instagram_post_height = $instagram_post_height[0];
|
624 |
+
}
|
625 |
+
}
|
626 |
+
$image_link = add_query_arg(array(
|
|
|
|
|
627 |
'instagram_post_width' => $instagram_post_width,
|
628 |
'instagram_post_height' => $instagram_post_height,
|
629 |
), $image_link);
|
|
|
630 |
$image_link = add_query_arg(array('TB_iframe' => '1'), $image_link);
|
631 |
$edit_link = add_query_arg(array('type' => 'rotate', 'TB_iframe' => '1'), $link);
|
632 |
$crop_link = add_query_arg(array('type' => 'crop', 'TB_iframe' => '1'), $link);
|
633 |
+
$image_url = (!$is_embed ? BWG()->upload_url : "") . $row->thumb_url;
|
634 |
$add_tag_url = add_query_arg(array('image_id' => $row->id, 'TB_iframe' => '1'), $params['add_tags_action']);
|
635 |
?>
|
636 |
<tr id="tr_<?php echo $row->id; ?>" class="<?php echo $alternate; ?><?php echo $temp ? ' wd-template wd-hide' : ''; ?>">
|
637 |
+
<th class="<?php if ($params['orderby'] == 'order') echo 'connectedSortable'; ?> col_drag handles ui-sortable-handle">
|
638 |
+
<div title="<?php _e('Drag to re-order', BWG()->prefix); ?>" class="wd-drag handle dashicons dashicons-move <?php if ($params['orderby'] != 'order') echo 'wd-hide'; ?>"></div>
|
639 |
<input class="wd-hide wd-order" id="order_input_<?php echo $row->id; ?>" name="order_input_<?php echo $row->id; ?>" type="text" size="1" value="<?php echo $row->order; ?>" />
|
640 |
</th>
|
641 |
<th class="check-column">
|
662 |
<?php } ?>
|
663 |
</strong>
|
664 |
<div class="row-actions">
|
665 |
+
<span class="wd-image-actions <?php echo ( !$is_embed && ( $params['gallery_type'] == '' ) ? '' : ' wd-hide' ); ?>"><a class="<?php echo (BWG()->is_demo || !BWG()->wp_editor_exists ? '' : 'thickbox thickbox-preview'); ?>" href="<?php echo (BWG()->is_demo ? 'javascript:alert(\'' . addslashes(__('This option is disabled in demo.', BWG()->prefix)) . '\');' : (BWG()->wp_editor_exists ? $edit_link : 'javascript:alert(\'' . addslashes(__('Image edit functionality is not supported by your web host.', BWG()->prefix)) . '\');')); ?>"><?php _e('Edit', BWG()->prefix); ?></a> |</span>
|
666 |
+
<span class="wd-image-actions <?php echo ( !$is_embed && ( $params['gallery_type'] == '' ) ? '' : ' wd-hide' ); ?>"><a class="<?php echo (BWG()->is_demo || !BWG()->wp_editor_exists ? '' : 'thickbox thickbox-preview'); ?>" href="<?php echo (BWG()->is_demo ? 'javascript:alert(\'' . addslashes(__('This option is disabled in demo.', BWG()->prefix)) . '\');' : (BWG()->wp_editor_exists ? $crop_link : 'javascript:alert(\'' . addslashes(__('Image edit functionality is not supported by your web host.', BWG()->prefix)) . '\');')); ?>"><?php _e('Crop', BWG()->prefix); ?></a> |</span>
|
667 |
<span class="wd-image-actions <?php echo ( !$is_embed && ( $params['gallery_type'] == '' ) ? '' : ' wd-hide' ); ?>"><a onclick="<?php echo (BWG()->is_demo ? 'alert(\'' . addslashes(__('This option is disabled in demo.', BWG()->prefix)) . '\');' : 'if (confirm(\'' . addslashes(__('Do you want to reset the image?', BWG()->prefix)) . '\')) { spider_set_input_value(\'ajax_task\', \'image_reset\'); spider_set_input_value(\'image_current_id\', \'' . $row->id . '\'); spider_ajax_save(\'bwg_gallery\'); } return false;'); ?>"><?php _e('Reset', BWG()->prefix); ?></a> |</span>
|
668 |
<span><a onclick="spider_set_input_value('ajax_task', 'image_<?php echo $row->published ? 'unpublish' : 'publish'; ?>');
|
669 |
spider_set_input_value('image_current_id', '<?php echo $row->id; ?>');
|
726 |
</div>
|
727 |
|
728 |
<input type="hidden" value="<?php echo $tags_id_string; ?>" id="tags_<?php echo $row->id; ?>" name="tags_<?php echo $row->id; ?>" />
|
729 |
+
<input type="hidden" id="image_url_<?php echo $row->id; ?>" name="image_url_<?php echo $row->id; ?>" value="<?php echo $row->pure_image_url; ?>" />
|
730 |
+
<input type="hidden" id="thumb_url_<?php echo $row->id; ?>" name="thumb_url_<?php echo $row->id; ?>" value="<?php echo $row->pure_thumb_url; ?>" />
|
731 |
<input type="hidden" id="input_filename_<?php echo $row->id; ?>" name="input_filename_<?php echo $row->id; ?>" value="<?php echo $row->filename; ?>" />
|
732 |
<input type="hidden" id="input_date_modified_<?php echo $row->id; ?>" name="input_date_modified_<?php echo $row->id; ?>" value="<?php echo $row->date; ?>" />
|
733 |
<input type="hidden" id="input_resolution_<?php echo $row->id; ?>" name="input_resolution_<?php echo $row->id; ?>" value="<?php echo $row->resolution; ?>" />
|
admin/views/Options.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
class OptionsView_bwg extends AdminView_bwg {
|
4 |
|
5 |
-
public function display($params) {
|
6 |
wp_enqueue_script('thickbox');
|
7 |
wp_enqueue_script('jquery-ui-tabs');
|
8 |
wp_enqueue_script(BWG()->prefix . '_admin');
|
@@ -25,10 +25,12 @@ class OptionsView_bwg extends AdminView_bwg {
|
|
25 |
echo $this->form(ob_get_clean(), $form_attr);
|
26 |
}
|
27 |
|
28 |
-
public function body($params) {
|
29 |
$row = $params['row'];
|
30 |
-
|
31 |
$instagram_reset_href = $params['instagram_reset_href'];
|
|
|
|
|
32 |
if (!$row) {
|
33 |
echo WDWLibrary::message_id(2);
|
34 |
return;
|
@@ -71,13 +73,13 @@ class OptionsView_bwg extends AdminView_bwg {
|
|
71 |
<a href="#bwg_tab_general_content" class="bwg-tablink"><?php _e('General', BWG()->prefix); ?></a>
|
72 |
</li>
|
73 |
<li class="tabs">
|
74 |
-
<a href="#bwg_tab_gallery_content" class="bwg-tablink"><?php _e('Gallery', BWG()->prefix); ?></a>
|
75 |
</li>
|
76 |
<li class="tabs">
|
77 |
-
<a href="#bwg_tab_gallery_group_content" class="bwg-tablink"><?php _e('Gallery
|
78 |
</li>
|
79 |
<li class="tabs">
|
80 |
-
<a href="#bwg_tab_lightbox_content" class="bwg-tablink"><?php _e('Lightbox', BWG()->prefix); ?></a>
|
81 |
</li>
|
82 |
<li class="tabs">
|
83 |
<a href="#bwg_tab_advanced_content" class="bwg-tablink"><?php _e('Advanced', BWG()->prefix); ?></a>
|
@@ -90,17 +92,23 @@ class OptionsView_bwg extends AdminView_bwg {
|
|
90 |
<div class="bwg-section bwg-flex-wrap">
|
91 |
<div class="wd-box-content wd-width-100 bwg-flex-wrap">
|
92 |
<div class="wd-box-content wd-width-50">
|
|
|
|
|
|
|
93 |
<div class="wd-box-content wd-width-100">
|
94 |
<div class="wd-group">
|
95 |
<label class="wd-label" for="images_directory"><?php _e('Images directory', BWG()->prefix); ?></label>
|
96 |
<div class="bwg-flex">
|
97 |
<input id="images_directory" name="images_directory" type="text" style="display:inline-block; width:100%;" value="<?php echo $row->images_directory; ?>" />
|
98 |
-
<input type="hidden" id="old_images_directory" name="old_images_directory" value="<?php echo $row->old_images_directory; ?>"/>
|
99 |
</div>
|
100 |
<p class="description"><?php _e('Provide the path of an existing folder inside the WordPress directory of your website to store uploaded images.<br />The content of the previous directory will be moved to the new one.', BWG()->prefix); ?></p>
|
101 |
</div>
|
102 |
</div>
|
103 |
-
|
|
|
|
|
|
|
104 |
<div class="wd-group">
|
105 |
<label class="wd-label" for="upload_img_width"><?php _e('Image dimensions', BWG()->prefix); ?></label>
|
106 |
<div class="bwg-flex">
|
@@ -116,7 +124,8 @@ class OptionsView_bwg extends AdminView_bwg {
|
|
116 |
<div class="bwg-flex">
|
117 |
<input type="number" name="upload_thumb_width" id="upload_thumb_width" value="<?php echo $row->upload_thumb_width; ?>" min="0" /><span>x</span>
|
118 |
<input type="number" name="upload_thumb_height" id="upload_thumb_height" value="<?php echo $row->upload_thumb_height; ?>" min="0" /><span>px</span>
|
119 |
-
<input type="
|
|
|
120 |
</div>
|
121 |
<p class="description"><?php _e('Specify the maximum dimensions of generated thumbnails. They must be larger than frontend thumbnail dimensions.', BWG()->prefix); ?></p>
|
122 |
</div>
|
@@ -867,10 +876,10 @@ class OptionsView_bwg extends AdminView_bwg {
|
|
867 |
</tbody>
|
868 |
</table>
|
869 |
<input type="submit" class="button-primary" title="<?php _e('Set watermark', BWG()->prefix); ?>" style="margin-top: 5px;"
|
870 |
-
onclick="<?php echo (BWG()->is_demo ? 'alert(\'' . addslashes(__('This option is disabled in demo.', BWG()->prefix)) . '\'); return false;' : '
|
871 |
value="<?php _e('Set Watermark', BWG()->prefix); ?>"/>
|
872 |
<input type="submit" class="button" title="<?php _e('Reset watermark', BWG()->prefix); ?>" style="margin-top: 5px;"
|
873 |
-
onclick="<?php echo (BWG()->is_demo ? 'alert(\'' . addslashes(__('This option is disabled in demo.', BWG()->prefix)) . '\'); return false;' : '
|
874 |
value="<?php _e('Reset Watermark', BWG()->prefix); ?>"/>
|
875 |
</div>
|
876 |
<p class="description"><?php _e('Mark the position where the watermark should appear on images.', BWG()->prefix) ?></p>
|
@@ -891,11 +900,12 @@ class OptionsView_bwg extends AdminView_bwg {
|
|
891 |
<input id="gallery_type" name="gallery_type" type="hidden" value="<?php echo $params['gallery_type']; ?>" />
|
892 |
<input id="album_type" name="album_type" type="hidden" value="<?php echo $params['album_type']; ?>" />
|
893 |
<script>
|
|
|
894 |
function bwg_add_built_in_watermark_image(files) {
|
895 |
-
document.getElementById("built_in_watermark_url").value = '<?php echo
|
896 |
}
|
897 |
function bwg_add_watermark_image(files) {
|
898 |
-
document.getElementById("watermark_url").value = '<?php echo
|
899 |
}
|
900 |
jQuery(document).ready(function() {
|
901 |
bwg_inputs();
|
@@ -1096,7 +1106,7 @@ class OptionsView_bwg extends AdminView_bwg {
|
|
1096 |
</div>
|
1097 |
<div class="wd-box-content wd-width-100" id="tr_search_box_width">
|
1098 |
<div class="wd-group">
|
1099 |
-
<label class="wd-label" for="search_box_width"><?php _e('Search box width', BWG()->prefix); ?></label>
|
1100 |
<div class="bwg-flex">
|
1101 |
<input type="number" name="search_box_width" id="search_box_width" value="<?php echo $row->search_box_width; ?>" min="0" /><span>px</span>
|
1102 |
</div>
|
@@ -1306,7 +1316,7 @@ class OptionsView_bwg extends AdminView_bwg {
|
|
1306 |
</div>
|
1307 |
<div class="wd-box-content wd-width-100" id="tr_masonry_search_box_width">
|
1308 |
<div class="wd-group">
|
1309 |
-
<label class="wd-label" for="masonry_search_box_width"><?php _e('Search box width', BWG()->prefix); ?></label>
|
1310 |
<div class="bwg-flex">
|
1311 |
<input type="number" name="masonry_search_box_width" id="masonry_search_box_width" value="<?php echo $row->masonry_search_box_width; ?>" min="0" /><span>px</span>
|
1312 |
</div>
|
@@ -1526,7 +1536,7 @@ class OptionsView_bwg extends AdminView_bwg {
|
|
1526 |
</div>
|
1527 |
<div class="wd-box-content wd-width-100" id="tr_mosaic_search_box_width">
|
1528 |
<div class="wd-group">
|
1529 |
-
<label class="wd-label" for="mosaic_search_box_width"><?php _e('Search box width', BWG()->prefix); ?></label>
|
1530 |
<div class="bwg-flex">
|
1531 |
<input type="number" name="mosaic_search_box_width" id="mosaic_search_box_width" value="<?php echo $row->mosaic_search_box_width; ?>" min="0" /><span>px</span>
|
1532 |
</div>
|
@@ -1954,7 +1964,7 @@ class OptionsView_bwg extends AdminView_bwg {
|
|
1954 |
</div>
|
1955 |
<div class="wd-box-content wd-width-100" id="tr_image_browser_search_box_width">
|
1956 |
<div class="wd-group">
|
1957 |
-
<label class="wd-label" for="image_browser_search_box_width"><?php _e('Search box width', BWG()->prefix); ?></label>
|
1958 |
<div class="bwg-flex">
|
1959 |
<input type="number" name="image_browser_search_box_width" id="image_browser_search_box_width" value="<?php echo $row->image_browser_search_box_width; ?>" min="0" /><span>px</span>
|
1960 |
</div>
|
@@ -2088,7 +2098,7 @@ class OptionsView_bwg extends AdminView_bwg {
|
|
2088 |
</div>
|
2089 |
<div class="wd-box-content wd-width-100" id="tr_blog_style_search_box_width">
|
2090 |
<div class="wd-group">
|
2091 |
-
<label class="wd-label" for="blog_style_search_box_width"><?php _e('Search box width', BWG()->prefix); ?></label>
|
2092 |
<div class="bwg-flex">
|
2093 |
<input type="number" name="blog_style_search_box_width" id="blog_style_search_box_width" value="<?php echo $row->blog_style_search_box_width; ?>" min="0" /><span>px</span>
|
2094 |
</div>
|
@@ -2444,7 +2454,7 @@ class OptionsView_bwg extends AdminView_bwg {
|
|
2444 |
</div>
|
2445 |
<div class="wd-box-content wd-width-100" id="tr_album_search_box_width">
|
2446 |
<div class="wd-group">
|
2447 |
-
<label class="wd-label" for="album_search_box_width"><?php _e('Search box width', BWG()->prefix); ?></label>
|
2448 |
<div class="bwg-flex">
|
2449 |
<input type="number" name="album_search_box_width" id="album_search_box_width" value="<?php echo $row->album_search_box_width; ?>" min="0" /><span>px</span>
|
2450 |
</div>
|
@@ -2715,7 +2725,7 @@ class OptionsView_bwg extends AdminView_bwg {
|
|
2715 |
</div>
|
2716 |
<div class="wd-box-content wd-width-100" id="tr_album_masonry_search_box_width">
|
2717 |
<div class="wd-group">
|
2718 |
-
<label class="wd-label" for="album_masonry_search_box_width"><?php _e('Search box width', BWG()->prefix); ?></label>
|
2719 |
<div class="bwg-flex">
|
2720 |
<input type="number" name="album_masonry_search_box_width" id="album_masonry_search_box_width" value="<?php echo $row->album_masonry_search_box_width; ?>" min="0" /><span>px</span>
|
2721 |
</div>
|
@@ -2911,7 +2921,7 @@ class OptionsView_bwg extends AdminView_bwg {
|
|
2911 |
</div>
|
2912 |
<div class="wd-box-content wd-width-100" id="tr_album_extended_search_box_width">
|
2913 |
<div class="wd-group">
|
2914 |
-
<label class="wd-label" for="album_extended_search_box_width"><?php _e('Search box width', BWG()->prefix); ?></label>
|
2915 |
<div class="bwg-flex">
|
2916 |
<input type="number" name="album_extended_search_box_width" id="album_extended_search_box_width" value="<?php echo $row->album_extended_search_box_width; ?>" min="0" /><span>px</span>
|
2917 |
</div>
|
2 |
|
3 |
class OptionsView_bwg extends AdminView_bwg {
|
4 |
|
5 |
+
public function display($params = array()) {
|
6 |
wp_enqueue_script('thickbox');
|
7 |
wp_enqueue_script('jquery-ui-tabs');
|
8 |
wp_enqueue_script(BWG()->prefix . '_admin');
|
25 |
echo $this->form(ob_get_clean(), $form_attr);
|
26 |
}
|
27 |
|
28 |
+
public function body($params = array()) {
|
29 |
$row = $params['row'];
|
30 |
+
$instagram_return_url = $params['instagram_return_url'];
|
31 |
$instagram_reset_href = $params['instagram_reset_href'];
|
32 |
+
$options_url_ajax = $params['options_url_ajax'];
|
33 |
+
$imgcount = $params['imgcount'];
|
34 |
if (!$row) {
|
35 |
echo WDWLibrary::message_id(2);
|
36 |
return;
|
73 |
<a href="#bwg_tab_general_content" class="bwg-tablink"><?php _e('General', BWG()->prefix); ?></a>
|
74 |
</li>
|
75 |
<li class="tabs">
|
76 |
+
<a href="#bwg_tab_gallery_content" class="bwg-tablink"><?php _e('Gallery defaults', BWG()->prefix); ?></a>
|
77 |
</li>
|
78 |
<li class="tabs">
|
79 |
+
<a href="#bwg_tab_gallery_group_content" class="bwg-tablink"><?php _e('Gallery Group defaults', BWG()->prefix); ?></a>
|
80 |
</li>
|
81 |
<li class="tabs">
|
82 |
+
<a href="#bwg_tab_lightbox_content" class="bwg-tablink"><?php _e('Lightbox defaults', BWG()->prefix); ?></a>
|
83 |
</li>
|
84 |
<li class="tabs">
|
85 |
<a href="#bwg_tab_advanced_content" class="bwg-tablink"><?php _e('Advanced', BWG()->prefix); ?></a>
|
92 |
<div class="bwg-section bwg-flex-wrap">
|
93 |
<div class="wd-box-content wd-width-100 bwg-flex-wrap">
|
94 |
<div class="wd-box-content wd-width-50">
|
95 |
+
<?php
|
96 |
+
if ( $row->images_directory !== 'wp-content/uploads' ) {
|
97 |
+
?>
|
98 |
<div class="wd-box-content wd-width-100">
|
99 |
<div class="wd-group">
|
100 |
<label class="wd-label" for="images_directory"><?php _e('Images directory', BWG()->prefix); ?></label>
|
101 |
<div class="bwg-flex">
|
102 |
<input id="images_directory" name="images_directory" type="text" style="display:inline-block; width:100%;" value="<?php echo $row->images_directory; ?>" />
|
103 |
+
<input type="hidden" id="old_images_directory" name="old_images_directory" value="<?php echo $row->old_images_directory; ?>" />
|
104 |
</div>
|
105 |
<p class="description"><?php _e('Provide the path of an existing folder inside the WordPress directory of your website to store uploaded images.<br />The content of the previous directory will be moved to the new one.', BWG()->prefix); ?></p>
|
106 |
</div>
|
107 |
</div>
|
108 |
+
<?php
|
109 |
+
}
|
110 |
+
?>
|
111 |
+
<div class="wd-box-content wd-width-100">
|
112 |
<div class="wd-group">
|
113 |
<label class="wd-label" for="upload_img_width"><?php _e('Image dimensions', BWG()->prefix); ?></label>
|
114 |
<div class="bwg-flex">
|
124 |
<div class="bwg-flex">
|
125 |
<input type="number" name="upload_thumb_width" id="upload_thumb_width" value="<?php echo $row->upload_thumb_width; ?>" min="0" /><span>x</span>
|
126 |
<input type="number" name="upload_thumb_height" id="upload_thumb_height" value="<?php echo $row->upload_thumb_height; ?>" min="0" /><span>px</span>
|
127 |
+
<input type="hidden" name="imgcount" id="bwg_imgcount" value="<?php echo $imgcount; ?>">
|
128 |
+
<input type="submit" class="button-primary" onclick="<?php echo (BWG()->is_demo ? 'alert(\'' . addslashes(__('This option is disabled in demo.', BWG()->prefix)) . '\'); return false;' : (BWG()->wp_editor_exists ? 'return bwg_recreate_thumb(0);' : 'alert(\'' . addslashes(__('Image edit functionality is not supported by your web host.', BWG()->prefix)) . '\'); return false;')); ?>" value="<?php _e('Recreate', BWG()->prefix); ?>" />
|
129 |
</div>
|
130 |
<p class="description"><?php _e('Specify the maximum dimensions of generated thumbnails. They must be larger than frontend thumbnail dimensions.', BWG()->prefix); ?></p>
|
131 |
</div>
|
876 |
</tbody>
|
877 |
</table>
|
878 |
<input type="submit" class="button-primary" title="<?php _e('Set watermark', BWG()->prefix); ?>" style="margin-top: 5px;"
|
879 |
+
onclick="<?php echo (BWG()->is_demo ? 'alert(\'' . addslashes(__('This option is disabled in demo.', BWG()->prefix)) . '\'); return false;' : (BWG()->wp_editor_exists ? 'return bwg_set_watermark(0)' : 'alert(\'' . addslashes(__('Image edit functionality is not supported by your web host.', BWG()->prefix)) . '\'); return false;')); ?>"
|
880 |
value="<?php _e('Set Watermark', BWG()->prefix); ?>"/>
|
881 |
<input type="submit" class="button" title="<?php _e('Reset watermark', BWG()->prefix); ?>" style="margin-top: 5px;"
|
882 |
+
onclick="<?php echo (BWG()->is_demo ? 'alert(\'' . addslashes(__('This option is disabled in demo.', BWG()->prefix)) . '\'); return false;' : (BWG()->wp_editor_exists ? 'return bwg_reset_watermark_all(0)' : 'alert(\'' . addslashes(__('Image edit functionality is not supported by your web host.', BWG()->prefix)) . '\'); return false;')); ?>"
|
883 |
value="<?php _e('Reset Watermark', BWG()->prefix); ?>"/>
|
884 |
</div>
|
885 |
<p class="description"><?php _e('Mark the position where the watermark should appear on images.', BWG()->prefix) ?></p>
|
900 |
<input id="gallery_type" name="gallery_type" type="hidden" value="<?php echo $params['gallery_type']; ?>" />
|
901 |
<input id="album_type" name="album_type" type="hidden" value="<?php echo $params['album_type']; ?>" />
|
902 |
<script>
|
903 |
+
var bwg_options_url_ajax = '<?php echo $options_url_ajax; ?>';
|
904 |
function bwg_add_built_in_watermark_image(files) {
|
905 |
+
document.getElementById("built_in_watermark_url").value = '<?php echo BWG()->upload_url; ?>' + files[0]['url'];
|
906 |
}
|
907 |
function bwg_add_watermark_image(files) {
|
908 |
+
document.getElementById("watermark_url").value = '<?php echo BWG()->upload_url; ?>' + files[0]['url'];
|
909 |
}
|
910 |
jQuery(document).ready(function() {
|
911 |
bwg_inputs();
|
1106 |
</div>
|
1107 |
<div class="wd-box-content wd-width-100" id="tr_search_box_width">
|
1108 |
<div class="wd-group">
|
1109 |
+
<label class="wd-label" for="search_box_width"><?php _e('Search box maximum width', BWG()->prefix); ?></label>
|
1110 |
<div class="bwg-flex">
|
1111 |
<input type="number" name="search_box_width" id="search_box_width" value="<?php echo $row->search_box_width; ?>" min="0" /><span>px</span>
|
1112 |
</div>
|
1316 |
</div>
|
1317 |
<div class="wd-box-content wd-width-100" id="tr_masonry_search_box_width">
|
1318 |
<div class="wd-group">
|
1319 |
+
<label class="wd-label" for="masonry_search_box_width"><?php _e('Search box maximum width', BWG()->prefix); ?></label>
|
1320 |
<div class="bwg-flex">
|
1321 |
<input type="number" name="masonry_search_box_width" id="masonry_search_box_width" value="<?php echo $row->masonry_search_box_width; ?>" min="0" /><span>px</span>
|
1322 |
</div>
|
1536 |
</div>
|
1537 |
<div class="wd-box-content wd-width-100" id="tr_mosaic_search_box_width">
|
1538 |
<div class="wd-group">
|
1539 |
+
<label class="wd-label" for="mosaic_search_box_width"><?php _e('Search box maximum width', BWG()->prefix); ?></label>
|
1540 |
<div class="bwg-flex">
|
1541 |
<input type="number" name="mosaic_search_box_width" id="mosaic_search_box_width" value="<?php echo $row->mosaic_search_box_width; ?>" min="0" /><span>px</span>
|
1542 |
</div>
|
1964 |
</div>
|
1965 |
<div class="wd-box-content wd-width-100" id="tr_image_browser_search_box_width">
|
1966 |
<div class="wd-group">
|
1967 |
+
<label class="wd-label" for="image_browser_search_box_width"><?php _e('Search box maximum width', BWG()->prefix); ?></label>
|
1968 |
<div class="bwg-flex">
|
1969 |
<input type="number" name="image_browser_search_box_width" id="image_browser_search_box_width" value="<?php echo $row->image_browser_search_box_width; ?>" min="0" /><span>px</span>
|
1970 |
</div>
|
2098 |
</div>
|
2099 |
<div class="wd-box-content wd-width-100" id="tr_blog_style_search_box_width">
|
2100 |
<div class="wd-group">
|
2101 |
+
<label class="wd-label" for="blog_style_search_box_width"><?php _e('Search box maximum width', BWG()->prefix); ?></label>
|
2102 |
<div class="bwg-flex">
|
2103 |
<input type="number" name="blog_style_search_box_width" id="blog_style_search_box_width" value="<?php echo $row->blog_style_search_box_width; ?>" min="0" /><span>px</span>
|
2104 |
</div>
|
2454 |
</div>
|
2455 |
<div class="wd-box-content wd-width-100" id="tr_album_search_box_width">
|
2456 |
<div class="wd-group">
|
2457 |
+
<label class="wd-label" for="album_search_box_width"><?php _e('Search box maximum width', BWG()->prefix); ?></label>
|
2458 |
<div class="bwg-flex">
|
2459 |
<input type="number" name="album_search_box_width" id="album_search_box_width" value="<?php echo $row->album_search_box_width; ?>" min="0" /><span>px</span>
|
2460 |
</div>
|
2725 |
</div>
|
2726 |
<div class="wd-box-content wd-width-100" id="tr_album_masonry_search_box_width">
|
2727 |
<div class="wd-group">
|
2728 |
+
<label class="wd-label" for="album_masonry_search_box_width"><?php _e('Search box maximum width', BWG()->prefix); ?></label>
|
2729 |
<div class="bwg-flex">
|
2730 |
<input type="number" name="album_masonry_search_box_width" id="album_masonry_search_box_width" value="<?php echo $row->album_masonry_search_box_width; ?>" min="0" /><span>px</span>
|
2731 |
</div>
|
2921 |
</div>
|
2922 |
<div class="wd-box-content wd-width-100" id="tr_album_extended_search_box_width">
|
2923 |
<div class="wd-group">
|
2924 |
+
<label class="wd-label" for="album_extended_search_box_width"><?php _e('Search box maximum width', BWG()->prefix); ?></label>
|
2925 |
<div class="bwg-flex">
|
2926 |
<input type="number" name="album_extended_search_box_width" id="album_extended_search_box_width" value="<?php echo $row->album_extended_search_box_width; ?>" min="0" /><span>px</span>
|
2927 |
</div>
|
admin/views/Shortcode.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
|
3 |
class ShortcodeView_bwg extends AdminView_bwg {
|
4 |
-
public function display( $params ) {
|
5 |
$from_menu = $params['from_menu'];
|
6 |
if ( !$from_menu ) {
|
7 |
BWG()->register_admin_scripts();
|
@@ -40,7 +40,7 @@ class ShortcodeView_bwg extends AdminView_bwg {
|
|
40 |
}
|
41 |
}
|
42 |
|
43 |
-
public function body( $params ) {
|
44 |
$gallery_rows = $params['gallery_rows'];
|
45 |
$album_rows = $params['album_rows'];
|
46 |
$theme_rows = $params['theme_rows'];
|
@@ -491,10 +491,10 @@ class ShortcodeView_bwg extends AdminView_bwg {
|
|
491 |
?>
|
492 |
</div>
|
493 |
<div id="loading_div" <?php echo ( $from_menu ) ? 'class="bwg_show"' : ''; ?>></div>
|
494 |
-
|
495 |
}
|
496 |
|
497 |
-
public function generate_script( $params ) {
|
498 |
$from_menu = $params['from_menu'];
|
499 |
$shortcodes = $params['shortcodes'];
|
500 |
$shortcode_max_id = $params['shortcode_max_id'];
|
@@ -517,7 +517,7 @@ class ShortcodeView_bwg extends AdminView_bwg {
|
|
517 |
var bwg_insert = 1;
|
518 |
<?php
|
519 |
if ($params['gutenberg_callback']) {
|
520 |
-
|
521 |
?>
|
522 |
var content = '';
|
523 |
<?php
|
@@ -530,7 +530,7 @@ class ShortcodeView_bwg extends AdminView_bwg {
|
|
530 |
}
|
531 |
elseif (!$from_menu) { ?>
|
532 |
var content;
|
533 |
-
if (top.tinyMCE.activeEditor) {
|
534 |
content = top.tinyMCE.activeEditor.selection.getContent();
|
535 |
}
|
536 |
else {
|
@@ -1700,7 +1700,7 @@ class ShortcodeView_bwg extends AdminView_bwg {
|
|
1700 |
}
|
1701 |
elseif (!$from_menu) { ?>
|
1702 |
var selected_text;
|
1703 |
-
if (top.tinyMCE.activeEditor) {
|
1704 |
selected_text = top.tinyMCE.activeEditor.selection.getContent();
|
1705 |
}
|
1706 |
else {
|
@@ -1745,6 +1745,8 @@ class ShortcodeView_bwg extends AdminView_bwg {
|
|
1745 |
}
|
1746 |
|
1747 |
function bwg_insert_shortcode(content) {
|
|
|
|
|
1748 |
window.parent.window.jQuery(window.parent.document).trigger("onOpenShortcode");
|
1749 |
var gallery_type = jQuery("input[name=gallery_type]:checked").val();
|
1750 |
var theme = jQuery("#theme").val();
|
@@ -1839,7 +1841,6 @@ class ShortcodeView_bwg extends AdminView_bwg {
|
|
1839 |
title = ' gal_title="' + jQuery.trim(jQuery('#gallery option:selected').text().replace("'", "").replace('"', '')) + '"';
|
1840 |
tagtext += ' gallery_id="' + jQuery("#gallery").val() + '"';
|
1841 |
tagtext += ' tag="' + jQuery("#tag").val() + '"';
|
1842 |
-
|
1843 |
tagtext += ' slideshow_effect="' + jQuery("#slideshow_type").val() + '"';
|
1844 |
tagtext += ' slideshow_interval="' + jQuery("#slideshow_interval").val() + '"';
|
1845 |
tagtext += ' slideshow_width="' + jQuery("#slideshow_width").val() + '"';
|
@@ -2075,9 +2076,12 @@ class ShortcodeView_bwg extends AdminView_bwg {
|
|
2075 |
|
2076 |
<?php if (!$from_menu && !$params['gutenberg_callback']) { ?>
|
2077 |
if (top.tinyMCE.activeEditor) {
|
2078 |
-
|
2079 |
-
|
2080 |
-
|
|
|
|
|
|
|
2081 |
}
|
2082 |
var post_data = {};
|
2083 |
var url = '<?php echo add_query_arg(array( 'action' => 'shortcode_bwg' ), admin_url('admin-ajax.php')); ?>';
|
@@ -2144,7 +2148,12 @@ class ShortcodeView_bwg extends AdminView_bwg {
|
|
2144 |
<?php } ?>
|
2145 |
return;
|
2146 |
}
|
2147 |
-
|
|
|
|
|
|
|
|
|
|
|
2148 |
jQuery(document).ready(function () {
|
2149 |
bwg_shortcode_hide_show_params();
|
2150 |
bwg_change_tab();
|
@@ -2161,4 +2170,4 @@ class ShortcodeView_bwg extends AdminView_bwg {
|
|
2161 |
<?php
|
2162 |
return ob_get_clean();
|
2163 |
}
|
2164 |
-
}
|
1 |
<?php
|
2 |
|
3 |
class ShortcodeView_bwg extends AdminView_bwg {
|
4 |
+
public function display( $params = array() ) {
|
5 |
$from_menu = $params['from_menu'];
|
6 |
if ( !$from_menu ) {
|
7 |
BWG()->register_admin_scripts();
|
40 |
}
|
41 |
}
|
42 |
|
43 |
+
public function body( $params = array() ) {
|
44 |
$gallery_rows = $params['gallery_rows'];
|
45 |
$album_rows = $params['album_rows'];
|
46 |
$theme_rows = $params['theme_rows'];
|
491 |
?>
|
492 |
</div>
|
493 |
<div id="loading_div" <?php echo ( $from_menu ) ? 'class="bwg_show"' : ''; ?>></div>
|
494 |
+
<?php
|
495 |
}
|
496 |
|
497 |
+
public function generate_script( $params = array() ) {
|
498 |
$from_menu = $params['from_menu'];
|
499 |
$shortcodes = $params['shortcodes'];
|
500 |
$shortcode_max_id = $params['shortcode_max_id'];
|
517 |
var bwg_insert = 1;
|
518 |
<?php
|
519 |
if ($params['gutenberg_callback']) {
|
520 |
+
if ($params['gutenberg_id'] == 0) {
|
521 |
?>
|
522 |
var content = '';
|
523 |
<?php
|
530 |
}
|
531 |
elseif (!$from_menu) { ?>
|
532 |
var content;
|
533 |
+
if (top.tinyMCE.activeEditor && top.tinyMCE.activeEditor.selection) {
|
534 |
content = top.tinyMCE.activeEditor.selection.getContent();
|
535 |
}
|
536 |
else {
|
1700 |
}
|
1701 |
elseif (!$from_menu) { ?>
|
1702 |
var selected_text;
|
1703 |
+
if (top.tinyMCE.activeEditor && top.tinyMCE.activeEditor.selection) {
|
1704 |
selected_text = top.tinyMCE.activeEditor.selection.getContent();
|
1705 |
}
|
1706 |
else {
|
1745 |
}
|
1746 |
|
1747 |
function bwg_insert_shortcode(content) {
|
1748 |
+
var page_builder_activated = bwg_before_shortcode_add_builder_editor();
|
1749 |
+
|
1750 |
window.parent.window.jQuery(window.parent.document).trigger("onOpenShortcode");
|
1751 |
var gallery_type = jQuery("input[name=gallery_type]:checked").val();
|
1752 |
var theme = jQuery("#theme").val();
|
1841 |
title = ' gal_title="' + jQuery.trim(jQuery('#gallery option:selected').text().replace("'", "").replace('"', '')) + '"';
|
1842 |
tagtext += ' gallery_id="' + jQuery("#gallery").val() + '"';
|
1843 |
tagtext += ' tag="' + jQuery("#tag").val() + '"';
|
|
|
1844 |
tagtext += ' slideshow_effect="' + jQuery("#slideshow_type").val() + '"';
|
1845 |
tagtext += ' slideshow_interval="' + jQuery("#slideshow_interval").val() + '"';
|
1846 |
tagtext += ' slideshow_width="' + jQuery("#slideshow_width").val() + '"';
|
2076 |
|
2077 |
<?php if (!$from_menu && !$params['gutenberg_callback']) { ?>
|
2078 |
if (top.tinyMCE.activeEditor) {
|
2079 |
+
// If there is no builder, then shortcode replace to image.
|
2080 |
+
if( !page_builder_activated ) {
|
2081 |
+
short_code = short_code.replace(/\[Best_Wordpress_Gallery([^\]]*)\]/g, function (d, c) {
|
2082 |
+
return "<img src='<?php echo BWG()->plugin_url; ?>/images/icons/gallery-icon.png' class='bwg_shortcode mceItem' title='Best_Wordpress_Gallery" + short_id + "' />";
|
2083 |
+
});
|
2084 |
+
}
|
2085 |
}
|
2086 |
var post_data = {};
|
2087 |
var url = '<?php echo add_query_arg(array( 'action' => 'shortcode_bwg' ), admin_url('admin-ajax.php')); ?>';
|
2148 |
<?php } ?>
|
2149 |
return;
|
2150 |
}
|
2151 |
+
function bwg_before_shortcode_add_builder_editor() {
|
2152 |
+
if ( top.jQuery('body').hasClass('elementor-editor-active') || top.jQuery('body').hasClass('fl-builder') ) {
|
2153 |
+
return true;
|
2154 |
+
}
|
2155 |
+
return false;
|
2156 |
+
}
|
2157 |
jQuery(document).ready(function () {
|
2158 |
bwg_shortcode_hide_show_params();
|
2159 |
bwg_change_tab();
|
2170 |
<?php
|
2171 |
return ob_get_clean();
|
2172 |
}
|
2173 |
+
}
|
admin/views/Themes.php
CHANGED
@@ -13,7 +13,7 @@ class ThemesView_bwg extends AdminView_bwg {
|
|
13 |
*
|
14 |
* @param $params
|
15 |
*/
|
16 |
-
public function display( $params ) {
|
17 |
if ( !BWG()->is_pro && get_option("wd_bwg_theme_version") ) {
|
18 |
WDWLibrary::topbar();
|
19 |
?>
|
@@ -43,7 +43,7 @@ class ThemesView_bwg extends AdminView_bwg {
|
|
43 |
*
|
44 |
* @param $params
|
45 |
*/
|
46 |
-
public function body( $params ) {
|
47 |
$order = $params['order'];
|
48 |
$orderby = $params['orderby'];
|
49 |
$actions = $params['actions'];
|
@@ -146,7 +146,7 @@ class ThemesView_bwg extends AdminView_bwg {
|
|
146 |
* @param array $params.
|
147 |
* @return string html.
|
148 |
*/
|
149 |
-
public function edit( $params ) {
|
150 |
ob_start();
|
151 |
if ( $params['reset'] ) {
|
152 |
echo WDWLibrary::message_id(17);
|
@@ -168,7 +168,7 @@ class ThemesView_bwg extends AdminView_bwg {
|
|
168 |
*
|
169 |
* @param $params
|
170 |
*/
|
171 |
-
public function edit_body( $params ) {
|
172 |
extract($params);
|
173 |
?>
|
174 |
<div class="bwg-page-header">
|
@@ -383,6 +383,12 @@ class ThemesView_bwg extends AdminView_bwg {
|
|
383 |
<input type="text" name="thumb_title_font_color" id="thumb_title_font_color" value="<?php echo $row->thumb_title_font_color; ?>" class="color" />
|
384 |
</td>
|
385 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
386 |
<tr>
|
387 |
<td class="spider_label"><label for="thumb_title_font_style"><?php echo __('Title font family:', BWG()->prefix); ?> </label></td>
|
388 |
<td>
|
13 |
*
|
14 |
* @param $params
|
15 |
*/
|
16 |
+
public function display( $params = array() ) {
|
17 |
if ( !BWG()->is_pro && get_option("wd_bwg_theme_version") ) {
|
18 |
WDWLibrary::topbar();
|
19 |
?>
|
43 |
*
|
44 |
* @param $params
|
45 |
*/
|
46 |
+
public function body( $params = array() ) {
|
47 |
$order = $params['order'];
|
48 |
$orderby = $params['orderby'];
|
49 |
$actions = $params['actions'];
|
146 |
* @param array $params.
|
147 |
* @return string html.
|
148 |
*/
|
149 |
+
public function edit( $params = array() ) {
|
150 |
ob_start();
|
151 |
if ( $params['reset'] ) {
|
152 |
echo WDWLibrary::message_id(17);
|
168 |
*
|
169 |
* @param $params
|
170 |
*/
|
171 |
+
public function edit_body( $params = array() ) {
|
172 |
extract($params);
|
173 |
?>
|
174 |
<div class="bwg-page-header">
|
383 |
<input type="text" name="thumb_title_font_color" id="thumb_title_font_color" value="<?php echo $row->thumb_title_font_color; ?>" class="color" />
|
384 |
</td>
|
385 |
</tr>
|
386 |
+
<tr>
|
387 |
+
<td class="spider_label"><label for="thumb_title_font_color_hover"><?php echo __('Title font color (Show on hover):', BWG()->prefix); ?> </label></td>
|
388 |
+
<td>
|
389 |
+
<input type="text" name="thumb_title_font_color_hover" id="thumb_title_font_color_hover" value="<?php echo $row->thumb_title_font_color_hover; ?>" class="color" />
|
390 |
+
</td>
|
391 |
+
</tr>
|
392 |
<tr>
|
393 |
<td class="spider_label"><label for="thumb_title_font_style"><?php echo __('Title font family:', BWG()->prefix); ?> </label></td>
|
394 |
<td>
|
admin/views/Uninstall.php
CHANGED
@@ -6,7 +6,7 @@ class UninstallView_bwg extends AdminView_bwg {
|
|
6 |
*
|
7 |
* @param $params
|
8 |
*/
|
9 |
-
public function display($params) {
|
10 |
ob_start();
|
11 |
echo $this->body($params);
|
12 |
// Pass the content to form.
|
@@ -24,7 +24,7 @@ class UninstallView_bwg extends AdminView_bwg {
|
|
24 |
*
|
25 |
* @param $params
|
26 |
*/
|
27 |
-
public function body( $params ) {
|
28 |
$deactivate_url = add_query_arg(array(
|
29 |
'action' => 'deactivate',
|
30 |
'plugin' => BWG()->main_file,
|
6 |
*
|
7 |
* @param $params
|
8 |
*/
|
9 |
+
public function display($params = array()) {
|
10 |
ob_start();
|
11 |
echo $this->body($params);
|
12 |
// Pass the content to form.
|
24 |
*
|
25 |
* @param $params
|
26 |
*/
|
27 |
+
public function body( $params = array() ) {
|
28 |
$deactivate_url = add_query_arg(array(
|
29 |
'action' => 'deactivate',
|
30 |
'plugin' => BWG()->main_file,
|
css/bwg_frontend.css
CHANGED
@@ -23,7 +23,7 @@ div[id^="bwg_container"] .SumoSelect.open > .CaptionCont {
|
|
23 |
background-color: #FFFFFF;
|
24 |
width: 100%;
|
25 |
font-family: inherit;
|
26 |
-
margin: 0 -5px 20px
|
27 |
z-index: 200;
|
28 |
position: relative;
|
29 |
}
|
@@ -34,7 +34,6 @@ div[id^="bwg_container"] .SumoSelect.open > .CaptionCont {
|
|
34 |
color: #CCCCCC;
|
35 |
cursor: pointer;
|
36 |
position: relative;
|
37 |
-
top: -4px;
|
38 |
}
|
39 |
|
40 |
#bwg_tag_container p {
|
@@ -104,16 +103,22 @@ div[id^="bwg_container"] div[id^="bwg_container"] .bwg_img_clear {
|
|
104 |
top: 50%;
|
105 |
width: 30px;
|
106 |
z-index: 10102;
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
}
|
112 |
|
113 |
.bwg_filmstrip_thumbnail_img {
|
114 |
max-width: none !important;
|
115 |
}
|
116 |
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
.spider_popup_overlay,
|
118 |
.footer-list-block .bwp_gallery .spider_popup_overlay,
|
119 |
.footer-list-block .bwp_gallery_tags .spider_popup_overlay {
|
@@ -278,7 +283,7 @@ div[id^="bwg_container"] div[id^="bwg_container"] .bwg_img_clear {
|
|
278 |
display: inline-block;
|
279 |
width: 100%;
|
280 |
text-align: right;
|
281 |
-
margin: 0 5px 20px
|
282 |
background-color: rgba(0,0,0,0);
|
283 |
}
|
284 |
.bwg_search_container_2 {
|
@@ -295,24 +300,23 @@ div[id^="bwg_search_container_1_"] div[id^="bwg_search_container_2_"] .bwg_searc
|
|
295 |
margin-right: 45px;
|
296 |
}
|
297 |
div[id^="bwg_search_container_1_"] div[id^="bwg_search_container_2_"] .bwg_search_loupe_container {
|
298 |
-
display: inline-block;
|
299 |
margin-right: 1px;
|
300 |
vertical-align: middle;
|
301 |
float: right;
|
302 |
-
padding-top: 3px;
|
303 |
}
|
304 |
div[id^="bwg_search_container_1_"] div[id^="bwg_search_container_2_"] .bwg_search_reset_container {
|
305 |
-
display: inline-block;
|
306 |
margin-right: 5px;
|
307 |
vertical-align: middle;
|
308 |
float: right;
|
309 |
-
padding-top: 3px;
|
310 |
}
|
311 |
-
div[id^="bwg_search_container_1_"] div[id^="bwg_search_container_2_"] .bwg_search,
|
312 |
-
div[id^="bwg_search_container_1_"] div[id^="bwg_search_container_2_"] .bwg_reset {
|
313 |
-
|
314 |
-
|
|
|
315 |
cursor: pointer;
|
|
|
316 |
}
|
317 |
div[id^="bwg_search_container_1_"] div[id^="bwg_search_container_2_"] .bwg_search_input,
|
318 |
div[id^="bwg_search_container_1_"] div[id^="bwg_search_container_2_"] .bwg_search_input:focus {
|
@@ -321,20 +325,61 @@ div[id^="bwg_search_container_1_"] div[id^="bwg_search_container_2_"] .bwg_searc
|
|
321 |
border: none;
|
322 |
box-shadow: none;
|
323 |
background: none;
|
324 |
-
padding:
|
325 |
font-family: inherit;
|
326 |
width: 100%;
|
327 |
}
|
328 |
/* end search */
|
329 |
|
330 |
/* sort */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
.bwg_order_cont {
|
332 |
background-color: rgba(0,0,0,0);
|
333 |
display: block;
|
334 |
-
margin: 0 5px 20px 5px;
|
335 |
text-align: right;
|
336 |
width: 100%;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
337 |
}
|
|
|
338 |
.bwg_order_label {
|
339 |
border: none;
|
340 |
box-shadow: none;
|
@@ -350,6 +395,7 @@ div[id^="bwg_search_container_1_"] div[id^="bwg_search_container_2_"] .bwg_searc
|
|
350 |
border-radius: 4px;
|
351 |
height: initial;
|
352 |
max-width: 100%;
|
|
|
353 |
}
|
354 |
/* end sort */
|
355 |
|
@@ -525,11 +571,12 @@ div[id^="bwg_container"] .bwg-border-box * {
|
|
525 |
}
|
526 |
.bwg_container {
|
527 |
position: relative;
|
|
|
528 |
}
|
529 |
|
530 |
.bwg_inst_play_btn_cont,
|
531 |
.bwg_inst_play_btn_cont .bwg_inst_play {
|
532 |
-
|
533 |
}
|
534 |
|
535 |
.hidden {
|
@@ -555,6 +602,527 @@ div[id^="bwg_container"] .bwg-border-box * {
|
|
555 |
display: inline-block;
|
556 |
}
|
557 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
558 |
.bwg_container div[id^="bwg_container2_"] img {
|
559 |
height: initial;
|
560 |
}
|
23 |
background-color: #FFFFFF;
|
24 |
width: 100%;
|
25 |
font-family: inherit;
|
26 |
+
margin: 0 -5px 20px 0px;
|
27 |
z-index: 200;
|
28 |
position: relative;
|
29 |
}
|
34 |
color: #CCCCCC;
|
35 |
cursor: pointer;
|
36 |
position: relative;
|
|
|
37 |
}
|
38 |
|
39 |
#bwg_tag_container p {
|
103 |
top: 50%;
|
104 |
width: 30px;
|
105 |
z-index: 10102;
|
106 |
+
/* animation: spin 2.5s infinite linear;
|
107 |
+
-moz-animation: spin 2.5s infinite linear;
|
108 |
+
-o-animation: spin 2.5s infinite linear;
|
109 |
+
-webkit-animation: spin 2.5s infinite linear;*/
|
110 |
}
|
111 |
|
112 |
.bwg_filmstrip_thumbnail_img {
|
113 |
max-width: none !important;
|
114 |
}
|
115 |
|
116 |
+
.dashicons-arrow-down-alt2:before {
|
117 |
+
content: "\f347";
|
118 |
+
height: 100%;
|
119 |
+
display: inline-block;
|
120 |
+
}
|
121 |
+
|
122 |
.spider_popup_overlay,
|
123 |
.footer-list-block .bwp_gallery .spider_popup_overlay,
|
124 |
.footer-list-block .bwp_gallery_tags .spider_popup_overlay {
|
283 |
display: inline-block;
|
284 |
width: 100%;
|
285 |
text-align: right;
|
286 |
+
margin: 0 5px 20px 0px;
|
287 |
background-color: rgba(0,0,0,0);
|
288 |
}
|
289 |
.bwg_search_container_2 {
|
300 |
margin-right: 45px;
|
301 |
}
|
302 |
div[id^="bwg_search_container_1_"] div[id^="bwg_search_container_2_"] .bwg_search_loupe_container {
|
303 |
+
display: inline-block;
|
304 |
margin-right: 1px;
|
305 |
vertical-align: middle;
|
306 |
float: right;
|
|
|
307 |
}
|
308 |
div[id^="bwg_search_container_1_"] div[id^="bwg_search_container_2_"] .bwg_search_reset_container {
|
|
|
309 |
margin-right: 5px;
|
310 |
vertical-align: middle;
|
311 |
float: right;
|
|
|
312 |
}
|
313 |
+
.bwg_thumbnail div[id^="bwg_search_container_1_"] div[id^="bwg_search_container_2_"] .bwg_search,
|
314 |
+
.bwg_thumbnail div[id^="bwg_search_container_1_"] div[id^="bwg_search_container_2_"] .bwg_reset {
|
315 |
+
display: block;
|
316 |
+
font-size: 12px;
|
317 |
+
color: #323A45;
|
318 |
cursor: pointer;
|
319 |
+
line-height: inherit!important;
|
320 |
}
|
321 |
div[id^="bwg_search_container_1_"] div[id^="bwg_search_container_2_"] .bwg_search_input,
|
322 |
div[id^="bwg_search_container_1_"] div[id^="bwg_search_container_2_"] .bwg_search_input:focus {
|
325 |
border: none;
|
326 |
box-shadow: none;
|
327 |
background: none;
|
328 |
+
padding: 3px 5px;
|
329 |
font-family: inherit;
|
330 |
width: 100%;
|
331 |
}
|
332 |
/* end search */
|
333 |
|
334 |
/* sort */
|
335 |
+
.bwg_order_cont .SumoSelect {
|
336 |
+
background-color: #FFFFFF;
|
337 |
+
border: 1px solid #CCCCCC;
|
338 |
+
box-shadow: 0 0 3px 1px #CCCCCC;
|
339 |
+
border-radius: 4px;
|
340 |
+
height: initial;
|
341 |
+
max-width: 100%;
|
342 |
+
padding: 0 10px;
|
343 |
+
}
|
344 |
+
|
345 |
+
.SumoSelect > .optWrapper > .options li.opt {
|
346 |
+
text-align: left;
|
347 |
+
}
|
348 |
+
|
349 |
+
.bwg_order_cont .SumoSelect .CaptionCont {
|
350 |
+
text-align: left;
|
351 |
+
}
|
352 |
+
|
353 |
.bwg_order_cont {
|
354 |
background-color: rgba(0,0,0,0);
|
355 |
display: block;
|
|
|
356 |
text-align: right;
|
357 |
width: 100%;
|
358 |
+
margin: 0 5px 20px 0px;
|
359 |
+
}
|
360 |
+
|
361 |
+
.bwg_order_cont .SumoSelect, #bwg_tag_container .SumoSelect {
|
362 |
+
display: inline-table;
|
363 |
+
}
|
364 |
+
|
365 |
+
.bwg_order_cont .SumoSelect ul.options, #bwg_tag_container .SumoSelect ul.options{
|
366 |
+
margin: 0;
|
367 |
+
padding: 0!important;
|
368 |
+
}
|
369 |
+
|
370 |
+
.bwg_order_cont .SumoSelect li, #bwg_tag_container .SumoSelect li{
|
371 |
+
list-style: none;
|
372 |
+
}
|
373 |
+
|
374 |
+
#bwg_tag_container .SumoSelect.open .search-txt {
|
375 |
+
padding: 0px 8px;
|
376 |
+
height: 100%;
|
377 |
+
}
|
378 |
+
|
379 |
+
#bwg_tag_container .SumoSelect > .optWrapper > .options li label {
|
380 |
+
margin: 0px;
|
381 |
}
|
382 |
+
|
383 |
.bwg_order_label {
|
384 |
border: none;
|
385 |
box-shadow: none;
|
395 |
border-radius: 4px;
|
396 |
height: initial;
|
397 |
max-width: 100%;
|
398 |
+
text-align: left;
|
399 |
}
|
400 |
/* end sort */
|
401 |
|
571 |
}
|
572 |
.bwg_container {
|
573 |
position: relative;
|
574 |
+
min-height: 300px;
|
575 |
}
|
576 |
|
577 |
.bwg_inst_play_btn_cont,
|
578 |
.bwg_inst_play_btn_cont .bwg_inst_play {
|
579 |
+
display: block;
|
580 |
}
|
581 |
|
582 |
.hidden {
|
602 |
display: inline-block;
|
603 |
}
|
604 |
|
605 |
+
/* Tags, Orders, Search */
|
606 |
+
@media only screen and (max-width: 800px) {
|
607 |
+
|
608 |
+
.bwg_thumbnail.bwg_container {
|
609 |
+
padding: 0 1px;
|
610 |
+
}
|
611 |
+
|
612 |
+
.bwg_thumbnail .bwg_container .search_line {
|
613 |
+
display: inline-block;
|
614 |
+
}
|
615 |
+
|
616 |
+
body .bwg_thumbnail.bwg_container .search_line .bwg_order_cont,
|
617 |
+
body .bwg_thumbnail.bwg_container .search_line .search_tags_container,
|
618 |
+
body .bwg_thumbnail.bwg_container .search_line .bwg_search_container_1 {
|
619 |
+
width: 100%;
|
620 |
+
margin: 0 0 10px 0;
|
621 |
+
text-align: center;
|
622 |
+
max-width: 100%;
|
623 |
+
}
|
624 |
+
|
625 |
+
.bwg_thumbnail .search_line .SumoSelect > .optWrapper.isFloating {
|
626 |
+
position: absolute;
|
627 |
+
max-height: none;
|
628 |
+
bottom: auto;
|
629 |
+
top:35px;
|
630 |
+
}
|
631 |
+
|
632 |
+
body .bwg_thumbnail .search_line .SumoSelect > .optWrapper.isFloating > ul.options {
|
633 |
+
box-shadow: none;
|
634 |
+
}
|
635 |
+
|
636 |
+
.bwg_thumbnail.bwg_container .search_line .SumoSelect .optWrapper {
|
637 |
+
width: 100%;
|
638 |
+
height: auto!important;
|
639 |
+
padding-bottom: 0px!important;
|
640 |
+
}
|
641 |
+
|
642 |
+
/* hide OK, Cancel buttons */
|
643 |
+
.bwg_thumbnail.bwg_container .search_line .MultiControls {
|
644 |
+
display: none!important;
|
645 |
+
}
|
646 |
+
|
647 |
+
.bwg_thumbnail.bwg_container .search_line .SumoSelect > .CaptionCont {
|
648 |
+
width: 100%;
|
649 |
+
text-align: center;
|
650 |
+
}
|
651 |
+
|
652 |
+
.bwg_thumbnail.bwg_container .search_line .bwg_search_container_1 {
|
653 |
+
width: 100%;
|
654 |
+
max-width: 100%!important;
|
655 |
+
}
|
656 |
+
|
657 |
+
.bwg_thumbnail.bwg_container .search_line .SumoSelect {
|
658 |
+
width: inherit;
|
659 |
+
height: inherit;
|
660 |
+
cursor:pointer;
|
661 |
+
display: block!important;
|
662 |
+
}
|
663 |
+
|
664 |
+
body .bwg_thumbnail.bwg_container .search_line .search-txt {
|
665 |
+
padding: 0px 10px!important;
|
666 |
+
}
|
667 |
+
|
668 |
+
body .bwg_thumbnail.bwg_container .search_line .SumoSelect > .CaptionCont > label {
|
669 |
+
width: 30px;
|
670 |
+
}
|
671 |
+
}
|
672 |
+
|
673 |
+
|
674 |
+
.bwg_thumbnail.bwg_container .search_line {
|
675 |
+
min-height: 50px;
|
676 |
+
-webkit-box-shadow: 0px 5px 7px -5px rgba(0,0,0,0.16);
|
677 |
+
-moz-box-shadow: 0px 5px 7px -5px rgba(0,0,0,0.16);
|
678 |
+
box-shadow: 0px 5px 7px -5px rgba(0,0,0,0.16);
|
679 |
+
margin-bottom: 10px;
|
680 |
+
display: inline-block;
|
681 |
+
width: 100%;
|
682 |
+
}
|
683 |
+
|
684 |
+
.bwg_thumbnail.bwg_container .search_line .bwg_search_container_1,
|
685 |
+
.bwg_thumbnail.bwg_container .search_line .bwg_order_cont,
|
686 |
+
.bwg_thumbnail.bwg_container .search_line #bwg_tag_wrap {
|
687 |
+
float: left;
|
688 |
+
display: table-cell;
|
689 |
+
text-align: left;
|
690 |
+
vertical-align: middle;
|
691 |
+
}
|
692 |
+
|
693 |
+
.bwg_thumbnail.bwg_container .search_line .bwg_order_cont select,
|
694 |
+
.bwg_thumbnail.bwg_container .search_line #bwg_tag_wrap #bwg_tag_container {
|
695 |
+
border: 0.5px solid rgba(0, 0, 0, .15);
|
696 |
+
box-shadow: none;
|
697 |
+
border-radius: 15px;
|
698 |
+
}
|
699 |
+
|
700 |
+
|
701 |
+
.bwg_thumbnail.bwg_container .search_line .bwg_order_cont,
|
702 |
+
.bwg_thumbnail.bwg_container .search_line .search_tags_container {
|
703 |
+
width: 25%;
|
704 |
+
min-width: 120px;
|
705 |
+
max-width: 180px;
|
706 |
+
margin-right: 20px;
|
707 |
+
margin-bottom: 10px;
|
708 |
+
border: 0.5px solid rgba(0, 0, 0, .15);
|
709 |
+
box-shadow: none;
|
710 |
+
border-radius: 15px;
|
711 |
+
float: left;
|
712 |
+
height: 30px;
|
713 |
+
padding: 0px;
|
714 |
+
cursor: pointer;
|
715 |
+
background: #ffffff;
|
716 |
+
}
|
717 |
+
|
718 |
+
.bwg_thumbnail.bwg_container .search_line.SumoSelect .opt label,
|
719 |
+
.bwg_thumbnail.bwg_container .search_line .placeholder,
|
720 |
+
.bwg_thumbnail.bwg_container .search_line .bwg_order_cont select,
|
721 |
+
.bwg_thumbnail.bwg_container .search_line .search-txt,
|
722 |
+
.bwg_thumbnail.bwg_container .search_line .select-all {
|
723 |
+
color:#323A45;
|
724 |
+
font-size: 12px;
|
725 |
+
text-transform: uppercase;
|
726 |
+
font-weight:normal;
|
727 |
+
font-family: Ubuntu;
|
728 |
+
margin: 0px;
|
729 |
+
border: none;
|
730 |
+
|
731 |
+
}
|
732 |
+
|
733 |
+
.bwg_thumbnail.bwg_container .search_line .select-all label {
|
734 |
+
margin-bottom: 0px;
|
735 |
+
line-height: 13px;
|
736 |
+
}
|
737 |
+
.bwg_thumbnail.bwg_container .search_line .SumoSelect ul.options {
|
738 |
+
padding: 1px 0px 0 10px!important;
|
739 |
+
}
|
740 |
+
|
741 |
+
.bwg_thumbnail.bwg_container .search_line .SumoSelect {
|
742 |
+
padding: 0px 10px;
|
743 |
+
width: initial;
|
744 |
+
height: inherit;
|
745 |
+
cursor:pointer;
|
746 |
+
display: block;
|
747 |
+
border: none;
|
748 |
+
box-shadow: none;
|
749 |
+
border-radius: 0px;
|
750 |
+
max-width: 100%;
|
751 |
+
background-color: transparent;
|
752 |
+
line-height: inherit;
|
753 |
+
vertical-align: bottom;
|
754 |
+
}
|
755 |
+
|
756 |
+
.bwg_thumbnail.bwg_container .search_line .bwg_search_input_container {
|
757 |
+
height: 30px;
|
758 |
+
text-align: center;
|
759 |
+
font-size: 12px;
|
760 |
+
font-family: Ubuntu;
|
761 |
+
border-radius: 15px;
|
762 |
+
text-align: left;
|
763 |
+
width: calc(100%);
|
764 |
+
margin: 0px;
|
765 |
+
overflow: hidden;
|
766 |
+
}
|
767 |
+
|
768 |
+
|
769 |
+
.bwg_thumbnail div[id^="bwg_search_container_1_"] div[id^="bwg_search_container_2_"] .bwg_search_input,
|
770 |
+
.bwg_thumbnail div[id^="bwg_search_container_1_"] div[id^="bwg_search_container_2_"] .bwg_search_input:focus {
|
771 |
+
height: 30px;
|
772 |
+
padding: 0px 10px;
|
773 |
+
text-align: center;
|
774 |
+
font-size: 12px;
|
775 |
+
font-family: Ubuntu;
|
776 |
+
border-radius: 15px;
|
777 |
+
text-align: left;
|
778 |
+
width: calc(100% - 64px);
|
779 |
+
display: inline-table;
|
780 |
+
}
|
781 |
+
|
782 |
+
.bwg_thumbnail.bwg_container .search_line .CaptionCont span{
|
783 |
+
display: block!important;
|
784 |
+
vertical-align: middle;
|
785 |
+
color: #323A45 !important;
|
786 |
+
font-size: 12px;
|
787 |
+
text-transform: uppercase;
|
788 |
+
font-family: Ubuntu;
|
789 |
+
cursor: pointer;
|
790 |
+
line-height: 29px;
|
791 |
+
max-width: calc( 100% - 20px );
|
792 |
+
}
|
793 |
+
|
794 |
+
.bwg_thumbnail .search_tags {
|
795 |
+
cursor: pointer;
|
796 |
+
}
|
797 |
+
|
798 |
+
.bwg_thumbnail.bwg_container .search_line .SumoSelect > .optWrapper.multiple > .options li.opt span,
|
799 |
+
.bwg_thumbnail.bwg_container .search_line .SumoSelect .select-all > span {
|
800 |
+
margin-left: -35px;
|
801 |
+
}
|
802 |
+
|
803 |
+
.bwg_thumbnail.bwg_container .search_line .SumoSelect > .optWrapper.multiple > .options li.opt {
|
804 |
+
padding-left: 25px;
|
805 |
+
}
|
806 |
+
|
807 |
+
.bwg_thumbnail .bwg_search_input::-webkit-input-placeholder { /* Chrome/Opera/Safari */
|
808 |
+
color:#CCCCCC;
|
809 |
+
font-size: 12px;
|
810 |
+
text-transform: uppercase;
|
811 |
+
font-family: Ubuntu;
|
812 |
+
|
813 |
+
|
814 |
+
}
|
815 |
+
.bwg_thumbnail .bwg_search_input::-moz-placeholder { /* Firefox 19+ */
|
816 |
+
color:#CCCCCC;
|
817 |
+
font-size: 12px;
|
818 |
+
text-transform: uppercase;
|
819 |
+
text-align: left;
|
820 |
+
font-family: Ubuntu;
|
821 |
+
line-height: 30px;
|
822 |
+
}
|
823 |
+
.bwg_thumbnail .bwg_search_input:-ms-input-placeholder { /* IE 10+ */
|
824 |
+
color:#CCCCCC;
|
825 |
+
font-size: 12px;
|
826 |
+
text-transform: uppercase;
|
827 |
+
text-align: left;
|
828 |
+
font-family: Ubuntu;
|
829 |
+
}
|
830 |
+
.bwg_thumbnail .bwg_search_input:-moz-placeholder { /* Firefox 18- */
|
831 |
+
color:#CCCCCC;
|
832 |
+
font-size: 12px;
|
833 |
+
text-transform: uppercase;
|
834 |
+
text-align: left;
|
835 |
+
font-family: Ubuntu;
|
836 |
+
}
|
837 |
+
|
838 |
+
.bwg_thumbnail .search-txt::-webkit-input-placeholder {
|
839 |
+
text-align: left;
|
840 |
+
color: #323A45;
|
841 |
+
opacity: 0.5;
|
842 |
+
font-size: 12px!important;
|
843 |
+
}
|
844 |
+
|
845 |
+
.bwg_thumbnail .search-txt::-moz-placeholder {
|
846 |
+
text-align: left;
|
847 |
+
color: #323A45;
|
848 |
+
opacity: 0.5;
|
849 |
+
font-size: 12px!important;
|
850 |
+
}
|
851 |
+
|
852 |
+
.bwg_thumbnail .search-txt::-ms-input-placeholder {
|
853 |
+
text-align: left;
|
854 |
+
color: #323A45;
|
855 |
+
opacity: 0.5;
|
856 |
+
font-size: 12px;
|
857 |
+
}
|
858 |
+
.bwg_thumbnail .search-txt:-ms-input-placeholder {
|
859 |
+
text-align: left;
|
860 |
+
color: #323A45;
|
861 |
+
opacity: 0.5;
|
862 |
+
font-size: 12px;
|
863 |
+
}
|
864 |
+
.bwg_thumbnail .search-txt:-moz-placeholder {
|
865 |
+
text-align: left;
|
866 |
+
color: #323A45;
|
867 |
+
opacity: 0.5;
|
868 |
+
font-size: 12px;
|
869 |
+
}
|
870 |
+
|
871 |
+
.bwg_thumbnail .bwg_search_input_container .search_placeholder_title {
|
872 |
+
width: calc(100% - 20px);
|
873 |
+
height: 29px;
|
874 |
+
text-align: center;
|
875 |
+
display: inline-block;
|
876 |
+
background: #ffffff;
|
877 |
+
position:absolute;
|
878 |
+
top:0.5px;
|
879 |
+
left:10px;
|
880 |
+
white-space: nowrap;
|
881 |
+
border-radius: 15px;
|
882 |
+
color:#4e4e4e;
|
883 |
+
text-transform: uppercase;
|
884 |
+
overflow: hidden;
|
885 |
+
}
|
886 |
+
|
887 |
+
.bwg_thumbnail .bwg_search_input_container .search_placeholder_title span {
|
888 |
+
line-height: 28px;
|
889 |
+
}
|
890 |
+
|
891 |
+
.bwg_thumbnail.bwg_container .search_line .bwg_search_loupe_container {
|
892 |
+
line-height: 29px;
|
893 |
+
display: inline-block;
|
894 |
+
top:0px;
|
895 |
+
margin-right: 10px;
|
896 |
+
vertical-align: middle;
|
897 |
+
float: none;
|
898 |
+
padding-top: 0px;
|
899 |
+
font-size: 12px;
|
900 |
+
font-family: Ubuntug;
|
901 |
+
}
|
902 |
+
|
903 |
+
.bwg_thumbnail.bwg_container .search_line .bwg_search_loupe_container1 {
|
904 |
+
/*
|
905 |
+
position: absolute;
|
906 |
+
*/
|
907 |
+
margin-left: 0pt;
|
908 |
+
float: left;
|
909 |
+
top: 0px;
|
910 |
+
line-height: 30px;
|
911 |
+
width: auto;
|
912 |
+
height: 30px;
|
913 |
+
margin-left: 10px;
|
914 |
+
}
|
915 |
+
|
916 |
+
.bwg_thumbnail.bwg_container .search_line .bwg_search_reset_container {
|
917 |
+
/*
|
918 |
+
position: absolute;
|
919 |
+
*/
|
920 |
+
right: 0px;
|
921 |
+
top: 0px;
|
922 |
+
line-height: 30px;
|
923 |
+
width: 11px;
|
924 |
+
height: 30px;
|
925 |
+
margin-right: 10px;
|
926 |
+
}
|
927 |
+
|
928 |
+
.bwg_thumbnail.bwg_container .search_line .bwg_search_container_1 {
|
929 |
+
float: right;
|
930 |
+
width: 30%;
|
931 |
+
}
|
932 |
+
|
933 |
+
.bwg_thumbnail.bwg_container .search_line .bwg_search_container_1 .bwg_search_container_2{
|
934 |
+
width: 100%!important;
|
935 |
+
float: right;
|
936 |
+
}
|
937 |
+
|
938 |
+
.bwg_thumbnail.bwg_container .search_line .SumoSelect .select-all {
|
939 |
+
padding: 0px 0 3px 35px!important;
|
940 |
+
height: 13px;
|
941 |
+
line-height: 13px;
|
942 |
+
margin-bottom: 15px!important;
|
943 |
+
}
|
944 |
+
|
945 |
+
.bwg_thumbnail.bwg_container .search_line .SumoSelect > .optWrapper > .options li.opt {
|
946 |
+
margin-bottom: 15px;
|
947 |
+
padding: 0px;
|
948 |
+
list-style: none;
|
949 |
+
color:#323A45;
|
950 |
+
font-size: 12px;
|
951 |
+
text-transform: uppercase;
|
952 |
+
font-family: Ubuntu;
|
953 |
+
line-height: 12px;
|
954 |
+
|
955 |
+
}
|
956 |
+
|
957 |
+
.bwg_thumbnail.bwg_container .search_line .SumoSelect > .optWrapper > .options li:first-child {
|
958 |
+
margin-top: 15px;
|
959 |
+
}
|
960 |
+
|
961 |
+
.bwg_thumbnail.bwg_container .search_line .SumoSelect > .optWrapper > .options li.opt label {
|
962 |
+
color:#323A45;
|
963 |
+
font-size: 12px;
|
964 |
+
text-transform: uppercase;
|
965 |
+
font-family: Ubuntu;
|
966 |
+
font-weight: normal;
|
967 |
+
margin-bottom: 0px;
|
968 |
+
}
|
969 |
+
|
970 |
+
|
971 |
+
.bwg_thumbnail.bwg_container .search_line .SumoSelect > .CaptionCont {
|
972 |
+
/*
|
973 |
+
display: table;
|
974 |
+
*/
|
975 |
+
height: inherit;
|
976 |
+
border: transparent;
|
977 |
+
background: inherit;
|
978 |
+
width: 100%;
|
979 |
+
cursor: pointer;
|
980 |
+
max-height: calc( 100% - 2px);
|
981 |
+
|
982 |
+
}
|
983 |
+
|
984 |
+
.bwg_thumbnail.bwg_container .search_line .SumoSelect > .CaptionCont > label {
|
985 |
+
margin: 0px;
|
986 |
+
line-height: 100%;
|
987 |
+
cursor: pointer;
|
988 |
+
width: 20px;
|
989 |
+
}
|
990 |
+
.bwg_thumbnail.bwg_container .search_line .SumoSelect > .CaptionCont > label > i {
|
991 |
+
line-height: 100%;
|
992 |
+
height: 100%;
|
993 |
+
}
|
994 |
+
.bwg_thumbnail.bwg_container .search_line .SumoSelect > .CaptionCont > label > i.closed:before {
|
995 |
+
content: "\f107";
|
996 |
+
color:#323A45;
|
997 |
+
font-size: 15px;
|
998 |
+
line-height: 30px;
|
999 |
+
}
|
1000 |
+
|
1001 |
+
.bwg_thumbnail.bwg_container .search_line .SumoSelect > .CaptionCont > label > i.opened:before {
|
1002 |
+
content: "\f106";
|
1003 |
+
color:#323A45;
|
1004 |
+
font-size: 15px;
|
1005 |
+
line-height: 30px;
|
1006 |
+
}
|
1007 |
+
|
1008 |
+
.bwg_thumbnail.bwg_container .search_line .bwg_reset {
|
1009 |
+
position: absolute;
|
1010 |
+
}
|
1011 |
+
|
1012 |
+
.bwg_thumbnail.bwg_container .search_line .no-match {
|
1013 |
+
font-family: Ubuntu;
|
1014 |
+
font-size: 12px;
|
1015 |
+
color:#323A45;
|
1016 |
+
padding: 5px 25px!important;
|
1017 |
+
text-align: center;
|
1018 |
+
}
|
1019 |
+
|
1020 |
+
.bwg_thumbnail.bwg_container .search_line .search-txt {
|
1021 |
+
border: transparent;
|
1022 |
+
background: transparent;
|
1023 |
+
padding: 4px 0px!important;
|
1024 |
+
height: 100%;
|
1025 |
+
}
|
1026 |
+
|
1027 |
+
.bwg_thumbnail.bwg_container .search_line .search-txt:focus {
|
1028 |
+
box-shadow: none;
|
1029 |
+
}
|
1030 |
+
|
1031 |
+
.bwg_thumbnail.bwg_container .search_line .bwg_order.SumoUnder {
|
1032 |
+
display: none;
|
1033 |
+
}
|
1034 |
+
|
1035 |
+
|
1036 |
+
.bwg_slideshow_image_container {
|
1037 |
+
position: absolute;
|
1038 |
+
}
|
1039 |
+
|
1040 |
+
.bwg_slideshow_image_container > div > div {
|
1041 |
+
display:table;
|
1042 |
+
margin:0 auto;
|
1043 |
+
}
|
1044 |
+
|
1045 |
+
.bwg_thumbnail #bwg_tag_container p {
|
1046 |
+
text-align: left;
|
1047 |
+
}
|
1048 |
+
|
1049 |
+
.bwg_thumbnail .bwg_search_container_2 {
|
1050 |
+
display: inline-block;
|
1051 |
+
position: relative;
|
1052 |
+
border-radius: 4px;
|
1053 |
+
background-color: #FFFFFF;
|
1054 |
+
max-width: 100%;
|
1055 |
+
box-shadow: none;
|
1056 |
+
border: .5px solid rgba(0,0,0,.15);
|
1057 |
+
border-radius: 15px;
|
1058 |
+
}
|
1059 |
+
|
1060 |
+
.bwg_thumbnail .bwg_order_cont {
|
1061 |
+
background-color: rgba(0,0,0,0);
|
1062 |
+
display: block;
|
1063 |
+
text-align: right;
|
1064 |
+
width: 100%;
|
1065 |
+
margin: 0 5px 20px 5px;
|
1066 |
+
}
|
1067 |
+
|
1068 |
+
.bwg_thumbnail div[id^="bwg_search_container_1_"] div[id^="bwg_search_container_2_"] .bwg_search_input_container {
|
1069 |
+
display: block;
|
1070 |
+
text-align: center;
|
1071 |
+
}
|
1072 |
+
.bwg_thumbnail div[id^="bwg_search_container_1_"] div[id^="bwg_search_container_2_"] .bwg_search_loupe_container {
|
1073 |
+
/*
|
1074 |
+
display: inline-block;
|
1075 |
+
margin-right: 1px;
|
1076 |
+
vertical-align: middle;
|
1077 |
+
float: right;
|
1078 |
+
padding-top: 3px;
|
1079 |
+
*/
|
1080 |
+
}
|
1081 |
+
div[id^="bwg_search_container_1_"] div[id^="bwg_search_container_2_"] .bwg_search_reset_container {
|
1082 |
+
/*
|
1083 |
+
margin-right: 5px;
|
1084 |
+
vertical-align: middle;
|
1085 |
+
float: right;
|
1086 |
+
*/
|
1087 |
+
}
|
1088 |
+
|
1089 |
+
.bwg_thumbnail .SumoSelect > .optWrapper > .options li.opt:hover {
|
1090 |
+
background-color: transparent;
|
1091 |
+
}
|
1092 |
+
|
1093 |
+
/* end Tags, Orders, Search */
|
1094 |
+
|
1095 |
+
/* start zoom effect */
|
1096 |
+
.bwg-zoom-effect .bwg-zoom-effect-overlay {
|
1097 |
+
position: absolute;
|
1098 |
+
top: 0;
|
1099 |
+
left: 0;
|
1100 |
+
width: 100%;
|
1101 |
+
height: 100%;
|
1102 |
+
overflow: hidden;
|
1103 |
+
filter: Alpha(opacity=0);
|
1104 |
+
opacity: 0;
|
1105 |
+
-webkit-transition: all .45s ease-in-out;
|
1106 |
+
transition: all .45s ease-in-out;
|
1107 |
+
}
|
1108 |
+
.bwg-zoom-effect:hover .bwg-zoom-effect-overlay {
|
1109 |
+
filter: Alpha(opacity=1);
|
1110 |
+
opacity: 1;
|
1111 |
+
}
|
1112 |
+
.bwg-zoom-effect img {
|
1113 |
+
-webkit-transition: all .3s;
|
1114 |
+
transition: all .3s;
|
1115 |
+
}
|
1116 |
+
.bwg-zoom-effect .bwg-title1 {
|
1117 |
+
-webkit-transition: all .3s ease-in-out;
|
1118 |
+
transition: all .3s ease-in-out;
|
1119 |
+
}
|
1120 |
+
/* end zoom effect */
|
1121 |
+
|
1122 |
+
.bwg_container div[id^="bwg_container2_"] img {
|
1123 |
+
height: initial;
|
1124 |
+
}
|
1125 |
+
|
1126 |
.bwg_container div[id^="bwg_container2_"] img {
|
1127 |
height: initial;
|
1128 |
}
|
css/bwg_tables.css
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
.ajax-msg,
|
2 |
-
.unsaved-msg
|
|
|
3 |
display: inline-block;
|
4 |
width: 100%;
|
5 |
}
|
@@ -475,12 +476,6 @@
|
|
475 |
width: 30px;
|
476 |
}
|
477 |
|
478 |
-
.updated,
|
479 |
-
.error,
|
480 |
-
.notice {
|
481 |
-
margin: 5px 0 2px !important;
|
482 |
-
}
|
483 |
-
|
484 |
.buttons_div {
|
485 |
clear: both;
|
486 |
float: right;
|
@@ -1426,6 +1421,7 @@ textarea.bwg_popup_input {
|
|
1426 |
height: 100%;
|
1427 |
position: relative;
|
1428 |
background-size: cover;
|
|
|
1429 |
}
|
1430 |
.bwg_tabs .tab_link {
|
1431 |
display: block !important;
|
@@ -1584,7 +1580,7 @@ textarea.bwg_popup_input {
|
|
1584 |
}
|
1585 |
|
1586 |
.col_drag {
|
1587 |
-
width:
|
1588 |
text-align: center !important;
|
1589 |
cursor: pointer;
|
1590 |
vertical-align: top;
|
@@ -1595,6 +1591,7 @@ textarea.bwg_popup_input {
|
|
1595 |
}
|
1596 |
|
1597 |
.wd-order {
|
|
|
1598 |
width: 100%;
|
1599 |
margin: 0 !important;
|
1600 |
text-align: right;
|
@@ -1664,6 +1661,11 @@ textarea.bwg_popup_input {
|
|
1664 |
margin-bottom: 10px;
|
1665 |
}
|
1666 |
|
|
|
|
|
|
|
|
|
|
|
1667 |
.bwg_albumsgalleries .tablenav .tablenav-pages a,
|
1668 |
.bwg_albumsgalleries .tablenav-pages-navspan,
|
1669 |
.bwg_tags .tablenav .tablenav-pages a,
|
@@ -1686,6 +1688,11 @@ textarea.bwg_popup_input {
|
|
1686 |
margin-bottom: 0px;
|
1687 |
}
|
1688 |
|
|
|
|
|
|
|
|
|
|
|
1689 |
.bwg_albumsgalleries p.search-box input,
|
1690 |
.bwg_tags p.search-box input {
|
1691 |
float: left;
|
@@ -2038,6 +2045,19 @@ li.tabs {
|
|
2038 |
display: flex;
|
2039 |
}
|
2040 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2041 |
/* Shortcode styles in options */
|
2042 |
|
2043 |
.pro_btn {
|
@@ -2054,4 +2074,4 @@ li.tabs {
|
|
2054 |
position: relative;
|
2055 |
top: 0;
|
2056 |
width: 20px;
|
2057 |
-
}
|
1 |
.ajax-msg,
|
2 |
+
.unsaved-msg,
|
3 |
+
.sorting-msg {
|
4 |
display: inline-block;
|
5 |
width: 100%;
|
6 |
}
|
476 |
width: 30px;
|
477 |
}
|
478 |
|
|
|
|
|
|
|
|
|
|
|
|
|
479 |
.buttons_div {
|
480 |
clear: both;
|
481 |
float: right;
|
1421 |
height: 100%;
|
1422 |
position: relative;
|
1423 |
background-size: cover;
|
1424 |
+
background-position: center;
|
1425 |
}
|
1426 |
.bwg_tabs .tab_link {
|
1427 |
display: block !important;
|
1580 |
}
|
1581 |
|
1582 |
.col_drag {
|
1583 |
+
width: 90px !important;
|
1584 |
text-align: center !important;
|
1585 |
cursor: pointer;
|
1586 |
vertical-align: top;
|
1591 |
}
|
1592 |
|
1593 |
.wd-order {
|
1594 |
+
max-width: 45px;
|
1595 |
width: 100%;
|
1596 |
margin: 0 !important;
|
1597 |
text-align: right;
|
1661 |
margin-bottom: 10px;
|
1662 |
}
|
1663 |
|
1664 |
+
.search-box select {
|
1665 |
+
margin: 0 10px;
|
1666 |
+
float: left;
|
1667 |
+
}
|
1668 |
+
|
1669 |
.bwg_albumsgalleries .tablenav .tablenav-pages a,
|
1670 |
.bwg_albumsgalleries .tablenav-pages-navspan,
|
1671 |
.bwg_tags .tablenav .tablenav-pages a,
|
1688 |
margin-bottom: 0px;
|
1689 |
}
|
1690 |
|
1691 |
+
.search-box select {
|
1692 |
+
margin: 5px 0;
|
1693 |
+
width: 100%;
|
1694 |
+
}
|
1695 |
+
|
1696 |
.bwg_albumsgalleries p.search-box input,
|
1697 |
.bwg_tags p.search-box input {
|
1698 |
float: left;
|
2045 |
display: flex;
|
2046 |
}
|
2047 |
}
|
2048 |
+
#bwg_options_form .gallery_type_radio,
|
2049 |
+
#bwg_options_form .album_type_radio {
|
2050 |
+
display: none !important;
|
2051 |
+
}
|
2052 |
+
#bwg_options_form .gallery_type_label,
|
2053 |
+
#bwg_options_form .album_type_label {
|
2054 |
+
text-align: center;
|
2055 |
+
}
|
2056 |
+
#bwg_options_form .gallery_type.gallery_type_active .gallery_type_div,
|
2057 |
+
#bwg_options_form .gallery_type.gallery_type_active .album_type_div {
|
2058 |
+
background: #0073aa;
|
2059 |
+
color: #ffffff;
|
2060 |
+
}
|
2061 |
/* Shortcode styles in options */
|
2062 |
|
2063 |
.pro_btn {
|
2074 |
position: relative;
|
2075 |
top: 0;
|
2076 |
width: 20px;
|
2077 |
+
}
|
css/sumoselect.css
CHANGED
@@ -9,93 +9,138 @@
|
|
9 |
.SumoSelect .hidden { display:none; }
|
10 |
.SumoSelect .search-txt{display:none;outline:none;}
|
11 |
.SumoSelect .no-match{display:none;padding: 6px;}
|
12 |
-
.SumoSelect.open .search-txt{display: inline-block;position: absolute;top: 0;left: 0;width: 100%;margin: 0;padding:
|
13 |
.SumoSelect.open>.search>span, .SumoSelect.open>.search>label{visibility:hidden;}
|
14 |
|
15 |
/*this is applied on that hidden select. DO NOT USE display:none; or visiblity:hidden; and Do not override any of these properties. */
|
16 |
-
.SelectClass,.SumoUnder { position: absolute; top: 0; left: 0; right: 0; height: 100%; width: 100%; border: none; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter: alpha(opacity=0); -moz-opacity: 0; -khtml-opacity: 0; opacity: 0; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
.SelectClass{z-index: 1;}
|
18 |
|
19 |
-
|
20 |
|
21 |
.SumoSelect { display: inline-block; position: relative;outline:none;}
|
22 |
.SumoSelect:focus > .CaptionCont,.SumoSelect:hover > .CaptionCont, .SumoSelect.open > .CaptionCont {box-shadow: 0 0 2px #7799D0;border-color: #7799D0;}
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
.SumoSelect > .optWrapper > .MultiControls { display: none; border-top: 1px solid #ddd; background-color: #fff; box-shadow: 0 0 2px rgba(0, 0, 0, 0.13); border-radius: 0 0 3px 3px; }
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
|
9 |
.SumoSelect .hidden { display:none; }
|
10 |
.SumoSelect .search-txt{display:none;outline:none;}
|
11 |
.SumoSelect .no-match{display:none;padding: 6px;}
|
12 |
+
.SumoSelect.open .search-txt{display: inline-block;position: absolute;top: 0;left: 0;width: 100%;margin: 0;padding: 4px 8px;border: none;-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;border-radius: 5px;}
|
13 |
.SumoSelect.open>.search>span, .SumoSelect.open>.search>label{visibility:hidden;}
|
14 |
|
15 |
/*this is applied on that hidden select. DO NOT USE display:none; or visiblity:hidden; and Do not override any of these properties. */
|
16 |
+
.bwg_thumbnail .SelectClass,.bwg_thumbnail .SumoUnder { position: absolute; top: 0; left: 0; right: 0; height: 100%; width: 100%; border: none; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter: alpha(opacity=0); -moz-opacity: 0; -khtml-opacity: 0; opacity: 0; }
|
17 |
+
.SelectClass, .SumoUnder {
|
18 |
+
display: inline-block;
|
19 |
+
position: absolute;
|
20 |
+
top: 0;
|
21 |
+
left: 0;
|
22 |
+
right: 0;
|
23 |
+
height: 100%;
|
24 |
+
width: 102%;
|
25 |
+
border: none;
|
26 |
+
-webkit-box-sizing: border-box;
|
27 |
+
-moz-box-sizing: border-box;
|
28 |
+
box-sizing: border-box;
|
29 |
+
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
30 |
+
filter: alpha(opacity=0);
|
31 |
+
-moz-opacity: 0;
|
32 |
+
-khtml-opacity: 0;
|
33 |
+
opacity: 0;
|
34 |
+
}
|
35 |
.SelectClass{z-index: 1;}
|
36 |
|
37 |
+
.SumoSelect > .optWrapper > .options li.opt label, .SumoSelect > .CaptionCont,.SumoSelect .select-all > label { user-select: none; -o-user-select: none; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; }
|
38 |
|
39 |
.SumoSelect { display: inline-block; position: relative;outline:none;}
|
40 |
.SumoSelect:focus > .CaptionCont,.SumoSelect:hover > .CaptionCont, .SumoSelect.open > .CaptionCont {box-shadow: 0 0 2px #7799D0;border-color: #7799D0;}
|
41 |
+
.SumoSelect > .CaptionCont { position: relative; border: 1px solid #A4A4A4; min-height: 14px; background-color: #fff;border-radius:2px;margin:0; }
|
42 |
+
.SumoSelect > .CaptionCont > span { display: block; padding-right: 0px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;cursor:default;}
|
43 |
+
/*placeholder style*/
|
44 |
+
.SumoSelect > .CaptionCont > span.placeholder { color: #000000; }
|
45 |
+
|
46 |
+
.SumoSelect > .CaptionCont > label { position: absolute; top: 0; right: 0; bottom: 0; width: 30px;}
|
47 |
+
|
48 |
+
.SumoSelect > .CaptionCont > label { position: absolute; top: 0; right: 0; bottom: 0; width: 30px;}
|
49 |
+
.bwg_thumbnail .SumoSelect > .CaptionCont > label > i {
|
50 |
+
background-image: none;
|
51 |
+
background-position: center center;
|
52 |
+
width: 16px;
|
53 |
+
height: 16px;
|
54 |
+
display: block;
|
55 |
+
position: absolute;
|
56 |
+
top: 0;
|
57 |
+
left: 0;
|
58 |
+
right: 0;
|
59 |
+
bottom: 0;
|
60 |
+
margin: auto;
|
61 |
+
background-repeat: no-repeat;
|
62 |
+
opacity: 0.8;
|
63 |
+
}
|
64 |
+
|
65 |
+
|
66 |
+
.bwg_thumbnail .SumoSelect > .CaptionCont > label > i {
|
67 |
+
background-position: center center; width: 16px; height: 16px; display: block; position: absolute; top: 0; left: 0; right: 0; margin: auto;background-repeat: no-repeat;opacity: 0.8;}
|
68 |
+
|
69 |
+
.SumoSelect > .optWrapper {display:none; z-index: 1000; top: 30px; width: 100%; position: absolute; left: 0; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; background: #fff; border: 1px solid #ddd; box-shadow: 2px 3px 3px rgba(0, 0, 0, 0.11); border-radius: 15px;overflow: hidden;}
|
70 |
+
.SumoSelect.open > .optWrapper {top:35px; display:block;}
|
71 |
+
.SumoSelect.open > .optWrapper.up {top: auto;bottom: 100%;margin-bottom: 5px;}
|
72 |
+
|
73 |
+
.SumoSelect > .optWrapper ul {list-style: none; display: block; padding: 0; margin: 0; overflow: auto;}
|
74 |
+
.SumoSelect > .optWrapper > .options { border-radius: 2px;position:relative;
|
75 |
+
/*Set the height of pop up here (only for desktop mode)*/
|
76 |
+
max-height: 250px;
|
77 |
+
/*height*/ }
|
78 |
+
.SumoSelect > .optWrapper > .options li.group.disabled > label{opacity:0.5;}
|
79 |
+
.SumoSelect > .optWrapper > .options li ul li.opt{padding-left: 22px;}
|
80 |
+
.SumoSelect > .optWrapper.multiple > .options li ul li.opt{padding-left: 50px;}
|
81 |
+
.SumoSelect > .optWrapper.isFloating > .options {max-height: 100%;box-shadow: 0 0 100px #595959;}
|
82 |
+
.SumoSelect > .optWrapper > .options li.opt { padding: 6px 6px; position: relative;}
|
83 |
+
.SumoSelect > .optWrapper > .options > li.opt:first-child { border-radius: 2px 2px 0 0; }
|
84 |
+
.SumoSelect > .optWrapper > .options > li.opt:last-child {border-radius: 0 0 2px 2px; border-bottom: none;}
|
85 |
+
.bwg_thumbnail .SumoSelect > .optWrapper > .options li.opt > label:hover { color: #323A45; opacity: 0.7; }
|
86 |
+
.SumoSelect > .optWrapper > .options li.opt:hover { background-color: #E4E4E4; }
|
87 |
+
.SumoSelect > .optWrapper > .options li.opt.sel{background-color: #a1c0e4; border-bottom: 1px solid #a1c0e4;}
|
88 |
+
|
89 |
+
.SumoSelect > .optWrapper > .options li label { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; display: block;cursor: pointer;}
|
90 |
+
.SumoSelect > .optWrapper > .options li span { display: none; }
|
91 |
+
.SumoSelect > .optWrapper > .options li.group > label {cursor: default;padding: 8px 6px;font-weight: bold;}
|
92 |
+
|
93 |
+
/*Floating styles*/
|
94 |
+
.SumoSelect > .optWrapper.isFloating { position: fixed; top: 0; left: 0; right: 0; width: 90%; bottom: 0; margin: auto; max-height: 90%; }
|
95 |
+
|
96 |
+
/*disabled state*/
|
97 |
+
.SumoSelect > .optWrapper > .options li.opt.disabled { background-color: inherit;pointer-events: none;}
|
98 |
+
.SumoSelect > .optWrapper > .options li.opt.disabled * { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; /* IE 5-7 */ filter: alpha(opacity=50); /* Netscape */ -moz-opacity: 0.5; /* Safari 1.x */ -khtml-opacity: 0.5; /* Good browsers */ opacity: 0.5; }
|
99 |
+
|
100 |
+
|
101 |
+
/*styling for multiple select*/
|
102 |
+
.SumoSelect > .optWrapper.multiple > .options li.opt { padding-left: 35px;cursor: pointer;}
|
103 |
+
.SumoSelect > .optWrapper.multiple > .options li.opt span,
|
104 |
+
.SumoSelect .select-all > span{position:absolute;display:block;width:30px;top:0;bottom:0;margin-left:-35px;}
|
105 |
+
.SumoSelect > .optWrapper.multiple > .options li.opt span i,
|
106 |
+
.SumoSelect .select-all > span i{position: absolute;margin: auto;left: 0;right: 0;top: 0;bottom: 0;width: 14px;height: 14px;border: 1px solid #AEAEAE;border-radius: 2px;box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);background-color: #fff;}
|
107 |
.SumoSelect > .optWrapper > .MultiControls { display: none; border-top: 1px solid #ddd; background-color: #fff; box-shadow: 0 0 2px rgba(0, 0, 0, 0.13); border-radius: 0 0 3px 3px; }
|
108 |
+
.SumoSelect > .optWrapper.multiple.isFloating > .MultiControls { display: block; margin-top: 5px; position: absolute; bottom: 0; width: 100%; }
|
109 |
+
|
110 |
+
.SumoSelect > .optWrapper.multiple.okCancelInMulti > .MultiControls { display: block; }
|
111 |
+
.SumoSelect > .optWrapper.multiple.okCancelInMulti > .MultiControls > p { padding: 6px; }
|
112 |
+
|
113 |
+
.SumoSelect > .optWrapper.multiple > .MultiControls > p { display: inline-block; cursor: pointer; padding: 12px; width: 50%; box-sizing: border-box; text-align: center; }
|
114 |
+
.SumoSelect > .optWrapper.multiple > .MultiControls > p:hover { background-color: #f1f1f1; }
|
115 |
+
.SumoSelect > .optWrapper.multiple > .MultiControls > p.btnOk { border-right: 1px solid #DBDBDB; border-radius: 0 0 0 3px; }
|
116 |
+
.SumoSelect > .optWrapper.multiple > .MultiControls > p.btnCancel { border-radius: 0 0 3px 0; }
|
117 |
+
/*styling for select on popup mode*/
|
118 |
+
.bwg_thumbnail .SumoSelect > .optWrapper.isFloating > .options li.opt { padding: 0px; }
|
119 |
+
.SumoSelect > .optWrapper.isFloating > .options li.opt { padding: 12px 6px; }
|
120 |
+
|
121 |
+
/*styling for only multiple select on popup mode*/
|
122 |
+
.SumoSelect > .optWrapper.multiple.isFloating > .options li.opt { padding-left: 35px; }
|
123 |
+
.SumoSelect > .optWrapper.multiple.isFloating { padding-bottom: 43px; }
|
124 |
+
|
125 |
+
.SumoSelect > .optWrapper.multiple > .options li.opt.selected span i,
|
126 |
+
.SumoSelect .select-all.selected > span i,
|
127 |
+
.SumoSelect .select-all.partial > span i{background-color: rgb(17, 169, 17);box-shadow: none;
|
128 |
+
/*
|
129 |
+
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAGCAYAAAD+Bd/7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNXG14zYAAABMSURBVAiZfc0xDkAAFIPhd2Kr1WRjcAExuIgzGUTIZ/AkImjSofnbNBAfHvzAHjOKNzhiQ42IDFXCDivaaxAJd0xYshT3QqBxqnxeHvhunpu23xnmAAAAAElFTkSuQmCC');
|
130 |
+
*/
|
131 |
+
background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAACzSURBVChTY/wPBAwkACYS1IKVEqWhfflFBsvczWANjISc1L/mEkP5wjsMv3/+ZVhTZcDAANKAC/StvvSf1WctGIPYYMNBhEXOpv9tyy6g6OtbfRFJ8UW4HMOa/bf+M7iugpoCkcClGCQH9kP/mstAd95mYGdlYvAyEmDYdu4Dw8/f/xg641UZCkN0UQMSZhfMVKnozSi2ofsPxdMgTQx2y8BOwgUwQunYpSf4Ag7iB1JiGwAouCBFqHEGogAAAABJRU5ErkJggg==');
|
132 |
+
background-repeat: no-repeat;
|
133 |
+
background-position: center center;}
|
134 |
+
/*disabled state*/
|
135 |
+
.SumoSelect.disabled { opacity: 0.7;cursor: not-allowed;}
|
136 |
+
.SumoSelect.disabled > .CaptionCont{border-color:#ccc;box-shadow:none;}
|
137 |
+
|
138 |
+
/**Select all button**/
|
139 |
+
.SumoSelect .select-all{border-radius: 3px 3px 0 0;position: relative;border-bottom: 1px solid #ddd;background-color: #fff;padding: 8px 0 3px 35px;height: 20px;cursor: pointer;}
|
140 |
+
.SumoSelect .select-all > label, .SumoSelect .select-all > span i{cursor: pointer;}
|
141 |
+
.SumoSelect .select-all.partial > span i{background-color:#ccc;}
|
142 |
+
|
143 |
+
|
144 |
+
/*styling for optgroups*/
|
145 |
+
.SumoSelect > .optWrapper > .options li.optGroup { padding-left: 5px; text-decoration: underline; }
|
146 |
|
filemanager/UploadHandler.php
CHANGED
@@ -299,35 +299,7 @@ class bwg_UploadHandler {
|
|
299 |
} else {
|
300 |
$new_file_path = $file_path;
|
301 |
}
|
302 |
-
$
|
303 |
-
$success = false;
|
304 |
-
if ( ! is_wp_error( $image ) ) {
|
305 |
-
$image_size = $image->get_size();
|
306 |
-
$img_width = $image_size['width'];
|
307 |
-
$img_height = $image_size['height'];
|
308 |
-
if (!$img_width || !$img_height) {
|
309 |
-
return false;
|
310 |
-
}
|
311 |
-
$max_width = $options['max_width'];
|
312 |
-
$max_height = $options['max_height'];
|
313 |
-
$scale = min(
|
314 |
-
$max_width / $img_width,
|
315 |
-
$max_height / $img_height
|
316 |
-
);
|
317 |
-
if (($scale >= 1) || (($max_width == NULL) && ($max_height == NULL))) {
|
318 |
-
if ($file_path !== $new_file_path) {
|
319 |
-
return copy($file_path, $new_file_path);
|
320 |
-
}
|
321 |
-
return true;
|
322 |
-
}
|
323 |
-
|
324 |
-
$new_width = $img_width * $scale;
|
325 |
-
$new_height = $img_height * $scale;
|
326 |
-
$image->set_quality(BWG()->options->image_quality);
|
327 |
-
$image->resize($new_width, $new_height, false);
|
328 |
-
$success = $image->save($new_file_path);
|
329 |
-
$success = !is_wp_error($success);
|
330 |
-
}
|
331 |
|
332 |
return $success;
|
333 |
}
|
@@ -557,7 +529,7 @@ class bwg_UploadHandler {
|
|
557 |
if ($allow_extract) {
|
558 |
$target_dir = substr($file_path, 0, strlen($file_path) - 4);
|
559 |
if (!is_dir($target_dir)) {
|
560 |
-
mkdir($target_dir,
|
561 |
}
|
562 |
$zip->extractTo($target_dir);
|
563 |
}
|
@@ -620,54 +592,57 @@ class bwg_UploadHandler {
|
|
620 |
|
621 |
$file_type_array = explode('.', $name);
|
622 |
$type = strtolower(end($file_type_array));
|
623 |
-
|
624 |
$file = new stdClass();
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
// Media library Upload.
|
637 |
-
$this->create_scaled_image($file->name, 'main', $this->options);
|
638 |
-
}
|
639 |
-
list($img_width) = @getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));
|
640 |
-
if ( is_int($img_width) ) {
|
641 |
-
$this->handle_image_file($file_path, $file);
|
642 |
-
}
|
643 |
-
$this->set_file_delete_properties($file);
|
644 |
-
|
645 |
-
// Additional information.
|
646 |
-
|
647 |
-
$file->filetype = $type;
|
648 |
-
$file->filename = str_replace('.' . $file->filetype, '', $file->name);
|
649 |
-
$file->alt = $file->filename;
|
650 |
-
$file->reliative_url = $this->options['upload_url'] . '/' . $this->options['media_library_folder'] . $file->name;
|
651 |
-
$file->url = '/' . $this->options['media_library_folder'] . '/' . $file->name;
|
652 |
-
$file->thumb = $this->options['upload_url'] . '/' . $this->options['media_library_folder'] . '/thumb/' . $file->name;
|
653 |
-
$file->thumb_url = '/' . $this->options['media_library_folder'] . '/thumb/' . $file->name;
|
654 |
-
|
655 |
-
$file_size_kb = (int)(filesize($file_path) / 1024);
|
656 |
-
$file->size = $file_size_kb . ' KB';
|
657 |
-
$file->date_modified = date('d F Y, H:i', filemtime($file_path));
|
658 |
-
$image_info = getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));
|
659 |
-
$file->resolution = $image_info[0] . ' x ' . $image_info[1] . ' px';
|
660 |
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
$
|
666 |
-
$
|
667 |
-
|
668 |
-
|
669 |
-
$
|
670 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
671 |
}
|
672 |
|
673 |
return $file;
|
299 |
} else {
|
300 |
$new_file_path = $file_path;
|
301 |
}
|
302 |
+
$success = WDWLibrary::resize_image($file_path, $new_file_path, $options['max_width'], $options['max_height']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
303 |
|
304 |
return $success;
|
305 |
}
|
529 |
if ($allow_extract) {
|
530 |
$target_dir = substr($file_path, 0, strlen($file_path) - 4);
|
531 |
if (!is_dir($target_dir)) {
|
532 |
+
mkdir($target_dir, 0755);
|
533 |
}
|
534 |
$zip->extractTo($target_dir);
|
535 |
}
|
592 |
|
593 |
$file_type_array = explode('.', $name);
|
594 |
$type = strtolower(end($file_type_array));
|
|
|
595 |
$file = new stdClass();
|
596 |
+
if ( WDWLibrary::allowed_upload_types($type) ) {
|
597 |
+
$file->error = false;
|
598 |
+
$file->name = $this->get_file_name($name, $type, 0, "");
|
599 |
+
$file->type = $type;
|
600 |
+
$this->handle_form_data($file, 0);
|
601 |
+
$upload_dir = $this->get_upload_path();
|
602 |
+
if ( !is_dir($upload_dir) ) {
|
603 |
+
mkdir($upload_dir, $this->options['mkdir_mode'], true);
|
604 |
+
}
|
605 |
+
$file_path = $this->get_upload_path($file->name);
|
606 |
+
copy($basedir . '/' . $uploaded_file, $file_path);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
607 |
|
608 |
+
if ( $this->options['max_width'] && $this->options['max_height'] ) {
|
609 |
+
// Media library Upload.
|
610 |
+
$this->create_scaled_image($file->name, 'main', $this->options);
|
611 |
+
}
|
612 |
+
list($img_width) = @getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));
|
613 |
+
if ( is_int($img_width) ) {
|
614 |
+
$this->handle_image_file($file_path, $file);
|
615 |
+
}
|
616 |
+
$this->set_file_delete_properties($file);
|
617 |
+
|
618 |
+
// Additional information.
|
619 |
+
$file->filetype = $type;
|
620 |
+
$file->filename = str_replace('.' . $file->filetype, '', $file->name);
|
621 |
+
$file->alt = $file->filename;
|
622 |
+
$file->reliative_url = $this->options['upload_url'] . '/' . $this->options['media_library_folder'] . $file->name;
|
623 |
+
$file->url = '/' . $this->options['media_library_folder'] . '/' . $file->name;
|
624 |
+
$file->thumb = $this->options['upload_url'] . '/' . $this->options['media_library_folder'] . '/thumb/' . $file->name;
|
625 |
+
$file->thumb_url = '/' . $this->options['media_library_folder'] . '/thumb/' . $file->name;
|
626 |
+
|
627 |
+
$file_size_kb = (int)(filesize($file_path) / 1024);
|
628 |
+
$file->size = $file_size_kb . ' KB';
|
629 |
+
$file->date_modified = date('d F Y, H:i', filemtime($file_path));
|
630 |
+
$image_info = getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));
|
631 |
+
$file->resolution = $image_info[0] . ' x ' . $image_info[1] . ' px';
|
632 |
+
|
633 |
+
if ( BWG()->options->read_metadata ) {
|
634 |
+
$exif = WDWLibrary::read_image_metadata($upload_dir . '.original/' . $file->name);
|
635 |
+
$file->credit = $exif['credit'];
|
636 |
+
$file->aperture = $exif['aperture'];
|
637 |
+
$file->camera = $exif['camera'];
|
638 |
+
$file->caption = $exif['caption'];
|
639 |
+
$file->iso = $exif['iso'];
|
640 |
+
$file->orientation = $exif['orientation'];
|
641 |
+
$file->copyright = $exif['copyright'];
|
642 |
+
}
|
643 |
+
}
|
644 |
+
else {
|
645 |
+
$file->error = true;
|
646 |
}
|
647 |
|
648 |
return $file;
|
filemanager/controller.php
CHANGED
@@ -10,12 +10,8 @@ class FilemanagerController {
|
|
10 |
public $uploads_url;
|
11 |
|
12 |
public function __construct() {
|
13 |
-
|
14 |
-
$this->
|
15 |
-
if (file_exists($this->uploads_dir) == FALSE) {
|
16 |
-
mkdir($this->uploads_dir);
|
17 |
-
}
|
18 |
-
$this->uploads_url = ((BWG()->options->images_directory . '/photo-gallery') ? site_url() . '/' . BWG()->options->images_directory . '/photo-gallery' : BWG()->plugin_url . '/filemanager/uploads');
|
19 |
}
|
20 |
|
21 |
public function execute() {
|
@@ -247,12 +243,12 @@ class FilemanagerController {
|
|
247 |
$dest = $dest_dir . '/' . $file_name;
|
248 |
if (!is_dir($src_dir . '/' . $file_name)) {
|
249 |
if (!is_dir($dest_dir . '/thumb')) {
|
250 |
-
mkdir($dest_dir . '/thumb',
|
251 |
}
|
252 |
$thumb_src = $src_dir . '/thumb/' . $file_name;
|
253 |
$thumb_dest = $dest_dir . '/thumb/' . $file_name;
|
254 |
if (!is_dir($dest_dir . '/.original')) {
|
255 |
-
mkdir($dest_dir . '/.original',
|
256 |
}
|
257 |
$original_src = $src_dir . '/.original/' . $file_name;
|
258 |
$original_dest = $dest_dir . '/.original/' . $file_name;
|
@@ -307,12 +303,12 @@ class FilemanagerController {
|
|
307 |
$thumb_src = $src_dir . '/thumb/' . $file_name;
|
308 |
$thumb_dest = $dest_dir . '/thumb/' . $file_name;
|
309 |
if ( !is_dir($dest_dir . '/thumb') ) {
|
310 |
-
mkdir($dest_dir . '/thumb',
|
311 |
}
|
312 |
$original_src = $src_dir . '/.original/' . $file_name;
|
313 |
$original_dest = $dest_dir . '/.original/' . $file_name;
|
314 |
if ( !is_dir($dest_dir . '/.original') ) {
|
315 |
-
mkdir($dest_dir . '/.original',
|
316 |
}
|
317 |
rename($thumb_src, $thumb_dest);
|
318 |
rename($original_src, $original_dest);
|
10 |
public $uploads_url;
|
11 |
|
12 |
public function __construct() {
|
13 |
+
$this->uploads_dir = BWG()->upload_dir;
|
14 |
+
$this->uploads_url = BWG()->upload_url;
|
|
|
|
|
|
|
|
|
15 |
}
|
16 |
|
17 |
public function execute() {
|
243 |
$dest = $dest_dir . '/' . $file_name;
|
244 |
if (!is_dir($src_dir . '/' . $file_name)) {
|
245 |
if (!is_dir($dest_dir . '/thumb')) {
|
246 |
+
mkdir($dest_dir . '/thumb', 0755);
|
247 |
}
|
248 |
$thumb_src = $src_dir . '/thumb/' . $file_name;
|
249 |
$thumb_dest = $dest_dir . '/thumb/' . $file_name;
|
250 |
if (!is_dir($dest_dir . '/.original')) {
|
251 |
+
mkdir($dest_dir . '/.original', 0755);
|
252 |
}
|
253 |
$original_src = $src_dir . '/.original/' . $file_name;
|
254 |
$original_dest = $dest_dir . '/.original/' . $file_name;
|
303 |
$thumb_src = $src_dir . '/thumb/' . $file_name;
|
304 |
$thumb_dest = $dest_dir . '/thumb/' . $file_name;
|
305 |
if ( !is_dir($dest_dir . '/thumb') ) {
|
306 |
+
mkdir($dest_dir . '/thumb', 0755);
|
307 |
}
|
308 |
$original_src = $src_dir . '/.original/' . $file_name;
|
309 |
$original_dest = $dest_dir . '/.original/' . $file_name;
|
310 |
if ( !is_dir($dest_dir . '/.original') ) {
|
311 |
+
mkdir($dest_dir . '/.original', 0755);
|
312 |
}
|
313 |
rename($thumb_src, $thumb_dest);
|
314 |
rename($original_src, $original_dest);
|
filemanager/js/default.js
CHANGED
@@ -5,7 +5,6 @@
|
|
5 |
*/
|
6 |
|
7 |
var keyFileSelected;
|
8 |
-
var keyFileSelectedML;
|
9 |
var filesSelected;
|
10 |
var dragFiles;
|
11 |
var isUploading;
|
@@ -14,22 +13,24 @@ var ajax = true;
|
|
14 |
|
15 |
var all_files_selected = false;
|
16 |
var no_selected_files = [];
|
|
|
17 |
|
18 |
jQuery(document).ready(function () {
|
19 |
-
|
20 |
-
var
|
|
|
|
|
21 |
jQuery("#explorer_body_container").scroll(function () {
|
22 |
var explorer_item_count = jQuery("#explorer_body .explorer_item").length;
|
23 |
-
if (ajax && explorer_item_count <
|
24 |
-
var scroll = jQuery(this).scrollTop();
|
25 |
var scroll_position = jQuery(this).scrollTop() + jQuery(this).innerHeight();
|
26 |
var scroll_Height = jQuery(this)[0].scrollHeight;
|
27 |
-
if (scroll_position >= scroll_Height) {
|
28 |
-
var start_count = (
|
29 |
-
var end_count =
|
30 |
-
var next_files =
|
31 |
ajax_print_images(next_files, jQuery("#explorer_body"), 'explorer_item', start_count);
|
32 |
-
|
33 |
}
|
34 |
}
|
35 |
});
|
@@ -64,19 +65,25 @@ jQuery(document).ready(function () {
|
|
64 |
onKeyDown(e);
|
65 |
});
|
66 |
jQuery("#search_by_name .search_by_name").on("input keyup", function() {
|
|
|
67 |
var search_by_name = jQuery(this).val().toLowerCase();
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
|
|
72 |
if (filename.indexOf(search_by_name) != -1) {
|
73 |
-
|
74 |
}
|
75 |
-
}
|
76 |
}
|
77 |
else {
|
78 |
-
|
79 |
}
|
|
|
|
|
|
|
|
|
80 |
});
|
81 |
});
|
82 |
// TODO. remove this not used
|
@@ -91,10 +98,10 @@ function getClipboardFiles() {
|
|
91 |
function submit(task, sortBy, sortOrder, itemsView, destDir, fileNewName, newDirName, clipboardTask, clipboardFiles, clipboardSrc, clipboardDest) {
|
92 |
var names_array = [];
|
93 |
if (all_files_selected === true) {
|
94 |
-
for (i in
|
95 |
-
var index = no_selected_files.indexOf(
|
96 |
if (index < 0) {
|
97 |
-
var all_names =
|
98 |
names_array.push(all_names);
|
99 |
}
|
100 |
}
|
@@ -196,29 +203,29 @@ function submitFiles() {
|
|
196 |
|
197 |
var filesValid = [];
|
198 |
if (all_files_selected === true) {
|
199 |
-
for (i in
|
200 |
var fileData = [];
|
201 |
-
if (
|
202 |
-
var index = no_selected_files.indexOf(
|
203 |
if (index < 0) {
|
204 |
-
fileData['name'] =
|
205 |
-
fileData['filename'] =
|
206 |
-
fileData['alt'] =
|
207 |
-
fileData['url'] = dir + "/" +
|
208 |
-
fileData['reliative_url'] = dirUrl + "/" +
|
209 |
-
fileData['thumb_url'] = dir + "/thumb/" +
|
210 |
-
fileData['thumb'] =
|
211 |
-
fileData['size'] =
|
212 |
-
fileData['filetype'] =
|
213 |
-
fileData['date_modified'] =
|
214 |
-
fileData['resolution'] =
|
215 |
-
fileData['aperture'] =
|
216 |
-
fileData['credit'] =
|
217 |
-
fileData['camera'] =
|
218 |
-
fileData['caption'] =
|
219 |
-
fileData['iso'] =
|
220 |
-
fileData['orientation'] =
|
221 |
-
fileData['copyright'] =
|
222 |
filesValid.push(fileData);
|
223 |
}
|
224 |
}
|
@@ -308,9 +315,21 @@ function onBtnMakeDirClick(event, obj) {
|
|
308 |
|
309 |
function onBtnRenameItemClick(event, obj) {
|
310 |
if (filesSelected.length != 0) {
|
311 |
-
var
|
|
|
312 |
if ((newName != null) && (newName != "")) {
|
313 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
314 |
}
|
315 |
}
|
316 |
}
|
@@ -320,10 +339,10 @@ function onBtnCopyClick(event, obj) {
|
|
320 |
var names_list = filesSelected.join("**#**");
|
321 |
var names_array = [];
|
322 |
if (all_files_selected === true) {
|
323 |
-
for (i in
|
324 |
-
var index = no_selected_files.indexOf(
|
325 |
if (index < 0) {
|
326 |
-
var all_names =
|
327 |
names_array.push(all_names);
|
328 |
}
|
329 |
}
|
@@ -339,14 +358,14 @@ function onBtnCutClick(event, obj) {
|
|
339 |
var names_list = filesSelected.join("**#**");
|
340 |
var names_array = [];
|
341 |
if (all_files_selected === true) {
|
342 |
-
for (i in
|
343 |
-
var index = no_selected_files.indexOf(
|
344 |
if (index < 0) {
|
345 |
-
var all_names =
|
346 |
names_array.push(all_names);
|
347 |
}
|
348 |
}
|
349 |
-
names_list =
|
350 |
}
|
351 |
submit("", null, null, null, null, null, null, "cut", names_list, dir, null);
|
352 |
}
|
@@ -354,12 +373,32 @@ function onBtnCutClick(event, obj) {
|
|
354 |
|
355 |
function onBtnPasteClick(event, obj) {
|
356 |
if (getClipboardFiles() != "") {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
357 |
submit("paste_items", null, null, null, null, null, null, null, null, null, dir);
|
358 |
}
|
359 |
}
|
360 |
|
361 |
function onBtnRemoveItemsClick(event, obj) {
|
362 |
if ((filesSelected.length != 0) && (confirm(warningRemoveItems) == true)) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
363 |
submit("remove_items", null, null, null, null, null, null, null, null, null, null);
|
364 |
}
|
365 |
}
|
@@ -582,7 +621,7 @@ function onBtnSelectAllClick() {
|
|
582 |
}
|
583 |
|
584 |
function ajax_print_images(files, element, view_type, count) {
|
585 |
-
for (i in files) {
|
586 |
var corent_file = files[i];
|
587 |
var name = corent_file["name"];
|
588 |
var filename = corent_file["filename"];
|
5 |
*/
|
6 |
|
7 |
var keyFileSelected;
|
|
|
8 |
var filesSelected;
|
9 |
var dragFiles;
|
10 |
var isUploading;
|
13 |
|
14 |
var all_files_selected = false;
|
15 |
var no_selected_files = [];
|
16 |
+
var wdb_all_files_filtered = [];
|
17 |
|
18 |
jQuery(document).ready(function () {
|
19 |
+
wdb_all_files_filtered = wdb_all_files;
|
20 |
+
var all_items_count = wdb_all_files_filtered.length;
|
21 |
+
var page = 2;
|
22 |
+
|
23 |
jQuery("#explorer_body_container").scroll(function () {
|
24 |
var explorer_item_count = jQuery("#explorer_body .explorer_item").length;
|
25 |
+
if ( ajax && explorer_item_count < all_items_count ) {
|
|
|
26 |
var scroll_position = jQuery(this).scrollTop() + jQuery(this).innerHeight();
|
27 |
var scroll_Height = jQuery(this)[0].scrollHeight;
|
28 |
+
if ( scroll_position >= scroll_Height ) {
|
29 |
+
var start_count = (page - 1) * element_load_count;
|
30 |
+
var end_count = page * element_load_count;
|
31 |
+
var next_files = wdb_all_files_filtered.slice(start_count, end_count);
|
32 |
ajax_print_images(next_files, jQuery("#explorer_body"), 'explorer_item', start_count);
|
33 |
+
page++;
|
34 |
}
|
35 |
}
|
36 |
});
|
65 |
onKeyDown(e);
|
66 |
});
|
67 |
jQuery("#search_by_name .search_by_name").on("input keyup", function() {
|
68 |
+
wdb_all_files_filtered = [];
|
69 |
var search_by_name = jQuery(this).val().toLowerCase();
|
70 |
+
jQuery("#explorer_body .explorer_item").remove();
|
71 |
+
jQuery('html,body').animate({scrollTop:0},0);
|
72 |
+
if ( search_by_name ) {
|
73 |
+
for ( var key in wdb_all_files ) {
|
74 |
+
var filename = wdb_all_files[key].filename.toLowerCase();
|
75 |
if (filename.indexOf(search_by_name) != -1) {
|
76 |
+
wdb_all_files_filtered.push(wdb_all_files[key]);
|
77 |
}
|
78 |
+
}
|
79 |
}
|
80 |
else {
|
81 |
+
wdb_all_files_filtered = wdb_all_files;
|
82 |
}
|
83 |
+
var next_files = wdb_all_files_filtered.slice(0, element_load_count);
|
84 |
+
ajax_print_images(next_files, jQuery("#explorer_body"), 'explorer_item', 0);
|
85 |
+
all_items_count = wdb_all_files_filtered.length;
|
86 |
+
page = 2;
|
87 |
});
|
88 |
});
|
89 |
// TODO. remove this not used
|
98 |
function submit(task, sortBy, sortOrder, itemsView, destDir, fileNewName, newDirName, clipboardTask, clipboardFiles, clipboardSrc, clipboardDest) {
|
99 |
var names_array = [];
|
100 |
if (all_files_selected === true) {
|
101 |
+
for (i in wdb_all_files_filtered) {
|
102 |
+
var index = no_selected_files.indexOf(wdb_all_files_filtered[i]["name"]);
|
103 |
if (index < 0) {
|
104 |
+
var all_names = wdb_all_files_filtered[i]["name"];
|
105 |
names_array.push(all_names);
|
106 |
}
|
107 |
}
|
203 |
|
204 |
var filesValid = [];
|
205 |
if (all_files_selected === true) {
|
206 |
+
for (i in wdb_all_files_filtered) {
|
207 |
var fileData = [];
|
208 |
+
if (wdb_all_files_filtered[i]["is_dir"] === false) {
|
209 |
+
var index = no_selected_files.indexOf(wdb_all_files_filtered[i]["name"]);
|
210 |
if (index < 0) {
|
211 |
+
fileData['name'] = wdb_all_files_filtered[i]["name"];
|
212 |
+
fileData['filename'] = wdb_all_files_filtered[i]["filename"];;
|
213 |
+
fileData['alt'] = wdb_all_files_filtered[i]["alt"];;
|
214 |
+
fileData['url'] = dir + "/" + wdb_all_files_filtered[i]["name"];
|
215 |
+
fileData['reliative_url'] = dirUrl + "/" + wdb_all_files_filtered[i]["name"];
|
216 |
+
fileData['thumb_url'] = dir + "/thumb/" + wdb_all_files_filtered[i]["name"];
|
217 |
+
fileData['thumb'] = wdb_all_files_filtered[i]["thumb"];
|
218 |
+
fileData['size'] = wdb_all_files_filtered[i]["size"];
|
219 |
+
fileData['filetype'] = wdb_all_files_filtered[i]["type"];
|
220 |
+
fileData['date_modified'] = wdb_all_files_filtered[i]["date_modified"];
|
221 |
+
fileData['resolution'] = wdb_all_files_filtered[i]["resolution"];
|
222 |
+
fileData['aperture'] = wdb_all_files_filtered[i]["aperture"];
|
223 |
+
fileData['credit'] = wdb_all_files_filtered[i]["credit"];
|
224 |
+
fileData['camera'] =wdb_all_files_filtered[i]["camera"];
|
225 |
+
fileData['caption'] = wdb_all_files_filtered[i]["caption"];
|
226 |
+
fileData['iso'] = wdb_all_files_filtered[i]["iso"];
|
227 |
+
fileData['orientation'] = wdb_all_files_filtered[i]["orientation"];
|
228 |
+
fileData['copyright'] = wdb_all_files_filtered[i]["copyright"];
|
229 |
filesValid.push(fileData);
|
230 |
}
|
231 |
}
|
315 |
|
316 |
function onBtnRenameItemClick(event, obj) {
|
317 |
if (filesSelected.length != 0) {
|
318 |
+
var oldName = getFileName(filesSelected[0]);
|
319 |
+
var newName = prompt(messageEnterNewName, oldName);
|
320 |
if ((newName != null) && (newName != "")) {
|
321 |
+
newName = newName.replace(/ /g, "_").replace(/%/g, "");
|
322 |
+
/*var image_url = jQuery('#tbody_arr', window.parent.document).find('input[value$="/' + filesSelected[0] + '"]');
|
323 |
+
if ( image_url.length ) {
|
324 |
+
var thumb_url = jQuery('#tbody_arr', window.parent.document).find('input[value$="/thumb/' + filesSelected[0] + '"]');
|
325 |
+
var file_name = jQuery('#tbody_arr', window.parent.document).find('input[value="' + oldName + '"]');
|
326 |
+
|
327 |
+
image_url.val(image_url.val().replace(oldName, newName));
|
328 |
+
thumb_url.val(thumb_url.val().replace(oldName, newName));
|
329 |
+
file_name.val(file_name.val().replace(oldName, newName));
|
330 |
+
}*/
|
331 |
+
|
332 |
+
submit("rename_item", null, null, null, null, newName, null, null, null, null, null);
|
333 |
}
|
334 |
}
|
335 |
}
|
339 |
var names_list = filesSelected.join("**#**");
|
340 |
var names_array = [];
|
341 |
if (all_files_selected === true) {
|
342 |
+
for (i in wdb_all_files_filtered) {
|
343 |
+
var index = no_selected_files.indexOf(wdb_all_files_filtered[i]["name"]);
|
344 |
if (index < 0) {
|
345 |
+
var all_names = wdb_all_files_filtered[i]["name"];
|
346 |
names_array.push(all_names);
|
347 |
}
|
348 |
}
|
358 |
var names_list = filesSelected.join("**#**");
|
359 |
var names_array = [];
|
360 |
if (all_files_selected === true) {
|
361 |
+
for (var i in wdb_all_files_filtered) {
|
362 |
+
var index = no_selected_files.indexOf(wdb_all_files_filtered[i]["name"]);
|
363 |
if (index < 0) {
|
364 |
+
var all_names = wdb_all_files_filtered[i]["name"];
|
365 |
names_array.push(all_names);
|
366 |
}
|
367 |
}
|
368 |
+
names_list = names_array.join("**#**");
|
369 |
}
|
370 |
submit("", null, null, null, null, null, null, "cut", names_list, dir, null);
|
371 |
}
|
373 |
|
374 |
function onBtnPasteClick(event, obj) {
|
375 |
if (getClipboardFiles() != "") {
|
376 |
+
/*if ( jQuery("form[name=adminForm]").find("input[name=clipboard_task]").val() == 'cut' ) {
|
377 |
+
var images_arr = jQuery("form[name=adminForm]").find("input[name=clipboard_files]").val().split("**#**");
|
378 |
+
for (var i in images_arr) {
|
379 |
+
var image_url = jQuery('#tbody_arr', window.parent.document).find('input[value$="/' + images_arr[i] + '"]');
|
380 |
+
if ( image_url.length ) {
|
381 |
+
var thumb_url = jQuery('#tbody_arr', window.parent.document).find('input[value$="/thumb/' + images_arr[i] + '"]');
|
382 |
+
image_url.val(dir + "/" + images_arr[i]);
|
383 |
+
thumb_url.val(dir + "/thumb/" + images_arr[i]);
|
384 |
+
}
|
385 |
+
}
|
386 |
+
}*/
|
387 |
submit("paste_items", null, null, null, null, null, null, null, null, null, dir);
|
388 |
}
|
389 |
}
|
390 |
|
391 |
function onBtnRemoveItemsClick(event, obj) {
|
392 |
if ((filesSelected.length != 0) && (confirm(warningRemoveItems) == true)) {
|
393 |
+
/*for ( var i in filesSelected ) {
|
394 |
+
var tr = jQuery('#tbody_arr', window.parent.document).find('input[value$="/' + filesSelected[i] + '"]').parents("tr");
|
395 |
+
if ( tr.length ) {
|
396 |
+
tr.remove();
|
397 |
+
var id = tr.attr("id");
|
398 |
+
id = id.replace("tr_", "");
|
399 |
+
jQuery("#ids_string", window.parent.document).val(jQuery("#ids_string", window.parent.document).val().replace(id + ",", ""));
|
400 |
+
}
|
401 |
+
}*/
|
402 |
submit("remove_items", null, null, null, null, null, null, null, null, null, null);
|
403 |
}
|
404 |
}
|
621 |
}
|
622 |
|
623 |
function ajax_print_images(files, element, view_type, count) {
|
624 |
+
for (var i in files) {
|
625 |
var corent_file = files[i];
|
626 |
var name = corent_file["name"];
|
627 |
var filename = corent_file["filename"];
|
framework/BWGOptions.php
CHANGED
@@ -4,7 +4,7 @@ defined('ABSPATH') || die('Access Denied');
|
|
4 |
class WD_BWG_Options {
|
5 |
|
6 |
// General
|
7 |
-
public $images_directory =
|
8 |
public $resizable_thumbnails = 1;
|
9 |
public $upload_img_width = 1200;
|
10 |
public $upload_img_height = 1200;
|
@@ -18,7 +18,7 @@ class WD_BWG_Options {
|
|
18 |
public $save_ip = 1;
|
19 |
public $image_right_click = 0;
|
20 |
public $use_inline_stiles_and_scripts = 0;
|
21 |
-
public $enable_wp_editor =
|
22 |
public $enable_seo = 1;
|
23 |
public $read_metadata = 1;
|
24 |
|
@@ -32,13 +32,13 @@ class WD_BWG_Options {
|
|
32 |
public $sort_by = 'order';
|
33 |
public $order_by = 'asc';
|
34 |
public $show_search_box = 0;
|
35 |
-
public $placeholder = '';
|
36 |
-
public $search_box_width =
|
37 |
public $show_sort_images = 0;
|
38 |
public $show_tag_box = 0;
|
39 |
public $showthumbs_name = 0;
|
40 |
public $show_gallery_description = 0;
|
41 |
-
public $image_title_show_hover = '
|
42 |
public $play_icon = 1;
|
43 |
public $gallery_download = 0;
|
44 |
public $ecommerce_icon_show_hover = 'none';
|
@@ -54,7 +54,7 @@ class WD_BWG_Options {
|
|
54 |
public $masonry_sort_by = 'order';
|
55 |
public $masonry_order_by = 'asc';
|
56 |
public $masonry_show_search_box = 0;
|
57 |
-
public $masonry_placeholder = '';
|
58 |
public $masonry_search_box_width = 180;
|
59 |
public $masonry_show_sort_images = 0;
|
60 |
public $masonry_show_tag_box = 0;
|
@@ -75,7 +75,7 @@ class WD_BWG_Options {
|
|
75 |
public $mosaic_sort_by = 'order';
|
76 |
public $mosaic_order_by = 'asc';
|
77 |
public $mosaic_show_search_box = 0;
|
78 |
-
public $mosaic_placeholder = '';
|
79 |
public $mosaic_search_box_width = 180;
|
80 |
public $mosaic_show_sort_images = 0;
|
81 |
public $mosaic_show_tag_box = 0;
|
@@ -118,7 +118,7 @@ class WD_BWG_Options {
|
|
118 |
public $image_browser_show_gallery_title = 0;
|
119 |
public $image_browser_show_gallery_description = 0;
|
120 |
public $image_browser_show_search_box = 0;
|
121 |
-
public $image_browser_placeholder = '';
|
122 |
public $image_browser_search_box_width = 180;
|
123 |
public $image_browser_gallery_download = 0;
|
124 |
|
@@ -134,7 +134,7 @@ class WD_BWG_Options {
|
|
134 |
public $blog_style_show_gallery_title = 0;
|
135 |
public $blog_style_show_gallery_description = 0;
|
136 |
public $blog_style_show_search_box = 0;
|
137 |
-
public $blog_style_placeholder = '';
|
138 |
public $blog_style_search_box_width = 180;
|
139 |
public $blog_style_show_sort_images = 0;
|
140 |
public $blog_style_show_tag_box = 0;
|
@@ -169,7 +169,7 @@ class WD_BWG_Options {
|
|
169 |
public $album_sort_by = 'order';
|
170 |
public $album_order_by = 'asc';
|
171 |
public $album_show_search_box = 0;
|
172 |
-
public $album_placeholder = '';
|
173 |
public $album_search_box_width = 180;
|
174 |
public $album_show_sort_images = 0;
|
175 |
public $album_show_tag_box = 0;
|
@@ -196,7 +196,7 @@ class WD_BWG_Options {
|
|
196 |
public $album_masonry_sort_by = 'order';
|
197 |
public $album_masonry_order_by = 'asc';
|
198 |
public $album_masonry_show_search_box = 0;
|
199 |
-
public $album_masonry_placeholder = '';
|
200 |
public $album_masonry_search_box_width = 180;
|
201 |
public $album_masonry_show_sort_images = 0;
|
202 |
public $album_masonry_show_tag_box = 0;
|
@@ -218,7 +218,7 @@ class WD_BWG_Options {
|
|
218 |
public $album_extended_sort_by = 'order';
|
219 |
public $album_extended_order_by = 'asc';
|
220 |
public $album_extended_show_search_box = 0;
|
221 |
-
public $album_extended_placeholder = '';
|
222 |
public $album_extended_search_box_width = 180;
|
223 |
public $album_extended_show_sort_images = 0;
|
224 |
public $album_extended_show_tag_box = 0;
|
@@ -319,28 +319,34 @@ class WD_BWG_Options {
|
|
319 |
}
|
320 |
}
|
321 |
|
322 |
-
if ($this->images_directory ===
|
|
|
323 |
$upload_dir = wp_upload_dir();
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
328 |
}
|
|
|
329 |
$this->old_images_directory = $old_images_directory;
|
|
|
330 |
if ( $reset ) {
|
331 |
$this->watermark_url = BWG()->plugin_url . '/images/watermark.png';
|
332 |
-
}
|
333 |
-
if ( $reset ) {
|
334 |
$this->built_in_watermark_url = BWG()->plugin_url . '/images/watermark.png';
|
335 |
}
|
336 |
if ($this->permissions != 'moderate_comments' && $this->permissions != 'publish_posts' && $this->permissions != 'edit_posts') {
|
337 |
$this->permissions = 'manage_options';
|
338 |
}
|
|
|
339 |
$this->jpeg_quality = $this->image_quality;
|
340 |
$this->png_quality = 9 - round(9 * $this->image_quality / 100);
|
341 |
}
|
342 |
-
|
343 |
-
private function make_directory($upload_dir) {
|
344 |
-
mkdir($upload_dir . '/photo-gallery', 0777);
|
345 |
-
}
|
346 |
}
|
4 |
class WD_BWG_Options {
|
5 |
|
6 |
// General
|
7 |
+
public $images_directory = 'wp-content/uploads';
|
8 |
public $resizable_thumbnails = 1;
|
9 |
public $upload_img_width = 1200;
|
10 |
public $upload_img_height = 1200;
|
18 |
public $save_ip = 1;
|
19 |
public $image_right_click = 0;
|
20 |
public $use_inline_stiles_and_scripts = 0;
|
21 |
+
public $enable_wp_editor = 0;
|
22 |
public $enable_seo = 1;
|
23 |
public $read_metadata = 1;
|
24 |
|
32 |
public $sort_by = 'order';
|
33 |
public $order_by = 'asc';
|
34 |
public $show_search_box = 0;
|
35 |
+
public $placeholder = 'Search';
|
36 |
+
public $search_box_width = 330;
|
37 |
public $show_sort_images = 0;
|
38 |
public $show_tag_box = 0;
|
39 |
public $showthumbs_name = 0;
|
40 |
public $show_gallery_description = 0;
|
41 |
+
public $image_title_show_hover = 'hover';
|
42 |
public $play_icon = 1;
|
43 |
public $gallery_download = 0;
|
44 |
public $ecommerce_icon_show_hover = 'none';
|
54 |
public $masonry_sort_by = 'order';
|
55 |
public $masonry_order_by = 'asc';
|
56 |
public $masonry_show_search_box = 0;
|
57 |
+
public $masonry_placeholder = 'Search';
|
58 |
public $masonry_search_box_width = 180;
|
59 |
public $masonry_show_sort_images = 0;
|
60 |
public $masonry_show_tag_box = 0;
|
75 |
public $mosaic_sort_by = 'order';
|
76 |
public $mosaic_order_by = 'asc';
|
77 |
public $mosaic_show_search_box = 0;
|
78 |
+
public $mosaic_placeholder = 'Search';
|
79 |
public $mosaic_search_box_width = 180;
|
80 |
public $mosaic_show_sort_images = 0;
|
81 |
public $mosaic_show_tag_box = 0;
|
118 |
public $image_browser_show_gallery_title = 0;
|
119 |
public $image_browser_show_gallery_description = 0;
|
120 |
public $image_browser_show_search_box = 0;
|
121 |
+
public $image_browser_placeholder = 'Search';
|
122 |
public $image_browser_search_box_width = 180;
|
123 |
public $image_browser_gallery_download = 0;
|
124 |
|
134 |
public $blog_style_show_gallery_title = 0;
|
135 |
public $blog_style_show_gallery_description = 0;
|
136 |
public $blog_style_show_search_box = 0;
|
137 |
+
public $blog_style_placeholder = 'Search';
|
138 |
public $blog_style_search_box_width = 180;
|
139 |
public $blog_style_show_sort_images = 0;
|
140 |
public $blog_style_show_tag_box = 0;
|
169 |
public $album_sort_by = 'order';
|
170 |
public $album_order_by = 'asc';
|
171 |
public $album_show_search_box = 0;
|
172 |
+
public $album_placeholder = 'Search';
|
173 |
public $album_search_box_width = 180;
|
174 |
public $album_show_sort_images = 0;
|
175 |
public $album_show_tag_box = 0;
|
196 |
public $album_masonry_sort_by = 'order';
|
197 |
public $album_masonry_order_by = 'asc';
|
198 |
public $album_masonry_show_search_box = 0;
|
199 |
+
public $album_masonry_placeholder = 'Search';
|
200 |
public $album_masonry_search_box_width = 180;
|
201 |
public $album_masonry_show_sort_images = 0;
|
202 |
public $album_masonry_show_tag_box = 0;
|
218 |
public $album_extended_sort_by = 'order';
|
219 |
public $album_extended_order_by = 'asc';
|
220 |
public $album_extended_show_search_box = 0;
|
221 |
+
public $album_extended_placeholder = 'Search';
|
222 |
public $album_extended_search_box_width = 180;
|
223 |
public $album_extended_show_sort_images = 0;
|
224 |
public $album_extended_show_tag_box = 0;
|
319 |
}
|
320 |
}
|
321 |
|
322 |
+
if ( $this->images_directory === 'wp-content/uploads' ) {
|
323 |
+
// If images directory has not been changed by user.
|
324 |
$upload_dir = wp_upload_dir();
|
325 |
+
$this->upload_dir = $upload_dir['basedir'] . '/photo-gallery';
|
326 |
+
$this->upload_url = $upload_dir['baseurl'] . '/photo-gallery';
|
327 |
+
}
|
328 |
+
else {
|
329 |
+
// For old users, who have changed images directory.
|
330 |
+
$this->upload_dir = ABSPATH . '/' . $this->images_directory . '/photo-gallery';
|
331 |
+
$this->upload_url = site_url() . '/' . $this->images_directory . '/photo-gallery';
|
332 |
+
}
|
333 |
+
|
334 |
+
// Create directory if not exist.
|
335 |
+
if ( !is_dir($this->upload_dir) ) {
|
336 |
+
mkdir($this->upload_dir, 0755);
|
337 |
}
|
338 |
+
|
339 |
$this->old_images_directory = $old_images_directory;
|
340 |
+
|
341 |
if ( $reset ) {
|
342 |
$this->watermark_url = BWG()->plugin_url . '/images/watermark.png';
|
|
|
|
|
343 |
$this->built_in_watermark_url = BWG()->plugin_url . '/images/watermark.png';
|
344 |
}
|
345 |
if ($this->permissions != 'moderate_comments' && $this->permissions != 'publish_posts' && $this->permissions != 'edit_posts') {
|
346 |
$this->permissions = 'manage_options';
|
347 |
}
|
348 |
+
|
349 |
$this->jpeg_quality = $this->image_quality;
|
350 |
$this->png_quality = 9 - round(9 * $this->image_quality / 100);
|
351 |
}
|
|
|
|
|
|
|
|
|
352 |
}
|
framework/WDWLibrary.php
CHANGED
@@ -200,6 +200,11 @@ class WDWLibrary {
|
|
200 |
$message = __('Items successfully edited.', BWG()->prefix);
|
201 |
$type = 'updated';
|
202 |
break;
|
|
|
|
|
|
|
|
|
|
|
203 |
}
|
204 |
default: {
|
205 |
$message = '';
|
@@ -256,6 +261,23 @@ class WDWLibrary {
|
|
256 |
return ob_get_clean();
|
257 |
}
|
258 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
/**
|
260 |
* Redirect.
|
261 |
*
|
@@ -764,7 +786,7 @@ class WDWLibrary {
|
|
764 |
|
765 |
public static function get_default_theme_id() {
|
766 |
global $wpdb;
|
767 |
-
$id = $wpdb->get_var('SELECT id FROM ' . $wpdb->prefix . 'bwg_theme WHERE default_theme=1');
|
768 |
return $id;
|
769 |
}
|
770 |
|
@@ -970,11 +992,23 @@ class WDWLibrary {
|
|
970 |
$gallery_id = (int) $gallery_id;
|
971 |
$tag = (int) $tag;
|
972 |
global $wpdb;
|
973 |
-
$bwg_search = (
|
|
|
974 |
$join = '';
|
975 |
$where = '';
|
976 |
-
|
977 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
978 |
}
|
979 |
if ( $sort_by == 'size' || $sort_by == 'resolution' ) {
|
980 |
$sort_by = ' CAST(image.' . $sort_by . ' AS SIGNED) ';
|
@@ -1008,7 +1042,7 @@ class WDWLibrary {
|
|
1008 |
}
|
1009 |
$where .= ($gallery_id ? ' AND image.gallery_id = "' . $gallery_id . '" ' : '') . ($tag ? ' AND tag.tag_id = "' . $tag . '" ' : '');
|
1010 |
$join = $tag ? 'LEFT JOIN ' . $wpdb->prefix . 'bwg_image_tag as tag ON image.id=tag.image_id' : '';
|
1011 |
-
if (
|
1012 |
$join .= ' LEFT JOIN (SELECT GROUP_CONCAT(tag_id SEPARATOR ",") AS tags_combined, image_id FROM ' . $wpdb->prefix . 'bwg_image_tag' . ($gallery_id ? ' WHERE gallery_id="' . $gallery_id . '"' : '') . ' GROUP BY image_id) AS tags ON image.id=tags.image_id';
|
1013 |
$where .= ' AND CONCAT(",", tags.tags_combined, ",") REGEXP ",(' . implode("|", $_REQUEST[$tag_input_name]) . ')," ';
|
1014 |
}
|
@@ -1025,6 +1059,8 @@ class WDWLibrary {
|
|
1025 |
$images = array();
|
1026 |
if ( !empty($rows) ) {
|
1027 |
foreach ( $rows as $row ) {
|
|
|
|
|
1028 |
if ( strpos($row->filetype, 'EMBED') === FALSE ) {
|
1029 |
$row->image_url = self::image_url_version($row->image_url, $row->modified_date);
|
1030 |
$row->thumb_url = self::image_url_version($row->thumb_url, $row->modified_date);
|
@@ -1094,40 +1130,59 @@ class WDWLibrary {
|
|
1094 |
return array( 'rows' => $row, 'page_nav' => $page_nav );
|
1095 |
}
|
1096 |
|
1097 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1098 |
global $wpdb;
|
|
|
1099 |
$options = new WD_BWG_Options();
|
1100 |
|
1101 |
-
if ( $options->built_in_watermark_type
|
1102 |
-
|
1103 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1104 |
|
1105 |
-
|
1106 |
-
$images = $wpdb->get_results('SELECT * FROM `' . $wpdb->prefix . 'bwg_image` WHERE '. $where);
|
1107 |
-
if ( !empty($images) ) {
|
1108 |
switch ( $options->built_in_watermark_type ) {
|
1109 |
case 'text':
|
1110 |
foreach ( $images as $image ) {
|
1111 |
-
if ( preg_match('/EMBED/', $image->filetype) == 1 ) {
|
1112 |
continue;
|
1113 |
}
|
1114 |
-
self::set_text_watermark(
|
1115 |
}
|
1116 |
break;
|
1117 |
case 'image':
|
1118 |
-
$watermark_path = str_replace(
|
1119 |
foreach ( $images as $image ) {
|
1120 |
-
if ( preg_match('/EMBED/', $image->filetype) == 1 ) {
|
1121 |
continue;
|
1122 |
}
|
1123 |
-
self::set_image_watermark(
|
1124 |
}
|
1125 |
break;
|
1126 |
}
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
|
|
|
|
1130 |
}
|
|
|
1131 |
}
|
1132 |
|
1133 |
public static function set_text_watermark($original_filename, $dest_filename, $watermark_text, $watermark_font, $watermark_font_size, $watermark_color, $watermark_transparency, $watermark_position) {
|
@@ -1278,12 +1333,21 @@ class WDWLibrary {
|
|
1278 |
}
|
1279 |
}
|
1280 |
|
1281 |
-
public static function bwg_image_recover_all($gallery_id) {
|
1282 |
$thumb_width = BWG()->options->upload_thumb_width;
|
1283 |
$width = BWG()->options->upload_img_width;
|
1284 |
global $wpdb;
|
1285 |
$where = ($gallery_id) ? ' `gallery_id` = ' . $gallery_id : 1;
|
1286 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1287 |
if ( !empty( $images ) ) {
|
1288 |
foreach ( $images as $image ) {
|
1289 |
if ( preg_match( '/EMBED/', $image->filetype ) == 1 ) {
|
@@ -1299,8 +1363,8 @@ class WDWLibrary {
|
|
1299 |
if ( preg_match('/EMBED/', $image->filetype) == 1 ) {
|
1300 |
return;
|
1301 |
}
|
1302 |
-
$filename = htmlspecialchars_decode(
|
1303 |
-
$thumb_filename = htmlspecialchars_decode(
|
1304 |
$original_filename = str_replace('/thumb/', '/.original/', $thumb_filename);
|
1305 |
if (file_exists($original_filename) || file_exists($filename)) {
|
1306 |
if (!file_exists($original_filename)) {
|
@@ -1315,12 +1379,16 @@ class WDWLibrary {
|
|
1315 |
self::recover_image_size($width_orig, $height_orig, $width, $original_image, $filename);
|
1316 |
self::recover_image_size($width_orig, $height_orig, $thumb_width, $original_image, $thumb_filename);
|
1317 |
}
|
|
|
|
|
|
|
|
|
1318 |
}
|
1319 |
if ($page == 'gallery_page') {
|
1320 |
?>
|
1321 |
<script language="javascript">
|
1322 |
var image_src = window.parent.document.getElementById("image_thumb_<?php echo $image->id; ?>").src;
|
1323 |
-
document.getElementById("image_thumb_<?php echo $image->id; ?>").src = image_src
|
1324 |
</script>
|
1325 |
<?php
|
1326 |
}
|
@@ -1334,6 +1402,36 @@ class WDWLibrary {
|
|
1334 |
$original_image->save($filename);
|
1335 |
}
|
1336 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1337 |
public static function bwg_hex2rgb($hex) {
|
1338 |
$hex = str_replace("#", "", $hex);
|
1339 |
if (strlen($hex) == 3) {
|
@@ -1983,45 +2081,48 @@ class WDWLibrary {
|
|
1983 |
}
|
1984 |
}
|
1985 |
|
1986 |
-
|
1987 |
-
|
1988 |
-
|
1989 |
-
|
1990 |
-
|
1991 |
-
|
1992 |
-
|
1993 |
-
|
1994 |
-
|
1995 |
-
|
1996 |
-
|
1997 |
-
}
|
1998 |
|
1999 |
-
|
2000 |
-
|
2001 |
-
|
2002 |
-
|
2003 |
-
|
2004 |
-
|
2005 |
-
|
2006 |
-
|
2007 |
-
|
2008 |
-
|
2009 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010 |
}
|
2011 |
-
global $wpdb;
|
2012 |
-
$update = $wpdb->query( $wpdb->prepare( 'UPDATE `' . $wpdb->prefix . 'bwg_image` SET `modified_date` = "%d" WHERE ' . $where, time() ) );
|
2013 |
-
$items = $wpdb->get_results( 'SELECT `gallery_id`, `thumb_url` FROM `' . $wpdb->prefix . 'bwg_image` WHERE ' . $where );
|
2014 |
-
if ( !empty($items) ) {
|
2015 |
-
$thumbs_str = '';
|
2016 |
-
foreach ( $items as $item ) {
|
2017 |
-
$thumbs_str = "'" . $item->thumb_url . "',";
|
2018 |
-
}
|
2019 |
-
$thumbs_str = rtrim($thumbs_str,',');
|
2020 |
-
$wpdb->query('UPDATE `' . $wpdb->prefix . 'bwg_gallery` SET `modified_date` = "' . time() . '" WHERE `preview_image` IN (' . $thumbs_str . ') OR `random_preview_image` IN (' . $thumbs_str . ')');
|
2021 |
-
$wpdb->query('UPDATE `' . $wpdb->prefix . 'bwg_album` SET `modified_date` = "' . time() . '" WHERE `preview_image` IN (' . $thumbs_str . ') OR `random_preview_image` IN (' . $thumbs_str . ')');
|
2022 |
-
}
|
2023 |
-
return $update;
|
2024 |
-
}
|
2025 |
|
2026 |
/**
|
2027 |
* Get description and title from gallery or album tables.
|
@@ -2040,21 +2141,29 @@ class WDWLibrary {
|
|
2040 |
return '';
|
2041 |
}
|
2042 |
|
2043 |
-
|
2044 |
-
|
2045 |
-
|
2046 |
-
|
2047 |
-
|
2048 |
-
|
2049 |
-
|
|
|
2050 |
public static function image_url_version($url, $date_modified) {
|
2051 |
-
if ($date_modified && !WDWLibrary::check_external_link($url)) {
|
|
|
|
|
|
|
|
|
|
|
|
|
2052 |
return $url . '?bwg=' . $date_modified;
|
2053 |
}
|
|
|
2054 |
return $url;
|
2055 |
}
|
2056 |
|
2057 |
-
|
2058 |
public static function get_theme_row_data($id) {
|
2059 |
global $wpdb;
|
2060 |
if ($id) {
|
@@ -2139,7 +2248,7 @@ class WDWLibrary {
|
|
2139 |
</span>
|
2140 |
<span class="bwg_search_input_container">
|
2141 |
<input id="bwg_search_input_<?php echo $current_view; ?>" class="bwg_search_input" type="text" onkeypress="return bwg_check_search_input_enter(this, event)" name="bwg_search_<?php echo $current_view; ?>" value="<?php echo $bwg_search; ?>" placeholder="<?php echo $placeholder; ?>" />
|
2142 |
-
<input id="bwg_images_count_<?php echo $current_view; ?>" class="bwg_search_input" type="hidden" name="bwg_images_count_<?php echo $current_view; ?>" value="<?php echo $images_count; ?>" >
|
2143 |
</span>
|
2144 |
</div>
|
2145 |
</div>
|
@@ -2300,8 +2409,8 @@ class WDWLibrary {
|
|
2300 |
<script type="text/javascript">
|
2301 |
jQuery(window).on("scroll", function() {
|
2302 |
if (jQuery(document).scrollTop() + jQuery(window).height() > (jQuery('#<?php echo $form_id; ?>').offset().top + jQuery('#<?php echo $form_id; ?>').height())) {
|
2303 |
-
spider_page_<?php echo $current_view; ?>('', <?php echo $page_number; ?>, 1, true);
|
2304 |
jQuery(window).off("scroll");
|
|
|
2305 |
return false;
|
2306 |
}
|
2307 |
});
|
@@ -2377,6 +2486,100 @@ class WDWLibrary {
|
|
2377 |
}
|
2378 |
}
|
2379 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2380 |
/**
|
2381 |
* Generate top bar.
|
2382 |
*
|
200 |
$message = __('Items successfully edited.', BWG()->prefix);
|
201 |
$type = 'updated';
|
202 |
break;
|
203 |
+
}
|
204 |
+
case 26: {
|
205 |
+
$message = __('Watermark could not be set. The image URL is incorrect.', BWG()->prefix);
|
206 |
+
$type = 'error';
|
207 |
+
break;
|
208 |
}
|
209 |
default: {
|
210 |
$message = '';
|
261 |
return ob_get_clean();
|
262 |
}
|
263 |
|
264 |
+
/**
|
265 |
+
* Possible choices to order images in admin page.
|
266 |
+
*
|
267 |
+
* @return array
|
268 |
+
*/
|
269 |
+
public static function admin_images_ordering_choices() {
|
270 |
+
return array(
|
271 |
+
'order_asc' => 'Default sorting',
|
272 |
+
'filename_asc' => 'File name (Asc)',
|
273 |
+
'filename_desc' => 'File name (Desc)',
|
274 |
+
'alt_asc' => 'Alt/Title (Asc)',
|
275 |
+
'alt_desc' => 'Alt/Title (Desc)',
|
276 |
+
'description_asc' => 'Description (Asc)',
|
277 |
+
'description_desc' => 'Description (Desc)',
|
278 |
+
);
|
279 |
+
}
|
280 |
+
|
281 |
/**
|
282 |
* Redirect.
|
283 |
*
|
786 |
|
787 |
public static function get_default_theme_id() {
|
788 |
global $wpdb;
|
789 |
+
$id = $wpdb->get_var('SELECT id FROM ' . $wpdb->prefix . 'bwg_theme WHERE default_theme = 1');
|
790 |
return $id;
|
791 |
}
|
792 |
|
992 |
$gallery_id = (int) $gallery_id;
|
993 |
$tag = (int) $tag;
|
994 |
global $wpdb;
|
995 |
+
$bwg_search = self::get('bwg_search_' . $bwg);
|
996 |
+
|
997 |
$join = '';
|
998 |
$where = '';
|
999 |
+
if ( $bwg_search ) {
|
1000 |
+
$bwg_search_keys = explode(' ', trim($bwg_search));
|
1001 |
+
$alt_search = '(';
|
1002 |
+
$description_search = '(';
|
1003 |
+
foreach( $bwg_search_keys as $search_key) {
|
1004 |
+
$alt_search .= '`image`.`alt` LIKE "%' . $search_key . '%" AND ';
|
1005 |
+
$description_search .= '`image`.`description` LIKE "%' . $search_key . '%" AND ';
|
1006 |
+
}
|
1007 |
+
$alt_search = rtrim($alt_search, 'AND ');
|
1008 |
+
$alt_search .= ')';
|
1009 |
+
$description_search = rtrim($description_search, 'AND ');
|
1010 |
+
$description_search .= ')';
|
1011 |
+
$where = 'AND (' . $alt_search . ' OR ' . $description_search . ')';
|
1012 |
}
|
1013 |
if ( $sort_by == 'size' || $sort_by == 'resolution' ) {
|
1014 |
$sort_by = ' CAST(image.' . $sort_by . ' AS SIGNED) ';
|
1042 |
}
|
1043 |
$where .= ($gallery_id ? ' AND image.gallery_id = "' . $gallery_id . '" ' : '') . ($tag ? ' AND tag.tag_id = "' . $tag . '" ' : '');
|
1044 |
$join = $tag ? 'LEFT JOIN ' . $wpdb->prefix . 'bwg_image_tag as tag ON image.id=tag.image_id' : '';
|
1045 |
+
if ( self::get($tag_input_name) ) {
|
1046 |
$join .= ' LEFT JOIN (SELECT GROUP_CONCAT(tag_id SEPARATOR ",") AS tags_combined, image_id FROM ' . $wpdb->prefix . 'bwg_image_tag' . ($gallery_id ? ' WHERE gallery_id="' . $gallery_id . '"' : '') . ' GROUP BY image_id) AS tags ON image.id=tags.image_id';
|
1047 |
$where .= ' AND CONCAT(",", tags.tags_combined, ",") REGEXP ",(' . implode("|", $_REQUEST[$tag_input_name]) . ')," ';
|
1048 |
}
|
1059 |
$images = array();
|
1060 |
if ( !empty($rows) ) {
|
1061 |
foreach ( $rows as $row ) {
|
1062 |
+
$row->pure_image_url = $row->image_url;
|
1063 |
+
$row->pure_thumb_url = $row->thumb_url;
|
1064 |
if ( strpos($row->filetype, 'EMBED') === FALSE ) {
|
1065 |
$row->image_url = self::image_url_version($row->image_url, $row->modified_date);
|
1066 |
$row->thumb_url = self::image_url_version($row->thumb_url, $row->modified_date);
|
1130 |
return array( 'rows' => $row, 'page_nav' => $page_nav );
|
1131 |
}
|
1132 |
|
1133 |
+
/**
|
1134 |
+
* Image set watermark.
|
1135 |
+
*
|
1136 |
+
* @param $gallery_id
|
1137 |
+
* @param int $image_id
|
1138 |
+
* @param string $limit
|
1139 |
+
* @return int
|
1140 |
+
*/
|
1141 |
+
public static function bwg_image_set_watermark( $gallery_id, $image_id = 0, $limit = '' ) {
|
1142 |
global $wpdb;
|
1143 |
+
$message_id = 21;
|
1144 |
$options = new WD_BWG_Options();
|
1145 |
|
1146 |
+
if ( $options->built_in_watermark_type != 'none' ) {
|
1147 |
+
$limitstart = '';
|
1148 |
+
if ( $limit != '' ) {
|
1149 |
+
$limitstart = ' LIMIT 50 OFFSET ' . $limit;
|
1150 |
+
}
|
1151 |
+
|
1152 |
+
$where = (($gallery_id) ? ' `gallery_id`=' . $gallery_id . ($image_id ? ' AND `id`=' . $image_id : '') : 1);
|
1153 |
+
$search = WDWLibrary::get( 's', '' );
|
1154 |
+
if ( $search ) {
|
1155 |
+
$where .= ' AND `filename` LIKE "%' . $search . '%"';
|
1156 |
+
}
|
1157 |
+
$images = $wpdb->get_results( 'SELECT * FROM `' . $wpdb->prefix . 'bwg_image` WHERE ' . $where . $limitstart );
|
1158 |
|
1159 |
+
if ( !empty( $images ) ) {
|
|
|
|
|
1160 |
switch ( $options->built_in_watermark_type ) {
|
1161 |
case 'text':
|
1162 |
foreach ( $images as $image ) {
|
1163 |
+
if ( preg_match( '/EMBED/', $image->filetype ) == 1 ) {
|
1164 |
continue;
|
1165 |
}
|
1166 |
+
self::set_text_watermark( BWG()->upload_dir . $image->image_url, BWG()->upload_dir . $image->image_url, html_entity_decode( $options->built_in_watermark_text ), $options->built_in_watermark_font, $options->built_in_watermark_font_size, '#' . $options->built_in_watermark_color, $options->built_in_watermark_opacity, $options->built_in_watermark_position );
|
1167 |
}
|
1168 |
break;
|
1169 |
case 'image':
|
1170 |
+
$watermark_path = str_replace( BWG()->upload_url, BWG()->upload_dir, $options->built_in_watermark_url );
|
1171 |
foreach ( $images as $image ) {
|
1172 |
+
if ( preg_match( '/EMBED/', $image->filetype ) == 1 ) {
|
1173 |
continue;
|
1174 |
}
|
1175 |
+
self::set_image_watermark( BWG()->upload_dir . $image->image_url, BWG()->upload_dir . $image->image_url, $watermark_path, $options->built_in_watermark_size, $options->built_in_watermark_size, $options->built_in_watermark_position );
|
1176 |
}
|
1177 |
break;
|
1178 |
}
|
1179 |
+
self::update_image_modified_date( $where );
|
1180 |
+
}
|
1181 |
+
}
|
1182 |
+
else {
|
1183 |
+
$message_id = 6;
|
1184 |
}
|
1185 |
+
return $message_id;
|
1186 |
}
|
1187 |
|
1188 |
public static function set_text_watermark($original_filename, $dest_filename, $watermark_text, $watermark_font, $watermark_font_size, $watermark_color, $watermark_transparency, $watermark_position) {
|
1333 |
}
|
1334 |
}
|
1335 |
|
1336 |
+
public static function bwg_image_recover_all($gallery_id, $limit = '') {
|
1337 |
$thumb_width = BWG()->options->upload_thumb_width;
|
1338 |
$width = BWG()->options->upload_img_width;
|
1339 |
global $wpdb;
|
1340 |
$where = ($gallery_id) ? ' `gallery_id` = ' . $gallery_id : 1;
|
1341 |
+
$search = WDWLibrary::get('s', '');
|
1342 |
+
if ( $search ) {
|
1343 |
+
$where .= ' AND `filename` LIKE "%' . $search . '%"';
|
1344 |
+
}
|
1345 |
+
$limitstart = '';
|
1346 |
+
if ( $limit != '' ) {
|
1347 |
+
$limitstart = ' LIMIT 50 OFFSET ' . $limit;
|
1348 |
+
}
|
1349 |
+
|
1350 |
+
$images = $wpdb->get_results( 'SELECT * FROM `' . $wpdb->prefix . 'bwg_image` WHERE ' . $where. $limitstart );
|
1351 |
if ( !empty( $images ) ) {
|
1352 |
foreach ( $images as $image ) {
|
1353 |
if ( preg_match( '/EMBED/', $image->filetype ) == 1 ) {
|
1363 |
if ( preg_match('/EMBED/', $image->filetype) == 1 ) {
|
1364 |
return;
|
1365 |
}
|
1366 |
+
$filename = htmlspecialchars_decode(BWG()->upload_dir . $image->image_url, ENT_COMPAT | ENT_QUOTES);
|
1367 |
+
$thumb_filename = htmlspecialchars_decode(BWG()->upload_dir . $image->thumb_url, ENT_COMPAT | ENT_QUOTES);
|
1368 |
$original_filename = str_replace('/thumb/', '/.original/', $thumb_filename);
|
1369 |
if (file_exists($original_filename) || file_exists($filename)) {
|
1370 |
if (!file_exists($original_filename)) {
|
1379 |
self::recover_image_size($width_orig, $height_orig, $width, $original_image, $filename);
|
1380 |
self::recover_image_size($width_orig, $height_orig, $thumb_width, $original_image, $thumb_filename);
|
1381 |
}
|
1382 |
+
else {
|
1383 |
+
copy($original_filename, $filename);
|
1384 |
+
copy($original_filename, $thumb_filename);
|
1385 |
+
}
|
1386 |
}
|
1387 |
if ($page == 'gallery_page') {
|
1388 |
?>
|
1389 |
<script language="javascript">
|
1390 |
var image_src = window.parent.document.getElementById("image_thumb_<?php echo $image->id; ?>").src;
|
1391 |
+
document.getElementById("image_thumb_<?php echo $image->id; ?>").src = image_src;
|
1392 |
</script>
|
1393 |
<?php
|
1394 |
}
|
1402 |
$original_image->save($filename);
|
1403 |
}
|
1404 |
|
1405 |
+
public static function resize_image($source, $destination, $max_width, $max_height) {
|
1406 |
+
$image = wp_get_image_editor( $source );
|
1407 |
+
if ( ! is_wp_error( $image ) ) {
|
1408 |
+
$image_size = $image->get_size();
|
1409 |
+
$img_width = $image_size[ 'width' ];
|
1410 |
+
$img_height = $image_size[ 'height' ];
|
1411 |
+
$scale = min( $max_width / $img_width, $max_height / $img_height );
|
1412 |
+
if ( ($scale >= 1) || (($max_width == NULL) && ($max_height == NULL)) ) {
|
1413 |
+
if ( $source !== $destination ) {
|
1414 |
+
return copy( $source, $destination );
|
1415 |
+
}
|
1416 |
+
return true;
|
1417 |
+
}
|
1418 |
+
else {
|
1419 |
+
$new_width = $img_width * $scale;
|
1420 |
+
$new_height = $img_height * $scale;
|
1421 |
+
$image->set_quality( BWG()->options->image_quality );
|
1422 |
+
$image->resize( $new_width, $new_height, false );
|
1423 |
+
$saved = $image->save( $destination );
|
1424 |
+
return !is_wp_error($saved);
|
1425 |
+
}
|
1426 |
+
}
|
1427 |
+
else {
|
1428 |
+
if ( $source !== $destination ) {
|
1429 |
+
return copy( $source, $destination );
|
1430 |
+
}
|
1431 |
+
return true;
|
1432 |
+
}
|
1433 |
+
}
|
1434 |
+
|
1435 |
public static function bwg_hex2rgb($hex) {
|
1436 |
$hex = str_replace("#", "", $hex);
|
1437 |
if (strlen($hex) == 3) {
|
2081 |
}
|
2082 |
}
|
2083 |
|
2084 |
+
/**
|
2085 |
+
* Check external link.
|
2086 |
+
*
|
2087 |
+
* @param string $link
|
2088 |
+
*
|
2089 |
+
* @return bool
|
2090 |
+
*/
|
2091 |
+
public static function check_external_link( $link ) {
|
2092 |
+
if ( is_string($link) && preg_match('/^(http|https):\\/\\/[a-z0-9_]+([\\-\\.]{1}[a-z_0-9]+)*\\.[_a-z]{2,5}' . '((:[0-9]{1,5})?\\/.*)?$/i', $link) ) {
|
2093 |
+
return TRUE;
|
2094 |
+
}
|
|
|
2095 |
|
2096 |
+
return FALSE;
|
2097 |
+
}
|
2098 |
+
|
2099 |
+
/**
|
2100 |
+
* Check external link.
|
2101 |
+
*
|
2102 |
+
* @param string $where
|
2103 |
+
* @return array
|
2104 |
+
*/
|
2105 |
+
public static function update_image_modified_date( $where = '' ) {
|
2106 |
+
if ( strpos($where, 'pr_' ) !== FALSE ) {
|
2107 |
+
// Newly added image.
|
2108 |
+
return;
|
2109 |
+
}
|
2110 |
+
global $wpdb;
|
2111 |
+
$time = time();
|
2112 |
+
$update = $wpdb->query( $wpdb->prepare( 'UPDATE `' . $wpdb->prefix . 'bwg_image` SET `modified_date` = "%d" WHERE ' . $where, $time ) );
|
2113 |
+
$items = $wpdb->get_results( 'SELECT `gallery_id`, `thumb_url` FROM `' . $wpdb->prefix . 'bwg_image` WHERE ' . $where );
|
2114 |
+
if ( !empty($items) ) {
|
2115 |
+
$thumbs_str = '';
|
2116 |
+
foreach ( $items as $item ) {
|
2117 |
+
$thumbs_str = "'" . $item->thumb_url . "',";
|
2118 |
+
}
|
2119 |
+
$thumbs_str = rtrim($thumbs_str,',');
|
2120 |
+
$wpdb->query('UPDATE `' . $wpdb->prefix . 'bwg_gallery` SET `modified_date` = "' . time() . '" WHERE `preview_image` IN (' . $thumbs_str . ') OR `random_preview_image` IN (' . $thumbs_str . ')');
|
2121 |
+
$wpdb->query('UPDATE `' . $wpdb->prefix . 'bwg_album` SET `modified_date` = "' . time() . '" WHERE `preview_image` IN (' . $thumbs_str . ') OR `random_preview_image` IN (' . $thumbs_str . ')');
|
2122 |
+
}
|
2123 |
+
|
2124 |
+
return array('status' => $update, 'modified_date' => $time );
|
2125 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2126 |
|
2127 |
/**
|
2128 |
* Get description and title from gallery or album tables.
|
2141 |
return '';
|
2142 |
}
|
2143 |
|
2144 |
+
/**
|
2145 |
+
* Adds date modified to image url to avoid caching.
|
2146 |
+
*
|
2147 |
+
* @param $url
|
2148 |
+
* @param $date_modified
|
2149 |
+
*
|
2150 |
+
* @return string
|
2151 |
+
*/
|
2152 |
public static function image_url_version($url, $date_modified) {
|
2153 |
+
if ( !empty($url) && $date_modified && !WDWLibrary::check_external_link($url)) {
|
2154 |
+
$key = '?bwg=';
|
2155 |
+
if ( strpos($url, $key) > 0 ) {
|
2156 |
+
$url_tmp = explode($key, $url);
|
2157 |
+
$url = $url_tmp[0];
|
2158 |
+
}
|
2159 |
+
|
2160 |
return $url . '?bwg=' . $date_modified;
|
2161 |
}
|
2162 |
+
|
2163 |
return $url;
|
2164 |
}
|
2165 |
|
2166 |
+
// TODO: To be removed when all views are ready.
|
2167 |
public static function get_theme_row_data($id) {
|
2168 |
global $wpdb;
|
2169 |
if ($id) {
|
2248 |
</span>
|
2249 |
<span class="bwg_search_input_container">
|
2250 |
<input id="bwg_search_input_<?php echo $current_view; ?>" class="bwg_search_input" type="text" onkeypress="return bwg_check_search_input_enter(this, event)" name="bwg_search_<?php echo $current_view; ?>" value="<?php echo $bwg_search; ?>" placeholder="<?php echo $placeholder; ?>" />
|
2251 |
+
<input id="bwg_images_count_<?php echo $current_view; ?>" class="bwg_search_input" type="hidden" name="bwg_images_count_<?php echo $current_view; ?>" value="333<?php echo $images_count; ?>" >
|
2252 |
</span>
|
2253 |
</div>
|
2254 |
</div>
|
2409 |
<script type="text/javascript">
|
2410 |
jQuery(window).on("scroll", function() {
|
2411 |
if (jQuery(document).scrollTop() + jQuery(window).height() > (jQuery('#<?php echo $form_id; ?>').offset().top + jQuery('#<?php echo $form_id; ?>').height())) {
|
|
|
2412 |
jQuery(window).off("scroll");
|
2413 |
+
spider_page_<?php echo $current_view; ?>('', <?php echo $page_number; ?>, 1, true);
|
2414 |
return false;
|
2415 |
}
|
2416 |
});
|
2486 |
}
|
2487 |
}
|
2488 |
|
2489 |
+
/**
|
2490 |
+
* Images bulk actions.
|
2491 |
+
*
|
2492 |
+
* @return array
|
2493 |
+
*/
|
2494 |
+
public static function image_actions() {
|
2495 |
+
$image_actions = array(
|
2496 |
+
'image_resize' => array(
|
2497 |
+
'title' => __('Resize', BWG()->prefix),
|
2498 |
+
'bulk_action' => __('resized', BWG()->prefix),
|
2499 |
+
'disabled' => (BWG()->wp_editor_exists ? '' : 'disabled="disabled"'),
|
2500 |
+
),
|
2501 |
+
'image_recreate_thumbnail' => array(
|
2502 |
+
'title' => __('Recreate thumbnail', BWG()->prefix),
|
2503 |
+
'bulk_action' => __('recreated', BWG()->prefix),
|
2504 |
+
'disabled' => (BWG()->wp_editor_exists ? '' : 'disabled="disabled"'),
|
2505 |
+
),
|
2506 |
+
'image_rotate_left' => array(
|
2507 |
+
'title' => __('Rotate left', BWG()->prefix),
|
2508 |
+
'bulk_action' => __('rotated left', BWG()->prefix),
|
2509 |
+
'disabled' => (BWG()->wp_editor_exists ? '' : 'disabled="disabled"'),
|
2510 |
+
),
|
2511 |
+
'image_rotate_right' => array(
|
2512 |
+
'title' => __('Rotate right', BWG()->prefix),
|
2513 |
+
'bulk_action' => __('rotated right', BWG()->prefix),
|
2514 |
+
'disabled' => (BWG()->wp_editor_exists ? '' : 'disabled="disabled"'),
|
2515 |
+
),
|
2516 |
+
'image_set_watermark' => array(
|
2517 |
+
'title' => __('Set watermark', BWG()->prefix),
|
2518 |
+
'bulk_action' => __('edited', BWG()->prefix),
|
2519 |
+
'disabled' => (BWG()->wp_editor_exists ? '' : 'disabled="disabled"'),
|
2520 |
+
),
|
2521 |
+
'image_reset' => array(
|
2522 |
+
'title' => __('Reset', BWG()->prefix),
|
2523 |
+
'bulk_action' => __('reset', BWG()->prefix),
|
2524 |
+
'disabled' => '',
|
2525 |
+
),
|
2526 |
+
'image_edit' => array(
|
2527 |
+
'title' => __('Edit info', BWG()->prefix),
|
2528 |
+
'bulk_action' => __('edited', BWG()->prefix),
|
2529 |
+
'disabled' => '',
|
2530 |
+
),
|
2531 |
+
'image_add_tag' => array(
|
2532 |
+
'title' => __('Add tag', BWG()->prefix),
|
2533 |
+
'bulk_action' => __('edited', BWG()->prefix),
|
2534 |
+
'disabled' => '',
|
2535 |
+
),
|
2536 |
+
'image_publish' => array(
|
2537 |
+
'title' => __('Publish', BWG()->prefix),
|
2538 |
+
'bulk_action' => __('published', BWG()->prefix),
|
2539 |
+
'disabled' => '',
|
2540 |
+
),
|
2541 |
+
'image_unpublish' => array(
|
2542 |
+
'title' => __('Unpublish', BWG()->prefix),
|
2543 |
+
'bulk_action' => __('unpublished', BWG()->prefix),
|
2544 |
+
'disabled' => '',
|
2545 |
+
),
|
2546 |
+
'image_delete' => array(
|
2547 |
+
'title' => __('Delete', BWG()->prefix),
|
2548 |
+
'bulk_action' => __('deleted', BWG()->prefix),
|
2549 |
+
'disabled' => '',
|
2550 |
+
),
|
2551 |
+
);
|
2552 |
+
if ( function_exists('BWGEC') ) {
|
2553 |
+
$image_actions['set_image_pricelist'] = array(
|
2554 |
+
'title' => __('Add pricelist', BWG()->prefix),
|
2555 |
+
'bulk_action' => __('edited', BWG()->prefix),
|
2556 |
+
'disabled' => '',
|
2557 |
+
);
|
2558 |
+
$image_actions['remove_pricelist_all'] = array(
|
2559 |
+
'title' => __('Remove pricelist', BWG()->prefix),
|
2560 |
+
'bulk_action' => __('edited', BWG()->prefix),
|
2561 |
+
'disabled' => '',
|
2562 |
+
);
|
2563 |
+
}
|
2564 |
+
|
2565 |
+
return $image_actions;
|
2566 |
+
}
|
2567 |
+
|
2568 |
+
public static function allowed_upload_types( $type = '' ) {
|
2569 |
+
if ( $type ) {
|
2570 |
+
switch ( $type ) {
|
2571 |
+
case 'jpg':
|
2572 |
+
case 'jpeg':
|
2573 |
+
case 'gif':
|
2574 |
+
case 'png':
|
2575 |
+
return TRUE;
|
2576 |
+
break;
|
2577 |
+
}
|
2578 |
+
}
|
2579 |
+
|
2580 |
+
return FALSE;
|
2581 |
+
}
|
2582 |
+
|
2583 |
/**
|
2584 |
* Generate top bar.
|
2585 |
*
|
framework/howto/data.php
ADDED
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$howto = array(
|
3 |
+
0 => array(
|
4 |
+
'title' => __('How to insert Photo Gallery (shortcode) ?', BWG()->prefix),
|
5 |
+
'description' => '',
|
6 |
+
'content' => array(
|
7 |
+
1 => array(
|
8 |
+
'title' => __('Click Add Photo Gallery Button', BWG()->prefix),
|
9 |
+
'content' => __('To add a gallery using shortcode, please find and click the "Add Photo Gallery" button in your post/page editor navigation.', BWG()->prefix),
|
10 |
+
'screenshot' => BWG()->plugin_url . '/framework/howto/screenshots/0_1.png',
|
11 |
+
'function' => ''
|
12 |
+
),
|
13 |
+
2 => array(
|
14 |
+
'title' => __('Configure and Insert', BWG()->prefix),
|
15 |
+
'content' => __('In the pop-up, choose gallery view type, gallery, theme and configure other options for your gallery. Click Insert into post button to add the gallery to the post/page.', BWG()->prefix),
|
16 |
+
'screenshot' => BWG()->plugin_url . '/framework/howto/screenshots/0_2.png',
|
17 |
+
'function' => ''
|
18 |
+
),
|
19 |
+
3 => array(
|
20 |
+
'title' => __('Congrats !', BWG()->prefix),
|
21 |
+
'content' => __('You\'ve added a gallery to your post/page. Click on Photo Gallery icon again if you want to make changes to your gallery.', BWG()->prefix),
|
22 |
+
'screenshot' => BWG()->plugin_url . '/framework/howto/screenshots/0_3.png',
|
23 |
+
'function' => ''
|
24 |
+
),
|
25 |
+
)
|
26 |
+
),
|
27 |
+
1 => array(
|
28 |
+
'title' => __('How to insert Photo Gallery as widget ?', BWG()->prefix),
|
29 |
+
'description' => '',
|
30 |
+
'content' => array(
|
31 |
+
1 => array(
|
32 |
+
'title' => __('Add Gallery Widget', BWG()->prefix),
|
33 |
+
'content' => __('In your WordPress dashboard go to Appearance > Widgets. Find Photo Gallery Widget in the list, click and choose the area you want to display the gallery and click "Add Widget button".', BWG()->prefix),
|
34 |
+
'screenshot' => BWG()->plugin_url . '/framework/howto/screenshots/1_1.png',
|
35 |
+
'function' => ''
|
36 |
+
),
|
37 |
+
2 => array(
|
38 |
+
'title' => __('Configure and Save', BWG()->prefix),
|
39 |
+
'content' => __('Configure gallery options on the right side of the page, including gallery/album you want to display, image count, dimensions and more. Click save to display the changes on your website.', BWG()->prefix),
|
40 |
+
'screenshot' => BWG()->plugin_url . '/framework/howto/screenshots/1_2.png',
|
41 |
+
'function' => ''
|
42 |
+
),
|
43 |
+
3 => array(
|
44 |
+
'title' => __('Congrats !', BWG()->prefix),
|
45 |
+
'content' => __('Great, you\'ve added a gallery widget to your site. You can always go back to the widgets page on your dashboard to edit or delete the Photo Gallery Widget or add a new one.', BWG()->prefix),
|
46 |
+
'screenshot' => '',
|
47 |
+
'function' => ''
|
48 |
+
),
|
49 |
+
)
|
50 |
+
),
|
51 |
+
2 => array(
|
52 |
+
'title' => __('Advanced: PHP code', BWG()->prefix),
|
53 |
+
'description' => sprintf(__('%s This code should be inserted into a PHP file. This is a more advanced method of publishing and should be used in case you want the galleries to be integrated into your theme files ( for example in your website header or footer area ). You can\'t insert this code into your post / page editor.', BWG()->prefix), '<span class="wh-howto-attention">' . __('Attention:', BWG()->prefix) . '</span>'),
|
54 |
+
'content' => array(
|
55 |
+
1 => array(
|
56 |
+
'title' => __('Copy the Code', BWG()->prefix),
|
57 |
+
'content' => __('Copy the PHP code that appears below before proceeding to next step.', BWG()->prefix),
|
58 |
+
'screenshot' => '',
|
59 |
+
'function' => 'bwg_howto_php_code'
|
60 |
+
),
|
61 |
+
2 => array(
|
62 |
+
'title' => __('Paste the Code', BWG()->prefix),
|
63 |
+
'content' => __('In your dashboard navigation go to Appearance > Editor. Choose the specific section you want the gallery to appear and paste the PHP code you copied in that section. Press Update File button to save the changes in the code.', BWG()->prefix),
|
64 |
+
'screenshot' => BWG()->plugin_url . '/framework/howto/screenshots/2_2.png',
|
65 |
+
'function' => ''
|
66 |
+
),
|
67 |
+
3 => array(
|
68 |
+
'title' => __('Congrats !', BWG()->prefix),
|
69 |
+
'content' => __('The Photo Gallery will now appear in the section of the site you’ve chosen.', BWG()->prefix),
|
70 |
+
'screenshot' => '',
|
71 |
+
'function' => ''
|
72 |
+
),
|
73 |
+
)
|
74 |
+
),
|
75 |
+
);
|
76 |
+
function bwg_howto_php_code($params) {
|
77 |
+
?>
|
78 |
+
<script>
|
79 |
+
function wd_copy_input_value(input) {
|
80 |
+
var copyText = document.getElementById(input);
|
81 |
+
copyText.select();
|
82 |
+
document.execCommand("copy");
|
83 |
+
}
|
84 |
+
</script>
|
85 |
+
<style>
|
86 |
+
.wd-howto-phpcode {
|
87 |
+
background: #F1F1F1;
|
88 |
+
border: #0000000d 1px solid;
|
89 |
+
border-radius: 10px;
|
90 |
+
padding: 20px;
|
91 |
+
margin: 20px 0;
|
92 |
+
}
|
93 |
+
#wd_howto_php_code.wd-howto-phpinput {
|
94 |
+
color:#323A45;
|
95 |
+
background-color: #FFFFFF;
|
96 |
+
border: #00000026 0.5px solid;
|
97 |
+
border-radius: 18px;
|
98 |
+
box-shadow: 0px 3px 2px #EBEBEBB5;
|
99 |
+
width: calc(100% - 140px);
|
100 |
+
height: 36px;
|
101 |
+
font-family: Ubuntu;
|
102 |
+
font-size: 14px;
|
103 |
+
font-weight: 300;
|
104 |
+
padding: 0 10px;
|
105 |
+
}
|
106 |
+
.wd-howto-phpinput:focus {
|
107 |
+
outline: none;
|
108 |
+
}
|
109 |
+
.wd-howto-copy-button {
|
110 |
+
background: #2160B5;
|
111 |
+
border: #00000026 0.5px solid;
|
112 |
+
border-radius: 100px;
|
113 |
+
box-shadow: 0px 3px 2px #EBEBEBB5;
|
114 |
+
color: #FFFFFF;
|
115 |
+
font-family: Ubuntu;
|
116 |
+
font-size: 12px;
|
117 |
+
font-weight: 300;
|
118 |
+
text-transform: uppercase;
|
119 |
+
width: 90px;
|
120 |
+
height: 36px;
|
121 |
+
margin: 0 20px;
|
122 |
+
cursor: pointer;
|
123 |
+
}
|
124 |
+
.wd-howto-copy-button:hover {
|
125 |
+
opacity: 0.8;
|
126 |
+
}
|
127 |
+
.wd-howto-copy-button:focus {
|
128 |
+
outline: none;
|
129 |
+
}
|
130 |
+
@media (max-width:480px) {
|
131 |
+
.wd-howto-phpcode {
|
132 |
+
text-align: center;
|
133 |
+
}
|
134 |
+
#wd_howto_php_code.wd-howto-phpinput {
|
135 |
+
margin-bottom: 10px;
|
136 |
+
width: 100%;
|
137 |
+
}
|
138 |
+
}
|
139 |
+
</style>
|
140 |
+
<div class="wd-howto-phpcode">
|
141 |
+
<input id="wd_howto_php_code" class="wd-howto-phpinput" value="<?php photo_gallery(<?php echo $params['shortcode_id']; ?>); ?>" onclick="spider_select_value(this)" readonly="readonly" />
|
142 |
+
<button class="wd-howto-copy-button" onclick="wd_copy_input_value('wd_howto_php_code'); return false;"><?php _e('Copy', BWG()->prefix); ?></button>
|
143 |
+
</div>
|
144 |
+
<?php
|
145 |
+
}
|
framework/howto/howto.php
ADDED
@@ -0,0 +1,407 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once BWG()->plugin_dir . '/framework/howto/data.php';
|
3 |
+
wp_print_scripts('jquery-ui-tabs');
|
4 |
+
?>
|
5 |
+
<link href="https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700" rel="stylesheet">
|
6 |
+
<script>
|
7 |
+
function wd_how_to_use() {
|
8 |
+
jQuery('#wd_howto_container').toggleClass('hidden');
|
9 |
+
jQuery('body').toggleClass('wd-howto-disable-scroll');
|
10 |
+
}
|
11 |
+
function wd_toggle_mobile_menu() {
|
12 |
+
jQuery('.wd-howto-menu').toggleClass('wd-howto-menu-opened');
|
13 |
+
jQuery('.wd-howto-menu-overlay').toggleClass('hidden');
|
14 |
+
}
|
15 |
+
jQuery(document).ready(function () {
|
16 |
+
jQuery('#wd_howto_wrap').tabs({
|
17 |
+
activate: function() {
|
18 |
+
if (jQuery('#wd_howto_wrap .wd-howto-menu').hasClass('wd-howto-menu-opened')) {
|
19 |
+
wd_toggle_mobile_menu();
|
20 |
+
}
|
21 |
+
}
|
22 |
+
});
|
23 |
+
jQuery(document).keyup(function(e) {
|
24 |
+
if ( e.keyCode == 27 && !jQuery('#wd_howto_container').hasClass('hidden') ) {
|
25 |
+
wd_how_to_use();
|
26 |
+
}
|
27 |
+
});
|
28 |
+
});
|
29 |
+
jQuery(window).on('load', function () {
|
30 |
+
wd_howto_src_change();
|
31 |
+
});
|
32 |
+
function wd_howto_src_change() {
|
33 |
+
jQuery('.wd-howto-screenshot').each(function () {
|
34 |
+
var that = jQuery(this);
|
35 |
+
var src = that.attr('data-src');
|
36 |
+
jQuery('<img src="' + src + '" />').on('load', function () {
|
37 |
+
that.attr('src', src).removeClass('wd-howto-loading-image');
|
38 |
+
});
|
39 |
+
});
|
40 |
+
}
|
41 |
+
</script>
|
42 |
+
<style>
|
43 |
+
.wd-howto-disable-scroll {
|
44 |
+
overflow: hidden;
|
45 |
+
}
|
46 |
+
#wd_howto_container * {
|
47 |
+
box-sizing: border-box;
|
48 |
+
}
|
49 |
+
#wd_howto_container {
|
50 |
+
position: fixed;
|
51 |
+
top: 0;
|
52 |
+
right: 0;
|
53 |
+
bottom: 0;
|
54 |
+
left: 0;
|
55 |
+
background: #000000b3;
|
56 |
+
z-index: 100500;
|
57 |
+
}
|
58 |
+
.wd-howto-overlay {
|
59 |
+
position: absolute;
|
60 |
+
top: 0;
|
61 |
+
right: 0;
|
62 |
+
bottom: 0;
|
63 |
+
left: 0;
|
64 |
+
}
|
65 |
+
.wd-howto-wrap {
|
66 |
+
background: #fff;
|
67 |
+
font-size: 0;
|
68 |
+
height: 100%;
|
69 |
+
width: 100%;
|
70 |
+
position: absolute;
|
71 |
+
top: 0;
|
72 |
+
bottom: 0;
|
73 |
+
margin: auto;
|
74 |
+
right: 0;
|
75 |
+
left: 0;
|
76 |
+
max-width: 955px;
|
77 |
+
max-height: 600px;
|
78 |
+
}
|
79 |
+
.wd-howto-menu {
|
80 |
+
display: inline-block;
|
81 |
+
font-size: initial;
|
82 |
+
background: #FBFCFD;
|
83 |
+
border: #0000000d 1px solid;
|
84 |
+
box-shadow: 0 1px 6px #0000000d;
|
85 |
+
max-width: 310px;
|
86 |
+
width: 33%;
|
87 |
+
height: 100%;
|
88 |
+
vertical-align: top;
|
89 |
+
padding: 20px;
|
90 |
+
}
|
91 |
+
.wd-howto-content {
|
92 |
+
display: inline-block;
|
93 |
+
font-size: initial;
|
94 |
+
background: #FFFFFF;
|
95 |
+
border: #0000000d 1px solid;
|
96 |
+
box-shadow: 0 1px 6px #0000000d;
|
97 |
+
width: 67%;
|
98 |
+
height: 100%;
|
99 |
+
vertical-align: top;
|
100 |
+
padding: 20px;
|
101 |
+
overflow-x: hidden;
|
102 |
+
overflow-y: scroll;
|
103 |
+
}
|
104 |
+
.wd-howto-title {
|
105 |
+
color: #323A45;
|
106 |
+
font-family: Ubuntu;
|
107 |
+
font-size: 22px;
|
108 |
+
font-weight: 500;
|
109 |
+
}
|
110 |
+
#wd_howto_container ul {
|
111 |
+
list-style: none;
|
112 |
+
}
|
113 |
+
#wd_howto_container li {
|
114 |
+
color: #323A45;
|
115 |
+
font-family: Ubuntu;
|
116 |
+
font-size: 14px;
|
117 |
+
font-weight: 500;
|
118 |
+
line-height: 28px;
|
119 |
+
}
|
120 |
+
#wd_howto_container li a {
|
121 |
+
color: inherit;
|
122 |
+
text-decoration: none;
|
123 |
+
}
|
124 |
+
#wd_howto_container li:focus,
|
125 |
+
#wd_howto_container li a:focus {
|
126 |
+
box-shadow: none;
|
127 |
+
outline-width: 0;
|
128 |
+
}
|
129 |
+
#wd_howto_container li.ui-tabs-active {
|
130 |
+
color: #2160B5;
|
131 |
+
}
|
132 |
+
.wd-howto-divider-horizontal {
|
133 |
+
border: #0000000d 1px solid;
|
134 |
+
margin-top: 20px;
|
135 |
+
width: 100%;
|
136 |
+
}
|
137 |
+
.wd-howto-divider-vertical {
|
138 |
+
border: #0000000d 1px solid;
|
139 |
+
width: 0;
|
140 |
+
height: calc(100% - 30px);
|
141 |
+
margin: 10px 15px;
|
142 |
+
}
|
143 |
+
#wd_howto_container .wd-howto-content .wd-howto-description {
|
144 |
+
color: #323A45;
|
145 |
+
font-family: Ubuntu;
|
146 |
+
font-size: 12px;
|
147 |
+
font-weight: 300;
|
148 |
+
line-height: 18px;
|
149 |
+
}
|
150 |
+
.wh-howto-attention {
|
151 |
+
color: #FD3C31;
|
152 |
+
}
|
153 |
+
.wd-howto-numeration {
|
154 |
+
color: #FFFFFF;
|
155 |
+
display: inline-block;
|
156 |
+
background: #29B311;
|
157 |
+
border-radius: 50%;
|
158 |
+
width: 30px;
|
159 |
+
height: 30px;
|
160 |
+
line-height: 30px;
|
161 |
+
font-family: Ubuntu;
|
162 |
+
font-size: 15px;
|
163 |
+
font-weight: 400;
|
164 |
+
text-align: center;
|
165 |
+
vertical-align: middle;
|
166 |
+
}
|
167 |
+
.wd-howto-content-wrap {
|
168 |
+
margin-top: 20px;
|
169 |
+
position: relative;
|
170 |
+
}
|
171 |
+
.wd-howto-content-title {
|
172 |
+
display: inline-block;
|
173 |
+
color: #323A45;
|
174 |
+
line-height: 18px;
|
175 |
+
font-family: Ubuntu;
|
176 |
+
font-size: 16px;
|
177 |
+
font-weight: 400;
|
178 |
+
vertical-align: middle;
|
179 |
+
}
|
180 |
+
.wd-howto-content-content {
|
181 |
+
color: #323A45;
|
182 |
+
line-height: 18px;
|
183 |
+
font-family: Ubuntu;
|
184 |
+
font-size: 16px;
|
185 |
+
font-weight: 300;
|
186 |
+
margin-top: 10px;
|
187 |
+
}
|
188 |
+
.wd-howto-screenshot {
|
189 |
+
margin: 20px 0;
|
190 |
+
width: 100%;
|
191 |
+
}
|
192 |
+
.wd-howto-mobile {
|
193 |
+
display: none;
|
194 |
+
}
|
195 |
+
.wd-howto-content-left,
|
196 |
+
.wd-howto-content-right {
|
197 |
+
display: inline-block;
|
198 |
+
vertical-align: top;
|
199 |
+
}
|
200 |
+
.wd-howto-content-left {
|
201 |
+
width: 40px;
|
202 |
+
height: 100%;
|
203 |
+
position: absolute;
|
204 |
+
top: 0;
|
205 |
+
bottom: 0;
|
206 |
+
}
|
207 |
+
.wd-howto-content-right {
|
208 |
+
padding-left: 40px;
|
209 |
+
width: calc(100% - 40px);
|
210 |
+
height: 100%;
|
211 |
+
}
|
212 |
+
#wd_howto_container .dashicons-no-alt {
|
213 |
+
color: #0083B8;
|
214 |
+
position: absolute;
|
215 |
+
top: 0;
|
216 |
+
right: -20px;
|
217 |
+
font-size: 30px;
|
218 |
+
cursor: pointer;
|
219 |
+
}
|
220 |
+
.wd-howto-loading-image {
|
221 |
+
width: 50px;
|
222 |
+
}
|
223 |
+
@media (max-width:1000px) {
|
224 |
+
#wd_howto_container .dashicons-no-alt {
|
225 |
+
color: #414852;
|
226 |
+
position: absolute;
|
227 |
+
top: 18px;
|
228 |
+
right: 20px;
|
229 |
+
font-size: 25px;
|
230 |
+
cursor: pointer;
|
231 |
+
}
|
232 |
+
}
|
233 |
+
@media (max-width:768px) {
|
234 |
+
.wd-howto-content {
|
235 |
+
padding: 16px;
|
236 |
+
}
|
237 |
+
.wd-howto-divider-horizontal {
|
238 |
+
display: none;
|
239 |
+
}
|
240 |
+
.wd-howto-mobile .wd-howto-divider-horizontal {
|
241 |
+
width: 768px;
|
242 |
+
margin-left: -16px;
|
243 |
+
display: block;
|
244 |
+
}
|
245 |
+
.wd-howto-divider-vertical {
|
246 |
+
height: calc(100% - 10px);
|
247 |
+
margin: 5px 9px;
|
248 |
+
}
|
249 |
+
.wd-howto-menu {
|
250 |
+
left: -310px;
|
251 |
+
position: absolute;
|
252 |
+
width: 310px;
|
253 |
+
z-index: 100501;
|
254 |
+
transition: left 0.5s;
|
255 |
+
}
|
256 |
+
.wd-howto-menu-opened {
|
257 |
+
left: 0;
|
258 |
+
}
|
259 |
+
.wd-howto-content {
|
260 |
+
width: 100%;
|
261 |
+
}
|
262 |
+
.wd-howto-wrap {
|
263 |
+
width: 100%;
|
264 |
+
height: 100%;
|
265 |
+
max-width: none;
|
266 |
+
max-height: none;
|
267 |
+
}
|
268 |
+
.wd-howto-mobile {
|
269 |
+
display: initial;
|
270 |
+
position: absolute;
|
271 |
+
top: 0;
|
272 |
+
padding: 16px 0 0 0;
|
273 |
+
background-color: #FFFFFF;
|
274 |
+
z-index: 100500;
|
275 |
+
}
|
276 |
+
.wd-howto-content {
|
277 |
+
padding-top: 60px;
|
278 |
+
}
|
279 |
+
.wd-howto-desktop {
|
280 |
+
display: none;
|
281 |
+
}
|
282 |
+
#wd_howto_container .dashicons-menu {
|
283 |
+
color: #414852;
|
284 |
+
cursor: pointer;
|
285 |
+
}
|
286 |
+
.wd-howto-title {
|
287 |
+
font-size: 16px;
|
288 |
+
line-height: 20px;
|
289 |
+
}
|
290 |
+
.wd-howto-title-desktop {
|
291 |
+
margin-top: 14px;
|
292 |
+
font-size: 14px;
|
293 |
+
}
|
294 |
+
.wd-howto-content-title {
|
295 |
+
font-size: 14px;
|
296 |
+
}
|
297 |
+
.wd-howto-content-content {
|
298 |
+
font-size: 12px;
|
299 |
+
}
|
300 |
+
.wd-howto-numeration {
|
301 |
+
width: 20px;
|
302 |
+
height: 20px;
|
303 |
+
font-size: 12px;
|
304 |
+
line-height: 20px;
|
305 |
+
}
|
306 |
+
span.wd-howto-title {
|
307 |
+
padding-left: 14px;
|
308 |
+
}
|
309 |
+
#wd_howto_container li {
|
310 |
+
font-size: 12px;
|
311 |
+
}
|
312 |
+
.wd-howto-menu-overlay {
|
313 |
+
position: fixed;
|
314 |
+
top: 0;
|
315 |
+
right: 0;
|
316 |
+
bottom: 0;
|
317 |
+
left: 0;
|
318 |
+
z-index: 100500;
|
319 |
+
}
|
320 |
+
#wd_howto_container .dashicons-no-alt {
|
321 |
+
color: #414852;
|
322 |
+
position: fixed;
|
323 |
+
top: 16px;
|
324 |
+
right: 16px;
|
325 |
+
font-size: 25px;
|
326 |
+
cursor: pointer;
|
327 |
+
}
|
328 |
+
}
|
329 |
+
</style>
|
330 |
+
<button class="button button-secondary button-large" onclick="wd_how_to_use(); return false;">
|
331 |
+
<?php _e('How to use', BWG()->prefix); ?>
|
332 |
+
</button>
|
333 |
+
<div id="wd_howto_container" class="hidden">
|
334 |
+
<div class="wd-howto-overlay" onclick="wd_how_to_use(); return false;"></div>
|
335 |
+
<div id="wd_howto_wrap" class="wd-howto-wrap">
|
336 |
+
<div class="wd-howto-menu-overlay hidden" onclick="wd_toggle_mobile_menu()"></div>
|
337 |
+
<div class="wd-howto-menu">
|
338 |
+
<div class="wd-howto-title"><?php _e('How to ...', BWG()->prefix); ?></div>
|
339 |
+
<ul>
|
340 |
+
<?php
|
341 |
+
foreach ($howto as $item => $value) {
|
342 |
+
?>
|
343 |
+
<li><a href="#wd-howto-<?php echo $item; ?>"><?php echo $value['title']; ?></a></li>
|
344 |
+
<?php
|
345 |
+
}
|
346 |
+
?>
|
347 |
+
</ul>
|
348 |
+
</div>
|
349 |
+
<div class="wd-howto-content">
|
350 |
+
<?php
|
351 |
+
foreach ($howto as $item => $value) {
|
352 |
+
?>
|
353 |
+
<div id="wd-howto-<?php echo $item; ?>">
|
354 |
+
<div class="wd-howto-title wd-howto-mobile">
|
355 |
+
<span class="dashicons dashicons-menu" onclick="wd_toggle_mobile_menu()"></span>
|
356 |
+
<span class="wd-howto-title"><?php _e('How to ...', BWG()->prefix); ?></span>
|
357 |
+
<span class="dashicons dashicons-no-alt" onclick="wd_how_to_use(); return false;"></span>
|
358 |
+
<div class="wd-howto-divider-horizontal"></div>
|
359 |
+
</div>
|
360 |
+
<div class="wd-howto-title wd-howto-title-desktop"><?php echo $value['title']; ?></div>
|
361 |
+
<span class="dashicons dashicons-no-alt" onclick="wd_how_to_use(); return false;"></span>
|
362 |
+
<div class="wd-howto-divider-horizontal"></div>
|
363 |
+
<?php
|
364 |
+
if (isset($value[ 'description' ]) && $value[ 'description' ]) {
|
365 |
+
?>
|
366 |
+
<p class="wd-howto-description"><?php echo $value[ 'description' ]; ?></p>
|
367 |
+
<?php
|
368 |
+
}
|
369 |
+
?>
|
370 |
+
<?php
|
371 |
+
foreach ($value['content'] as $i => $section) {
|
372 |
+
?>
|
373 |
+
<div class="wd-howto-content-wrap">
|
374 |
+
<div class="wd-howto-content-left">
|
375 |
+
<div class="wd-howto-numeration"><?php echo $i; ?></div>
|
376 |
+
<div class="wd-howto-divider-vertical"></div>
|
377 |
+
</div>
|
378 |
+
<div class="wd-howto-content-right">
|
379 |
+
<div class="wd-howto-content-title">
|
380 |
+
<?php echo $section[ 'title' ]; ?>
|
381 |
+
</div>
|
382 |
+
<div class="wd-howto-content-content">
|
383 |
+
<?php echo $section[ 'content' ]; ?>
|
384 |
+
</div>
|
385 |
+
<?php
|
386 |
+
if (isset($section[ 'screenshot' ]) && $section[ 'screenshot' ]) {
|
387 |
+
?>
|
388 |
+
<img class="wd-howto-screenshot wd-howto-loading-image" src="<?php echo BWG()->plugin_url ?>/images/ajax_loader.png" data-src="<?php echo $section[ 'screenshot' ]; ?>" alt="" />
|
389 |
+
<?php
|
390 |
+
}
|
391 |
+
if (isset($section[ 'function' ]) && $section[ 'function' ]) {
|
392 |
+
$section[ 'function' ]($params);
|
393 |
+
}
|
394 |
+
?>
|
395 |
+
</div>
|
396 |
+
</div>
|
397 |
+
<?php
|
398 |
+
}
|
399 |
+
?>
|
400 |
+
</div>
|
401 |
+
<?php
|
402 |
+
}
|
403 |
+
?>
|
404 |
+
</div>
|
405 |
+
</div>
|
406 |
+
</div>
|
407 |
+
<?php
|
framework/howto/screenshots/0_1.png
ADDED
Binary file
|
framework/howto/screenshots/0_2.png
ADDED
Binary file
|
framework/howto/screenshots/0_3.png
ADDED
Binary file
|
framework/howto/screenshots/1_1.png
ADDED
Binary file
|
framework/howto/screenshots/1_2.png
ADDED
Binary file
|
framework/howto/screenshots/2_2.png
ADDED
Binary file
|
frontend/controllers/BWGControllerAlbum_compact_preview.php
CHANGED
@@ -8,12 +8,9 @@ class BWGControllerAlbum_compact_preview {
|
|
8 |
$this->display($params, $from_shortcode, $bwg);
|
9 |
}
|
10 |
|
11 |
-
public function display($params, $from_shortcode = 0, $bwg = 0) {
|
12 |
-
require_once BWG()->plugin_dir . "/frontend/models/BWGModelAlbum_compact_preview.php";
|
13 |
-
$model = new BWGModelAlbum_compact_preview();
|
14 |
-
|
15 |
require_once BWG()->plugin_dir . "/frontend/views/BWGViewAlbum_compact_preview.php";
|
16 |
-
$view = new BWGViewAlbum_compact_preview(
|
17 |
if( isset($params[ 'show_gallery_description' ]) && $params[ 'show_gallery_description' ] ) {
|
18 |
if ( isset( $_POST[ 'type_' . $bwg ] ) && isset( $_POST[ 'album_gallery_id_' . $bwg ] ) ) {
|
19 |
$description = WDWLibrary::get_album_gallery_title_description( $_POST[ 'type_' . $bwg ], $_POST[ 'album_gallery_id_' . $bwg ] );
|
8 |
$this->display($params, $from_shortcode, $bwg);
|
9 |
}
|
10 |
|
11 |
+
public function display($params = array(), $from_shortcode = 0, $bwg = 0) {
|
|
|
|
|
|
|
12 |
require_once BWG()->plugin_dir . "/frontend/views/BWGViewAlbum_compact_preview.php";
|
13 |
+
$view = new BWGViewAlbum_compact_preview();
|
14 |
if( isset($params[ 'show_gallery_description' ]) && $params[ 'show_gallery_description' ] ) {
|
15 |
if ( isset( $_POST[ 'type_' . $bwg ] ) && isset( $_POST[ 'album_gallery_id_' . $bwg ] ) ) {
|
16 |
$description = WDWLibrary::get_album_gallery_title_description( $_POST[ 'type_' . $bwg ], $_POST[ 'album_gallery_id_' . $bwg ] );
|
frontend/controllers/BWGControllerAlbum_extended_preview.php
CHANGED
@@ -8,9 +8,7 @@ class BWGControllerAlbum_extended_preview {
|
|
8 |
$this->display($params, $from_shortcode, $bwg);
|
9 |
}
|
10 |
|
11 |
-
public function display($params, $from_shortcode = 0, $bwg = 0) {
|
12 |
-
require_once BWG()->plugin_dir . "/frontend/models/BWGModelAlbum_extended_preview.php";
|
13 |
-
$model = new BWGModelAlbum_extended_preview();
|
14 |
if( $params['show_gallery_description'] ) {
|
15 |
if ( isset($_POST['type_' . $bwg]) && isset($_POST['album_gallery_id_' . $bwg]) ) {
|
16 |
$description = WDWLibrary::get_album_gallery_title_description($_POST['type_' . $bwg], $_POST['album_gallery_id_' . $bwg]);
|
@@ -41,7 +39,7 @@ class BWGControllerAlbum_extended_preview {
|
|
41 |
}
|
42 |
|
43 |
require_once BWG()->plugin_dir . "/frontend/views/BWGViewAlbum_extended_preview.php";
|
44 |
-
$view = new BWGViewAlbum_extended_preview(
|
45 |
$view->display($params, $from_shortcode, $bwg);
|
46 |
}
|
47 |
}
|
8 |
$this->display($params, $from_shortcode, $bwg);
|
9 |
}
|
10 |
|
11 |
+
public function display($params = array(), $from_shortcode = 0, $bwg = 0) {
|
|
|
|
|
12 |
if( $params['show_gallery_description'] ) {
|
13 |
if ( isset($_POST['type_' . $bwg]) && isset($_POST['album_gallery_id_' . $bwg]) ) {
|
14 |
$description = WDWLibrary::get_album_gallery_title_description($_POST['type_' . $bwg], $_POST['album_gallery_id_' . $bwg]);
|
39 |
}
|
40 |
|
41 |
require_once BWG()->plugin_dir . "/frontend/views/BWGViewAlbum_extended_preview.php";
|
42 |
+
$view = new BWGViewAlbum_extended_preview();
|
43 |
$view->display($params, $from_shortcode, $bwg);
|
44 |
}
|
45 |
}
|
frontend/controllers/BWGControllerAlbum_masonry_preview.php
CHANGED
@@ -8,12 +8,9 @@ class BWGControllerAlbum_masonry_preview {
|
|
8 |
$this->display($params, $from_shortcode, $bwg);
|
9 |
}
|
10 |
|
11 |
-
public function display($params, $from_shortcode = 0, $bwg = 0) {
|
12 |
-
require_once BWG()->plugin_dir . "/frontend/models/BWGModelAlbum_masonry_preview.php";
|
13 |
-
$model = new BWGModelAlbum_masonry_preview();
|
14 |
-
|
15 |
require_once BWG()->plugin_dir . "/frontend/views/BWGViewAlbum_masonry_preview.php";
|
16 |
-
$view = new BWGViewAlbum_masonry_preview(
|
17 |
|
18 |
if( isset($params[ 'show_gallery_description' ]) && $params[ 'show_gallery_description' ] ) {
|
19 |
if ( isset( $_POST[ 'type_' . $bwg ] ) && isset( $_POST[ 'album_gallery_id_' . $bwg ] ) ) {
|
8 |
$this->display($params, $from_shortcode, $bwg);
|
9 |
}
|
10 |
|
11 |
+
public function display($params = array(), $from_shortcode = 0, $bwg = 0) {
|
|
|
|
|
|
|
12 |
require_once BWG()->plugin_dir . "/frontend/views/BWGViewAlbum_masonry_preview.php";
|
13 |
+
$view = new BWGViewAlbum_masonry_preview();
|
14 |
|
15 |
if( isset($params[ 'show_gallery_description' ]) && $params[ 'show_gallery_description' ] ) {
|
16 |
if ( isset( $_POST[ 'type_' . $bwg ] ) && isset( $_POST[ 'album_gallery_id_' . $bwg ] ) ) {
|
frontend/controllers/BWGControllerBlog_style.php
CHANGED
@@ -22,12 +22,9 @@ class BWGControllerBlog_style {
|
|
22 |
$this->display($params, $from_shortcode, $bwg);
|
23 |
}
|
24 |
|
25 |
-
public function display($params, $from_shortcode = 0, $bwg = 0) {
|
26 |
-
require_once BWG()->plugin_dir . "/frontend/models/BWGModelBlog_style.php";
|
27 |
-
$model = new BWGModelBlog_style();
|
28 |
-
|
29 |
require_once BWG()->plugin_dir . "/frontend/views/BWGViewBlog_style.php";
|
30 |
-
$view = new BWGViewBlog_style(
|
31 |
|
32 |
$view->display($params, $from_shortcode, $bwg);
|
33 |
}
|
22 |
$this->display($params, $from_shortcode, $bwg);
|
23 |
}
|
24 |
|
25 |
+
public function display($params = array(), $from_shortcode = 0, $bwg = 0) {
|
|
|
|
|
|
|
26 |
require_once BWG()->plugin_dir . "/frontend/views/BWGViewBlog_style.php";
|
27 |
+
$view = new BWGViewBlog_style();
|
28 |
|
29 |
$view->display($params, $from_shortcode, $bwg);
|
30 |
}
|
frontend/controllers/BWGControllerCarousel.php
CHANGED
@@ -22,12 +22,9 @@ class BWGControllerCarousel {
|
|
22 |
$this->display($params, $from_shortcode, $bwg);
|
23 |
}
|
24 |
|
25 |
-
public function display($params, $from_shortcode = 0, $bwg = 0) {
|
26 |
-
require_once BWG()->plugin_dir . "/frontend/models/BWGModelCarousel.php";
|
27 |
-
$model = new BWGModelCarousel();
|
28 |
-
|
29 |
require_once BWG()->plugin_dir . "/frontend/views/BWGViewCarousel.php";
|
30 |
-
$view = new BWGViewCarousel(
|
31 |
$view->display($params, $from_shortcode, $bwg);
|
32 |
}
|
33 |
////////////////////////////////////////////////////////////////////////////////////////
|
22 |
$this->display($params, $from_shortcode, $bwg);
|
23 |
}
|
24 |
|
25 |
+
public function display($params = array(), $from_shortcode = 0, $bwg = 0) {
|
|
|
|
|
|
|
26 |
require_once BWG()->plugin_dir . "/frontend/views/BWGViewCarousel.php";
|
27 |
+
$view = new BWGViewCarousel();
|
28 |
$view->display($params, $from_shortcode, $bwg);
|
29 |
}
|
30 |
////////////////////////////////////////////////////////////////////////////////////////
|
frontend/controllers/BWGControllerDownload_gallery.php
CHANGED
@@ -8,6 +8,16 @@ class BWGControllerDownload_gallery {
|
|
8 |
public function display() {
|
9 |
require_once BWG()->plugin_dir . "/frontend/views/BWGViewDownload_gallery.php";
|
10 |
$view = new BWGViewDownload_gallery();
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
}
|
13 |
}
|
8 |
public function display() {
|
9 |
require_once BWG()->plugin_dir . "/frontend/views/BWGViewDownload_gallery.php";
|
10 |
$view = new BWGViewDownload_gallery();
|
11 |
+
|
12 |
+
$params = array();
|
13 |
+
|
14 |
+
$params['bwg'] = WDWLibrary::get('bwg');
|
15 |
+
$params['search'] = WDWLibrary::get('bwg_search_'.$params['bwg']);
|
16 |
+
$params['gallery_id'] = WDWLibrary::get('gallery_id');
|
17 |
+
$params['type'] = WDWLibrary::get('type');
|
18 |
+
$params['tag_input_name'] = WDWLibrary::get('tag_input_name');
|
19 |
+
$params['tag'] = WDWLibrary::get('tag');
|
20 |
+
|
21 |
+
$view->display( $params );
|
22 |
}
|
23 |
}
|
frontend/controllers/BWGControllerImage_browser.php
CHANGED
@@ -8,12 +8,9 @@ class BWGControllerImage_browser {
|
|
8 |
$this->display($params, $from_shortcode, $bwg);
|
9 |
}
|
10 |
|
11 |
-
public function display($params, $from_shortcode = 0, $bwg = 0) {
|
12 |
-
require_once BWG()->plugin_dir . "/frontend/models/BWGModelImage_browser.php";
|
13 |
-
$model = new BWGModelImage_browser();
|
14 |
-
|
15 |
require_once BWG()->plugin_dir . "/frontend/views/BWGViewImage_browser.php";
|
16 |
-
$view = new BWGViewImage_browser(
|
17 |
|
18 |
$view->display($params, $from_shortcode, $bwg);
|
19 |
}
|
8 |
$this->display($params, $from_shortcode, $bwg);
|
9 |
}
|
10 |
|
11 |
+
public function display($params = array(), $from_shortcode = 0, $bwg = 0) {
|
|
|
|
|
|
|
12 |
require_once BWG()->plugin_dir . "/frontend/views/BWGViewImage_browser.php";
|
13 |
+
$view = new BWGViewImage_browser();
|
14 |
|
15 |
$view->display($params, $from_shortcode, $bwg);
|
16 |
}
|
frontend/controllers/BWGControllerThumbnails_masonry.php
CHANGED
@@ -9,12 +9,9 @@ class BWGControllerThumbnails_masonry {
|
|
9 |
$this->display($params, $from_shortcode, $bwg);
|
10 |
}
|
11 |
|
12 |
-
public function display($params, $from_shortcode = 0, $bwg = 0) {
|
13 |
-
require_once BWG()->plugin_dir . "/frontend/models/BWGModelThumbnails_masonry.php";
|
14 |
-
$model = new BWGModelThumbnails_masonry();
|
15 |
-
|
16 |
require_once BWG()->plugin_dir . "/frontend/views/BWGViewThumbnails_masonry.php";
|
17 |
-
$view = new BWGViewThumbnails_masonry(
|
18 |
|
19 |
$view->display($params, $from_shortcode, $bwg);
|
20 |
}
|
9 |
$this->display($params, $from_shortcode, $bwg);
|
10 |
}
|
11 |
|
12 |
+
public function display($params = array(), $from_shortcode = 0, $bwg = 0) {
|
|
|
|
|
|
|
13 |
require_once BWG()->plugin_dir . "/frontend/views/BWGViewThumbnails_masonry.php";
|
14 |
+
$view = new BWGViewThumbnails_masonry();
|
15 |
|
16 |
$view->display($params, $from_shortcode, $bwg);
|
17 |
}
|
frontend/controllers/BWGControllerThumbnails_mosaic.php
CHANGED
@@ -9,11 +9,8 @@ class BWGControllerThumbnails_mosaic {
|
|
9 |
}
|
10 |
|
11 |
public function display($params, $from_shortcode = 0, $bwg = 0) {
|
12 |
-
require_once BWG()->plugin_dir . "/frontend/models/BWGModelThumbnails_mosaic.php";
|
13 |
-
$model = new BWGModelThumbnails_mosaic();
|
14 |
-
|
15 |
require_once BWG()->plugin_dir . "/frontend/views/BWGViewThumbnails_mosaic.php";
|
16 |
-
$view = new BWGViewThumbnails_mosaic(
|
17 |
|
18 |
$view->display($params, $from_shortcode, $bwg);
|
19 |
}
|
9 |
}
|
10 |
|
11 |
public function display($params, $from_shortcode = 0, $bwg = 0) {
|
|
|
|
|
|
|
12 |
require_once BWG()->plugin_dir . "/frontend/views/BWGViewThumbnails_mosaic.php";
|
13 |
+
$view = new BWGViewThumbnails_mosaic();
|
14 |
|
15 |
$view->display($params, $from_shortcode, $bwg);
|
16 |
}
|
frontend/controllers/BWGControllerWidget.php
CHANGED
@@ -10,7 +10,7 @@ class BWGControllerWidgetFrontEnd {
|
|
10 |
}
|
11 |
}
|
12 |
|
13 |
-
public function view_tags($params) {
|
14 |
require_once BWG()->plugin_dir . "/frontend/models/BWGModelWidget.php";
|
15 |
$model = new BWGModelWidgetFrontEnd();
|
16 |
|
10 |
}
|
11 |
}
|
12 |
|
13 |
+
public function view_tags($params = array()) {
|
14 |
require_once BWG()->plugin_dir . "/frontend/models/BWGModelWidget.php";
|
15 |
$model = new BWGModelWidgetFrontEnd();
|
16 |
|
frontend/controllers/controller.php
CHANGED
@@ -4,7 +4,7 @@ class BWGControllerSite {
|
|
4 |
private $model;
|
5 |
private $view;
|
6 |
|
7 |
-
public function __construct($view) {
|
8 |
require_once BWG()->plugin_dir . "/frontend/models/model.php";
|
9 |
$this->model = new BWGModelSite();
|
10 |
|
@@ -15,11 +15,10 @@ class BWGControllerSite {
|
|
15 |
}
|
16 |
|
17 |
public function execute($params = array(), $from_shortcode = 0, $bwg = 0) {
|
18 |
-
|
19 |
$theme_row = $this->model->get_theme_row_data($theme_id);
|
20 |
if ( !$theme_row ) {
|
21 |
echo WDWLibrary::message(__('There is no theme selected or the theme was deleted.', BWG()->prefix), 'wd_error');
|
22 |
-
|
23 |
return;
|
24 |
}
|
25 |
else {
|
@@ -70,10 +69,7 @@ class BWGControllerSite {
|
|
70 |
$params['sort_by'] = 'RAND()';
|
71 |
}
|
72 |
else {
|
73 |
-
if ( $sort_by
|
74 |
-
$params['sort_by'] = $params['sort_by'];
|
75 |
-
}
|
76 |
-
else {
|
77 |
$params['sort_by'] = $sort_by;
|
78 |
}
|
79 |
}
|
@@ -91,7 +87,6 @@ class BWGControllerSite {
|
|
91 |
else {
|
92 |
echo WDWLibrary::message(__('There are no images in this gallery.', BWG()->prefix), 'wd_error');
|
93 |
}
|
94 |
-
|
95 |
return;
|
96 |
}
|
97 |
$params['image_rows'] = $image_rows;
|
@@ -163,10 +158,10 @@ class BWGControllerSite {
|
|
163 |
$params_array['watermark_height'] = $params['watermark_height'];
|
164 |
}
|
165 |
$params['params_array'] = $params_array;
|
166 |
-
|
167 |
}
|
168 |
|
169 |
-
public function display($params, $from_shortcode = 0, $bwg = 0) {
|
170 |
$this->view->display($params, $from_shortcode, $bwg);
|
171 |
}
|
172 |
}
|
4 |
private $model;
|
5 |
private $view;
|
6 |
|
7 |
+
public function __construct($view = 'Thumbnails') {
|
8 |
require_once BWG()->plugin_dir . "/frontend/models/model.php";
|
9 |
$this->model = new BWGModelSite();
|
10 |
|
15 |
}
|
16 |
|
17 |
public function execute($params = array(), $from_shortcode = 0, $bwg = 0) {
|
18 |
+
$theme_id = $params['theme_id'];
|
19 |
$theme_row = $this->model->get_theme_row_data($theme_id);
|
20 |
if ( !$theme_row ) {
|
21 |
echo WDWLibrary::message(__('There is no theme selected or the theme was deleted.', BWG()->prefix), 'wd_error');
|
|
|
22 |
return;
|
23 |
}
|
24 |
else {
|
69 |
$params['sort_by'] = 'RAND()';
|
70 |
}
|
71 |
else {
|
72 |
+
if ( in_array($sort_by, array('default', 'filename', 'size')) ) {
|
|
|
|
|
|
|
73 |
$params['sort_by'] = $sort_by;
|
74 |
}
|
75 |
}
|
87 |
else {
|
88 |
echo WDWLibrary::message(__('There are no images in this gallery.', BWG()->prefix), 'wd_error');
|
89 |
}
|
|
|
90 |
return;
|
91 |
}
|
92 |
$params['image_rows'] = $image_rows;
|
158 |
$params_array['watermark_height'] = $params['watermark_height'];
|
159 |
}
|
160 |
$params['params_array'] = $params_array;
|
161 |
+
$this->display($params, $from_shortcode, $bwg);
|
162 |
}
|
163 |
|
164 |
+
public function display($params = array(), $from_shortcode = 0, $bwg = 0) {
|
165 |
$this->view->display($params, $from_shortcode, $bwg);
|
166 |
}
|
167 |
}
|
frontend/models/BWGModelGalleryBox.php
CHANGED
@@ -8,7 +8,19 @@ class BWGModelGalleryBox {
|
|
8 |
|
9 |
public function get_image_rows_data($gallery_id, $bwg, $sort_by, $order_by = 'asc', $tag = 0) {
|
10 |
global $wpdb;
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
$sort_by = ' CAST(image.' . $sort_by . ' AS SIGNED) ';
|
13 |
}
|
14 |
elseif ($sort_by == 'random' || $sort_by == 'RAND()') {
|
@@ -17,18 +29,54 @@ class BWGModelGalleryBox {
|
|
17 |
elseif (($sort_by != 'alt') && ($sort_by != 'date') && ($sort_by != 'filetype') && ($sort_by != 'filename')) {
|
18 |
$sort_by = 'image.`order`';
|
19 |
}
|
|
|
|
|
|
|
|
|
20 |
if (strtolower($order_by) != 'asc') {
|
21 |
$order_by = 'desc';
|
22 |
}
|
23 |
WDWLibrary::bwg_session_start();
|
24 |
$bwg_random_seed = isset($_SESSION['bwg_random_seed_'. $bwg]) ? $_SESSION['bwg_random_seed_'. $bwg] : '';
|
25 |
-
|
26 |
-
$
|
27 |
-
$
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
}
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
$where .= ($gallery_id ? ' AND image.gallery_id = "' . $gallery_id . '" ' : '') . ($tag ? ' AND tag.tag_id = "' . $tag . '" ' : '');
|
33 |
$join = $tag ? 'LEFT JOIN ' . $wpdb->prefix . 'bwg_image_tag as tag ON image.id=tag.image_id' : '';
|
34 |
|
@@ -67,4 +115,4 @@ class BWGModelGalleryBox {
|
|
67 |
public function get_image_pricelist($image_id) {
|
68 |
return FALSE;
|
69 |
}
|
70 |
-
}
|
8 |
|
9 |
public function get_image_rows_data($gallery_id, $bwg, $sort_by, $order_by = 'asc', $tag = 0) {
|
10 |
global $wpdb;
|
11 |
+
|
12 |
+
$bwg_sort_by_temp = WDWLibrary::get('filtersortby', '');
|
13 |
+
if ( $bwg_sort_by_temp == '' ) { /* for thumbnail view */
|
14 |
+
$bwg_sort_by_temp = WDWLibrary::get('filtersortby_' . $bwg, ''); /* for other views */
|
15 |
+
if ( $bwg_sort_by_temp != '' ) {
|
16 |
+
$sort_by = $bwg_sort_by_temp;
|
17 |
+
}
|
18 |
+
}
|
19 |
+
else {
|
20 |
+
$sort_by = $bwg_sort_by_temp;
|
21 |
+
}
|
22 |
+
|
23 |
+
if ( $sort_by == 'size' || $sort_by == 'resolution' ) {
|
24 |
$sort_by = ' CAST(image.' . $sort_by . ' AS SIGNED) ';
|
25 |
}
|
26 |
elseif ($sort_by == 'random' || $sort_by == 'RAND()') {
|
29 |
elseif (($sort_by != 'alt') && ($sort_by != 'date') && ($sort_by != 'filetype') && ($sort_by != 'filename')) {
|
30 |
$sort_by = 'image.`order`';
|
31 |
}
|
32 |
+
else {
|
33 |
+
$sort_by = 'image.' . $sort_by;
|
34 |
+
}
|
35 |
+
|
36 |
if (strtolower($order_by) != 'asc') {
|
37 |
$order_by = 'desc';
|
38 |
}
|
39 |
WDWLibrary::bwg_session_start();
|
40 |
$bwg_random_seed = isset($_SESSION['bwg_random_seed_'. $bwg]) ? $_SESSION['bwg_random_seed_'. $bwg] : '';
|
41 |
+
|
42 |
+
$bwg_filter_tag_temp = WDWLibrary::get('filter_tag', 0);
|
43 |
+
if ( $bwg_filter_tag_temp == 0 ) {
|
44 |
+
$filter_tags = array();
|
45 |
+
$bwg_filter_tag_temp = WDWLibrary::get('filter_tag_' . $bwg, 0);
|
46 |
+
if ( $bwg_filter_tag_temp != 0 ) {
|
47 |
+
$filter_tags = explode(",", $bwg_filter_tag_temp);
|
48 |
+
}
|
49 |
+
}
|
50 |
+
else {
|
51 |
+
$filter_tags = explode(",", $bwg_filter_tag_temp);
|
52 |
}
|
53 |
|
54 |
+
$filter_search_name_temp = WDWLibrary::get('filter_search_name', '');
|
55 |
+
if ( $filter_search_name_temp == '' ) { /* for thumbnail view */
|
56 |
+
$filter_search_name_temp = WDWLibrary::get('filter_search_name_' . $bwg);
|
57 |
+
if ( $filter_search_name_temp != '' ) {
|
58 |
+
$filter_search_name = $filter_search_name_temp;
|
59 |
+
}
|
60 |
+
}
|
61 |
+
else {
|
62 |
+
$filter_search_name = $filter_search_name_temp;
|
63 |
+
}
|
64 |
+
|
65 |
+
$where = '';
|
66 |
+
if ( !empty($filter_search_name) ) {
|
67 |
+
$bwg_search_keys = explode(' ', trim($filter_search_name));
|
68 |
+
$alt_search = '(';
|
69 |
+
$description_search = '(';
|
70 |
+
foreach( $bwg_search_keys as $search_key) {
|
71 |
+
$alt_search .= '`image`.`alt` LIKE "%' . $search_key . '%" AND ';
|
72 |
+
$description_search .= '`image`.`description` LIKE "%' . $search_key . '%" AND ';
|
73 |
+
}
|
74 |
+
$alt_search = rtrim($alt_search, 'AND ');
|
75 |
+
$alt_search .= ')';
|
76 |
+
$description_search = rtrim($description_search, 'AND ');
|
77 |
+
$description_search .= ')';
|
78 |
+
$where = 'AND (' . $alt_search . ' OR ' . $description_search . ')';
|
79 |
+
}
|
80 |
$where .= ($gallery_id ? ' AND image.gallery_id = "' . $gallery_id . '" ' : '') . ($tag ? ' AND tag.tag_id = "' . $tag . '" ' : '');
|
81 |
$join = $tag ? 'LEFT JOIN ' . $wpdb->prefix . 'bwg_image_tag as tag ON image.id=tag.image_id' : '';
|
82 |
|
115 |
public function get_image_pricelist($image_id) {
|
116 |
return FALSE;
|
117 |
}
|
118 |
+
}
|
frontend/models/BWGModelWidget.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
class BWGModelWidgetFrontEnd {
|
3 |
-
public function get_tags_data($count) {
|
4 |
global $wpdb;
|
5 |
$rows = $wpdb->get_results('SELECT image.thumb_url as thumb_url, image.id as image_id, tags.name, tags.slug, tags.term_id, image.filetype FROM ' . $wpdb->prefix . 'terms AS tags INNER JOIN ' . $wpdb->prefix . 'term_taxonomy AS taxonomy ON taxonomy.term_id=tags.term_id INNER JOIN (SELECT image.thumb_url, tag.tag_id, image.id, image.filetype FROM ' . $wpdb->prefix . 'bwg_image AS image INNER JOIN ' . $wpdb->prefix . 'bwg_image_tag AS tag ON image.id=tag.image_id ORDER BY RAND()) AS image ON image.tag_id=tags.term_id WHERE taxonomy.taxonomy="bwg_tag" GROUP BY tags.term_id' . ($count ? ' LIMIT ' . $count : ""));
|
6 |
foreach ( $rows as $row ) {
|
1 |
<?php
|
2 |
class BWGModelWidgetFrontEnd {
|
3 |
+
public function get_tags_data($count = 0) {
|
4 |
global $wpdb;
|
5 |
$rows = $wpdb->get_results('SELECT image.thumb_url as thumb_url, image.id as image_id, tags.name, tags.slug, tags.term_id, image.filetype FROM ' . $wpdb->prefix . 'terms AS tags INNER JOIN ' . $wpdb->prefix . 'term_taxonomy AS taxonomy ON taxonomy.term_id=tags.term_id INNER JOIN (SELECT image.thumb_url, tag.tag_id, image.id, image.filetype FROM ' . $wpdb->prefix . 'bwg_image AS image INNER JOIN ' . $wpdb->prefix . 'bwg_image_tag AS tag ON image.id=tag.image_id ORDER BY RAND()) AS image ON image.tag_id=tags.term_id WHERE taxonomy.taxonomy="bwg_tag" GROUP BY tags.term_id' . ($count ? ' LIMIT ' . $count : ""));
|
6 |
foreach ( $rows as $row ) {
|
frontend/models/model.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
class BWGModelSite {
|
3 |
-
public function get_theme_row_data($id) {
|
4 |
global $wpdb;
|
5 |
if ($id) {
|
6 |
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'bwg_theme WHERE id="%d"', $id));
|
@@ -14,7 +14,7 @@ class BWGModelSite {
|
|
14 |
return $row;
|
15 |
}
|
16 |
|
17 |
-
public function get_gallery_row_data($id, $from = '') {
|
18 |
global $wpdb;
|
19 |
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'bwg_gallery WHERE published=1 AND id="%d"', $id));
|
20 |
if ($row) {
|
@@ -44,14 +44,25 @@ class BWGModelSite {
|
|
44 |
}
|
45 |
|
46 |
public function get_image_rows_data( $gallery_id, $bwg, $type, $tag_input_name, $tag, $images_per_page, $load_more_image_count, $sort_by, $sort_direction = 'ASC' ) {
|
|
|
47 |
$gallery_id = (int) $gallery_id;
|
48 |
$tag = (int) $tag;
|
49 |
-
global $wpdb;
|
50 |
$bwg_search = ((isset($_POST['bwg_search_' . $bwg]) && esc_html($_POST['bwg_search_' . $bwg]) != '') ? esc_html($_POST['bwg_search_' . $bwg]) : '');
|
51 |
$join = '';
|
52 |
$where = '';
|
53 |
if ( $bwg_search ) {
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
}
|
56 |
if ( $sort_by == 'size' || $sort_by == 'resolution' ) {
|
57 |
$sort_by = ' CAST(image.' . $sort_by . ' AS SIGNED) ';
|
@@ -91,8 +102,8 @@ class BWGModelSite {
|
|
91 |
}
|
92 |
$join .= ' LEFT JOIN '. $wpdb->prefix .'bwg_gallery as gallery ON gallery.id = image.gallery_id';
|
93 |
$where .= ' AND gallery.published = 1 ';
|
94 |
-
|
95 |
-
$rows = $wpdb->get_results(
|
96 |
$total = $wpdb->get_var('SELECT COUNT(*) FROM ' . $wpdb->prefix . 'bwg_image as image ' . $join . ' WHERE image.published=1 ' . $where);
|
97 |
$page_nav['total'] = $total;
|
98 |
$page_nav['limit'] = 1;
|
1 |
<?php
|
2 |
class BWGModelSite {
|
3 |
+
public function get_theme_row_data($id = 0) {
|
4 |
global $wpdb;
|
5 |
if ($id) {
|
6 |
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'bwg_theme WHERE id="%d"', $id));
|
14 |
return $row;
|
15 |
}
|
16 |
|
17 |
+
public function get_gallery_row_data($id = 0, $from = '') {
|
18 |
global $wpdb;
|
19 |
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'bwg_gallery WHERE published=1 AND id="%d"', $id));
|
20 |
if ($row) {
|
44 |
}
|
45 |
|
46 |
public function get_image_rows_data( $gallery_id, $bwg, $type, $tag_input_name, $tag, $images_per_page, $load_more_image_count, $sort_by, $sort_direction = 'ASC' ) {
|
47 |
+
global $wpdb;
|
48 |
$gallery_id = (int) $gallery_id;
|
49 |
$tag = (int) $tag;
|
|
|
50 |
$bwg_search = ((isset($_POST['bwg_search_' . $bwg]) && esc_html($_POST['bwg_search_' . $bwg]) != '') ? esc_html($_POST['bwg_search_' . $bwg]) : '');
|
51 |
$join = '';
|
52 |
$where = '';
|
53 |
if ( $bwg_search ) {
|
54 |
+
$bwg_search_keys = explode(' ', trim($bwg_search));
|
55 |
+
$alt_search = '(';
|
56 |
+
$description_search = '(';
|
57 |
+
foreach( $bwg_search_keys as $search_key) {
|
58 |
+
$alt_search .= '`image`.`alt` LIKE "%' . $search_key . '%" AND ';
|
59 |
+
$description_search .= '`image`.`description` LIKE "%' . $search_key . '%" AND ';
|
60 |
+
}
|
61 |
+
$alt_search = rtrim($alt_search, 'AND ');
|
62 |
+
$alt_search .= ')';
|
63 |
+
$description_search = rtrim($description_search, 'AND ');
|
64 |
+
$description_search .= ')';
|
65 |
+
$where = 'AND (' . $alt_search . ' OR ' . $description_search . ')';
|
66 |
}
|
67 |
if ( $sort_by == 'size' || $sort_by == 'resolution' ) {
|
68 |
$sort_by = ' CAST(image.' . $sort_by . ' AS SIGNED) ';
|
102 |
}
|
103 |
$join .= ' LEFT JOIN '. $wpdb->prefix .'bwg_gallery as gallery ON gallery.id = image.gallery_id';
|
104 |
$where .= ' AND gallery.published = 1 ';
|
105 |
+
$query = 'SELECT image.* FROM ' . $wpdb->prefix . 'bwg_image as image ' . $join . ' WHERE image.published=1 ' . $where . ' ORDER BY ' . str_replace('RAND()', 'RAND(' . $bwg_random_seed . ')', $sort_by) . ' ' . $sort_direction . ' ' . $limit_str;
|
106 |
+
$rows = $wpdb->get_results($query);
|
107 |
$total = $wpdb->get_var('SELECT COUNT(*) FROM ' . $wpdb->prefix . 'bwg_image as image ' . $join . ' WHERE image.published=1 ' . $where);
|
108 |
$page_nav['total'] = $total;
|
109 |
$page_nav['limit'] = 1;
|
frontend/views/BWGViewAlbum_compact_preview.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
class BWGViewAlbum_compact_preview {
|
3 |
-
public function display($params, $from_shortcode = 0, $bwg = 0) {
|
4 |
require_once(BWG()->plugin_dir . '/framework/WDWLibrary.php');
|
5 |
|
6 |
$theme_id = $params['theme_id'];
|
@@ -339,8 +339,8 @@ class BWGViewAlbum_compact_preview {
|
|
339 |
}
|
340 |
else {
|
341 |
if($local_preview_image){
|
342 |
-
$preview_url =
|
343 |
-
$preview_path =
|
344 |
}
|
345 |
else{
|
346 |
$preview_url = $preview_image;
|
@@ -429,7 +429,7 @@ class BWGViewAlbum_compact_preview {
|
|
429 |
$is_embed_video = preg_match('/VIDEO/', $image_row->filetype) == 1 ? true : false;
|
430 |
$is_embed_instagram = preg_match('/EMBED_OEMBED_INSTAGRAM/', $image_row->filetype) == 1 ? true : false;
|
431 |
if (!$is_embed) {
|
432 |
-
$thumb_path_url = htmlspecialchars_decode(
|
433 |
$thumb_path_url = explode('?bwg', $thumb_path_url);
|
434 |
list($image_thumb_width, $image_thumb_height) = getimagesize($thumb_path_url[0]);
|
435 |
}
|
@@ -467,7 +467,7 @@ class BWGViewAlbum_compact_preview {
|
|
467 |
$thumb_top = ($params['compuct_album_image_thumb_height'] - $image_thumb_height) / 2;
|
468 |
if ($album_view_type == 'thumbnail') {
|
469 |
?>
|
470 |
-
<a <?php echo ($params['thumb_click_action'] == 'open_lightbox' ? (' class="bwg_lightbox_' . $bwg . '"' . (BWG()->options->enable_seo ? ' href="' . ($is_embed ? $image_row->thumb_url :
|
471 |
<span class="bwg_standart_thumb_<?php echo $bwg; ?>">
|
472 |
<?php
|
473 |
if ($params['compuct_album_image_title'] == 'show' && $theme_row->album_compact_thumb_title_pos == 'top') {
|
@@ -511,7 +511,7 @@ class BWGViewAlbum_compact_preview {
|
|
511 |
<?php
|
512 |
}
|
513 |
?>
|
514 |
-
<img class="bwg_img_clear bwg_img_custom" style="width:<?php echo $image_thumb_width; ?>px; height:<?php echo $image_thumb_height; ?>px; margin-left: <?php echo $thumb_left; ?>px; margin-top: <?php echo $thumb_top; ?>px;" id="<?php echo $image_row->id; ?>" src="<?php echo ( $is_embed ? "" :
|
515 |
</span>
|
516 |
</span>
|
517 |
<?php
|
@@ -548,9 +548,16 @@ class BWGViewAlbum_compact_preview {
|
|
548 |
<?php
|
549 |
if ( $type == 'gallery' ) {
|
550 |
if ( BWG()->is_pro && $gallery_download && $image_rows ) {
|
|
|
551 |
$query_url = addslashes(add_query_arg(array(
|
552 |
"action" => "download_gallery",
|
553 |
-
"gallery_id" => $
|
|
|
|
|
|
|
|
|
|
|
|
|
554 |
), admin_url('admin-ajax.php')));
|
555 |
?>
|
556 |
<div class="bwg_download_gallery">
|
@@ -583,19 +590,6 @@ class BWGViewAlbum_compact_preview {
|
|
583 |
var filtersearchname = jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() ? "&filter_search_name_<?php echo $bwg; ?>=" + jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() : '';
|
584 |
spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>&gallery_id=' + gallery_id + '&image_id=' + image_id + "&filter_tag_<?php echo $bwg; ?>=" + filterTags + ecommerce + filtersearchname, '<?php echo $bwg; ?>', '<?php echo $bwg; ?>', '<?php echo $params['popup_width']; ?>', '<?php echo $params['popup_height']; ?>', 1, 'testpopup', 5, "<?php echo $theme_row->lightbox_ctrl_btn_pos ;?>");
|
585 |
}
|
586 |
-
<?php
|
587 |
-
if ( BWG()->is_pro ) {
|
588 |
-
?>
|
589 |
-
var bwg_hash = window.location.hash.substring(1);
|
590 |
-
if (bwg_hash) {
|
591 |
-
if (bwg_hash.indexOf("bwg") != "-1") {
|
592 |
-
bwg_hash_array = bwg_hash.replace("bwg", "").split("/");
|
593 |
-
bwg_gallery_box_<?php echo $bwg; ?>(bwg_hash_array[0], bwg_hash_array[1]);
|
594 |
-
}
|
595 |
-
}
|
596 |
-
<?php
|
597 |
-
}
|
598 |
-
?>
|
599 |
function bwg_document_ready_<?php echo $bwg; ?>() {
|
600 |
var bwg_touch_flag = false;
|
601 |
jQuery("#bwg_container2_<?php echo $bwg; ?>").on("click", ".bwg_lightbox_<?php echo $bwg; ?>", function () {
|
@@ -617,7 +611,39 @@ class BWGViewAlbum_compact_preview {
|
|
617 |
return false;
|
618 |
}
|
619 |
});
|
620 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
621 |
jQuery("#bwg_container2_<?php echo $bwg; ?>").on("click", ".bwg_album_<?php echo $bwg; ?>", function () {
|
622 |
if (!bwg_touch_flag) {
|
623 |
bwg_touch_flag = true;
|
@@ -636,6 +662,17 @@ class BWGViewAlbum_compact_preview {
|
|
636 |
jQuery('div[id^="bwg_container"]').css('webkitTouchCallout','none');
|
637 |
<?php
|
638 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
639 |
?>
|
640 |
}
|
641 |
jQuery(document).ready(function () {
|
1 |
<?php
|
2 |
class BWGViewAlbum_compact_preview {
|
3 |
+
public function display($params = array(), $from_shortcode = 0, $bwg = 0) {
|
4 |
require_once(BWG()->plugin_dir . '/framework/WDWLibrary.php');
|
5 |
|
6 |
$theme_id = $params['theme_id'];
|
339 |
}
|
340 |
else {
|
341 |
if($local_preview_image){
|
342 |
+
$preview_url = BWG()->upload_url . $preview_image;
|
343 |
+
$preview_path = BWG()->upload_dir . $preview_image;
|
344 |
}
|
345 |
else{
|
346 |
$preview_url = $preview_image;
|
429 |
$is_embed_video = preg_match('/VIDEO/', $image_row->filetype) == 1 ? true : false;
|
430 |
$is_embed_instagram = preg_match('/EMBED_OEMBED_INSTAGRAM/', $image_row->filetype) == 1 ? true : false;
|
431 |
if (!$is_embed) {
|
432 |
+
$thumb_path_url = htmlspecialchars_decode(BWG()->upload_dir . $image_row->thumb_url, ENT_COMPAT | ENT_QUOTES);
|
433 |
$thumb_path_url = explode('?bwg', $thumb_path_url);
|
434 |
list($image_thumb_width, $image_thumb_height) = getimagesize($thumb_path_url[0]);
|
435 |
}
|
467 |
$thumb_top = ($params['compuct_album_image_thumb_height'] - $image_thumb_height) / 2;
|
468 |
if ($album_view_type == 'thumbnail') {
|
469 |
?>
|
470 |
+
<a <?php echo ($params['thumb_click_action'] == 'open_lightbox' ? (' class="bwg_lightbox_' . $bwg . '"' . (BWG()->options->enable_seo ? ' href="' . ($is_embed ? $image_row->thumb_url : BWG()->upload_url . $image_row->image_url) . '"' : '') . ' data-image-id="' . $image_row->id . '" data-gallery-id="' . $album_gallery_id . '"') : ($image_row->redirect_url ? 'href="' . $image_row->redirect_url . '" target="' . ($params['thumb_link_target'] ? '_blank' : '') . '"' : '')) ?>>
|
471 |
<span class="bwg_standart_thumb_<?php echo $bwg; ?>">
|
472 |
<?php
|
473 |
if ($params['compuct_album_image_title'] == 'show' && $theme_row->album_compact_thumb_title_pos == 'top') {
|
511 |
<?php
|
512 |
}
|
513 |
?>
|
514 |
+
<img class="bwg_img_clear bwg_img_custom" style="width:<?php echo $image_thumb_width; ?>px; height:<?php echo $image_thumb_height; ?>px; margin-left: <?php echo $thumb_left; ?>px; margin-top: <?php echo $thumb_top; ?>px;" id="<?php echo $image_row->id; ?>" src="<?php echo ( $is_embed ? "" : BWG()->upload_url) . $image_row->thumb_url; ?>" alt="<?php echo $image_row->alt; ?>" />
|
515 |
</span>
|
516 |
</span>
|
517 |
<?php
|
548 |
<?php
|
549 |
if ( $type == 'gallery' ) {
|
550 |
if ( BWG()->is_pro && $gallery_download && $image_rows ) {
|
551 |
+
$bwg_tags_input_value = WDWLibrary::get('bwg_tag_id_bwg_album_compact_' . $bwg);
|
552 |
$query_url = addslashes(add_query_arg(array(
|
553 |
"action" => "download_gallery",
|
554 |
+
"gallery_id" => $params['gallery_id'],
|
555 |
+
"bwg" => $bwg,
|
556 |
+
"type" => 'gallery',
|
557 |
+
"tag_input_name" => 'bwg_tag_id_bwg_album_compact_' . $bwg,
|
558 |
+
"bwg_tag_id_bwg_album_compact_" . $bwg => $bwg_tags_input_value,
|
559 |
+
"tag" => $params['tag'],
|
560 |
+
"bwg_search_".$bwg => WDWLibrary::get('bwg_search_'.$bwg),
|
561 |
), admin_url('admin-ajax.php')));
|
562 |
?>
|
563 |
<div class="bwg_download_gallery">
|
590 |
var filtersearchname = jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() ? "&filter_search_name_<?php echo $bwg; ?>=" + jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() : '';
|
591 |
spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>&gallery_id=' + gallery_id + '&image_id=' + image_id + "&filter_tag_<?php echo $bwg; ?>=" + filterTags + ecommerce + filtersearchname, '<?php echo $bwg; ?>', '<?php echo $bwg; ?>', '<?php echo $params['popup_width']; ?>', '<?php echo $params['popup_height']; ?>', 1, 'testpopup', 5, "<?php echo $theme_row->lightbox_ctrl_btn_pos ;?>");
|
592 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
593 |
function bwg_document_ready_<?php echo $bwg; ?>() {
|
594 |
var bwg_touch_flag = false;
|
595 |
jQuery("#bwg_container2_<?php echo $bwg; ?>").on("click", ".bwg_lightbox_<?php echo $bwg; ?>", function () {
|
611 |
return false;
|
612 |
}
|
613 |
});
|
614 |
+
|
615 |
+
jQuery( 'div[id^="bwg_container"]' ).each( function () {
|
616 |
+
var bwg_container = jQuery(this);
|
617 |
+
if (bwg_container.data('right-click-protection')) {
|
618 |
+
/* Disable right click.*/
|
619 |
+
bwg_container.bind("contextmenu", function () {
|
620 |
+
return false;
|
621 |
+
});
|
622 |
+
bwg_container.css('webkitTouchCallout', 'none');
|
623 |
+
}
|
624 |
+
var search_tags = bwg_container.find('.search_tags');
|
625 |
+
if (search_tags.length) {
|
626 |
+
search_tags.SumoSelect({
|
627 |
+
triggerChangeCombined: true,
|
628 |
+
placeholder: bwg_objectsL10n.bwg_select_tag,
|
629 |
+
search: 1,
|
630 |
+
searchText: bwg_objectsL10n.bwg_search,
|
631 |
+
forceCustomRendering: true,
|
632 |
+
noMatch: bwg_objectsL10n.bwg_tag_no_match,
|
633 |
+
captionFormatAllSelected: bwg_objectsL10n.bwg_all_tags_selected,
|
634 |
+
captionFormat: '{0} ' + bwg_objectsL10n.bwg_tags_selected,
|
635 |
+
});
|
636 |
+
}
|
637 |
+
var bwg_order = bwg_container.find('.bwg_order');
|
638 |
+
if (bwg_order.length) {
|
639 |
+
bwg_order.SumoSelect({
|
640 |
+
triggerChangeCombined: true,
|
641 |
+
forceCustomRendering: true,
|
642 |
+
});
|
643 |
+
}
|
644 |
+
});
|
645 |
+
|
646 |
+
<?php if ($from !== "widget") { ?>
|
647 |
jQuery("#bwg_container2_<?php echo $bwg; ?>").on("click", ".bwg_album_<?php echo $bwg; ?>", function () {
|
648 |
if (!bwg_touch_flag) {
|
649 |
bwg_touch_flag = true;
|
662 |
jQuery('div[id^="bwg_container"]').css('webkitTouchCallout','none');
|
663 |
<?php
|
664 |
}
|
665 |
+
if ( BWG()->is_pro ) {
|
666 |
+
?>
|
667 |
+
var bwg_hash = window.location.hash.substring(1);
|
668 |
+
if (bwg_hash) {
|
669 |
+
if (bwg_hash.indexOf("bwg") != "-1") {
|
670 |
+
bwg_hash_array = bwg_hash.replace("bwg", "").split("/");
|
671 |
+
bwg_gallery_box_<?php echo $bwg; ?>(bwg_hash_array[0], bwg_hash_array[1]);
|
672 |
+
}
|
673 |
+
}
|
674 |
+
<?php
|
675 |
+
}
|
676 |
?>
|
677 |
}
|
678 |
jQuery(document).ready(function () {
|
frontend/views/BWGViewAlbum_extended_preview.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
class BWGViewAlbum_extended_preview {
|
3 |
-
public function display($params, $from_shortcode = 0, $bwg = 0) {
|
4 |
require_once(BWG()->plugin_dir . '/framework/WDWLibrary.php');
|
5 |
|
6 |
$order_by = $params['order_by'];
|
@@ -335,8 +335,8 @@ class BWGViewAlbum_extended_preview {
|
|
335 |
}
|
336 |
else {
|
337 |
if($local_preview_image){
|
338 |
-
$preview_url =
|
339 |
-
$preview_path =
|
340 |
}
|
341 |
else{
|
342 |
$preview_url = $preview_image;
|
@@ -424,7 +424,7 @@ class BWGViewAlbum_extended_preview {
|
|
424 |
$is_embed_video = preg_match('/VIDEO/', $image_row->filetype) == 1 ? true : false;
|
425 |
$is_embed_instagram = preg_match('/EMBED_OEMBED_INSTAGRAM/', $image_row->filetype) == 1 ? true : false;
|
426 |
if (!$is_embed) {
|
427 |
-
$thumb_path_url = htmlspecialchars_decode(
|
428 |
$thumb_path_url = explode('?bwg', $thumb_path_url);
|
429 |
list($image_thumb_width, $image_thumb_height) = getimagesize($thumb_path_url[0]);
|
430 |
}
|
@@ -462,7 +462,7 @@ class BWGViewAlbum_extended_preview {
|
|
462 |
$thumb_top = ($params['extended_album_image_thumb_height'] - $image_thumb_height) / 2;
|
463 |
if ($album_view_type == 'thumbnail') {
|
464 |
?>
|
465 |
-
<a <?php echo ($params['thumb_click_action'] == 'open_lightbox' ? (' class="bwg_lightbox_' . $bwg . '"' . (BWG()->options->enable_seo ? ' href="' . ($is_embed ? $image_row->thumb_url :
|
466 |
<span class="bwg_standart_thumb_<?php echo $bwg; ?>">
|
467 |
<span class="bwg_standart_thumb_spun1_<?php echo $bwg; ?>">
|
468 |
<span class="bwg_standart_thumb_spun2_<?php echo $bwg; ?>">
|
@@ -494,7 +494,7 @@ class BWGViewAlbum_extended_preview {
|
|
494 |
<?php
|
495 |
}
|
496 |
?>
|
497 |
-
<img class="bwg_img_clear bwg_img_custom" style="width:<?php echo $image_thumb_width; ?>px; height:<?php echo $image_thumb_height; ?>px; margin-left: <?php echo $thumb_left; ?>px; margin-top: <?php echo $thumb_top; ?>px;" id="<?php echo $image_row->id; ?>" src="<?php echo ( $is_embed ? "" :
|
498 |
</span>
|
499 |
</span>
|
500 |
<?php
|
@@ -522,7 +522,7 @@ class BWGViewAlbum_extended_preview {
|
|
522 |
</span>
|
523 |
</a>
|
524 |
<?php
|
525 |
-
}
|
526 |
}
|
527 |
} /* End of if gallery.*/
|
528 |
?>
|
@@ -544,9 +544,16 @@ class BWGViewAlbum_extended_preview {
|
|
544 |
<?php
|
545 |
if ( $type == 'gallery' ) {
|
546 |
if ( BWG()->is_pro && $gallery_download && $image_rows ) {
|
|
|
547 |
$query_url = addslashes(add_query_arg(array(
|
548 |
"action" => "download_gallery",
|
549 |
-
"gallery_id" => $
|
|
|
|
|
|
|
|
|
|
|
|
|
550 |
), admin_url('admin-ajax.php')));
|
551 |
?>
|
552 |
<div class="bwg_download_gallery">
|
@@ -579,19 +586,6 @@ class BWGViewAlbum_extended_preview {
|
|
579 |
var filtersearchname = jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() ? "&filter_search_name_<?php echo $bwg; ?>=" + jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() : '';
|
580 |
spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>&gallery_id=' + gallery_id + '&image_id=' + image_id + "&filter_tag_<?php echo $bwg; ?>=" + filterTags + ecommerce + filtersearchname, '<?php echo $bwg; ?>', '<?php echo $params['popup_width']; ?>', '<?php echo $params['popup_height']; ?>', 1, 'testpopup', 5, "<?php echo $theme_row->lightbox_ctrl_btn_pos ;?>");
|
581 |
}
|
582 |
-
<?php
|
583 |
-
if ( BWG()->is_pro ) {
|
584 |
-
?>
|
585 |
-
var bwg_hash = window.location.hash.substring(1);
|
586 |
-
if (bwg_hash) {
|
587 |
-
if (bwg_hash.indexOf("bwg") != "-1") {
|
588 |
-
bwg_hash_array = bwg_hash.replace("bwg", "").split("/");
|
589 |
-
bwg_gallery_box_<?php echo $bwg; ?>(bwg_hash_array[0], bwg_hash_array[1]);
|
590 |
-
}
|
591 |
-
}
|
592 |
-
<?php
|
593 |
-
}
|
594 |
-
?>
|
595 |
function bwg_document_ready_<?php echo $bwg; ?>() {
|
596 |
var bwg_touch_flag = false;
|
597 |
jQuery("#bwg_container2_<?php echo $bwg; ?>").on("click", ".bwg_lightbox_<?php echo $bwg; ?>", function () {
|
@@ -621,7 +615,39 @@ class BWGViewAlbum_extended_preview {
|
|
621 |
return false;
|
622 |
}
|
623 |
});
|
624 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
625 |
if ($image_right_click) {
|
626 |
?>
|
627 |
/* Disable right click.*/
|
@@ -631,6 +657,17 @@ class BWGViewAlbum_extended_preview {
|
|
631 |
jQuery('div[id^="bwg_container"]').css('webkitTouchCallout','none');
|
632 |
<?php
|
633 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
634 |
?>
|
635 |
}
|
636 |
jQuery(document).ready(function () {
|
@@ -1407,4 +1444,4 @@ class BWGViewAlbum_extended_preview {
|
|
1407 |
<?php
|
1408 |
return ob_get_clean();
|
1409 |
}
|
1410 |
-
}
|
1 |
<?php
|
2 |
class BWGViewAlbum_extended_preview {
|
3 |
+
public function display($params = array(), $from_shortcode = 0, $bwg = 0) {
|
4 |
require_once(BWG()->plugin_dir . '/framework/WDWLibrary.php');
|
5 |
|
6 |
$order_by = $params['order_by'];
|
335 |
}
|
336 |
else {
|
337 |
if($local_preview_image){
|
338 |
+
$preview_url = BWG()->upload_url . $preview_image;
|
339 |
+
$preview_path = BWG()->upload_dir . $preview_image;
|
340 |
}
|
341 |
else{
|
342 |
$preview_url = $preview_image;
|
424 |
$is_embed_video = preg_match('/VIDEO/', $image_row->filetype) == 1 ? true : false;
|
425 |
$is_embed_instagram = preg_match('/EMBED_OEMBED_INSTAGRAM/', $image_row->filetype) == 1 ? true : false;
|
426 |
if (!$is_embed) {
|
427 |
+
$thumb_path_url = htmlspecialchars_decode(BWG()->upload_dir . $image_row->thumb_url, ENT_COMPAT | ENT_QUOTES);
|
428 |
$thumb_path_url = explode('?bwg', $thumb_path_url);
|
429 |
list($image_thumb_width, $image_thumb_height) = getimagesize($thumb_path_url[0]);
|
430 |
}
|
462 |
$thumb_top = ($params['extended_album_image_thumb_height'] - $image_thumb_height) / 2;
|
463 |
if ($album_view_type == 'thumbnail') {
|
464 |
?>
|
465 |
+
<a <?php echo ($params['thumb_click_action'] == 'open_lightbox' ? (' class="bwg_lightbox_' . $bwg . '"' . (BWG()->options->enable_seo ? ' href="' . ($is_embed ? $image_row->thumb_url : BWG()->upload_url . $image_row->image_url) . '"' : '') . ' data-image-id="' . $image_row->id . '" data-gallery-id="' . $album_gallery_id . '"') : ($params['thumb_click_action'] == 'redirect_to_url' && $image_row->redirect_url ? 'href="' . $image_row->redirect_url . '" target="' . ($params['thumb_link_target'] ? '_blank' : '') . '"' : '')) ?>>
|
466 |
<span class="bwg_standart_thumb_<?php echo $bwg; ?>">
|
467 |
<span class="bwg_standart_thumb_spun1_<?php echo $bwg; ?>">
|
468 |
<span class="bwg_standart_thumb_spun2_<?php echo $bwg; ?>">
|
494 |
<?php
|
495 |
}
|
496 |
?>
|
497 |
+
<img class="bwg_img_clear bwg_img_custom" style="width:<?php echo $image_thumb_width; ?>px; height:<?php echo $image_thumb_height; ?>px; margin-left: <?php echo $thumb_left; ?>px; margin-top: <?php echo $thumb_top; ?>px;" id="<?php echo $image_row->id; ?>" src="<?php echo ( $is_embed ? "" : BWG()->upload_url) . $image_row->thumb_url; ?>" alt="<?php echo $image_row->alt; ?>" />
|
498 |
</span>
|
499 |
</span>
|
500 |
<?php
|
522 |
</span>
|
523 |
</a>
|
524 |
<?php
|
525 |
+
}
|
526 |
}
|
527 |
} /* End of if gallery.*/
|
528 |
?>
|
544 |
<?php
|
545 |
if ( $type == 'gallery' ) {
|
546 |
if ( BWG()->is_pro && $gallery_download && $image_rows ) {
|
547 |
+
$bwg_tags_input_value = WDWLibrary::get('bwg_tag_id_bwg_album_extended_' . $bwg);
|
548 |
$query_url = addslashes(add_query_arg(array(
|
549 |
"action" => "download_gallery",
|
550 |
+
"gallery_id" => $params['gallery_id'],
|
551 |
+
"bwg" => $bwg,
|
552 |
+
"type" => 'gallery',
|
553 |
+
"tag_input_name" => 'bwg_tag_id_bwg_album_extended_' . $bwg,
|
554 |
+
"bwg_tag_id_bwg_album_extended_" . $bwg => $bwg_tags_input_value,
|
555 |
+
"tag" => $params['tag'],
|
556 |
+
"bwg_search_".$bwg => WDWLibrary::get('bwg_search_'.$bwg),
|
557 |
), admin_url('admin-ajax.php')));
|
558 |
?>
|
559 |
<div class="bwg_download_gallery">
|
586 |
var filtersearchname = jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() ? "&filter_search_name_<?php echo $bwg; ?>=" + jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() : '';
|
587 |
spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>&gallery_id=' + gallery_id + '&image_id=' + image_id + "&filter_tag_<?php echo $bwg; ?>=" + filterTags + ecommerce + filtersearchname, '<?php echo $bwg; ?>', '<?php echo $params['popup_width']; ?>', '<?php echo $params['popup_height']; ?>', 1, 'testpopup', 5, "<?php echo $theme_row->lightbox_ctrl_btn_pos ;?>");
|
588 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
589 |
function bwg_document_ready_<?php echo $bwg; ?>() {
|
590 |
var bwg_touch_flag = false;
|
591 |
jQuery("#bwg_container2_<?php echo $bwg; ?>").on("click", ".bwg_lightbox_<?php echo $bwg; ?>", function () {
|
615 |
return false;
|
616 |
}
|
617 |
});
|
618 |
+
|
619 |
+
jQuery( 'div[id^="bwg_container"]' ).each( function () {
|
620 |
+
var bwg_container = jQuery(this);
|
621 |
+
if (bwg_container.data('right-click-protection')) {
|
622 |
+
/* Disable right click.*/
|
623 |
+
bwg_container.bind("contextmenu", function () {
|
624 |
+
return false;
|
625 |
+
});
|
626 |
+
bwg_container.css('webkitTouchCallout', 'none');
|
627 |
+
}
|
628 |
+
var search_tags = bwg_container.find('.search_tags');
|
629 |
+
if (search_tags.length) {
|
630 |
+
search_tags.SumoSelect({
|
631 |
+
triggerChangeCombined: true,
|
632 |
+
placeholder: bwg_objectsL10n.bwg_select_tag,
|
633 |
+
search: 1,
|
634 |
+
searchText: bwg_objectsL10n.bwg_search,
|
635 |
+
forceCustomRendering: true,
|
636 |
+
noMatch: bwg_objectsL10n.bwg_tag_no_match,
|
637 |
+
captionFormatAllSelected: bwg_objectsL10n.bwg_all_tags_selected,
|
638 |
+
captionFormat: '{0} ' + bwg_objectsL10n.bwg_tags_selected,
|
639 |
+
});
|
640 |
+
}
|
641 |
+
var bwg_order = bwg_container.find('.bwg_order');
|
642 |
+
if (bwg_order.length) {
|
643 |
+
bwg_order.SumoSelect({
|
644 |
+
triggerChangeCombined: true,
|
645 |
+
forceCustomRendering: true,
|
646 |
+
});
|
647 |
+
}
|
648 |
+
});
|
649 |
+
|
650 |
+
<?php
|
651 |
if ($image_right_click) {
|
652 |
?>
|
653 |
/* Disable right click.*/
|
657 |
jQuery('div[id^="bwg_container"]').css('webkitTouchCallout','none');
|
658 |
<?php
|
659 |
}
|
660 |
+
if ( BWG()->is_pro ) {
|
661 |
+
?>
|
662 |
+
var bwg_hash = window.location.hash.substring(1);
|
663 |
+
if (bwg_hash) {
|
664 |
+
if (bwg_hash.indexOf("bwg") != "-1") {
|
665 |
+
bwg_hash_array = bwg_hash.replace("bwg", "").split("/");
|
666 |
+
bwg_gallery_box_<?php echo $bwg; ?>(bwg_hash_array[0], bwg_hash_array[1]);
|
667 |
+
}
|
668 |
+
}
|
669 |
+
<?php
|
670 |
+
}
|
671 |
?>
|
672 |
}
|
673 |
jQuery(document).ready(function () {
|
1444 |
<?php
|
1445 |
return ob_get_clean();
|
1446 |
}
|
1447 |
+
}
|
frontend/views/BWGViewGalleryBox.php
CHANGED
@@ -16,8 +16,8 @@ class BWGViewGalleryBox {
|
|
16 |
$bwg = (isset($_GET['current_view']) ? esc_html($_GET['current_view']) : 0);
|
17 |
$current_image_id = WDWLibrary::esc_script('get', 'image_id', 0, 'int');
|
18 |
$theme_id = (isset($_GET['theme_id']) ? esc_html($_GET['theme_id']) : 1);
|
19 |
-
|
20 |
-
|
21 |
$open_with_fullscreen = WDWLibrary::esc_script('get', 'open_with_fullscreen', 0, 'int');
|
22 |
$open_with_autoplay = WDWLibrary::esc_script('get', 'open_with_autoplay', 0, 'int');
|
23 |
$image_width = WDWLibrary::esc_script('get', 'image_width', 800, 'int');
|
@@ -69,15 +69,17 @@ class BWGViewGalleryBox {
|
|
69 |
$watermark_width = (isset($_GET['watermark_width']) ? (int) $_GET['watermark_width'] : 90);
|
70 |
$watermark_height = (isset($_GET['watermark_height']) ? (int) $_GET['watermark_height'] : 90);
|
71 |
|
72 |
-
|
73 |
|
74 |
$theme_row = WDWLibrary::get_theme_row_data($theme_id);
|
75 |
$filmstrip_direction = 'horizontal';
|
76 |
if ($theme_row->lightbox_filmstrip_pos == 'right' || $theme_row->lightbox_filmstrip_pos == 'left') {
|
77 |
-
$filmstrip_direction = 'vertical';
|
78 |
}
|
79 |
-
|
80 |
-
|
|
|
|
|
81 |
$image_filmstrip_height = WDWLibrary::esc_script('get', 'image_filmstrip_height', 20, 'int');
|
82 |
$thumb_ratio = $thumb_width / $thumb_height;
|
83 |
$image_filmstrip_width = round($thumb_ratio * $image_filmstrip_height);
|
@@ -153,25 +155,43 @@ class BWGViewGalleryBox {
|
|
153 |
$params_array['watermark_height'] = $watermark_height;
|
154 |
}
|
155 |
$popup_url = add_query_arg(array($params_array), admin_url('admin-ajax.php'));
|
156 |
-
$filmstrip_thumb_margin = $theme_row->lightbox_filmstrip_thumb_margin;
|
157 |
$margins_split = explode(" ", $filmstrip_thumb_margin);
|
|
|
|
|
|
|
158 |
$filmstrip_thumb_margin_right = 0;
|
|
|
159 |
$filmstrip_thumb_margin_left = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
$temp_iterator = ($filmstrip_direction == 'horizontal' ? 1 : 0);
|
161 |
-
if (isset($margins_split[$temp_iterator])) {
|
162 |
-
$filmstrip_thumb_margin_right = (int) $margins_split[$temp_iterator];
|
163 |
-
if (isset($margins_split[$temp_iterator + 2])) {
|
164 |
-
$filmstrip_thumb_margin_left = (int) $margins_split[$temp_iterator + 2];
|
165 |
-
}
|
166 |
-
else {
|
167 |
-
$filmstrip_thumb_margin_left = $filmstrip_thumb_margin_right;
|
168 |
-
}
|
169 |
-
}
|
170 |
-
elseif (isset($margins_split[0])) {
|
171 |
-
$filmstrip_thumb_margin_right = (int) $margins_split[0];
|
172 |
-
$filmstrip_thumb_margin_left = $filmstrip_thumb_margin_right;
|
173 |
-
}
|
174 |
-
$filmstrip_thumb_margin_hor = $filmstrip_thumb_margin_right + $filmstrip_thumb_margin_left;
|
175 |
$rgb_bwg_image_info_bg_color = WDWLibrary::spider_hex2rgb($theme_row->lightbox_info_bg_color);
|
176 |
$rgb_bwg_image_hit_bg_color = WDWLibrary::spider_hex2rgb($theme_row->lightbox_hit_bg_color);
|
177 |
$rgb_lightbox_ctrl_cont_bg_color = WDWLibrary::spider_hex2rgb($theme_row->lightbox_ctrl_cont_bg_color);
|
@@ -192,7 +212,7 @@ class BWGViewGalleryBox {
|
|
192 |
$outerWidth_or_outerHeight = 'outerHeight';
|
193 |
}
|
194 |
$lightbox_bg_transparent = (isset($theme_row->lightbox_bg_transparent)) ? $theme_row->lightbox_bg_transparent : 100;
|
195 |
-
$lightbox_bg_color = WDWLibrary::spider_hex2rgb($theme_row->lightbox_bg_color);
|
196 |
|
197 |
$current_filename = '';
|
198 |
|
@@ -209,15 +229,15 @@ class BWGViewGalleryBox {
|
|
209 |
filter: Alpha(opacity=<?php echo $theme_row->lightbox_overlay_bg_transparent; ?>);
|
210 |
}
|
211 |
.bwg_inst_play_btn_cont {
|
212 |
-
width: 100%;
|
213 |
-
height: 100%;
|
214 |
-
position: absolute;
|
215 |
-
z-index: 1;
|
216 |
cursor: pointer;
|
217 |
top: 0;
|
218 |
}
|
219 |
.bwg_inst_play {
|
220 |
-
position: absolute;
|
221 |
width: 50px;
|
222 |
height: 50px;
|
223 |
background-image: url('<?php echo BWG()->plugin_url . '/images/play.png'; ?>');
|
@@ -401,7 +421,7 @@ class BWGViewGalleryBox {
|
|
401 |
}
|
402 |
#spider_popup_right-ico{
|
403 |
left: -9999px;
|
404 |
-
}
|
405 |
<?php }
|
406 |
else { ?>
|
407 |
#spider_popup_left-ico {
|
@@ -707,28 +727,35 @@ class BWGViewGalleryBox {
|
|
707 |
z-index: 10106;
|
708 |
}
|
709 |
.bwg_filmstrip_thumbnails {
|
710 |
-
height: <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : ($image_filmstrip_height + $
|
711 |
<?php echo $left_or_top; ?>: 0px;
|
712 |
margin: 0 auto;
|
713 |
overflow: hidden;
|
714 |
position: relative;
|
715 |
-
width: <?php echo ($filmstrip_direction == 'horizontal' ? ($image_filmstrip_width + $
|
716 |
}
|
717 |
.bwg_filmstrip_thumbnail {
|
718 |
-
|
719 |
-
|
720 |
-
border: <?php echo $theme_row->lightbox_filmstrip_thumb_border_width; ?>px <?php echo $theme_row->lightbox_filmstrip_thumb_border_style; ?> #<?php echo $theme_row->lightbox_filmstrip_thumb_border_color; ?>;
|
721 |
-
border-radius: <?php echo $theme_row->lightbox_filmstrip_thumb_border_radius; ?>;
|
722 |
-
cursor: pointer;
|
723 |
float: left;
|
724 |
height: <?php echo $image_filmstrip_height; ?>px;
|
725 |
-
margin: <?php echo $theme_row->lightbox_filmstrip_thumb_margin; ?>;
|
726 |
width: <?php echo $image_filmstrip_width; ?>px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
727 |
overflow: hidden;
|
728 |
}
|
729 |
.bwg_thumb_active {
|
730 |
opacity: 1;
|
731 |
filter: Alpha(opacity=100);
|
|
|
|
|
732 |
border: <?php echo $theme_row->lightbox_filmstrip_thumb_active_border_width; ?>px solid #<?php echo $theme_row->lightbox_filmstrip_thumb_active_border_color; ?>;
|
733 |
}
|
734 |
.bwg_thumb_deactive {
|
@@ -903,7 +930,7 @@ class BWGViewGalleryBox {
|
|
903 |
<?php } ?>
|
904 |
padding: <?php echo $theme_row->lightbox_info_padding; ?>;
|
905 |
<?php echo ((!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'top') && $theme_row->lightbox_ctrl_btn_pos == 'top' && $theme_row->lightbox_info_pos == 'top') ? 'top: ' . ($theme_row->lightbox_ctrl_btn_height + 2 * $theme_row->lightbox_ctrl_btn_margin_top) . 'px;' : '' ?>
|
906 |
-
word-break : break-
|
907 |
}
|
908 |
.bwg_image_info::-webkit-scrollbar {
|
909 |
width: 4px;
|
@@ -921,6 +948,7 @@ class BWGViewGalleryBox {
|
|
921 |
font-family: <?php echo $theme_row->lightbox_title_font_style; ?>;
|
922 |
font-size: <?php echo $theme_row->lightbox_title_font_size; ?>px;
|
923 |
font-weight: <?php echo $theme_row->lightbox_title_font_weight; ?>;
|
|
|
924 |
}
|
925 |
.bwg_image_description,
|
926 |
.bwg_image_description * {
|
@@ -928,7 +956,7 @@ class BWGViewGalleryBox {
|
|
928 |
font-family: <?php echo $theme_row->lightbox_description_font_style; ?>;
|
929 |
font-size: <?php echo $theme_row->lightbox_description_font_size; ?>px;
|
930 |
font-weight: <?php echo $theme_row->lightbox_description_font_weight; ?>;
|
931 |
-
word-break: break-
|
932 |
}
|
933 |
.bwg_image_rate_spun {
|
934 |
text-align: <?php echo $theme_row->lightbox_rate_align; ?>;
|
@@ -998,6 +1026,7 @@ class BWGViewGalleryBox {
|
|
998 |
var event_stack = [];
|
999 |
<?php
|
1000 |
$image_id_exist = FALSE;
|
|
|
1001 |
foreach ($image_rows as $key => $image_row) {
|
1002 |
if ($image_row->id == $image_id) {
|
1003 |
$current_avg_rating = $image_row->avg_rating;
|
@@ -1015,6 +1044,7 @@ class BWGViewGalleryBox {
|
|
1015 |
$current_filename = $image_row->filename;
|
1016 |
$image_id_exist = TRUE;
|
1017 |
}
|
|
|
1018 |
if ( BWG()->is_pro ) {
|
1019 |
$current_pricelist_id = $this->model->get_image_pricelist($image_row->id) ? $this->model->get_image_pricelist($image_row->id) : 0;
|
1020 |
$_pricelist_data = $this->model->get_image_pricelists($current_pricelist_id);
|
@@ -1070,23 +1100,23 @@ class BWGViewGalleryBox {
|
|
1070 |
<div class="bwg_image_wrap">
|
1071 |
<?php
|
1072 |
$current_pos = 0;
|
1073 |
-
if ($enable_image_filmstrip) {
|
1074 |
?>
|
1075 |
<div class="bwg_filmstrip_container">
|
1076 |
<div class="bwg_filmstrip_left"><i class="fa <?php echo ($filmstrip_direction == 'horizontal'? 'fa-angle-left' : 'fa-angle-up'); ?> "></i></div>
|
1077 |
<div class="bwg_filmstrip">
|
1078 |
-
<div class="bwg_filmstrip_thumbnails">
|
1079 |
<?php
|
1080 |
foreach ($image_rows as $key => $image_row) {
|
1081 |
if ($image_row->id == $current_image_id) {
|
1082 |
-
$current_pos = $key * (($filmstrip_direction == 'horizontal' ? $image_filmstrip_width : $image_filmstrip_height) + $
|
1083 |
$current_key = $key;
|
1084 |
}
|
1085 |
|
1086 |
$is_embed = preg_match('/EMBED/',$image_row->filetype)==1 ? true : false;
|
1087 |
-
$is_embed_instagram = preg_match('/EMBED_OEMBED_INSTAGRAM/'
|
1088 |
-
if (!$is_embed) {
|
1089 |
-
$thumb_path_url = htmlspecialchars_decode(
|
1090 |
$thumb_path_url = explode('?bwg', $thumb_path_url);
|
1091 |
list($image_thumb_width, $image_thumb_height) = getimagesize($thumb_path_url[0]);
|
1092 |
}
|
@@ -1117,14 +1147,19 @@ class BWGViewGalleryBox {
|
|
1117 |
$image_thumb_height = $image_filmstrip_height;
|
1118 |
}
|
1119 |
}
|
|
|
|
|
|
|
1120 |
$scale = max($image_filmstrip_width / $image_thumb_width, $image_filmstrip_height / $image_thumb_height);
|
1121 |
$image_thumb_width *= $scale;
|
1122 |
$image_thumb_height *= $scale;
|
1123 |
-
|
1124 |
-
$thumb_top = ($
|
1125 |
?>
|
1126 |
-
<div id="bwg_filmstrip_thumbnail_<?php echo $key; ?>"
|
1127 |
-
<
|
|
|
|
|
1128 |
</div>
|
1129 |
<?php
|
1130 |
}
|
@@ -1197,7 +1232,7 @@ class BWGViewGalleryBox {
|
|
1197 |
<i title="<?php echo __('Show rating', BWG()->prefix); ?>" class="bwg_ctrl_btn bwg_rate fa fa-star"></i>
|
1198 |
<?php }
|
1199 |
$is_embed = preg_match('/EMBED/', $current_filetype) == 1 ? TRUE : FALSE;
|
1200 |
-
$share_image_url = str_replace('%252F', '%2F', urlencode( $is_embed ? $current_thumb_url :
|
1201 |
if ($enable_image_facebook) {
|
1202 |
?>
|
1203 |
<a id="bwg_facebook_a" href="https://www.facebook.com/sharer/sharer.php?u=<?php echo urlencode($share_url); ?>" target="_blank" title="<?php echo __('Share on Facebook', BWG()->prefix); ?>">
|
@@ -1235,7 +1270,7 @@ class BWGViewGalleryBox {
|
|
1235 |
}
|
1236 |
if ($popup_enable_fullsize_image) {
|
1237 |
?>
|
1238 |
-
<a id="bwg_fullsize_image" href="<?php echo !$is_embed ?
|
1239 |
<i title="<?php echo __('Open image in original size.', BWG()->prefix); ?>" class="bwg_ctrl_btn fa fa-external-link"></i>
|
1240 |
</a>
|
1241 |
<?php
|
@@ -1244,7 +1279,7 @@ class BWGViewGalleryBox {
|
|
1244 |
$style = 'none';
|
1245 |
$current_image_arr = explode('/', $current_image_url);
|
1246 |
if (!$is_embed) {
|
1247 |
-
$download_href =
|
1248 |
$style = 'inline-block';
|
1249 |
}
|
1250 |
?>
|
@@ -1358,8 +1393,7 @@ class BWGViewGalleryBox {
|
|
1358 |
<div class="bwg_slider">
|
1359 |
<?php
|
1360 |
$current_key = -6;
|
1361 |
-
foreach ($image_rows as $key => $image_row) {
|
1362 |
-
|
1363 |
$is_embed = preg_match('/EMBED/',$image_row->filetype)==1 ? true :false;
|
1364 |
$is_embed_instagram_post = preg_match('/INSTAGRAM_POST/',$image_row->filetype)==1 ? true :false;
|
1365 |
$is_embed_instagram_video = preg_match('/INSTAGRAM_VIDEO/', $image_row->filetype) == 1 ? true :false;
|
@@ -1372,11 +1406,11 @@ class BWGViewGalleryBox {
|
|
1372 |
<?php
|
1373 |
if (!$is_embed) {
|
1374 |
?>
|
1375 |
-
<img class="bwg_popup_image bwg_popup_watermark" src="<?php echo
|
1376 |
<?php
|
1377 |
}
|
1378 |
else { /*$is_embed*/ ?>
|
1379 |
-
<span id="embed_conteiner" class="bwg_popup_embed bwg_popup_watermark" style="display:
|
1380 |
<?php echo $is_embed_instagram_video ? '<span class="bwg_inst_play_btn_cont" onclick="bwg_play_instagram_video(this)" ><span class="bwg_inst_play"></span></span>' : '';
|
1381 |
if ($is_embed_instagram_post) {
|
1382 |
$post_width = $image_width - ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0);
|
@@ -1400,7 +1434,7 @@ class BWGViewGalleryBox {
|
|
1400 |
WDWLibraryEmbed::display_embed($image_row->filetype, $image_row->image_url, $image_row->filename, array('class' => "bwg_embed_frame", 'data-width' => $instagram_post_width, 'data-height' => $instagram_post_height, 'frameborder' => "0", 'style' => "width:" . $post_width . "px; height:" . $post_height . "px; vertical-align:middle; display:inline-block; position:relative;"));
|
1401 |
}
|
1402 |
else{
|
1403 |
-
WDWLibraryEmbed::display_embed($image_row->filetype, $image_row->image_url, $image_row->filename, array('class'=>"bwg_embed_frame", 'frameborder'=>"0", 'allowfullscreen'=>"allowfullscreen", 'style'=>"display:
|
1404 |
}
|
1405 |
?>
|
1406 |
</span>
|
@@ -1611,12 +1645,11 @@ class BWGViewGalleryBox {
|
|
1611 |
<form id="bwg_ecommerce_form" method="post" action="<?php echo $popup_url; ?>">
|
1612 |
<div class="pge_add_to_cart">
|
1613 |
<div>
|
1614 |
-
|
1615 |
-
|
1616 |
<div>
|
1617 |
-
|
1618 |
-
|
1619 |
-
|
1620 |
</div>
|
1621 |
<div class="bwg_ecommerce_body">
|
1622 |
<ul class="pge_tabs" <?php if(count($pricelist_sections)<=1) echo "style='display:none;'"; ?>>
|
@@ -1639,7 +1672,6 @@ class BWGViewGalleryBox {
|
|
1639 |
<!-- manual -->
|
1640 |
<div class="manual pge_pricelist" id="manual" <?php if( count($pricelist_sections) == 2 || (count($pricelist_sections) == 1 && end($pricelist_sections) == "manual")) echo 'style="display: block;"'; else echo 'style="display: none;"'; ?> >
|
1641 |
<div>
|
1642 |
-
|
1643 |
<div class="product_manual_price_div">
|
1644 |
<p><?php echo $pricelist->manual_title ? __('Name', BWG()->prefix).': '.$pricelist->manual_title : "";?></p>
|
1645 |
<?php if ($pricelist->price) {
|
@@ -1794,7 +1826,6 @@ class BWGViewGalleryBox {
|
|
1794 |
</p>
|
1795 |
</div>
|
1796 |
</div>
|
1797 |
-
|
1798 |
</div>
|
1799 |
|
1800 |
<div style="margin-top:10px;">
|
@@ -1810,14 +1841,13 @@ class BWGViewGalleryBox {
|
|
1810 |
<input type="hidden" name="option_checkout_page" value="<?php echo get_permalink($options->checkout_page);?>">
|
1811 |
<input type="hidden" name="option_show_digital_items_count" value="<?php echo $options->show_digital_items_count;?>">
|
1812 |
</div>
|
1813 |
-
|
1814 |
</form>
|
1815 |
</div>
|
1816 |
</div>
|
1817 |
</div>
|
1818 |
</div>
|
1819 |
<script>
|
1820 |
-
|
1821 |
var totalPrice = 0;
|
1822 |
var showdigitalItemsCount = jQuery("[name=option_show_digital_items_count]").val();
|
1823 |
if( showdigitalItemsCount == 0 ){
|
@@ -1891,12 +1921,9 @@ class BWGViewGalleryBox {
|
|
1891 |
productPrice = count * productPrice;
|
1892 |
productPrice = productPrice.toFixed(2).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,");;
|
1893 |
jQuery(".product_manual_price").html(productPrice);
|
1894 |
-
|
1895 |
-
|
1896 |
}
|
1897 |
|
1898 |
function onBtnClickAddToCart(){
|
1899 |
-
|
1900 |
var type = jQuery("[name=type]").val();
|
1901 |
if(type != ""){
|
1902 |
var data = {};
|
@@ -2008,24 +2035,26 @@ class BWGViewGalleryBox {
|
|
2008 |
else{
|
2009 |
jQuery(".add_to_cart_msg").html("<?php echo __("Please select Prints and products or Downloads", BWG()->prefix);?>");
|
2010 |
}
|
2011 |
-
|
2012 |
-
}
|
2013 |
|
2014 |
function onBtnViewCart(){
|
2015 |
var checkoutPage = jQuery("[name=option_checkout_page]").val();
|
2016 |
jQuery("#bwg_ecommerce_form").attr("action",checkoutPage)
|
2017 |
jQuery("#bwg_ecommerce_form").submit();
|
2018 |
}
|
2019 |
-
|
2020 |
-
</script>
|
2021 |
-
|
2022 |
<?php
|
2023 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024 |
?>
|
2025 |
<a class="spider_popup_close" onclick="spider_destroypopup(1000); return false;" ontouchend="spider_destroypopup(1000); return false;"><span><i class="bwg_close_btn fa fa-times"></i></span></a>
|
2026 |
-
<script language="javascript" type="text/javascript" src="<?php echo BWG()->plugin_url . '/js/bwg_embed.js?ver=' . BWG()->plugin_version; ?>"></script>
|
2027 |
<script>
|
2028 |
-
|
2029 |
var filmstrip_width;
|
2030 |
var preloadCount;
|
2031 |
var filmstrip_thumbnail_width = jQuery(".bwg_filmstrip_thumbnail").width();
|
@@ -2094,7 +2123,7 @@ class BWGViewGalleryBox {
|
|
2094 |
bwg_image_effect : '<?php echo $image_effect; ?>',
|
2095 |
enable_image_filmstrip : <?php echo ($enable_image_filmstrip == '') ? 0 : $enable_image_filmstrip; ?>,
|
2096 |
gallery_id : <?php echo $gallery_id; ?>,
|
2097 |
-
site_url : '<?php echo
|
2098 |
lightbox_comment_width : <?php echo $theme_row->lightbox_comment_width; ?>,
|
2099 |
watermark_width : <?php echo $watermark_width; ?>,
|
2100 |
image_width : <?php echo $image_width; ?>,
|
@@ -2107,7 +2136,7 @@ class BWGViewGalleryBox {
|
|
2107 |
image_filmstrip_height : <?php echo $image_filmstrip_height; ?>,
|
2108 |
lightbox_info_margin : '<?php echo $theme_row->lightbox_info_margin; ?>',
|
2109 |
bwg_share_url : '<?php echo add_query_arg(array('curr_url' => $current_url, 'image_id' => ''), WDWLibrary::get_share_page()); ?>',
|
2110 |
-
bwg_share_image_url : "<?php echo urlencode(
|
2111 |
slideshow_interval : <?php echo $slideshow_interval; ?>,
|
2112 |
open_with_fullscreen : <?php echo $open_with_fullscreen; ?>,
|
2113 |
};
|
@@ -2132,6 +2161,8 @@ class BWGViewGalleryBox {
|
|
2132 |
}, 100);
|
2133 |
var bwg_trans_in_progress = false;
|
2134 |
var bwg_transition_duration = <?php echo (($slideshow_interval < 4 * $slideshow_effect_duration) && ($slideshow_interval != 0)) ? ($slideshow_interval * 1000) / 4 : ($slideshow_effect_duration * 1000); ?>;
|
|
|
|
|
2135 |
var bwg_playInterval;
|
2136 |
if ((jQuery("#spider_popup_wrap").width() >= jQuery(window).width()) || (jQuery("#spider_popup_wrap").height() >= jQuery(window).height())) {
|
2137 |
jQuery(".spider_popup_close").attr("class", "bwg_ctrl_btn spider_popup_close_fullscreen");
|
@@ -2174,16 +2205,12 @@ class BWGViewGalleryBox {
|
|
2174 |
var bwg_popup_current_width = <?php echo $image_width; ?>;
|
2175 |
var bwg_popup_current_height = <?php echo $image_height; ?>;
|
2176 |
|
2177 |
-
|
2178 |
/* jQuery(document).ready(function () { */
|
2179 |
-
<?php
|
2180 |
-
|
2181 |
-
if ($enable_addthis && $addthis_profile_id) {
|
2182 |
?>
|
2183 |
-
|
2184 |
-
|
2185 |
-
}
|
2186 |
-
?>
|
2187 |
/* Increase image hit counter.*/
|
2188 |
spider_set_input_value('rate_ajax_task', 'save_hit_count');
|
2189 |
spider_rate_ajax_save('bwg_rate_form');
|
@@ -2192,20 +2219,14 @@ class BWGViewGalleryBox {
|
|
2192 |
if (!bwg_hash || bwg_hash.indexOf("bwg") == "-1") {
|
2193 |
window.location.hash = "bwg<?php echo $gallery_id; ?>/<?php echo $current_image_id; ?>";
|
2194 |
}
|
2195 |
-
|
2196 |
-
|
2197 |
-
?>
|
2198 |
-
<?php
|
2199 |
-
if ($image_right_click) {
|
2200 |
-
?>
|
2201 |
/* Disable right click.*/
|
2202 |
jQuery(".bwg_image_wrap").bind("contextmenu", function (e) {
|
2203 |
return false;
|
2204 |
});
|
2205 |
jQuery(".bwg_image_wrap").css('webkitTouchCallout','none');
|
2206 |
-
|
2207 |
-
}
|
2208 |
-
?>
|
2209 |
jQuery('#spider_popup_wrap').bind('touchmove', function (event) {
|
2210 |
event.preventDefault();
|
2211 |
});
|
@@ -2295,13 +2316,17 @@ class BWGViewGalleryBox {
|
|
2295 |
});
|
2296 |
jQuery(".bwg_filmstrip_right").on(bwg_click, function () {
|
2297 |
jQuery( ".bwg_filmstrip_thumbnails" ).stop(true, false);
|
2298 |
-
if (jQuery(".bwg_filmstrip_thumbnails").position().<?php echo $left_or_top; ?> >= -(jQuery(".bwg_filmstrip_thumbnails").<?php echo $width_or_height; ?>() - jQuery(".bwg_filmstrip").<?php echo $width_or_height; ?>())) {
|
2299 |
-
jQuery(".bwg_filmstrip_left").css({opacity: 1, filter: "Alpha(opacity=100)"});
|
2300 |
-
if (jQuery(".bwg_filmstrip_thumbnails").position().<?php echo $left_or_top; ?> < -(jQuery(".bwg_filmstrip_thumbnails").<?php echo $width_or_height; ?>() - jQuery(".bwg_filmstrip").<?php echo $width_or_height; ?>() - <?php echo $
|
2301 |
-
|
|
|
|
|
2302 |
}
|
2303 |
else {
|
2304 |
-
jQuery(".bwg_filmstrip_thumbnails").animate({
|
|
|
|
|
2305 |
}
|
2306 |
}
|
2307 |
/* Disable right arrow.*/
|
@@ -2313,13 +2338,13 @@ class BWGViewGalleryBox {
|
|
2313 |
});
|
2314 |
jQuery(".bwg_filmstrip_left").on(bwg_click, function () {
|
2315 |
jQuery( ".bwg_filmstrip_thumbnails" ).stop(true, false);
|
2316 |
-
if (jQuery(".bwg_filmstrip_thumbnails").position().<?php echo $left_or_top; ?> < 0) {
|
2317 |
jQuery(".bwg_filmstrip_right").css({opacity: 1, filter: "Alpha(opacity=100)"});
|
2318 |
-
if (jQuery(".bwg_filmstrip_thumbnails").position().<?php echo $left_or_top; ?> > - <?php echo $
|
2319 |
jQuery(".bwg_filmstrip_thumbnails").animate({<?php echo $left_or_top; ?>: 0}, 500, 'linear');
|
2320 |
}
|
2321 |
else {
|
2322 |
-
jQuery(".bwg_filmstrip_thumbnails").animate({<?php echo $left_or_top; ?>: (jQuery(".bwg_filmstrip_thumbnails").position().<?php echo $left_or_top; ?> + <?php echo $image_filmstrip_width + $
|
2323 |
}
|
2324 |
}
|
2325 |
/* Disable left arrow.*/
|
@@ -2372,23 +2397,23 @@ class BWGViewGalleryBox {
|
|
2372 |
jQuery(".bwg_toggle_container").on(bwg_click, function () {
|
2373 |
var bwg_open_toggle_btn_class = "<?php echo ($theme_row->lightbox_ctrl_btn_pos == 'top') ? 'fa-angle-up' : 'fa-angle-down'; ?>";
|
2374 |
var bwg_close_toggle_btn_class = "<?php echo ($theme_row->lightbox_ctrl_btn_pos == 'top') ? 'fa-angle-down' : 'fa-angle-up'; ?>";
|
2375 |
-
|
2376 |
var bwg_image_info_height = jQuery(".bwg_image_info_container1").height()-jQuery(".bwg_ctrl_btn_container").height()-2*(parseInt("<?php echo $theme_row->lightbox_info_margin; ?>"));
|
2377 |
-
|
2378 |
var image_info= jQuery(".bwg_image_description").outerHeight() + jQuery(".bwg_image_title").outerHeight() + 2*(parseInt("<?php echo $theme_row->lightbox_info_margin; ?>"));
|
2379 |
-
|
2380 |
if (jQuery(".bwg_toggle_container i").hasClass(bwg_open_toggle_btn_class)) {
|
2381 |
/* Close controll buttons.*/
|
2382 |
var info_height = bwg_image_info_height + jQuery(".bwg_ctrl_btn_container").height();
|
2383 |
var top = parseInt(jQuery(".bwg_image_info").css("top")) - jQuery(".bwg_ctrl_btn_container").height();
|
2384 |
var bottom = jQuery(".bwg_ctrl_btn_container").height();
|
2385 |
-
|
2386 |
<?php
|
2387 |
if ($theme_row->lightbox_ctrl_btn_pos == 'top' && $theme_row->lightbox_info_pos == 'top') {
|
2388 |
?>
|
2389 |
if (jQuery(".bwg_image_info_container1").height() < image_info) {
|
2390 |
jQuery(".bwg_image_info").animate({top: top + "px", height: info_height}, 500);
|
2391 |
-
}
|
2392 |
else {
|
2393 |
jQuery(".bwg_image_info").animate({top: top + "px"}, 500);
|
2394 |
}
|
@@ -2453,9 +2478,9 @@ class BWGViewGalleryBox {
|
|
2453 |
}
|
2454 |
else {
|
2455 |
var bwg_image_info_height = jQuery(".bwg_image_info_container1").height()-2*(parseInt("<?php echo $theme_row->lightbox_info_margin; ?>")) - jQuery(".bwg_toggle_container").height();
|
2456 |
-
|
2457 |
var image_info= jQuery(".bwg_image_description").outerHeight() + jQuery(".bwg_image_title").outerHeight() + 2*(parseInt("<?php echo $theme_row->lightbox_info_margin; ?>")) + jQuery(".bwg_toggle_container").height();
|
2458 |
-
|
2459 |
var info_height = bwg_image_info_height;
|
2460 |
var top = parseInt(jQuery(".bwg_image_info").css("top")) + jQuery(".bwg_ctrl_btn_container").height();
|
2461 |
/* Open controll buttons.*/
|
@@ -2475,7 +2500,7 @@ class BWGViewGalleryBox {
|
|
2475 |
?>
|
2476 |
if(jQuery(".bwg_image_info_container1").height() < image_info) {
|
2477 |
jQuery(".bwg_image_info").animate({bottom: 0, height: info_height}, 500);
|
2478 |
-
}
|
2479 |
else {
|
2480 |
jQuery(".bwg_image_info").animate({top: 0}, 500);
|
2481 |
}
|
@@ -2618,14 +2643,14 @@ class BWGViewGalleryBox {
|
|
2618 |
maxWidth: (screen_width - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>),
|
2619 |
maxHeight: (screen_height - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>)
|
2620 |
});
|
2621 |
-
|
2622 |
jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({
|
2623 |
maxWidth: (screen_width - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>),
|
2624 |
maxHeight: (screen_height - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>)
|
2625 |
});
|
2626 |
-
|
2627 |
bwg_resize_instagram_post();
|
2628 |
-
|
2629 |
/* Set watermark container size.*/
|
2630 |
bwg_change_watermark_container();
|
2631 |
jQuery(".bwg_filmstrip_container").css({<?php echo $width_or_height; ?>: (screen_<?php echo $width_or_height; ?> - <?php echo ($filmstrip_direction == 'horizontal' ? 'comment_container_width' : 0); ?>)});
|
@@ -2676,14 +2701,6 @@ class BWGViewGalleryBox {
|
|
2676 |
<?php
|
2677 |
}
|
2678 |
?>
|
2679 |
-
<?php
|
2680 |
-
if (BWG()->options->preload_images) {
|
2681 |
-
echo "bwg_preload_images(parseInt(jQuery('#bwg_current_image_key').val()));";
|
2682 |
-
}
|
2683 |
-
?>
|
2684 |
-
jQuery('#bwg_popup_image img').on('load',function() {
|
2685 |
-
bwg_load_filmstrip();
|
2686 |
-
});
|
2687 |
|
2688 |
/* load filmstrip not visible images */
|
2689 |
function bwg_load_filmstrip() {
|
@@ -2727,8 +2744,8 @@ class BWGViewGalleryBox {
|
|
2727 |
event_stack = [];
|
2728 |
window.clearInterval(bwg_playInterval);
|
2729 |
});
|
2730 |
-
var lightbox_ctrl_btn_pos = "<?php echo $theme_row->lightbox_ctrl_btn_pos ;?>";
|
2731 |
-
if(<?php echo $open_ecommerce;?> == 1){
|
2732 |
setTimeout(function(){ bwg_ecommerce(); }, 400);
|
2733 |
}
|
2734 |
</script>
|
@@ -2741,5 +2758,4 @@ class BWGViewGalleryBox {
|
|
2741 |
<div class="bwg-loading hidden"></div>
|
2742 |
<?php
|
2743 |
}
|
2744 |
-
|
2745 |
-
}
|
16 |
$bwg = (isset($_GET['current_view']) ? esc_html($_GET['current_view']) : 0);
|
17 |
$current_image_id = WDWLibrary::esc_script('get', 'image_id', 0, 'int');
|
18 |
$theme_id = (isset($_GET['theme_id']) ? esc_html($_GET['theme_id']) : 1);
|
19 |
+
$thumb_width = BWG()->options->thumb_width;
|
20 |
+
$thumb_height = BWG()->options->thumb_height;
|
21 |
$open_with_fullscreen = WDWLibrary::esc_script('get', 'open_with_fullscreen', 0, 'int');
|
22 |
$open_with_autoplay = WDWLibrary::esc_script('get', 'open_with_autoplay', 0, 'int');
|
23 |
$image_width = WDWLibrary::esc_script('get', 'image_width', 800, 'int');
|
69 |
$watermark_width = (isset($_GET['watermark_width']) ? (int) $_GET['watermark_width'] : 90);
|
70 |
$watermark_height = (isset($_GET['watermark_height']) ? (int) $_GET['watermark_height'] : 90);
|
71 |
|
72 |
+
$image_right_click = isset(BWG()->options->image_right_click) ? BWG()->options->image_right_click : 0;
|
73 |
|
74 |
$theme_row = WDWLibrary::get_theme_row_data($theme_id);
|
75 |
$filmstrip_direction = 'horizontal';
|
76 |
if ($theme_row->lightbox_filmstrip_pos == 'right' || $theme_row->lightbox_filmstrip_pos == 'left') {
|
77 |
+
$filmstrip_direction = 'vertical';
|
78 |
}
|
79 |
+
$image_filmstrip_height = 0;
|
80 |
+
$image_filmstrip_width = 0;
|
81 |
+
if ( $enable_image_filmstrip ) {
|
82 |
+
if ( $filmstrip_direction == 'horizontal' ) {
|
83 |
$image_filmstrip_height = WDWLibrary::esc_script('get', 'image_filmstrip_height', 20, 'int');
|
84 |
$thumb_ratio = $thumb_width / $thumb_height;
|
85 |
$image_filmstrip_width = round($thumb_ratio * $image_filmstrip_height);
|
155 |
$params_array['watermark_height'] = $watermark_height;
|
156 |
}
|
157 |
$popup_url = add_query_arg(array($params_array), admin_url('admin-ajax.php'));
|
158 |
+
$filmstrip_thumb_margin = trim($theme_row->lightbox_filmstrip_thumb_margin);
|
159 |
$margins_split = explode(" ", $filmstrip_thumb_margin);
|
160 |
+
$all_images_top_bottom_space = 0;
|
161 |
+
$all_images_right_left_space = 0;
|
162 |
+
$filmstrip_thumb_margin_top = 0;
|
163 |
$filmstrip_thumb_margin_right = 0;
|
164 |
+
$filmstrip_thumb_margin_bottom = 0;
|
165 |
$filmstrip_thumb_margin_left = 0;
|
166 |
+
if ( count($margins_split) == 1 ) {
|
167 |
+
$filmstrip_thumb_margin_top = (int) $margins_split[0];
|
168 |
+
$filmstrip_thumb_margin_right = (int) $margins_split[0];
|
169 |
+
$filmstrip_thumb_margin_bottom = (int) $margins_split[0];
|
170 |
+
$filmstrip_thumb_margin_left = (int) $margins_split[0];
|
171 |
+
}
|
172 |
+
if ( count($margins_split) == 2 ) {
|
173 |
+
$filmstrip_thumb_margin_top = (int) $margins_split[0];
|
174 |
+
$filmstrip_thumb_margin_right = (int) $margins_split[1];
|
175 |
+
$filmstrip_thumb_margin_bottom = (int) $margins_split[0];
|
176 |
+
$filmstrip_thumb_margin_left = (int) $margins_split[1];
|
177 |
+
}
|
178 |
+
if ( count($margins_split) == 3 ) {
|
179 |
+
$filmstrip_thumb_margin_top = (int) $margins_split[0];
|
180 |
+
$filmstrip_thumb_margin_right = (int) $margins_split[1];
|
181 |
+
$filmstrip_thumb_margin_bottom = (int) $margins_split[2];
|
182 |
+
$filmstrip_thumb_margin_left = (int) $margins_split[1];
|
183 |
+
}
|
184 |
+
if ( count($margins_split) == 4 ) {
|
185 |
+
$filmstrip_thumb_margin_top = (int) $margins_split[0];
|
186 |
+
$filmstrip_thumb_margin_right = (int) $margins_split[1];
|
187 |
+
$filmstrip_thumb_margin_bottom = (int) $margins_split[2];
|
188 |
+
$filmstrip_thumb_margin_left = (int) $margins_split[3];
|
189 |
+
}
|
190 |
+
$filmstrip_thumb_top_bottom_space = $filmstrip_thumb_margin_top + $filmstrip_thumb_margin_bottom;
|
191 |
+
$filmstrip_thumb_right_left_space = $filmstrip_thumb_margin_right + $filmstrip_thumb_margin_left;
|
192 |
+
$all_images_top_bottom_space = count($image_rows) * $filmstrip_thumb_top_bottom_space;
|
193 |
+
$all_images_right_left_space = count($image_rows) * $filmstrip_thumb_right_left_space;
|
194 |
$temp_iterator = ($filmstrip_direction == 'horizontal' ? 1 : 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
$rgb_bwg_image_info_bg_color = WDWLibrary::spider_hex2rgb($theme_row->lightbox_info_bg_color);
|
196 |
$rgb_bwg_image_hit_bg_color = WDWLibrary::spider_hex2rgb($theme_row->lightbox_hit_bg_color);
|
197 |
$rgb_lightbox_ctrl_cont_bg_color = WDWLibrary::spider_hex2rgb($theme_row->lightbox_ctrl_cont_bg_color);
|
212 |
$outerWidth_or_outerHeight = 'outerHeight';
|
213 |
}
|
214 |
$lightbox_bg_transparent = (isset($theme_row->lightbox_bg_transparent)) ? $theme_row->lightbox_bg_transparent : 100;
|
215 |
+
$lightbox_bg_color = WDWLibrary::spider_hex2rgb($theme_row->lightbox_bg_color);
|
216 |
|
217 |
$current_filename = '';
|
218 |
|
229 |
filter: Alpha(opacity=<?php echo $theme_row->lightbox_overlay_bg_transparent; ?>);
|
230 |
}
|
231 |
.bwg_inst_play_btn_cont {
|
232 |
+
width: 100%;
|
233 |
+
height: 100%;
|
234 |
+
position: absolute;
|
235 |
+
z-index: 1;
|
236 |
cursor: pointer;
|
237 |
top: 0;
|
238 |
}
|
239 |
.bwg_inst_play {
|
240 |
+
position: absolute;
|
241 |
width: 50px;
|
242 |
height: 50px;
|
243 |
background-image: url('<?php echo BWG()->plugin_url . '/images/play.png'; ?>');
|
421 |
}
|
422 |
#spider_popup_right-ico{
|
423 |
left: -9999px;
|
424 |
+
}
|
425 |
<?php }
|
426 |
else { ?>
|
427 |
#spider_popup_left-ico {
|
727 |
z-index: 10106;
|
728 |
}
|
729 |
.bwg_filmstrip_thumbnails {
|
730 |
+
height: <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : ($image_filmstrip_height + $filmstrip_thumb_right_left_space) * count($image_rows)); ?>px;
|
731 |
<?php echo $left_or_top; ?>: 0px;
|
732 |
margin: 0 auto;
|
733 |
overflow: hidden;
|
734 |
position: relative;
|
735 |
+
width: <?php echo ($filmstrip_direction == 'horizontal' ? ($image_filmstrip_width + $filmstrip_thumb_right_left_space) * count($image_rows) : $image_filmstrip_width); ?>px;
|
736 |
}
|
737 |
.bwg_filmstrip_thumbnail {
|
738 |
+
position: relative;
|
739 |
+
background: none;
|
|
|
|
|
|
|
740 |
float: left;
|
741 |
height: <?php echo $image_filmstrip_height; ?>px;
|
|
|
742 |
width: <?php echo $image_filmstrip_width; ?>px;
|
743 |
+
padding: <?php echo $theme_row->lightbox_filmstrip_thumb_margin; ?>;
|
744 |
+
cursor: pointer;
|
745 |
+
overflow: hidden;
|
746 |
+
}
|
747 |
+
.bwg_filmstrip_thumbnail .bwg_filmstrip_thumbnail_img_wrap {
|
748 |
+
width:<?php echo $image_filmstrip_width - $filmstrip_thumb_right_left_space ?>px;
|
749 |
+
height:<?php echo $image_filmstrip_height - $filmstrip_thumb_top_bottom_space;?>px;
|
750 |
+
border: <?php echo $theme_row->lightbox_filmstrip_thumb_border_width; ?>px <?php echo $theme_row->lightbox_filmstrip_thumb_border_style; ?> #<?php echo $theme_row->lightbox_filmstrip_thumb_border_color; ?>;
|
751 |
+
border-radius: <?php echo $theme_row->lightbox_filmstrip_thumb_border_radius; ?>;
|
752 |
overflow: hidden;
|
753 |
}
|
754 |
.bwg_thumb_active {
|
755 |
opacity: 1;
|
756 |
filter: Alpha(opacity=100);
|
757 |
+
}
|
758 |
+
.bwg_thumb_active .bwg_filmstrip_thumbnail_img_wrap {
|
759 |
border: <?php echo $theme_row->lightbox_filmstrip_thumb_active_border_width; ?>px solid #<?php echo $theme_row->lightbox_filmstrip_thumb_active_border_color; ?>;
|
760 |
}
|
761 |
.bwg_thumb_deactive {
|
930 |
<?php } ?>
|
931 |
padding: <?php echo $theme_row->lightbox_info_padding; ?>;
|
932 |
<?php echo ((!$enable_image_filmstrip || $theme_row->lightbox_filmstrip_pos != 'top') && $theme_row->lightbox_ctrl_btn_pos == 'top' && $theme_row->lightbox_info_pos == 'top') ? 'top: ' . ($theme_row->lightbox_ctrl_btn_height + 2 * $theme_row->lightbox_ctrl_btn_margin_top) . 'px;' : '' ?>
|
933 |
+
word-break : break-word;
|
934 |
}
|
935 |
.bwg_image_info::-webkit-scrollbar {
|
936 |
width: 4px;
|
948 |
font-family: <?php echo $theme_row->lightbox_title_font_style; ?>;
|
949 |
font-size: <?php echo $theme_row->lightbox_title_font_size; ?>px;
|
950 |
font-weight: <?php echo $theme_row->lightbox_title_font_weight; ?>;
|
951 |
+
word-wrap: break-word;
|
952 |
}
|
953 |
.bwg_image_description,
|
954 |
.bwg_image_description * {
|
956 |
font-family: <?php echo $theme_row->lightbox_description_font_style; ?>;
|
957 |
font-size: <?php echo $theme_row->lightbox_description_font_size; ?>px;
|
958 |
font-weight: <?php echo $theme_row->lightbox_description_font_weight; ?>;
|
959 |
+
word-break: break-word;
|
960 |
}
|
961 |
.bwg_image_rate_spun {
|
962 |
text-align: <?php echo $theme_row->lightbox_rate_align; ?>;
|
1026 |
var event_stack = [];
|
1027 |
<?php
|
1028 |
$image_id_exist = FALSE;
|
1029 |
+
$has_embed = FALSE;
|
1030 |
foreach ($image_rows as $key => $image_row) {
|
1031 |
if ($image_row->id == $image_id) {
|
1032 |
$current_avg_rating = $image_row->avg_rating;
|
1044 |
$current_filename = $image_row->filename;
|
1045 |
$image_id_exist = TRUE;
|
1046 |
}
|
1047 |
+
$has_embed = $has_embed || preg_match('/EMBED/',$image_row->filetype) == 1;
|
1048 |
if ( BWG()->is_pro ) {
|
1049 |
$current_pricelist_id = $this->model->get_image_pricelist($image_row->id) ? $this->model->get_image_pricelist($image_row->id) : 0;
|
1050 |
$_pricelist_data = $this->model->get_image_pricelists($current_pricelist_id);
|
1100 |
<div class="bwg_image_wrap">
|
1101 |
<?php
|
1102 |
$current_pos = 0;
|
1103 |
+
if ( $enable_image_filmstrip ) {
|
1104 |
?>
|
1105 |
<div class="bwg_filmstrip_container">
|
1106 |
<div class="bwg_filmstrip_left"><i class="fa <?php echo ($filmstrip_direction == 'horizontal'? 'fa-angle-left' : 'fa-angle-up'); ?> "></i></div>
|
1107 |
<div class="bwg_filmstrip">
|
1108 |
+
<div class="bwg_filmstrip_thumbnails" data-all-images-right-left-space="<?php echo $all_images_right_left_space; ?>" data-all-images-top-bottom-space="<?php echo $all_images_top_bottom_space; ?>">
|
1109 |
<?php
|
1110 |
foreach ($image_rows as $key => $image_row) {
|
1111 |
if ($image_row->id == $current_image_id) {
|
1112 |
+
$current_pos = $key * (($filmstrip_direction == 'horizontal' ? $image_filmstrip_width : $image_filmstrip_height) + $filmstrip_thumb_right_left_space);
|
1113 |
$current_key = $key;
|
1114 |
}
|
1115 |
|
1116 |
$is_embed = preg_match('/EMBED/',$image_row->filetype)==1 ? true : false;
|
1117 |
+
$is_embed_instagram = preg_match('/EMBED_OEMBED_INSTAGRAM/', $image_row->filetype ) == 1 ? true : false;
|
1118 |
+
if ( !$is_embed ) {
|
1119 |
+
$thumb_path_url = htmlspecialchars_decode(BWG()->upload_dir . $image_row->thumb_url, ENT_COMPAT | ENT_QUOTES);
|
1120 |
$thumb_path_url = explode('?bwg', $thumb_path_url);
|
1121 |
list($image_thumb_width, $image_thumb_height) = getimagesize($thumb_path_url[0]);
|
1122 |
}
|
1147 |
$image_thumb_height = $image_filmstrip_height;
|
1148 |
}
|
1149 |
}
|
1150 |
+
|
1151 |
+
$_image_filmstrip_width = $image_filmstrip_width - $filmstrip_thumb_right_left_space;
|
1152 |
+
$_image_filmstrip_height = $image_filmstrip_height - $filmstrip_thumb_top_bottom_space;
|
1153 |
$scale = max($image_filmstrip_width / $image_thumb_width, $image_filmstrip_height / $image_thumb_height);
|
1154 |
$image_thumb_width *= $scale;
|
1155 |
$image_thumb_height *= $scale;
|
1156 |
+
$thumb_left = ($_image_filmstrip_width - $image_thumb_width) / 2;
|
1157 |
+
$thumb_top = ($_image_filmstrip_height - $image_thumb_height) / 2;
|
1158 |
?>
|
1159 |
+
<div id="bwg_filmstrip_thumbnail_<?php echo $key; ?>" class="bwg_filmstrip_thumbnail <?php echo (($image_row->id == $current_image_id) ? 'bwg_thumb_active' : 'bwg_thumb_deactive'); ?>">
|
1160 |
+
<div class="bwg_filmstrip_thumbnail_img_wrap">
|
1161 |
+
<img style="width:<?php echo $image_thumb_width; ?>px; height:<?php echo $image_thumb_height; ?>px; margin-left: <?php echo $thumb_left; ?>px; margin-top: <?php echo $thumb_top; ?>px;" class="bwg_filmstrip_thumbnail_img hidden" data-url="<?php echo ($is_embed ? "" : BWG()->upload_url) . $image_row->thumb_url; ?>" src="" onclick="bwg_change_image(parseInt(jQuery('#bwg_current_image_key').val()), '<?php echo $key; ?>', data)" ontouchend="bwg_change_image(parseInt(jQuery('#bwg_current_image_key').val()), '<?php echo $key; ?>', data,'')" image_id="<?php echo $image_row->id; ?>" image_key="<?php echo $key; ?>" alt="<?php echo $image_row->alt; ?>" />
|
1162 |
+
</div>
|
1163 |
</div>
|
1164 |
<?php
|
1165 |
}
|
1232 |
<i title="<?php echo __('Show rating', BWG()->prefix); ?>" class="bwg_ctrl_btn bwg_rate fa fa-star"></i>
|
1233 |
<?php }
|
1234 |
$is_embed = preg_match('/EMBED/', $current_filetype) == 1 ? TRUE : FALSE;
|
1235 |
+
$share_image_url = str_replace('%252F', '%2F', urlencode( $is_embed ? $current_thumb_url : BWG()->upload_url . rawurlencode($current_image_url)));
|
1236 |
if ($enable_image_facebook) {
|
1237 |
?>
|
1238 |
<a id="bwg_facebook_a" href="https://www.facebook.com/sharer/sharer.php?u=<?php echo urlencode($share_url); ?>" target="_blank" title="<?php echo __('Share on Facebook', BWG()->prefix); ?>">
|
1270 |
}
|
1271 |
if ($popup_enable_fullsize_image) {
|
1272 |
?>
|
1273 |
+
<a id="bwg_fullsize_image" href="<?php echo !$is_embed ? BWG()->upload_url . $current_image_url : $current_image_url; ?>" target="_blank">
|
1274 |
<i title="<?php echo __('Open image in original size.', BWG()->prefix); ?>" class="bwg_ctrl_btn fa fa-external-link"></i>
|
1275 |
</a>
|
1276 |
<?php
|
1279 |
$style = 'none';
|
1280 |
$current_image_arr = explode('/', $current_image_url);
|
1281 |
if (!$is_embed) {
|
1282 |
+
$download_href = BWG()->upload_url . str_replace('/thumb/', '/.original/', $current_thumb_url);
|
1283 |
$style = 'inline-block';
|
1284 |
}
|
1285 |
?>
|
1393 |
<div class="bwg_slider">
|
1394 |
<?php
|
1395 |
$current_key = -6;
|
1396 |
+
foreach ( $image_rows as $key => $image_row ) {
|
|
|
1397 |
$is_embed = preg_match('/EMBED/',$image_row->filetype)==1 ? true :false;
|
1398 |
$is_embed_instagram_post = preg_match('/INSTAGRAM_POST/',$image_row->filetype)==1 ? true :false;
|
1399 |
$is_embed_instagram_video = preg_match('/INSTAGRAM_VIDEO/', $image_row->filetype) == 1 ? true :false;
|
1406 |
<?php
|
1407 |
if (!$is_embed) {
|
1408 |
?>
|
1409 |
+
<img class="bwg_popup_image bwg_popup_watermark" src="<?php echo BWG()->upload_url . $image_row->image_url; ?>" alt="<?php echo $image_row->alt; ?>" />
|
1410 |
<?php
|
1411 |
}
|
1412 |
else { /*$is_embed*/ ?>
|
1413 |
+
<span id="embed_conteiner" class="bwg_popup_embed bwg_popup_watermark" style="display: block; table-layout: fixed; height: 100%;">
|
1414 |
<?php echo $is_embed_instagram_video ? '<span class="bwg_inst_play_btn_cont" onclick="bwg_play_instagram_video(this)" ><span class="bwg_inst_play"></span></span>' : '';
|
1415 |
if ($is_embed_instagram_post) {
|
1416 |
$post_width = $image_width - ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0);
|
1434 |
WDWLibraryEmbed::display_embed($image_row->filetype, $image_row->image_url, $image_row->filename, array('class' => "bwg_embed_frame", 'data-width' => $instagram_post_width, 'data-height' => $instagram_post_height, 'frameborder' => "0", 'style' => "width:" . $post_width . "px; height:" . $post_height . "px; vertical-align:middle; display:inline-block; position:relative;"));
|
1435 |
}
|
1436 |
else{
|
1437 |
+
WDWLibraryEmbed::display_embed($image_row->filetype, $image_row->image_url, $image_row->filename, array('class'=>"bwg_embed_frame", 'frameborder'=>"0", 'allowfullscreen'=>"allowfullscreen", 'style'=>"display:block; width:inherit; height:inherit; vertical-align:middle;"));
|
1438 |
}
|
1439 |
?>
|
1440 |
</span>
|
1645 |
<form id="bwg_ecommerce_form" method="post" action="<?php echo $popup_url; ?>">
|
1646 |
<div class="pge_add_to_cart">
|
1647 |
<div>
|
1648 |
+
<span class="pge_add_to_cart_title"><?php echo (__('Add to cart', BWG()->prefix)); ?></span>
|
1649 |
+
</div>
|
1650 |
<div>
|
1651 |
+
<a href="<?php echo get_permalink($options->checkout_page);?>"><?php echo "<span class='products_in_cart'>".$products_in_cart ."</span> ". __('items', BWG()->prefix); ?></a>
|
1652 |
+
</div>
|
|
|
1653 |
</div>
|
1654 |
<div class="bwg_ecommerce_body">
|
1655 |
<ul class="pge_tabs" <?php if(count($pricelist_sections)<=1) echo "style='display:none;'"; ?>>
|
1672 |
<!-- manual -->
|
1673 |
<div class="manual pge_pricelist" id="manual" <?php if( count($pricelist_sections) == 2 || (count($pricelist_sections) == 1 && end($pricelist_sections) == "manual")) echo 'style="display: block;"'; else echo 'style="display: none;"'; ?> >
|
1674 |
<div>
|
|
|
1675 |
<div class="product_manual_price_div">
|
1676 |
<p><?php echo $pricelist->manual_title ? __('Name', BWG()->prefix).': '.$pricelist->manual_title : "";?></p>
|
1677 |
<?php if ($pricelist->price) {
|
1826 |
</p>
|
1827 |
</div>
|
1828 |
</div>
|
|
|
1829 |
</div>
|
1830 |
|
1831 |
<div style="margin-top:10px;">
|
1841 |
<input type="hidden" name="option_checkout_page" value="<?php echo get_permalink($options->checkout_page);?>">
|
1842 |
<input type="hidden" name="option_show_digital_items_count" value="<?php echo $options->show_digital_items_count;?>">
|
1843 |
</div>
|
|
|
1844 |
</form>
|
1845 |
</div>
|
1846 |
</div>
|
1847 |
</div>
|
1848 |
</div>
|
1849 |
<script>
|
1850 |
+
function changeDownloadsTotal(obj){
|
1851 |
var totalPrice = 0;
|
1852 |
var showdigitalItemsCount = jQuery("[name=option_show_digital_items_count]").val();
|
1853 |
if( showdigitalItemsCount == 0 ){
|
1921 |
productPrice = count * productPrice;
|
1922 |
productPrice = productPrice.toFixed(2).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,");;
|
1923 |
jQuery(".product_manual_price").html(productPrice);
|
|
|
|
|
1924 |
}
|
1925 |
|
1926 |
function onBtnClickAddToCart(){
|
|
|
1927 |
var type = jQuery("[name=type]").val();
|
1928 |
if(type != ""){
|
1929 |
var data = {};
|
2035 |
else{
|
2036 |
jQuery(".add_to_cart_msg").html("<?php echo __("Please select Prints and products or Downloads", BWG()->prefix);?>");
|
2037 |
}
|
2038 |
+
}
|
|
|
2039 |
|
2040 |
function onBtnViewCart(){
|
2041 |
var checkoutPage = jQuery("[name=option_checkout_page]").val();
|
2042 |
jQuery("#bwg_ecommerce_form").attr("action",checkoutPage)
|
2043 |
jQuery("#bwg_ecommerce_form").submit();
|
2044 |
}
|
2045 |
+
</script>
|
|
|
|
|
2046 |
<?php
|
2047 |
}
|
2048 |
+
if ( BWG()->options->use_inline_stiles_and_scripts ) {
|
2049 |
+
if ( $has_embed ) {
|
2050 |
+
?>
|
2051 |
+
<script language="javascript" type="text/javascript" src="<?php echo BWG()->plugin_url . '/js/bwg_embed.js?ver=' . BWG()->plugin_version; ?>"></script>
|
2052 |
+
<?php
|
2053 |
+
}
|
2054 |
+
}
|
2055 |
?>
|
2056 |
<a class="spider_popup_close" onclick="spider_destroypopup(1000); return false;" ontouchend="spider_destroypopup(1000); return false;"><span><i class="bwg_close_btn fa fa-times"></i></span></a>
|
|
|
2057 |
<script>
|
|
|
2058 |
var filmstrip_width;
|
2059 |
var preloadCount;
|
2060 |
var filmstrip_thumbnail_width = jQuery(".bwg_filmstrip_thumbnail").width();
|
2123 |
bwg_image_effect : '<?php echo $image_effect; ?>',
|
2124 |
enable_image_filmstrip : <?php echo ($enable_image_filmstrip == '') ? 0 : $enable_image_filmstrip; ?>,
|
2125 |
gallery_id : <?php echo $gallery_id; ?>,
|
2126 |
+
site_url : '<?php echo BWG()->upload_url; ?>',
|
2127 |
lightbox_comment_width : <?php echo $theme_row->lightbox_comment_width; ?>,
|
2128 |
watermark_width : <?php echo $watermark_width; ?>,
|
2129 |
image_width : <?php echo $image_width; ?>,
|
2136 |
image_filmstrip_height : <?php echo $image_filmstrip_height; ?>,
|
2137 |
lightbox_info_margin : '<?php echo $theme_row->lightbox_info_margin; ?>',
|
2138 |
bwg_share_url : '<?php echo add_query_arg(array('curr_url' => $current_url, 'image_id' => ''), WDWLibrary::get_share_page()); ?>',
|
2139 |
+
bwg_share_image_url : "<?php echo urlencode(BWG()->upload_url); ?>",
|
2140 |
slideshow_interval : <?php echo $slideshow_interval; ?>,
|
2141 |
open_with_fullscreen : <?php echo $open_with_fullscreen; ?>,
|
2142 |
};
|
2161 |
}, 100);
|
2162 |
var bwg_trans_in_progress = false;
|
2163 |
var bwg_transition_duration = <?php echo (($slideshow_interval < 4 * $slideshow_effect_duration) && ($slideshow_interval != 0)) ? ($slideshow_interval * 1000) / 4 : ($slideshow_effect_duration * 1000); ?>;
|
2164 |
+
bwg_param['bwg_transition_duration'] = bwg_transition_duration;
|
2165 |
+
|
2166 |
var bwg_playInterval;
|
2167 |
if ((jQuery("#spider_popup_wrap").width() >= jQuery(window).width()) || (jQuery("#spider_popup_wrap").height() >= jQuery(window).height())) {
|
2168 |
jQuery(".spider_popup_close").attr("class", "bwg_ctrl_btn spider_popup_close_fullscreen");
|
2205 |
var bwg_popup_current_width = <?php echo $image_width; ?>;
|
2206 |
var bwg_popup_current_height = <?php echo $image_height; ?>;
|
2207 |
|
|
|
2208 |
/* jQuery(document).ready(function () { */
|
2209 |
+
<?php if ( BWG()->is_pro ) {
|
2210 |
+
if ($enable_addthis && $addthis_profile_id) {
|
|
|
2211 |
?>
|
2212 |
+
jQuery(".at4-share-outer").show();
|
2213 |
+
<?php } ?>
|
|
|
|
|
2214 |
/* Increase image hit counter.*/
|
2215 |
spider_set_input_value('rate_ajax_task', 'save_hit_count');
|
2216 |
spider_rate_ajax_save('bwg_rate_form');
|
2219 |
if (!bwg_hash || bwg_hash.indexOf("bwg") == "-1") {
|
2220 |
window.location.hash = "bwg<?php echo $gallery_id; ?>/<?php echo $current_image_id; ?>";
|
2221 |
}
|
2222 |
+
<?php } ?>
|
2223 |
+
<?php if ($image_right_click) { ?>
|
|
|
|
|
|
|
|
|
2224 |
/* Disable right click.*/
|
2225 |
jQuery(".bwg_image_wrap").bind("contextmenu", function (e) {
|
2226 |
return false;
|
2227 |
});
|
2228 |
jQuery(".bwg_image_wrap").css('webkitTouchCallout','none');
|
2229 |
+
<?php } ?>
|
|
|
|
|
2230 |
jQuery('#spider_popup_wrap').bind('touchmove', function (event) {
|
2231 |
event.preventDefault();
|
2232 |
});
|
2316 |
});
|
2317 |
jQuery(".bwg_filmstrip_right").on(bwg_click, function () {
|
2318 |
jQuery( ".bwg_filmstrip_thumbnails" ).stop(true, false);
|
2319 |
+
if ( jQuery(".bwg_filmstrip_thumbnails").position().<?php echo $left_or_top; ?> >= - (jQuery(".bwg_filmstrip_thumbnails").<?php echo $width_or_height; ?>() - jQuery(".bwg_filmstrip").<?php echo $width_or_height; ?>()) ) {
|
2320 |
+
jQuery(".bwg_filmstrip_left").css({ opacity: 1, filter: "Alpha(opacity=100)" });
|
2321 |
+
if ( (jQuery(".bwg_filmstrip_thumbnails").position().<?php echo $left_or_top; ?>) < ( - (jQuery(".bwg_filmstrip_thumbnails").<?php echo $width_or_height; ?>() - jQuery(".bwg_filmstrip").<?php echo $width_or_height; ?>() - <?php echo $filmstrip_thumb_right_left_space + $image_filmstrip_width + $all_images_right_left_space ?>))) {
|
2322 |
+
jQuery(".bwg_filmstrip_thumbnails").animate({
|
2323 |
+
<?php echo $left_or_top; ?>: -( jQuery(".bwg_filmstrip_thumbnails").<?php echo $width_or_height; ?>() - jQuery(".bwg_filmstrip").<?php echo $width_or_height ?>() - <?php echo $all_images_right_left_space; ?>)
|
2324 |
+
}, 500, 'linear');
|
2325 |
}
|
2326 |
else {
|
2327 |
+
jQuery(".bwg_filmstrip_thumbnails").animate({
|
2328 |
+
<?php echo $left_or_top; ?>: (jQuery(".bwg_filmstrip_thumbnails").position().<?php echo $left_or_top; ?> - <?php echo $filmstrip_thumb_right_left_space + $image_filmstrip_width; ?>)
|
2329 |
+
}, 500, 'linear');
|
2330 |
}
|
2331 |
}
|
2332 |
/* Disable right arrow.*/
|
2338 |
});
|
2339 |
jQuery(".bwg_filmstrip_left").on(bwg_click, function () {
|
2340 |
jQuery( ".bwg_filmstrip_thumbnails" ).stop(true, false);
|
2341 |
+
if ((jQuery(".bwg_filmstrip_thumbnails").position().<?php echo $left_or_top; ?>) < 0) {
|
2342 |
jQuery(".bwg_filmstrip_right").css({opacity: 1, filter: "Alpha(opacity=100)"});
|
2343 |
+
if (jQuery(".bwg_filmstrip_thumbnails").position().<?php echo $left_or_top; ?> > - <?php echo $filmstrip_thumb_right_left_space + $image_filmstrip_width; ?>) {
|
2344 |
jQuery(".bwg_filmstrip_thumbnails").animate({<?php echo $left_or_top; ?>: 0}, 500, 'linear');
|
2345 |
}
|
2346 |
else {
|
2347 |
+
jQuery(".bwg_filmstrip_thumbnails").animate({<?php echo $left_or_top; ?>: (jQuery(".bwg_filmstrip_thumbnails").position().<?php echo $left_or_top; ?> + <?php echo $image_filmstrip_width + $filmstrip_thumb_right_left_space; ?>)}, 500, 'linear');
|
2348 |
}
|
2349 |
}
|
2350 |
/* Disable left arrow.*/
|
2397 |
jQuery(".bwg_toggle_container").on(bwg_click, function () {
|
2398 |
var bwg_open_toggle_btn_class = "<?php echo ($theme_row->lightbox_ctrl_btn_pos == 'top') ? 'fa-angle-up' : 'fa-angle-down'; ?>";
|
2399 |
var bwg_close_toggle_btn_class = "<?php echo ($theme_row->lightbox_ctrl_btn_pos == 'top') ? 'fa-angle-down' : 'fa-angle-up'; ?>";
|
2400 |
+
|
2401 |
var bwg_image_info_height = jQuery(".bwg_image_info_container1").height()-jQuery(".bwg_ctrl_btn_container").height()-2*(parseInt("<?php echo $theme_row->lightbox_info_margin; ?>"));
|
2402 |
+
|
2403 |
var image_info= jQuery(".bwg_image_description").outerHeight() + jQuery(".bwg_image_title").outerHeight() + 2*(parseInt("<?php echo $theme_row->lightbox_info_margin; ?>"));
|
2404 |
+
|
2405 |
if (jQuery(".bwg_toggle_container i").hasClass(bwg_open_toggle_btn_class)) {
|
2406 |
/* Close controll buttons.*/
|
2407 |
var info_height = bwg_image_info_height + jQuery(".bwg_ctrl_btn_container").height();
|
2408 |
var top = parseInt(jQuery(".bwg_image_info").css("top")) - jQuery(".bwg_ctrl_btn_container").height();
|
2409 |
var bottom = jQuery(".bwg_ctrl_btn_container").height();
|
2410 |
+
|
2411 |
<?php
|
2412 |
if ($theme_row->lightbox_ctrl_btn_pos == 'top' && $theme_row->lightbox_info_pos == 'top') {
|
2413 |
?>
|
2414 |
if (jQuery(".bwg_image_info_container1").height() < image_info) {
|
2415 |
jQuery(".bwg_image_info").animate({top: top + "px", height: info_height}, 500);
|
2416 |
+
}
|
2417 |
else {
|
2418 |
jQuery(".bwg_image_info").animate({top: top + "px"}, 500);
|
2419 |
}
|
2478 |
}
|
2479 |
else {
|
2480 |
var bwg_image_info_height = jQuery(".bwg_image_info_container1").height()-2*(parseInt("<?php echo $theme_row->lightbox_info_margin; ?>")) - jQuery(".bwg_toggle_container").height();
|
2481 |
+
|
2482 |
var image_info= jQuery(".bwg_image_description").outerHeight() + jQuery(".bwg_image_title").outerHeight() + 2*(parseInt("<?php echo $theme_row->lightbox_info_margin; ?>")) + jQuery(".bwg_toggle_container").height();
|
2483 |
+
|
2484 |
var info_height = bwg_image_info_height;
|
2485 |
var top = parseInt(jQuery(".bwg_image_info").css("top")) + jQuery(".bwg_ctrl_btn_container").height();
|
2486 |
/* Open controll buttons.*/
|
2500 |
?>
|
2501 |
if(jQuery(".bwg_image_info_container1").height() < image_info) {
|
2502 |
jQuery(".bwg_image_info").animate({bottom: 0, height: info_height}, 500);
|
2503 |
+
}
|
2504 |
else {
|
2505 |
jQuery(".bwg_image_info").animate({top: 0}, 500);
|
2506 |
}
|
2643 |
maxWidth: (screen_width - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>),
|
2644 |
maxHeight: (screen_height - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>)
|
2645 |
});
|
2646 |
+
|
2647 |
jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({
|
2648 |
maxWidth: (screen_width - comment_container_width - <?php echo ($filmstrip_direction == 'vertical' ? $image_filmstrip_width : 0); ?>),
|
2649 |
maxHeight: (screen_height - <?php echo ($filmstrip_direction == 'horizontal' ? $image_filmstrip_height : 0); ?>)
|
2650 |
});
|
2651 |
+
|
2652 |
bwg_resize_instagram_post();
|
2653 |
+
|
2654 |
/* Set watermark container size.*/
|
2655 |
bwg_change_watermark_container();
|
2656 |
jQuery(".bwg_filmstrip_container").css({<?php echo $width_or_height; ?>: (screen_<?php echo $width_or_height; ?> - <?php echo ($filmstrip_direction == 'horizontal' ? 'comment_container_width' : 0); ?>)});
|
2701 |
<?php
|
2702 |
}
|
2703 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2704 |
|
2705 |
/* load filmstrip not visible images */
|
2706 |
function bwg_load_filmstrip() {
|
2744 |
event_stack = [];
|
2745 |
window.clearInterval(bwg_playInterval);
|
2746 |
});
|
2747 |
+
var lightbox_ctrl_btn_pos = "<?php echo $theme_row->lightbox_ctrl_btn_pos ;?>";
|
2748 |
+
if ( <?php echo $open_ecommerce;?> == 1) {
|
2749 |
setTimeout(function(){ bwg_ecommerce(); }, 400);
|
2750 |
}
|
2751 |
</script>
|
2758 |
<div class="bwg-loading hidden"></div>
|
2759 |
<?php
|
2760 |
}
|
2761 |
+
}
|
|
frontend/views/BWGViewImage_browser.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
class BWGViewImage_browser {
|
3 |
-
public function display($params, $from_shortcode = 0, $bwg = 0) {
|
4 |
require_once(BWG()->plugin_dir . '/framework/WDWLibrary.php');
|
5 |
require_once(BWG()->plugin_dir . '/framework/WDWLibraryEmbed.php');
|
6 |
|
@@ -250,7 +250,7 @@ class BWGViewImage_browser {
|
|
250 |
if (!$is_embed) {
|
251 |
?>
|
252 |
<a style="position:relative;" <?php echo ($params['thumb_click_action'] == 'open_lightbox' ? (' class="bwg_lightbox_' . $bwg . '" data-image-id="' . $image_row->id . '"') : ($params['thumb_click_action'] == 'redirect_to_url' && $image_row->redirect_url ? 'href="' . $image_row->redirect_url . '" target="' . ($params['thumb_link_target'] ? '_blank' : '') . '"' : '')) ?>>
|
253 |
-
<img class="bwg_image_browser_img_<?php echo $bwg; ?>" src="<?php echo
|
254 |
</a>
|
255 |
<?php
|
256 |
}
|
@@ -348,6 +348,9 @@ class BWGViewImage_browser {
|
|
348 |
$query_url = addslashes(add_query_arg(array(
|
349 |
"action" => "download_gallery",
|
350 |
"gallery_id" => $params['gallery_id'],
|
|
|
|
|
|
|
351 |
), admin_url('admin-ajax.php')));
|
352 |
?>
|
353 |
<div class="bwg_download_gallery">
|
@@ -385,21 +388,6 @@ class BWGViewImage_browser {
|
|
385 |
var filtersearchname = jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() ? "&filter_search_name_<?php echo $bwg; ?>=" + jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() : '';
|
386 |
spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>&image_id=' + image_id + filtersearchname, '<?php echo $bwg; ?>', '<?php echo $params['popup_width']; ?>', '<?php echo $params['popup_height']; ?>', 1, 'testpopup', 5, "<?php echo $theme_row->lightbox_ctrl_btn_pos ;?>");
|
387 |
}
|
388 |
-
<?php
|
389 |
-
if ( BWG()->is_pro ) {
|
390 |
-
?>
|
391 |
-
var bwg_hash = window.location.hash.substring(1);
|
392 |
-
if (bwg_hash) {
|
393 |
-
if (bwg_hash.indexOf("bwg") != "-1") {
|
394 |
-
bwg_hash_array = bwg_hash.replace("bwg", "").split("/");
|
395 |
-
if (bwg_hash_array[0] == "<?php echo $params_array['gallery_id']; ?>") {
|
396 |
-
bwg_gallery_box_<?php echo $bwg; ?>(bwg_hash_array[1]);
|
397 |
-
}
|
398 |
-
}
|
399 |
-
}
|
400 |
-
<?php
|
401 |
-
}
|
402 |
-
?>
|
403 |
function bwg_document_ready_<?php echo $bwg; ?>() {
|
404 |
var bwg_touch_flag = false;
|
405 |
jQuery(".bwg_lightbox_<?php echo $bwg; ?>").on("click", function () {
|
@@ -410,6 +398,21 @@ class BWGViewImage_browser {
|
|
410 |
return false;
|
411 |
}
|
412 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
413 |
}
|
414 |
jQuery(document).ready(function () {
|
415 |
bwg_document_ready_<?php echo $bwg; ?>();
|
1 |
<?php
|
2 |
class BWGViewImage_browser {
|
3 |
+
public function display($params = array(), $from_shortcode = 0, $bwg = 0) {
|
4 |
require_once(BWG()->plugin_dir . '/framework/WDWLibrary.php');
|
5 |
require_once(BWG()->plugin_dir . '/framework/WDWLibraryEmbed.php');
|
6 |
|
250 |
if (!$is_embed) {
|
251 |
?>
|
252 |
<a style="position:relative;" <?php echo ($params['thumb_click_action'] == 'open_lightbox' ? (' class="bwg_lightbox_' . $bwg . '" data-image-id="' . $image_row->id . '"') : ($params['thumb_click_action'] == 'redirect_to_url' && $image_row->redirect_url ? 'href="' . $image_row->redirect_url . '" target="' . ($params['thumb_link_target'] ? '_blank' : '') . '"' : '')) ?>>
|
253 |
+
<img class="bwg_image_browser_img_<?php echo $bwg; ?>" src="<?php echo BWG()->upload_url . $image_row->image_url; ?>" alt="<?php echo $image_row->alt; ?>" />
|
254 |
</a>
|
255 |
<?php
|
256 |
}
|
348 |
$query_url = addslashes(add_query_arg(array(
|
349 |
"action" => "download_gallery",
|
350 |
"gallery_id" => $params['gallery_id'],
|
351 |
+
"bwg" => $bwg,
|
352 |
+
"type" => 'gallery',
|
353 |
+
"bwg_search_".$bwg => WDWLibrary::get('bwg_search_'.$bwg),
|
354 |
), admin_url('admin-ajax.php')));
|
355 |
?>
|
356 |
<div class="bwg_download_gallery">
|
388 |
var filtersearchname = jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() ? "&filter_search_name_<?php echo $bwg; ?>=" + jQuery("#bwg_search_input_<?php echo $bwg; ?>" ).val() : '';
|
389 |
spider_createpopup('<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>&image_id=' + image_id + filtersearchname, '<?php echo $bwg; ?>', '<?php echo $params['popup_width']; ?>', '<?php echo $params['popup_height']; ?>', 1, 'testpopup', 5, "<?php echo $theme_row->lightbox_ctrl_btn_pos ;?>");
|
390 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
391 |
function bwg_document_ready_<?php echo $bwg; ?>() {
|
392 |
var bwg_touch_flag = false;
|
393 |
jQuery(".bwg_lightbox_<?php echo $bwg; ?>").on("click", function () {
|
398 |
return false;
|
399 |
}
|
400 |
});
|
401 |
+
<?php
|
402 |
+
if ( BWG()->is_pro ) {
|
403 |
+
?>
|
404 |
+
var bwg_hash = window.location.hash.substring(1);
|
405 |
+
if (bwg_hash) {
|
406 |
+
if (bwg_hash.indexOf("bwg") != "-1") {
|
407 |
+
bwg_hash_array = bwg_hash.replace("bwg", "").split("/");
|
408 |
+
if (bwg_hash_array[0] == "<?php echo $params_array['gallery_id']; ?>") {
|
409 |
+
bwg_gallery_box_<?php echo $bwg; ?>(bwg_hash_array[1]);
|
410 |
+
}
|
411 |
+
}
|
412 |
+
}
|
413 |
+
<?php
|
414 |
+
}
|
415 |
+
?>
|
416 |
}
|
417 |
jQuery(document).ready(function () {
|
418 |
bwg_document_ready_<?php echo $bwg; ?>();
|
frontend/views/BWGViewSlideshow.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
class BWGViewSlideshow extends BWGViewSite {
|
3 |
-
public function display($params, $from_shortcode = 0, $bwg = 0) {
|
4 |
$theme_row = $params['theme_row'];
|
5 |
$image_rows = $params['image_rows'];
|
6 |
$image_rows = $image_rows['images'];
|
@@ -42,7 +42,7 @@ class BWGViewSlideshow extends BWGViewSite {
|
|
42 |
// Validate url. If not valid add upload url.
|
43 |
$url = filter_var($slideshow_music_url, FILTER_SANITIZE_URL);
|
44 |
if (false === filter_var($url, FILTER_VALIDATE_URL)) {
|
45 |
-
$slideshow_music_url =
|
46 |
}
|
47 |
$image_width = $params['slideshow_width'];
|
48 |
$image_height = $params['slideshow_height'];
|
@@ -94,6 +94,8 @@ class BWGViewSlideshow extends BWGViewSite {
|
|
94 |
}
|
95 |
|
96 |
$inline_style = $this->inline_styles($bwg, $theme_row, $params, $image_width, $image_height, $filmstrip_direction, $slideshow_filmstrip_height, BWG()->options, $left_or_top, $width_or_height, $filmstrip_thumb_margin_hor, $slideshow_filmstrip_width, $image_rows, $watermark_position, $slideshow_title_position, $slideshow_description_position, $watermark_height, $watermark_width, $watermark_opacity, $watermark_font_size, $watermark_font, $watermark_color, $enable_slideshow_filmstrip);
|
|
|
|
|
97 |
if ( BWG()->options->use_inline_stiles_and_scripts ) {
|
98 |
wp_add_inline_style('bwg_frontend', $inline_style);
|
99 |
if ( !wp_script_is('bwg_embed', 'done') ) {
|
@@ -164,7 +166,7 @@ class BWGViewSlideshow extends BWGViewSite {
|
|
164 |
}
|
165 |
}
|
166 |
if (!$is_embed) {
|
167 |
-
$thumb_path_url = htmlspecialchars_decode(
|
168 |
$thumb_path_url = explode('?bwg', $thumb_path_url);
|
169 |
list($image_thumb_width, $image_thumb_height) = getimagesize($thumb_path_url[0]);
|
170 |
}
|
@@ -202,7 +204,7 @@ class BWGViewSlideshow extends BWGViewSite {
|
|
202 |
$thumb_top = ($slideshow_filmstrip_height - $image_thumb_height) / 2;
|
203 |
?>
|
204 |
<div id="bwg_filmstrip_thumbnail_<?php echo $key; ?>_<?php echo $bwg; ?>" class="bwg_slideshow_filmstrip_thumbnail_<?php echo $bwg; ?> <?php echo (($image_row->id == $current_image_id) ? 'bwg_slideshow_thumb_active_' . $bwg : 'bwg_slideshow_thumb_deactive_' . $bwg); ?>">
|
205 |
-
<img style="width:<?php echo $image_thumb_width; ?>px; height:<?php echo $image_thumb_height; ?>px; margin-left: <?php echo $thumb_left; ?>px; margin-top: <?php echo $thumb_top; ?>px;" class="bwg_filmstrip_thumbnail_img bwg_slideshow_filmstrip_thumbnail_img_<?php echo $bwg; ?>" src="<?php echo ( $is_embed ? "" :
|
206 |
</div>
|
207 |
<?php
|
208 |
}
|
@@ -224,7 +226,7 @@ class BWGViewSlideshow extends BWGViewSite {
|
|
224 |
$current_key = $key;
|
225 |
}
|
226 |
?>
|
227 |
-
<span id="bwg_dots_<?php echo $key; ?>_<?php echo $bwg; ?>" class="bwg_slideshow_dots_<?php echo $bwg; ?> <?php echo (($image_row->id == $current_image_id) ? 'bwg_slideshow_dots_active_' . $bwg : 'bwg_slideshow_dots_deactive_' . $bwg); ?>" onclick="
|
228 |
<?php
|
229 |
}
|
230 |
?>
|
@@ -251,8 +253,8 @@ class BWGViewSlideshow extends BWGViewSite {
|
|
251 |
<?php
|
252 |
if (!$is_embed) {
|
253 |
?>
|
254 |
-
<a <?php echo ($params['thumb_click_action'] == 'open_lightbox' ? (' class="bwg_lightbox"' . (BWG()->options->enable_seo ? ' href="' . ($is_embed ? $image_row->thumb_url :
|
255 |
-
<img id="bwg_slideshow_image_<?php echo $bwg; ?>" class="bwg_slide bwg_slideshow_image_<?php echo $bwg; ?>" src="<?php echo
|
256 |
</a>
|
257 |
<?php
|
258 |
}
|
@@ -303,8 +305,8 @@ class BWGViewSlideshow extends BWGViewSite {
|
|
303 |
<?php
|
304 |
if (!$is_embed) {
|
305 |
?>
|
306 |
-
<a <?php echo ($params['thumb_click_action'] == 'open_lightbox' ? (' class="bwg_lightbox_' . $bwg . '"' . (BWG()->options->enable_seo ? ' href="' . ($is_embed ? $image_row->thumb_url :
|
307 |
-
<img id="bwg_slideshow_image_<?php echo $bwg; ?>" class="bwg_slide bwg_slideshow_image_<?php echo $bwg; ?>" src="<?php echo
|
308 |
</a>
|
309 |
<?php
|
310 |
}
|
@@ -351,9 +353,9 @@ class BWGViewSlideshow extends BWGViewSite {
|
|
351 |
<?php
|
352 |
if ($enable_slideshow_ctrl) {
|
353 |
?>
|
354 |
-
<a id="spider_slideshow_left_<?php echo $bwg; ?>" onclick="
|
355 |
<span id="bwg_slideshow_play_pause_<?php echo $bwg; ?>" style="display: <?php echo $play_pause_button_display; ?>;"><span><span id="bwg_slideshow_play_pause-ico_<?php echo $bwg; ?>"><i class="bwg_ctrl_btn_<?php echo $bwg; ?> bwg_slideshow_play_pause_<?php echo $bwg; ?> fa fa-play"></i></span></span></span>
|
356 |
-
<a id="spider_slideshow_right_<?php echo $bwg; ?>" onclick="
|
357 |
<?php
|
358 |
}
|
359 |
?>
|
@@ -361,9 +363,9 @@ class BWGViewSlideshow extends BWGViewSite {
|
|
361 |
<?php
|
362 |
if ($params['watermark_type'] != 'none') {
|
363 |
?>
|
364 |
-
<div class="bwg_slideshow_image_container_<?php echo $bwg; ?>
|
365 |
<div class="bwg_slideshow_watermark_container_<?php echo $bwg; ?>">
|
366 |
-
<div
|
367 |
<span class="bwg_slideshow_watermark_spun_<?php echo $bwg; ?>" id="bwg_slideshow_watermark_container_<?php echo $bwg; ?>">
|
368 |
<?php
|
369 |
if ($params['watermark_type'] == 'image') {
|
@@ -387,11 +389,11 @@ class BWGViewSlideshow extends BWGViewSite {
|
|
387 |
}
|
388 |
if ($enable_image_title) {
|
389 |
?>
|
390 |
-
<div class="bwg_slideshow_image_container_<?php echo $bwg; ?>
|
391 |
<div class="bwg_slideshow_watermark_container_<?php echo $bwg; ?>">
|
392 |
-
<div
|
393 |
<span class="bwg_slideshow_title_spun_<?php echo $bwg; ?>">
|
394 |
-
<div class="bwg_slideshow_title_text_<?php echo $bwg; ?>
|
395 |
<?php echo html_entity_decode($current_image_alt); ?>
|
396 |
</div>
|
397 |
</span>
|
@@ -402,11 +404,11 @@ class BWGViewSlideshow extends BWGViewSite {
|
|
402 |
}
|
403 |
if ($enable_image_description) {
|
404 |
?>
|
405 |
-
<div class="bwg_slideshow_image_container_<?php echo $bwg; ?>
|
406 |
<div class="bwg_slideshow_watermark_container_<?php echo $bwg; ?>">
|
407 |
-
<div
|
408 |
<span class="bwg_slideshow_description_spun_<?php echo $bwg; ?>">
|
409 |
-
<div class="bwg_slideshow_description_text_<?php echo $bwg; ?>
|
410 |
<?php echo html_entity_decode(str_replace("\r\n", esc_html('<br />'), $current_image_description)); ?>
|
411 |
</div>
|
412 |
</span>
|
@@ -424,595 +426,64 @@ class BWGViewSlideshow extends BWGViewSite {
|
|
424 |
</div>
|
425 |
<?php
|
426 |
|
427 |
-
parent::
|
428 |
|
429 |
?>
|
430 |
<script>
|
431 |
-
var bwg_trans_in_progress_<?php echo $bwg; ?> = false;
|
432 |
var bwg_transition_duration_<?php echo $bwg; ?> = <?php echo (($params['slideshow_interval'] < 4) && ($params['slideshow_interval'] != 0)) ? ($params['slideshow_interval'] * 1000) / 4 : ($params['slideshow_effect_duration'] * 1000); ?>;
|
433 |
var bwg_playInterval_<?php echo $bwg; ?>;
|
434 |
/* Stop autoplay.*/
|
435 |
window.clearInterval(bwg_playInterval_<?php echo $bwg; ?>);
|
436 |
-
|
437 |
-
function bwg_change_watermark_container_<?php echo $bwg; ?>() {
|
438 |
-
jQuery(".bwg_slider_<?php echo $bwg; ?>").children().each(function() {
|
439 |
-
if (jQuery(this).css("zIndex") == 2) {
|
440 |
-
/* For images.*/
|
441 |
-
var bwg_current_image_span = jQuery(this).find("img");
|
442 |
-
if (bwg_current_image_span.length) {
|
443 |
-
if (bwg_current_image_span.prop('complete')) {
|
444 |
-
var width = bwg_current_image_span.width();
|
445 |
-
var height = bwg_current_image_span.height();
|
446 |
-
bwg_change_each_watermark_container_<?php echo $bwg; ?>(width, height);
|
447 |
-
}
|
448 |
-
else {
|
449 |
-
bwg_current_image_span.on("load", function () {
|
450 |
-
var width = bwg_current_image_span.width();
|
451 |
-
var height = bwg_current_image_span.height();
|
452 |
-
bwg_change_each_watermark_container_<?php echo $bwg; ?>(width, height);
|
453 |
-
});
|
454 |
-
}
|
455 |
-
}
|
456 |
-
else {
|
457 |
-
/* For embeds and videos.*/
|
458 |
-
bwg_current_image_span = jQuery(this).find("iframe");
|
459 |
-
if (!bwg_current_image_span.length) {
|
460 |
-
bwg_current_image_span = jQuery(this).find("video");
|
461 |
-
}
|
462 |
-
var width = bwg_current_image_span.width();
|
463 |
-
var height = bwg_current_image_span.height();
|
464 |
-
bwg_change_each_watermark_container_<?php echo $bwg; ?>(width, height);
|
465 |
-
}
|
466 |
-
}
|
467 |
-
});
|
468 |
-
}
|
469 |
-
/* Set each watermark container size.*/
|
470 |
-
function bwg_change_each_watermark_container_<?php echo $bwg; ?>(width, height) {
|
471 |
-
jQuery(".bwg_slideshow_watermark_spun_<?php echo $bwg; ?>").width(width);
|
472 |
-
jQuery(".bwg_slideshow_watermark_spun_<?php echo $bwg; ?>").height(height);
|
473 |
-
jQuery(".bwg_slideshow_title_spun_<?php echo $bwg; ?>").width(width);
|
474 |
-
jQuery(".bwg_slideshow_title_spun_<?php echo $bwg; ?>").height(height);
|
475 |
-
jQuery(".bwg_slideshow_description_spun_<?php echo $bwg; ?>").width(width);
|
476 |
-
jQuery(".bwg_slideshow_description_spun_<?php echo $bwg; ?>").height(height);
|
477 |
-
jQuery(".bwg_slideshow_watermark_<?php echo $bwg; ?>").css({display: ''});
|
478 |
-
if (jQuery.trim(jQuery(".bwg_slideshow_title_text_<?php echo $bwg; ?>").text())) {
|
479 |
-
jQuery(".bwg_slideshow_title_text_<?php echo $bwg; ?>").css({display: ''});
|
480 |
-
}
|
481 |
-
if (jQuery.trim(jQuery(".bwg_slideshow_description_text_<?php echo $bwg; ?>").text())) {
|
482 |
-
jQuery(".bwg_slideshow_description_text_<?php echo $bwg; ?>").css({display: ''});
|
483 |
-
}
|
484 |
-
}
|
485 |
var bwg_current_key_<?php echo $bwg; ?> = '<?php echo (isset($current_key) ? $current_key : ''); ?>';
|
486 |
var bwg_current_filmstrip_pos_<?php echo $bwg; ?> = <?php echo $current_pos; ?>;
|
487 |
-
/* Set filmstrip initial position.*/
|
488 |
-
function bwg_set_filmstrip_pos_<?php echo $bwg; ?>(filmStripWidth) {
|
489 |
-
var selectedImagePos = -bwg_current_filmstrip_pos_<?php echo $bwg; ?> - (jQuery(".bwg_slideshow_filmstrip_thumbnail_<?php echo $bwg; ?>").<?php echo $width_or_height; ?>() + <?php echo $filmstrip_thumb_margin_hor; ?>) / 2;
|
490 |
-
var imagesContainerLeft = Math.min(0, Math.max(filmStripWidth - jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>").<?php echo $width_or_height; ?>(), selectedImagePos + filmStripWidth / 2));
|
491 |
-
jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>").animate({
|
492 |
-
<?php echo $left_or_top; ?>: imagesContainerLeft
|
493 |
-
}, {
|
494 |
-
duration: 500,
|
495 |
-
complete: function () { bwg_filmstrip_arrows_<?php echo $bwg; ?>(); }
|
496 |
-
});
|
497 |
-
}
|
498 |
-
function bwg_move_filmstrip_<?php echo $bwg; ?>() {
|
499 |
-
var image_left = jQuery(".bwg_slideshow_thumb_active_<?php echo $bwg; ?>").position().<?php echo $left_or_top; ?>;
|
500 |
-
var image_right = jQuery(".bwg_slideshow_thumb_active_<?php echo $bwg; ?>").position().<?php echo $left_or_top; ?> + jQuery(".bwg_slideshow_thumb_active_<?php echo $bwg; ?>").<?php echo $outerWidth_or_outerHeight; ?>(true);
|
501 |
-
var bwg_filmstrip_width = jQuery(".bwg_slideshow_filmstrip_<?php echo $bwg; ?>").<?php echo $outerWidth_or_outerHeight; ?>(true);
|
502 |
-
var bwg_filmstrip_thumbnails_width = jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>").<?php echo $outerWidth_or_outerHeight; ?>(true);
|
503 |
-
var long_filmstrip_cont_left = jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>").position().<?php echo $left_or_top; ?>;
|
504 |
-
var long_filmstrip_cont_right = Math.abs(jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>").position().<?php echo $left_or_top; ?>) + bwg_filmstrip_width;
|
505 |
-
if (bwg_filmstrip_width > bwg_filmstrip_thumbnails_width) {
|
506 |
-
return;
|
507 |
-
}
|
508 |
-
if (image_left < Math.abs(long_filmstrip_cont_left)) {
|
509 |
-
jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>").animate({
|
510 |
-
<?php echo $left_or_top; ?>: -image_left
|
511 |
-
}, {
|
512 |
-
duration: 500,
|
513 |
-
complete: function () { bwg_filmstrip_arrows_<?php echo $bwg; ?>(); }
|
514 |
-
});
|
515 |
-
}
|
516 |
-
else if (image_right > long_filmstrip_cont_right) {
|
517 |
-
jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>").animate({
|
518 |
-
<?php echo $left_or_top; ?>: -(image_right - bwg_filmstrip_width)
|
519 |
-
}, {
|
520 |
-
duration: 500,
|
521 |
-
complete: function () { bwg_filmstrip_arrows_<?php echo $bwg; ?>(); }
|
522 |
-
});
|
523 |
-
}
|
524 |
-
}
|
525 |
-
function bwg_move_dots_<?php echo $bwg; ?>() {
|
526 |
-
var image_left = jQuery(".bwg_slideshow_dots_active_<?php echo $bwg; ?>").position().left;
|
527 |
-
var image_right = jQuery(".bwg_slideshow_dots_active_<?php echo $bwg; ?>").position().left + jQuery(".bwg_slideshow_dots_active_<?php echo $bwg; ?>").outerWidth(true);
|
528 |
-
var bwg_dots_width = jQuery(".bwg_slideshow_dots_container_<?php echo $bwg; ?>").outerWidth(true);
|
529 |
-
var bwg_dots_thumbnails_width = jQuery(".bwg_slideshow_dots_thumbnails_<?php echo $bwg; ?>").outerWidth(false);
|
530 |
-
var long_filmstrip_cont_left = jQuery(".bwg_slideshow_dots_thumbnails_<?php echo $bwg; ?>").position().left;
|
531 |
-
var long_filmstrip_cont_right = Math.abs(jQuery(".bwg_slideshow_dots_thumbnails_<?php echo $bwg; ?>").position().left) + bwg_dots_width;
|
532 |
-
if (bwg_dots_width > bwg_dots_thumbnails_width) {
|
533 |
-
return;
|
534 |
-
}
|
535 |
-
if (image_left < Math.abs(long_filmstrip_cont_left)) {
|
536 |
-
jQuery(".bwg_slideshow_dots_thumbnails_<?php echo $bwg; ?>").animate({
|
537 |
-
left: -image_left
|
538 |
-
}, {
|
539 |
-
duration: 500,
|
540 |
-
complete: function () { }
|
541 |
-
});
|
542 |
-
}
|
543 |
-
else if (image_right > long_filmstrip_cont_right) {
|
544 |
-
jQuery(".bwg_slideshow_dots_thumbnails_<?php echo $bwg; ?>").animate({
|
545 |
-
left: -(image_right - bwg_dots_width)
|
546 |
-
}, {
|
547 |
-
duration: 500,
|
548 |
-
complete: function () { }
|
549 |
-
});
|
550 |
-
}
|
551 |
-
}
|
552 |
-
/* Show/hide filmstrip arrows.*/
|
553 |
-
function bwg_filmstrip_arrows_<?php echo $bwg; ?>() {
|
554 |
-
if (jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>").<?php echo $width_or_height; ?>() < jQuery(".bwg_slideshow_filmstrip_<?php echo $bwg; ?>").<?php echo $width_or_height; ?>()) {
|
555 |
-
jQuery(".bwg_slideshow_filmstrip_left_<?php echo $bwg; ?>").hide();
|
556 |
-
jQuery(".bwg_slideshow_filmstrip_right_<?php echo $bwg; ?>").hide();
|
557 |
-
}
|
558 |
-
else {
|
559 |
-
jQuery(".bwg_slideshow_filmstrip_left_<?php echo $bwg; ?>").show();
|
560 |
-
jQuery(".bwg_slideshow_filmstrip_right_<?php echo $bwg; ?>").show();
|
561 |
-
}
|
562 |
-
}
|
563 |
-
function bwg_testBrowser_cssTransitions_<?php echo $bwg; ?>() {
|
564 |
-
return bwg_testDom_<?php echo $bwg; ?>('Transition');
|
565 |
-
}
|
566 |
-
function bwg_testBrowser_cssTransforms3d_<?php echo $bwg; ?>() {
|
567 |
-
return bwg_testDom_<?php echo $bwg; ?>('Perspective');
|
568 |
-
}
|
569 |
-
function bwg_testDom_<?php echo $bwg; ?>(prop) {
|
570 |
-
/* Browser vendor CSS prefixes.*/
|
571 |
-
var browserVendors = ['', '-webkit-', '-moz-', '-ms-', '-o-', '-khtml-'];
|
572 |
-
/* Browser vendor DOM prefixes.*/
|
573 |
-
var domPrefixes = ['', 'Webkit', 'Moz', 'ms', 'O', 'Khtml'];
|
574 |
-
var i = domPrefixes.length;
|
575 |
-
while (i--) {
|
576 |
-
if (typeof document.body.style[domPrefixes[i] + prop] !== 'undefined') {
|
577 |
-
return true;
|
578 |
-
}
|
579 |
-
}
|
580 |
-
return false;
|
581 |
-
}
|
582 |
|
583 |
bwg_param = {
|
|
|
584 |
bwg_current_key : bwg_current_key_<?php echo $bwg; ?>,
|
585 |
bwg_transition_duration : bwg_transition_duration_<?php echo $bwg; ?>,
|
586 |
bwg_trans_in_progress : false,
|
587 |
data : data_<?php echo $bwg; ?>,
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
});
|
627 |
-
/* Pause videos facebook video.*/
|
628 |
-
jQuery('#image_id_<?php echo $bwg; ?>_' + data_<?php echo $bwg; ?>[current_key]["id"]).find('.bwg_fb_video').each(function () {
|
629 |
-
jQuery(this).attr('src', jQuery(this).attr('src'));
|
630 |
-
});
|
631 |
-
if (data_<?php echo $bwg; ?>[key]) {
|
632 |
-
if (jQuery('.bwg_ctrl_btn_<?php echo $bwg; ?>').hasClass('fa-pause')) {
|
633 |
-
bwg_play_<?php echo $bwg; ?>();
|
634 |
-
}
|
635 |
-
if (!from_effect) {
|
636 |
-
/* Change image key.*/
|
637 |
-
jQuery("#bwg_current_image_key_<?php echo $bwg; ?>").val(key);
|
638 |
-
if (current_key == '-1') { /* Filmstrip.*/
|
639 |
-
current_key = jQuery(".bwg_slideshow_thumb_active_<?php echo $bwg; ?>").children("img").attr("image_key");
|
640 |
-
}
|
641 |
-
else if (current_key == '-2') { /* Dots.*/
|
642 |
-
current_key = jQuery(".bwg_slideshow_dots_active_<?php echo $bwg; ?>").attr("image_key");
|
643 |
-
}
|
644 |
-
}
|
645 |
-
if (bwg_params[<?php echo $bwg; ?>]['bwg_trans_in_progress']) {
|
646 |
-
event_stack_<?php echo $bwg; ?>.push(current_key + '-' + key);
|
647 |
-
bwg_params[<?php echo $bwg; ?>]['event_stack'] = event_stack_<?php echo $bwg; ?>;
|
648 |
-
return;
|
649 |
-
}
|
650 |
-
var direction = 'right';
|
651 |
-
if (bwg_current_key_<?php echo $bwg; ?> > key) {
|
652 |
-
var direction = 'left';
|
653 |
-
}
|
654 |
-
else if (bwg_current_key_<?php echo $bwg; ?> == key) {
|
655 |
-
return;
|
656 |
-
}
|
657 |
-
jQuery(".bwg_slideshow_watermark_<?php echo $bwg; ?>").css({display: 'none'});
|
658 |
-
jQuery(".bwg_slideshow_title_text_<?php echo $bwg; ?>").css({display: 'none'});
|
659 |
-
jQuery(".bwg_slideshow_description_text_<?php echo $bwg; ?>").css({display: 'none'});
|
660 |
-
/* Set active thumbnail position.*/
|
661 |
-
bwg_current_filmstrip_pos_<?php echo $bwg; ?> = key * (jQuery(".bwg_slideshow_filmstrip_thumbnail_<?php echo $bwg; ?>").<?php echo $width_or_height; ?>() + 2 + 2 * <?php echo $theme_row->lightbox_filmstrip_thumb_border_width; ?>);
|
662 |
-
bwg_current_key_<?php echo $bwg; ?> = key;
|
663 |
-
bwg_params[<?php echo $bwg; ?>]['bwg_current_key'] = bwg_current_key_<?php echo $bwg; ?>;
|
664 |
-
/* Change image id, title, description.*/
|
665 |
-
jQuery("#bwg_slideshow_image_<?php echo $bwg; ?>").attr('image_id', data_<?php echo $bwg; ?>[key]["id"]);
|
666 |
-
jQuery(".bwg_slideshow_title_text_<?php echo $bwg; ?>").html(jQuery('<span style="display: block;" />').html(data_<?php echo $bwg; ?>[key]["alt"]).text());
|
667 |
-
jQuery(".bwg_slideshow_description_text_<?php echo $bwg; ?>").html(jQuery('<span style="display: block;" />').html(data_<?php echo $bwg; ?>[key]["description"]).text());
|
668 |
-
var current_image_class = jQuery(".bwg_slideshow_image_spun_<?php echo $bwg; ?>").css("zIndex") == 2 ? ".bwg_slideshow_image_spun_<?php echo $bwg; ?>" : ".bwg_slideshow_image_second_spun_<?php echo $bwg; ?>";
|
669 |
-
var next_image_class = current_image_class == ".bwg_slideshow_image_second_spun_<?php echo $bwg; ?>" ? ".bwg_slideshow_image_spun_<?php echo $bwg; ?>" : ".bwg_slideshow_image_second_spun_<?php echo $bwg; ?>";
|
670 |
-
var is_embed = data_<?php echo $bwg; ?>[key]['filetype'].indexOf("EMBED_") > -1 ? true : false;
|
671 |
-
var is_embed_instagram_post = data_<?php echo $bwg; ?>[key]['filetype'].indexOf('INSTAGRAM_POST') > -1 ? true :false;
|
672 |
-
var is_embed_instagram_video = data_<?php echo $bwg; ?>[key]['filetype'].indexOf('INSTAGRAM_VIDEO') > -1 ? true :false;
|
673 |
-
var cur_height = jQuery(current_image_class).height();
|
674 |
-
var cur_width = jQuery(current_image_class).width();
|
675 |
-
var innhtml = '<span class="bwg_slideshow_image_spun1_<?php echo $bwg; ?>" style="display: ' + (!is_embed ? 'table' : 'block') + ' ;width: inherit; height: inherit;"><span class="bwg_slideshow_image_spun2_<?php echo $bwg; ?>" style="display: ' + (!is_embed ? 'table-cell' : 'block') + '; vertical-align: middle; text-align: center; ">';
|
676 |
-
if (!is_embed) {
|
677 |
-
<?php
|
678 |
-
if ($params['thumb_click_action'] != 'do_nothing' ) {
|
679 |
-
?>
|
680 |
-
innhtml += '<a' + <?php if ($params['thumb_click_action'] == 'open_lightbox') { echo '\' class="bwg_lightbox" data-image-id="\' + data_' . $bwg . '[key][\'id\'] + \'"'; } else { echo ($params['thumb_click_action'] == 'redirect_to_url' && 'data_' . $bwg . '[key][\'redirect_url\']') ? '\' href="\'+ data_' . $bwg . '[key][\'redirect_url\']+\'" target="' . ($params['thumb_link_target'] ? '_blank' : '') . '"' : '';} ?> '+'>';
|
681 |
-
<?php
|
682 |
-
}
|
683 |
-
?>
|
684 |
-
innhtml += '<img style="max-height: ' + cur_height + 'px !important; max-width: ' + cur_width + 'px !important;display:inline-block;" class="bwg_slide bwg_slideshow_image_<?php echo $bwg; ?>" id="bwg_slideshow_image_<?php echo $bwg; ?>" src="<?php echo site_url() . '/' . BWG()->upload_dir; ?>' + jQuery('<span style="display: block;" />').html(data_<?php echo $bwg; ?>[key]["image_url"]).text() + '" alt="' + data_<?php echo $bwg; ?>[key]["alt"] + '" image_id="' + data_<?php echo $bwg; ?>[key]["id"] + '" /></a>';
|
685 |
-
}
|
686 |
-
else { /*is_embed*/
|
687 |
-
innhtml += '<span style="height: ' + cur_height + 'px; width: ' + cur_width + 'px;" class="bwg_popup_embed bwg_popup_watermark">';
|
688 |
-
if (is_embed_instagram_video ) {
|
689 |
-
innhtml += '<span class="bwg_inst_play_btn_cont" onclick="bwg_play_instagram_video(this)"><span class="bwg_inst_play"></span></span>';
|
690 |
-
}
|
691 |
-
if (is_embed_instagram_post) {
|
692 |
-
var post_width = 0;
|
693 |
-
var post_height = 0;
|
694 |
-
if (cur_height < cur_width + 88) {
|
695 |
-
post_height = cur_height;
|
696 |
-
post_width = post_height - 88;
|
697 |
-
}
|
698 |
-
else {
|
699 |
-
post_width = cur_width;
|
700 |
-
post_height = post_width + 88;
|
701 |
-
}
|
702 |
-
innhtml += spider_display_embed(data_<?php echo $bwg; ?>[key]['filetype'], data_<?php echo $bwg; ?>[key]['image_url'], data_<?php echo $bwg; ?>[key]['filename'], {class:"bwg_embed_frame", 'data-width': data_<?php echo $bwg; ?>[key]['image_width'], 'data-height': data_<?php echo $bwg; ?>[key]['image_height'], frameborder: "0", allowfullscreen: "allowfullscreen", style: "width:" + post_width + "px; height:" + post_height + "px; vertical-align:middle; display:inline-block; position:relative;"});
|
703 |
-
}
|
704 |
-
else {
|
705 |
-
innhtml += spider_display_embed(data_<?php echo $bwg; ?>[key]['filetype'], data_<?php echo $bwg; ?>[key]['image_url'], data_<?php echo $bwg; ?>[key]['filename'], {class:"bwg_embed_frame", frameborder:"0", allowfullscreen:"allowfullscreen", style:"width:inherit; height:inherit; vertical-align:middle; display:table-cell;" });
|
706 |
-
}
|
707 |
-
innhtml += "</span>";
|
708 |
-
}
|
709 |
-
innhtml += '</span></span>';
|
710 |
-
jQuery(next_image_class).html(innhtml);
|
711 |
-
<?php
|
712 |
-
if (BWG()->options->preload_images) {
|
713 |
-
echo "bwg_preload_images_" . $bwg . "(key);";
|
714 |
-
}
|
715 |
-
?>
|
716 |
-
bwg_<?php echo $slideshow_effect; ?>(current_image_class, next_image_class, direction, <?php echo $bwg; ?>);
|
717 |
-
<?php
|
718 |
-
if ($enable_slideshow_filmstrip) {
|
719 |
-
?>
|
720 |
-
bwg_move_filmstrip_<?php echo $bwg; ?>();
|
721 |
-
<?php
|
722 |
-
}
|
723 |
-
else {
|
724 |
-
?>
|
725 |
-
bwg_move_dots_<?php echo $bwg; ?>();
|
726 |
-
<?php
|
727 |
-
}
|
728 |
-
?>
|
729 |
-
if (data_<?php echo $bwg; ?>[key]["is_embed_video"]) {
|
730 |
-
jQuery("#bwg_slideshow_play_pause_<?php echo $bwg; ?>").css({display: 'none'});
|
731 |
-
}
|
732 |
-
else {
|
733 |
-
jQuery("#bwg_slideshow_play_pause_<?php echo $bwg; ?>").css({display: ''});
|
734 |
-
}
|
735 |
-
}
|
736 |
-
bwg_document_ready();
|
737 |
-
}
|
738 |
-
function bwg_preload_images_<?php echo $bwg; ?>(key) {
|
739 |
-
count = <?php echo (int) BWG()->options->preload_images_count / 2; ?>;
|
740 |
-
var count_all = data_<?php echo $bwg; ?>.length;
|
741 |
-
if (count_all < <?php echo BWG()->options->preload_images_count; ?>) {
|
742 |
-
count = 0;
|
743 |
-
}
|
744 |
-
if (count != 0) {
|
745 |
-
for (var i = key - count; i < key + count; i++) {
|
746 |
-
var index = parseInt((i + count_all) % count_all);
|
747 |
-
var is_embed = data_<?php echo $bwg; ?>[index]['filetype'].indexOf("EMBED_") > -1 ? true : false;
|
748 |
-
if (typeof data_<?php echo $bwg; ?>[index] != "undefined") {
|
749 |
-
if (!is_embed) {
|
750 |
-
jQuery("<img/>").attr("src", '<?php echo site_url() . '/' . BWG()->upload_dir; ?>' + jQuery('<span style="display: block;" />').html(data_<?php echo $bwg; ?>[index]["image_url"]).text());
|
751 |
-
}
|
752 |
-
}
|
753 |
-
}
|
754 |
-
}
|
755 |
-
else {
|
756 |
-
for (var i = 0; i < data_<?php echo $bwg; ?>.length; i++) {
|
757 |
-
var is_embed = data_<?php echo $bwg; ?>[i]['filetype'].indexOf("EMBED_") > -1 ? true : false;
|
758 |
-
if (typeof data_<?php echo $bwg; ?>[i] != "undefined") {
|
759 |
-
if (!is_embed) {
|
760 |
-
jQuery("<img/>").attr("src", '<?php echo site_url() . '/' . BWG()->upload_dir; ?>' + jQuery('<span style="display: block;" />').html(data_<?php echo $bwg; ?>[i]["image_url"]).text());
|
761 |
-
}
|
762 |
-
}
|
763 |
-
}
|
764 |
-
}
|
765 |
-
}
|
766 |
-
function bwg_popup_resize_<?php echo $bwg; ?>() {
|
767 |
-
var parent_width = jQuery(".bwg_slideshow_image_wrap_<?php echo $bwg; ?>").parent().width();
|
768 |
-
if (parent_width >= <?php echo $image_width; ?>) {
|
769 |
-
jQuery(".bwg_slideshow_image_wrap_<?php echo $bwg; ?>").css({width: <?php echo $image_width; ?>});
|
770 |
-
jQuery(".bwg_slideshow_image_wrap_<?php echo $bwg; ?>").css({height: <?php echo $image_height; ?>});
|
771 |
-
jQuery(".bwg_slideshow_image_container_<?php echo $bwg; ?>").css({width: <?php echo ($filmstrip_direction == 'horizontal' ? $image_width : $image_width - $slideshow_filmstrip_width); ?>});
|
772 |
-
jQuery(".bwg_slideshow_image_container_<?php echo $bwg; ?>").css({height: (<?php echo ($filmstrip_direction == 'horizontal' ? $image_height - $slideshow_filmstrip_height : $image_height); ?>)});
|
773 |
-
jQuery(".bwg_slideshow_image_<?php echo $bwg; ?>").css({
|
774 |
-
cssText: "max-width: <?php echo ($filmstrip_direction == 'horizontal' ? $image_width : $image_width - $slideshow_filmstrip_width); ?>px !important; max-height: <?php echo ($filmstrip_direction == 'horizontal' ? $image_height - $slideshow_filmstrip_height : $image_height); ?>px !important;"
|
775 |
-
});
|
776 |
-
jQuery(".bwg_slideshow_embed_<?php echo $bwg; ?>").css({
|
777 |
-
cssText: "width: <?php echo ($filmstrip_direction == 'horizontal' ? $image_width : $image_width - $slideshow_filmstrip_width); ?>px !important; height: <?php echo ($filmstrip_direction == 'horizontal' ? $image_height - $slideshow_filmstrip_height : $image_height); ?>px !important;"
|
778 |
-
});
|
779 |
-
bwg_resize_instagram_post_<?php echo $bwg?>();
|
780 |
-
/* Set watermark container size.*/
|
781 |
-
bwg_change_watermark_container_<?php echo $bwg; ?>();
|
782 |
-
jQuery(".bwg_slideshow_filmstrip_container_<?php echo $bwg; ?>").css({<?php echo ($filmstrip_direction == 'horizontal' ? 'width: ' . $image_width : 'height: ' . $image_height); ?>});
|
783 |
-
jQuery(".bwg_slideshow_filmstrip_<?php echo $bwg; ?>").css({<?php echo ($filmstrip_direction == 'horizontal' ? 'width: ' . ($image_width - 40) : 'height: ' . ($image_height - 40)); ?>});
|
784 |
-
jQuery(".bwg_slideshow_dots_container_<?php echo $bwg; ?>").css({width: <?php echo $image_width; ?>});
|
785 |
-
jQuery("#bwg_slideshow_play_pause-ico_<?php echo $bwg; ?>").css({fontSize: (<?php echo $theme_row->slideshow_play_pause_btn_size; ?>)});
|
786 |
-
jQuery(".bwg_slideshow_watermark_image_<?php echo $bwg; ?>").css({maxWidth: <?php echo $watermark_width; ?>, maxHeight: <?php echo $watermark_height; ?>});
|
787 |
-
jQuery(".bwg_slideshow_watermark_text_<?php echo $bwg; ?>, .bwg_slideshow_watermark_text_<?php echo $bwg; ?>:hover").css({fontSize: (<?php echo $watermark_font_size; ?>)});
|
788 |
-
jQuery(".bwg_slideshow_title_text_<?php echo $bwg; ?>").css({fontSize: (<?php echo $theme_row->slideshow_title_font_size * 2; ?>)});
|
789 |
-
jQuery(".bwg_slideshow_description_text_<?php echo $bwg; ?>").css({fontSize: (<?php echo $theme_row->slideshow_description_font_size * 2; ?>)});
|
790 |
-
}
|
791 |
-
else {
|
792 |
-
jQuery(".bwg_slideshow_image_wrap_<?php echo $bwg; ?>").css({width: (parent_width)});
|
793 |
-
jQuery(".bwg_slideshow_image_wrap_<?php echo $bwg; ?>").css({height: ((parent_width) * <?php echo $image_height / $image_width ?>)});
|
794 |
-
jQuery(".bwg_slideshow_image_container_<?php echo $bwg; ?>").css({width: (parent_width - <?php echo ($filmstrip_direction == 'horizontal' ? 0 : $slideshow_filmstrip_width); ?>)});
|
795 |
-
jQuery(".bwg_slideshow_image_container_<?php echo $bwg; ?>").css({height: ((parent_width) * <?php echo $image_height / $image_width ?> - <?php echo ($filmstrip_direction == 'horizontal' ? $slideshow_filmstrip_height : 0); ?>)});
|
796 |
-
jQuery(".bwg_slideshow_image_<?php echo $bwg; ?>").css({
|
797 |
-
cssText: "max-width: " + (parent_width - <?php echo ($filmstrip_direction == 'horizontal' ? 0 : $slideshow_filmstrip_width) ?>) + "px !important; max-height: " + (parent_width * (<?php echo $image_height / $image_width ?>) - <?php echo ($filmstrip_direction == 'horizontal' ? $slideshow_filmstrip_height : 0); ?> - 1) + "px !important;"
|
798 |
-
});
|
799 |
-
jQuery(".bwg_slideshow_embed_<?php echo $bwg; ?>").css({
|
800 |
-
cssText: "width: " + (parent_width - <?php echo ($filmstrip_direction == 'horizontal' ? 0 : $slideshow_filmstrip_width) ?>) + "px !important; height: " + (parent_width * (<?php echo $image_height / $image_width ?>) - <?php echo ($filmstrip_direction == 'horizontal' ? $slideshow_filmstrip_height : 0); ?> - 1) + "px !important;"
|
801 |
-
});
|
802 |
-
bwg_resize_instagram_post_<?php echo $bwg?>();
|
803 |
-
/* Set watermark container size.*/
|
804 |
-
bwg_change_watermark_container_<?php echo $bwg; ?>();
|
805 |
-
<?php if ($filmstrip_direction == 'horizontal') { ?>
|
806 |
-
jQuery(".bwg_slideshow_filmstrip_container_<?php echo $bwg; ?>").css({width: (parent_width)});
|
807 |
-
jQuery(".bwg_slideshow_filmstrip_<?php echo $bwg; ?>").css({width: (parent_width - 40)});
|
808 |
-
<?php }
|
809 |
-
else {
|
810 |
-
?>
|
811 |
-
jQuery(".bwg_slideshow_filmstrip_container_<?php echo $bwg; ?>").css({height: (parent_width * <?php echo $image_height / $image_width ?>)});
|
812 |
-
jQuery(".bwg_slideshow_filmstrip_<?php echo $bwg; ?>").css({height: (parent_width * <?php echo $image_height / $image_width ?> - 40)});
|
813 |
-
<?php
|
814 |
-
}
|
815 |
-
?>
|
816 |
-
jQuery(".bwg_slideshow_dots_container_<?php echo $bwg; ?>").css({width: (parent_width)});
|
817 |
-
jQuery("#bwg_slideshow_play_pause-ico_<?php echo $bwg; ?>").css({fontSize: ((parent_width) * <?php echo $theme_row->slideshow_play_pause_btn_size / $image_width; ?>)});
|
818 |
-
jQuery(".bwg_slideshow_watermark_image_<?php echo $bwg; ?>").css({maxWidth: ((parent_width) * <?php echo $watermark_width / $image_width; ?>), maxHeight: ((parent_width) * <?php echo $watermark_height / $image_width; ?>)});
|
819 |
-
jQuery(".bwg_slideshow_watermark_text_<?php echo $bwg; ?>, .bwg_slideshow_watermark_text_<?php echo $bwg; ?>:hover").css({fontSize: ((parent_width) * <?php echo $watermark_font_size / $image_width; ?>)});
|
820 |
-
jQuery(".bwg_slideshow_title_text_<?php echo $bwg; ?>").css({fontSize: ((parent_width) * <?php echo 2 * $theme_row->slideshow_title_font_size / $image_width; ?>)});
|
821 |
-
jQuery(".bwg_slideshow_description_text_<?php echo $bwg; ?>").css({fontSize: ((parent_width) * <?php echo 2 * $theme_row->slideshow_description_font_size / $image_width; ?>)});
|
822 |
-
jQuery(".bwg_slideshow_image_<?php echo $bwg; ?>").css({'display':'inline-block'});
|
823 |
-
}
|
824 |
-
if (data_<?php echo $bwg; ?>[parseInt(jQuery("#bwg_current_image_key_<?php echo $bwg; ?>").val())]["is_embed_video"]) {
|
825 |
-
jQuery("#bwg_slideshow_play_pause_<?php echo $bwg; ?>").css({display: 'none'});
|
826 |
-
}
|
827 |
-
else {
|
828 |
-
jQuery("#bwg_slideshow_play_pause_<?php echo $bwg; ?>").css({display: ''});
|
829 |
-
}
|
830 |
-
}
|
831 |
-
jQuery(window).resize(function() {
|
832 |
-
bwg_popup_resize_<?php echo $bwg; ?>();
|
833 |
-
});
|
834 |
-
jQuery(document).ready(function () {
|
835 |
-
bwg_container_loaded('<?php echo $bwg; ?>');
|
836 |
-
<?php
|
837 |
-
if ( BWG()->options->image_right_click ) {
|
838 |
-
?>
|
839 |
-
/* Disable right click.*/
|
840 |
-
jQuery('div[id^="bwg_container"]').bind("contextmenu", function () {
|
841 |
-
return false;
|
842 |
-
});
|
843 |
-
jQuery('div[id^="bwg_container"]').css('webkitTouchCallout','none');
|
844 |
-
<?php
|
845 |
-
}
|
846 |
-
?>
|
847 |
-
if (typeof jQuery().swiperight !== 'undefined') {
|
848 |
-
if (jQuery.isFunction(jQuery().swiperight)) {
|
849 |
-
jQuery('#bwg_container1_<?php echo $bwg; ?>').swiperight(function () {
|
850 |
-
bwg_change_image_<?php echo $bwg; ?>(parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()), (parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()) - bwg_iterator_<?php echo $bwg; ?>()) >= 0 ? (parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()) - bwg_iterator_<?php echo $bwg; ?>()) % data_<?php echo $bwg; ?>.length : data_<?php echo $bwg; ?>.length - 1, data_<?php echo $bwg; ?>);
|
851 |
-
return false;
|
852 |
-
});
|
853 |
-
}
|
854 |
-
}
|
855 |
-
if (typeof jQuery().swipeleft !== 'undefined') {
|
856 |
-
if (jQuery.isFunction(jQuery().swipeleft)) {
|
857 |
-
jQuery('#bwg_container1_<?php echo $bwg; ?>').swipeleft(function () {
|
858 |
-
bwg_change_image_<?php echo $bwg; ?>(parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()), (parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()) + bwg_iterator_<?php echo $bwg; ?>()) % data_<?php echo $bwg; ?>.length, data_<?php echo $bwg; ?>);
|
859 |
-
return false;
|
860 |
-
});
|
861 |
-
}
|
862 |
-
}
|
863 |
-
var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
|
864 |
-
var bwg_click = isMobile ? 'touchend' : 'click';
|
865 |
-
bwg_popup_resize_<?php echo $bwg; ?>();
|
866 |
-
jQuery(".bwg_slideshow_watermark_<?php echo $bwg; ?>").css({display: 'none'});
|
867 |
-
jQuery(".bwg_slideshow_title_text_<?php echo $bwg; ?>").css({display: 'none'});
|
868 |
-
jQuery(".bwg_slideshow_description_text_<?php echo $bwg; ?>").css({display: 'none'});
|
869 |
-
setTimeout(function () {
|
870 |
-
bwg_change_watermark_container_<?php echo $bwg; ?>();
|
871 |
-
}, 500);
|
872 |
-
/* Set image container height.*/
|
873 |
-
<?php if ($filmstrip_direction == 'horizontal') { ?>
|
874 |
-
jQuery(".bwg_slideshow_image_container_<?php echo $bwg; ?>").height(jQuery(".bwg_slideshow_image_wrap_<?php echo $bwg; ?>").height() - <?php echo $slideshow_filmstrip_height; ?>);
|
875 |
-
<?php }
|
876 |
-
else {
|
877 |
-
?>
|
878 |
-
jQuery(".bwg_slideshow_image_container_<?php echo $bwg; ?>").width(jQuery(".bwg_slideshow_image_wrap_<?php echo $bwg; ?>").width() - <?php echo $slideshow_filmstrip_width; ?>);
|
879 |
-
<?php
|
880 |
-
} ?>
|
881 |
-
var mousewheelevt = (/Firefox/i.test(navigator.userAgent)) ? "DOMMouseScroll" : "mousewheel"; /* FF doesn't recognize mousewheel as of FF3.x */
|
882 |
-
jQuery('.bwg_slideshow_filmstrip_<?php echo $bwg; ?>').bind(mousewheelevt, function(e) {
|
883 |
-
var evt = window.event || e; /* Equalize event object.*/
|
884 |
-
evt = evt.originalEvent ? evt.originalEvent : evt; /* Convert to originalEvent if possible.*/
|
885 |
-
var delta = evt.detail ? evt.detail*(-40) : evt.wheelDelta; /* Check for detail first, because it is used by Opera and FF.*/
|
886 |
-
if (delta > 0) {
|
887 |
-
/* Scroll up.*/
|
888 |
-
jQuery(".bwg_slideshow_filmstrip_left_<?php echo $bwg; ?>").trigger("click");
|
889 |
-
}
|
890 |
-
else {
|
891 |
-
/* Scroll down.*/
|
892 |
-
jQuery(".bwg_slideshow_filmstrip_right_<?php echo $bwg; ?>").trigger("click");
|
893 |
-
}
|
894 |
-
return false;
|
895 |
-
});
|
896 |
-
jQuery(".bwg_slideshow_filmstrip_right_<?php echo $bwg; ?>").on(bwg_click, function () {
|
897 |
-
jQuery( ".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>" ).stop(true, false);
|
898 |
-
if (jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>").position().<?php echo $left_or_top; ?> >= -(jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>").<?php echo $width_or_height; ?>() - jQuery(".bwg_slideshow_filmstrip_<?php echo $bwg; ?>").<?php echo $width_or_height; ?>())) {
|
899 |
-
jQuery(".bwg_slideshow_filmstrip_left_<?php echo $bwg; ?>").css({opacity: 1, filter: "Alpha(opacity=100)"});
|
900 |
-
if (jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>").position().<?php echo $left_or_top; ?> < -(jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>").<?php echo $width_or_height; ?>() - jQuery(".bwg_slideshow_filmstrip_<?php echo $bwg; ?>").<?php echo $width_or_height; ?>() - <?php echo $filmstrip_thumb_margin_hor + $slideshow_filmstrip_width; ?>)) {
|
901 |
-
jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>").animate({<?php echo $left_or_top; ?>: -(jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>").<?php echo $width_or_height; ?>() - jQuery(".bwg_slideshow_filmstrip_<?php echo $bwg; ?>").<?php echo $width_or_height; ?>())}, 500, 'linear');
|
902 |
-
}
|
903 |
-
else {
|
904 |
-
jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>").animate({<?php echo $left_or_top; ?>: (jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>").position().<?php echo $left_or_top; ?> - <?php echo $filmstrip_thumb_margin_hor + $slideshow_filmstrip_width; ?>)}, 500, 'linear');
|
905 |
-
}
|
906 |
-
}
|
907 |
-
/* Disable right arrow.*/
|
908 |
-
window.setTimeout(function(){
|
909 |
-
if (jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>").position().<?php echo $left_or_top; ?> == -(jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>").<?php echo $width_or_height; ?>() - jQuery(".bwg_slideshow_filmstrip_<?php echo $bwg; ?>").<?php echo $width_or_height; ?>())) {
|
910 |
-
jQuery(".bwg_slideshow_filmstrip_right_<?php echo $bwg; ?>").css({opacity: 0.3, filter: "Alpha(opacity=30)"});
|
911 |
-
}
|
912 |
-
}, 500);
|
913 |
-
});
|
914 |
-
jQuery(".bwg_slideshow_filmstrip_left_<?php echo $bwg; ?>").on(bwg_click, function () {
|
915 |
-
jQuery( ".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>" ).stop(true, false);
|
916 |
-
if (jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>").position().<?php echo $left_or_top; ?> < 0) {
|
917 |
-
jQuery(".bwg_slideshow_filmstrip_right_<?php echo $bwg; ?>").css({opacity: 1, filter: "Alpha(opacity=100)"});
|
918 |
-
if (jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>").position().<?php echo $left_or_top; ?> > - <?php echo $filmstrip_thumb_margin_hor + $slideshow_filmstrip_width; ?>) {
|
919 |
-
jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>").animate({<?php echo $left_or_top; ?>: 0}, 500, 'linear');
|
920 |
-
}
|
921 |
-
else {
|
922 |
-
jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>").animate({<?php echo $left_or_top; ?>: (jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>").position().<?php echo $left_or_top; ?> + <?php echo $filmstrip_thumb_margin_hor + $slideshow_filmstrip_width; ?>)}, 500, 'linear');
|
923 |
-
}
|
924 |
-
}
|
925 |
-
/* Disable left arrow.*/
|
926 |
-
window.setTimeout(function(){
|
927 |
-
if (jQuery(".bwg_slideshow_filmstrip_thumbnails_<?php echo $bwg; ?>").position().<?php echo $left_or_top; ?> == 0) {
|
928 |
-
jQuery(".bwg_slideshow_filmstrip_left_<?php echo $bwg; ?>").css({opacity: 0.3, filter: "Alpha(opacity=30)"});
|
929 |
-
}
|
930 |
-
}, 500);
|
931 |
-
});
|
932 |
-
/* Set filmstrip initial position.*/
|
933 |
-
bwg_set_filmstrip_pos_<?php echo $bwg; ?>(jQuery(".bwg_slideshow_filmstrip_<?php echo $bwg; ?>").<?php echo $width_or_height; ?>());
|
934 |
-
/* Play/pause.*/
|
935 |
-
jQuery("#bwg_slideshow_play_pause_<?php echo $bwg; ?>").on(bwg_click, function () {
|
936 |
-
if (jQuery(".bwg_ctrl_btn_<?php echo $bwg; ?>").hasClass("fa-play")) {
|
937 |
-
bwg_play_<?php echo $bwg; ?>();
|
938 |
-
jQuery(".bwg_slideshow_play_pause_<?php echo $bwg; ?>").attr("title", "<?php echo __('Pause', BWG()->prefix); ?>");
|
939 |
-
jQuery(".bwg_slideshow_play_pause_<?php echo $bwg; ?>").attr("class", "bwg_ctrl_btn_<?php echo $bwg; ?> bwg_slideshow_play_pause_<?php echo $bwg; ?> fa fa-pause");
|
940 |
-
if (<?php echo $enable_slideshow_music ?>) {
|
941 |
-
document.getElementById("bwg_audio_<?php echo $bwg; ?>").play();
|
942 |
-
}
|
943 |
-
}
|
944 |
-
else {
|
945 |
-
/* Pause.*/
|
946 |
-
window.clearInterval(bwg_playInterval_<?php echo $bwg; ?>);
|
947 |
-
jQuery(".bwg_slideshow_play_pause_<?php echo $bwg; ?>").attr("title", "<?php echo __('Play', BWG()->prefix); ?>");
|
948 |
-
jQuery(".bwg_slideshow_play_pause_<?php echo $bwg; ?>").attr("class", "bwg_ctrl_btn_<?php echo $bwg; ?> bwg_slideshow_play_pause_<?php echo $bwg; ?> fa fa-play");
|
949 |
-
if (<?php echo $enable_slideshow_music ?>) {
|
950 |
-
document.getElementById("bwg_audio_<?php echo $bwg; ?>").pause();
|
951 |
-
}
|
952 |
-
}
|
953 |
-
});
|
954 |
-
if (<?php echo $enable_slideshow_autoplay; ?>) {
|
955 |
-
bwg_play_<?php echo $bwg; ?>();
|
956 |
-
jQuery(".bwg_slideshow_play_pause_<?php echo $bwg; ?>").attr("title", "<?php echo __('Pause', BWG()->prefix); ?>");
|
957 |
-
jQuery(".bwg_slideshow_play_pause_<?php echo $bwg; ?>").attr("class", "bwg_ctrl_btn_<?php echo $bwg; ?> bwg_slideshow_play_pause_<?php echo $bwg; ?> fa fa-pause");
|
958 |
-
if (<?php echo $enable_slideshow_music ?>) {
|
959 |
-
document.getElementById("bwg_audio_<?php echo $bwg; ?>").play();
|
960 |
-
}
|
961 |
-
}
|
962 |
-
<?php
|
963 |
-
if (BWG()->options->preload_images) {
|
964 |
-
echo "bwg_preload_images_" . $bwg . "(parseInt(jQuery('#bwg_current_image_key_" . $bwg . "').val()));";
|
965 |
-
}
|
966 |
-
?>
|
967 |
-
jQuery(".bwg_slideshow_image_<?php echo $bwg; ?>").removeAttr("width");
|
968 |
-
jQuery(".bwg_slideshow_image_<?php echo $bwg; ?>").removeAttr("height");
|
969 |
-
});
|
970 |
-
function bwg_resize_instagram_post_<?php echo $bwg?>() {
|
971 |
-
if (jQuery('.inner_instagram_iframe_bwg_embed_frame_<?php echo $bwg?>').length) {
|
972 |
-
var post_width = jQuery('.bwg_slideshow_embed_<?php echo $bwg?>').width();
|
973 |
-
var post_height = jQuery('.bwg_slideshow_embed_<?php echo $bwg?>').height();
|
974 |
-
jQuery('.inner_instagram_iframe_bwg_embed_frame_<?php echo $bwg?>').each(function() {
|
975 |
-
var parent_container = jQuery(this).parent();
|
976 |
-
if (post_height / (parseInt(parent_container.attr('data-height')) + 96) < post_width / parseInt(parent_container.attr('data-width'))) {
|
977 |
-
parent_container.height(post_height);
|
978 |
-
parent_container.width((parent_container.height() - 96) * parent_container.attr('data-width') / parent_container.attr('data-height') + 16);
|
979 |
-
}
|
980 |
-
else {
|
981 |
-
parent_container.width(post_width);
|
982 |
-
parent_container.height((parent_container.width() - 16) * parent_container.attr('data-height') / parent_container.attr('data-width') + 96);
|
983 |
-
}
|
984 |
-
});
|
985 |
-
}
|
986 |
-
bwg_change_watermark_container_<?php echo $bwg; ?>();
|
987 |
-
}
|
988 |
-
function bwg_play_<?php echo $bwg; ?>() {
|
989 |
-
window.clearInterval(bwg_playInterval_<?php echo $bwg; ?>);
|
990 |
-
/* Play.*/
|
991 |
-
bwg_playInterval_<?php echo $bwg; ?> = setInterval(function () {
|
992 |
-
var iterator = 1;
|
993 |
-
if (<?php echo $enable_slideshow_shuffle; ?>) {
|
994 |
-
iterator = Math.floor((data_<?php echo $bwg; ?>.length - 1) * Math.random() + 1);
|
995 |
-
}
|
996 |
-
bwg_change_image_<?php echo $bwg; ?>(parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()), (parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()) + iterator) % data_<?php echo $bwg; ?>.length, data_<?php echo $bwg; ?>)
|
997 |
-
}, '<?php echo $params['slideshow_interval'] * 1000; ?>');
|
998 |
-
}
|
999 |
-
jQuery(window).focus(function() {
|
1000 |
-
if (!jQuery(".bwg_ctrl_btn_<?php echo $bwg; ?>").hasClass("fa-play")) {
|
1001 |
-
bwg_play_<?php echo $bwg; ?>();
|
1002 |
-
}
|
1003 |
-
var i_<?php echo $bwg; ?> = 0;
|
1004 |
-
jQuery(".bwg_slider_<?php echo $bwg; ?>").children("span").each(function () {
|
1005 |
-
if (jQuery(this).css('opacity') == 1) {
|
1006 |
-
jQuery("#bwg_current_image_key_<?php echo $bwg; ?>").val(i_<?php echo $bwg; ?>);
|
1007 |
-
}
|
1008 |
-
i_<?php echo $bwg; ?>++;
|
1009 |
-
});
|
1010 |
-
});
|
1011 |
-
jQuery(window).blur(function() {
|
1012 |
-
event_stack_<?php echo $bwg; ?> = [];
|
1013 |
-
window.clearInterval(bwg_playInterval_<?php echo $bwg; ?>);
|
1014 |
-
});
|
1015 |
</script>
|
|
|
1016 |
<?php
|
1017 |
if ($from_shortcode) {
|
1018 |
return;
|
@@ -1179,24 +650,28 @@ class BWGViewSlideshow extends BWGViewSite {
|
|
1179 |
cursor: pointer;
|
1180 |
}
|
1181 |
<?php
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
<?php
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
|
|
|
|
|
1196 |
left: auto;
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
|
|
|
|
1200 |
#bwg_container1_<?php echo $bwg; ?> #bwg_container2_<?php echo $bwg; ?> .bwg_slideshow_image_container_<?php echo $bwg; ?> {
|
1201 |
display: table;
|
1202 |
position: absolute;
|
1 |
<?php
|
2 |
class BWGViewSlideshow extends BWGViewSite {
|
3 |
+
public function display($params = array(), $from_shortcode = 0, $bwg = 0) {
|
4 |
$theme_row = $params['theme_row'];
|
5 |
$image_rows = $params['image_rows'];
|
6 |
$image_rows = $image_rows['images'];
|
42 |
// Validate url. If not valid add upload url.
|
43 |
$url = filter_var($slideshow_music_url, FILTER_SANITIZE_URL);
|
44 |
if (false === filter_var($url, FILTER_VALIDATE_URL)) {
|
45 |
+
$slideshow_music_url = BWG()->upload_url . $slideshow_music_url;
|
46 |
}
|
47 |
$image_width = $params['slideshow_width'];
|
48 |
$image_height = $params['slideshow_height'];
|
94 |
}
|
95 |
|
96 |
$inline_style = $this->inline_styles($bwg, $theme_row, $params, $image_width, $image_height, $filmstrip_direction, $slideshow_filmstrip_height, BWG()->options, $left_or_top, $width_or_height, $filmstrip_thumb_margin_hor, $slideshow_filmstrip_width, $image_rows, $watermark_position, $slideshow_title_position, $slideshow_description_position, $watermark_height, $watermark_width, $watermark_opacity, $watermark_font_size, $watermark_font, $watermark_color, $enable_slideshow_filmstrip);
|
97 |
+
|
98 |
+
|
99 |
if ( BWG()->options->use_inline_stiles_and_scripts ) {
|
100 |
wp_add_inline_style('bwg_frontend', $inline_style);
|
101 |
if ( !wp_script_is('bwg_embed', 'done') ) {
|
166 |
}
|
167 |
}
|
168 |
if (!$is_embed) {
|
169 |
+
$thumb_path_url = htmlspecialchars_decode(BWG()->upload_dir . $image_row->thumb_url, ENT_COMPAT | ENT_QUOTES);
|
170 |
$thumb_path_url = explode('?bwg', $thumb_path_url);
|
171 |
list($image_thumb_width, $image_thumb_height) = getimagesize($thumb_path_url[0]);
|
172 |
}
|
204 |
$thumb_top = ($slideshow_filmstrip_height - $image_thumb_height) / 2;
|
205 |
?>
|
206 |
<div id="bwg_filmstrip_thumbnail_<?php echo $key; ?>_<?php echo $bwg; ?>" class="bwg_slideshow_filmstrip_thumbnail_<?php echo $bwg; ?> <?php echo (($image_row->id == $current_image_id) ? 'bwg_slideshow_thumb_active_' . $bwg : 'bwg_slideshow_thumb_deactive_' . $bwg); ?>">
|
207 |
+
<img style="width:<?php echo $image_thumb_width; ?>px; height:<?php echo $image_thumb_height; ?>px; margin-left: <?php echo $thumb_left; ?>px; margin-top: <?php echo $thumb_top; ?>px;" class="bwg_filmstrip_thumbnail_img bwg_slideshow_filmstrip_thumbnail_img_<?php echo $bwg; ?>" src="<?php echo ( $is_embed ? "" : BWG()->upload_url) . $image_row->thumb_url; ?>" onclick="bwg_change_image(parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()), '<?php echo $key; ?>', data_<?php echo $bwg; ?>, '', <?php echo $bwg; ?>)" image_id="<?php echo $image_row->id; ?>" image_key="<?php echo $key; ?>" alt="<?php echo $image_row->alt; ?>"/>
|
208 |
</div>
|
209 |
<?php
|
210 |
}
|
226 |
$current_key = $key;
|
227 |
}
|
228 |
?>
|
229 |
+
<span id="bwg_dots_<?php echo $key; ?>_<?php echo $bwg; ?>" class="bwg_slideshow_dots_<?php echo $bwg; ?> <?php echo (($image_row->id == $current_image_id) ? 'bwg_slideshow_dots_active_' . $bwg : 'bwg_slideshow_dots_deactive_' . $bwg); ?>" onclick="bwg_change_image(parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()), '<?php echo $key; ?>', data_<?php echo $bwg; ?>, '', <?php echo $bwg; ?>)" image_id="<?php echo $image_row->id; ?>" image_key="<?php echo $key; ?>"></span>
|
230 |
<?php
|
231 |
}
|
232 |
?>
|
253 |
<?php
|
254 |
if (!$is_embed) {
|
255 |
?>
|
256 |
+
<a <?php echo ($params['thumb_click_action'] == 'open_lightbox' ? (' class="bwg_lightbox"' . (BWG()->options->enable_seo ? ' href="' . ($is_embed ? $image_row->thumb_url : BWG()->upload_url . $image_row->image_url) . '"' : '') . ' data-image-id="' . $image_row->id . '"') : ($params['thumb_click_action'] == 'redirect_to_url' && $image_row->redirect_url ? 'href="' . $image_row->redirect_url . '" target="' . ($params['thumb_link_target'] ? '_blank' : '') . '"' : '')) ?>>
|
257 |
+
<img id="bwg_slideshow_image_<?php echo $bwg; ?>" class="bwg_slide bwg_slideshow_image_<?php echo $bwg; ?>" src="<?php echo BWG()->upload_url . $image_row->image_url; ?>" image_id="<?php echo $image_row->id; ?>" alt="<?php echo $image_row->alt; ?>"/>
|
258 |
</a>
|
259 |
<?php
|
260 |
}
|
305 |
<?php
|
306 |
if (!$is_embed) {
|
307 |
?>
|
308 |
+
<a <?php echo ($params['thumb_click_action'] == 'open_lightbox' ? (' class="bwg_lightbox_' . $bwg . '"' . (BWG()->options->enable_seo ? ' href="' . ($is_embed ? $image_row->thumb_url : BWG()->upload_url . $image_row->image_url) . '"' : '') . ' data-image-id="' . $image_row->id . '"') : ($params['thumb_click_action'] == 'redirect_to_url' && $image_row->redirect_url ? 'href="' . $image_row->redirect_url . '" target="' . ($params['thumb_link_target'] ? '_blank' : '') . '"' : '')) ?>>
|
309 |
+
<img id="bwg_slideshow_image_<?php echo $bwg; ?>" class="bwg_slide bwg_slideshow_image_<?php echo $bwg; ?>" src="<?php echo BWG()->upload_url . $image_row->image_url; ?>" image_id="<?php echo $image_row->id; ?>" alt="<?php echo $image_row->alt; ?>"/>
|
310 |
</a>
|
311 |
<?php
|
312 |
}
|
353 |
<?php
|
354 |
if ($enable_slideshow_ctrl) {
|
355 |
?>
|
356 |
+
<a id="spider_slideshow_left_<?php echo $bwg; ?>" onclick="bwg_change_image(parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()), (parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()) + data_<?php echo $bwg; ?>.length - bwg_iterator(<?php echo $bwg; ?>)) % data_<?php echo $bwg; ?>.length, data_<?php echo $bwg; ?>, '', <?php echo $bwg; ?>); return false;"><span id="spider_slideshow_left-ico_<?php echo $bwg; ?>"><span><i class="bwg_slideshow_prev_btn_<?php echo $bwg; ?> fa <?php echo $theme_row->slideshow_rl_btn_style; ?>-left"></i></span></span></a>
|
357 |
<span id="bwg_slideshow_play_pause_<?php echo $bwg; ?>" style="display: <?php echo $play_pause_button_display; ?>;"><span><span id="bwg_slideshow_play_pause-ico_<?php echo $bwg; ?>"><i class="bwg_ctrl_btn_<?php echo $bwg; ?> bwg_slideshow_play_pause_<?php echo $bwg; ?> fa fa-play"></i></span></span></span>
|
358 |
+
<a id="spider_slideshow_right_<?php echo $bwg; ?>" onclick="bwg_change_image(parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()), (parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()) + bwg_iterator(<?php echo $bwg; ?>)) % data_<?php echo $bwg; ?>.length, data_<?php echo $bwg; ?>, '', <?php echo $bwg; ?>); return false;"><span id="spider_slideshow_right-ico_<?php echo $bwg; ?>"><span><i class="bwg_slideshow_next_btn_<?php echo $bwg; ?> fa <?php echo $theme_row->slideshow_rl_btn_style; ?>-right"></i></span></span></a>
|
359 |
<?php
|
360 |
}
|
361 |
?>
|
363 |
<?php
|
364 |
if ($params['watermark_type'] != 'none') {
|
365 |
?>
|
366 |
+
<div class="bwg_slideshow_image_container_<?php echo $bwg; ?> bwg_slideshow_image_container">
|
367 |
<div class="bwg_slideshow_watermark_container_<?php echo $bwg; ?>">
|
368 |
+
<div>
|
369 |
<span class="bwg_slideshow_watermark_spun_<?php echo $bwg; ?>" id="bwg_slideshow_watermark_container_<?php echo $bwg; ?>">
|
370 |
<?php
|
371 |
if ($params['watermark_type'] == 'image') {
|
389 |
}
|
390 |
if ($enable_image_title) {
|
391 |
?>
|
392 |
+
<div class="bwg_slideshow_image_container_<?php echo $bwg; ?> bwg_slideshow_image_container">
|
393 |
<div class="bwg_slideshow_watermark_container_<?php echo $bwg; ?>">
|
394 |
+
<div>
|
395 |
<span class="bwg_slideshow_title_spun_<?php echo $bwg; ?>">
|
396 |
+
<div class="bwg_slideshow_title_text_<?php echo $bwg; ?> <?php if (!$current_image_alt) echo 'hidden'; ?>">
|
397 |
<?php echo html_entity_decode($current_image_alt); ?>
|
398 |
</div>
|
399 |
</span>
|
404 |
}
|
405 |
if ($enable_image_description) {
|
406 |
?>
|
407 |
+
<div class="bwg_slideshow_image_container_<?php echo $bwg; ?> bwg_slideshow_image_container">
|
408 |
<div class="bwg_slideshow_watermark_container_<?php echo $bwg; ?>">
|
409 |
+
<div>
|
410 |
<span class="bwg_slideshow_description_spun_<?php echo $bwg; ?>">
|
411 |
+
<div class="bwg_slideshow_description_text_<?php echo $bwg; ?> <?php if (!$current_image_description) echo 'hidden'; ?>">
|
412 |
<?php echo html_entity_decode(str_replace("\r\n", esc_html('<br />'), $current_image_description)); ?>
|
413 |
</div>
|
414 |
</span>
|
426 |
</div>
|
427 |
<?php
|
428 |
|
429 |
+
parent::container($params, $bwg, ob_get_clean());
|
430 |
|
431 |
?>
|
432 |
<script>
|
|
|
433 |
var bwg_transition_duration_<?php echo $bwg; ?> = <?php echo (($params['slideshow_interval'] < 4) && ($params['slideshow_interval'] != 0)) ? ($params['slideshow_interval'] * 1000) / 4 : ($params['slideshow_effect_duration'] * 1000); ?>;
|
434 |
var bwg_playInterval_<?php echo $bwg; ?>;
|
435 |
/* Stop autoplay.*/
|
436 |
window.clearInterval(bwg_playInterval_<?php echo $bwg; ?>);
|
437 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
438 |
var bwg_current_key_<?php echo $bwg; ?> = '<?php echo (isset($current_key) ? $current_key : ''); ?>';
|
439 |
var bwg_current_filmstrip_pos_<?php echo $bwg; ?> = <?php echo $current_pos; ?>;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
440 |
|
441 |
bwg_param = {
|
442 |
+
bwg_source : 'slider',
|
443 |
bwg_current_key : bwg_current_key_<?php echo $bwg; ?>,
|
444 |
bwg_transition_duration : bwg_transition_duration_<?php echo $bwg; ?>,
|
445 |
bwg_trans_in_progress : false,
|
446 |
data : data_<?php echo $bwg; ?>,
|
447 |
+
bwg_current_filmstrip_pos : bwg_current_filmstrip_pos_<?php echo $bwg; ?>,
|
448 |
+
width_or_height : '<?php echo $width_or_height ?>',
|
449 |
+
filmstrip_thumb_margin_hor : <?php echo $filmstrip_thumb_margin_hor; ?>,
|
450 |
+
left_or_top : '<?php echo $left_or_top; ?>',
|
451 |
+
outerWidth_or_outerHeight : '<?php echo $outerWidth_or_outerHeight; ?>',
|
452 |
+
enable_slideshow_shuffle : <?php echo $enable_slideshow_shuffle; ?>,
|
453 |
+
lightbox_filmstrip_thumb_border_width : <?php echo $theme_row->lightbox_filmstrip_thumb_border_width; ?>,
|
454 |
+
thumb_click_action : '<?php echo $params['thumb_click_action'] ?>',
|
455 |
+
thumb_link_target : '<?php echo $params['thumb_link_target'] ?>',
|
456 |
+
upload_url : '<?php echo BWG()->upload_url; ?>',
|
457 |
+
preload_images : <?php echo BWG()->options->preload_images ?>,
|
458 |
+
slideshow_effect : '<?php echo $slideshow_effect ?>',
|
459 |
+
enable_slideshow_filmstrip : <?php echo $enable_slideshow_filmstrip ?>,
|
460 |
+
event_stack : event_stack_<?php echo $bwg; ?>,
|
461 |
+
preload_images_count : <?php echo (int) BWG()->options->preload_images_count; ?>,
|
462 |
+
image_width : <?php echo $image_width; ?>,
|
463 |
+
image_height : <?php echo $image_height; ?>,
|
464 |
+
filmstrip_direction : '<?php echo $filmstrip_direction; ?>',
|
465 |
+
slideshow_filmstrip_width : <?php echo $slideshow_filmstrip_width; ?>,
|
466 |
+
slideshow_filmstrip_height : <?php echo $slideshow_filmstrip_height; ?>,
|
467 |
+
slideshow_play_pause_btn_size : <?php echo $theme_row->slideshow_play_pause_btn_size; ?>,
|
468 |
+
watermark_width : <?php echo $watermark_width; ?>,
|
469 |
+
watermark_height : <?php echo $watermark_height; ?>,
|
470 |
+
watermark_font_size : <?php echo $watermark_font_size; ?>,
|
471 |
+
slideshow_title_font_size : <?php echo $theme_row->slideshow_title_font_size; ?>,
|
472 |
+
slideshow_description_font_size : <?php echo $theme_row->slideshow_description_font_size; ?>,
|
473 |
+
bwg_playInterval : bwg_playInterval_<?php echo $bwg; ?>,
|
474 |
+
slideshow_interval : <?php echo $params['slideshow_interval'] ?>,
|
475 |
+
image_right_click :<?php echo isset( BWG()->options->image_right_click ) ? BWG()->options->image_right_click : 0 ?>,
|
476 |
+
enable_slideshow_autoplay : <?php echo $enable_slideshow_autoplay; ?>,
|
477 |
+
enable_slideshow_music : <?php echo $enable_slideshow_music ?> ,
|
478 |
+
watermark_type : '<?php echo $params['watermark_type'] ?>',
|
479 |
+
};
|
480 |
+
|
481 |
+
if ( typeof bwg_params == "undefined" ) {
|
482 |
+
var bwg_params = [];
|
483 |
+
}
|
484 |
+
bwg_params[<?php echo $bwg; ?>] = bwg_param;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
485 |
</script>
|
486 |
+
|
487 |
<?php
|
488 |
if ($from_shortcode) {
|
489 |
return;
|
650 |
cursor: pointer;
|
651 |
}
|
652 |
<?php
|
653 |
+
if ( $params['autohide_slideshow_navigation'] ) {
|
654 |
+
?>
|
655 |
+
#spider_slideshow_left-ico_<?php echo $bwg; ?> {
|
656 |
+
left: -9999px;
|
657 |
+
}
|
658 |
+
#spider_slideshow_right-ico_<?php echo $bwg; ?> {
|
659 |
+
left: -9999px;
|
660 |
+
}
|
661 |
+
<?php
|
662 |
+
}
|
663 |
+
else {
|
664 |
+
?>
|
665 |
+
#spider_slideshow_left-ico_<?php echo $bwg; ?> {
|
666 |
+
left: 20px;
|
667 |
+
}
|
668 |
+
#spider_slideshow_right-ico_<?php echo $bwg; ?> {
|
669 |
left: auto;
|
670 |
+
right: 20px;
|
671 |
+
}
|
672 |
+
<?php
|
673 |
+
}
|
674 |
+
?>
|
675 |
#bwg_container1_<?php echo $bwg; ?> #bwg_container2_<?php echo $bwg; ?> .bwg_slideshow_image_container_<?php echo $bwg; ?> {
|
676 |
display: table;
|
677 |
position: absolute;
|
frontend/views/BWGViewThumbnails.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
<?php
|
2 |
class BWGViewThumbnails extends BWGViewSite {
|
3 |
-
|
|
|
4 |
$theme_row = $params['theme_row'];
|
5 |
$image_rows = $params['image_rows'];
|
6 |
$image_rows = $image_rows['images'];
|
7 |
-
|
8 |
$inline_style = $this->inline_styles($bwg, $theme_row, $params);
|
9 |
if (BWG()->options->use_inline_stiles_and_scripts) {
|
10 |
wp_add_inline_style('bwg_frontend', $inline_style);
|
@@ -41,7 +41,7 @@ class BWGViewThumbnails extends BWGViewSite {
|
|
41 |
$class = ' class="bwg_lightbox"';
|
42 |
$data_image_id = ' data-image-id="' . $image_row->id . '"';
|
43 |
if ( BWG()->options->enable_seo ) {
|
44 |
-
$href = ' href="' . ($is_embed ? $image_row->thumb_url :
|
45 |
}
|
46 |
}
|
47 |
elseif ( $params['thumb_click_action'] == 'redirect_to_url' && $image_row->redirect_url ) {
|
@@ -49,31 +49,40 @@ class BWGViewThumbnails extends BWGViewSite {
|
|
49 |
}
|
50 |
?>
|
51 |
<div class="bwg-item">
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
<?php if ( function_exists('BWGEC') && $params['ecommerce_icon'] == 'hover' && $image_row->pricelist_id ) { echo $ecommerce_icon; } ?>
|
58 |
<?php if ( $is_embed_video && $params['play_icon'] ) { echo $play_icon; } ?>
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
</div>
|
65 |
-
</div>
|
66 |
-
</div>
|
67 |
-
<?php if ( function_exists('BWGEC') && $params['ecommerce_icon'] == 'show' ) { echo $ecommerce_icon; } ?>
|
68 |
-
<?php if ( $params['image_title'] == 'show' && $theme_row->thumb_title_pos == 'bottom' ) { echo $title; } ?>
|
69 |
</a>
|
70 |
-
|
71 |
-
|
72 |
-
}
|
73 |
-
?>
|
74 |
</div>
|
75 |
<?php
|
76 |
-
parent::
|
77 |
if ($from_shortcode) {
|
78 |
return;
|
79 |
}
|
@@ -149,24 +158,32 @@ class BWGViewThumbnails extends BWGViewSite {
|
|
149 |
max-width: none;
|
150 |
padding: 0 !important;
|
151 |
}
|
152 |
-
<?php
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
}
|
165 |
-
|
166 |
-
<?php
|
167 |
}
|
168 |
else {
|
169 |
-
|
170 |
@media only screen and (min-width: 480px) {
|
171 |
#bwg_container1_<?php echo $bwg; ?> #bwg_container2_<?php echo $bwg; ?> .bwg-container-<?php echo $bwg; ?> .bwg-item0 {
|
172 |
<?php echo ($theme_row->thumb_transition) ? 'transition: all 0.3s ease 0s;-webkit-transition: all 0.3s ease 0s;' : ''; ?>
|
@@ -184,34 +201,31 @@ class BWGViewThumbnails extends BWGViewSite {
|
|
184 |
padding-top: <?php echo $params['thumb_height'] / $params['thumb_width'] * 100; ?>%;
|
185 |
}
|
186 |
<?php
|
187 |
-
|
188 |
-
|
189 |
#bwg_container1_<?php echo $bwg; ?> #bwg_container2_<?php echo $bwg; ?> .bwg-container-<?php echo $bwg; ?> .bwg-title1 {
|
190 |
-
display: flex;
|
191 |
-
height: 100%;
|
192 |
-
left: -3000px;
|
193 |
-
opacity: 0;
|
194 |
-
filter: Alpha(opacity=0);
|
195 |
position: absolute;
|
196 |
top: 0;
|
197 |
-
width: 100%;
|
198 |
z-index: 100;
|
|
|
|
|
|
|
199 |
justify-content: center;
|
200 |
align-content: center;
|
201 |
flex-direction: column;
|
|
|
|
|
202 |
}
|
203 |
-
|
204 |
-
}
|
205 |
-
?>
|
206 |
#bwg_container1_<?php echo $bwg; ?> #bwg_container2_<?php echo $bwg; ?> .bwg-container-<?php echo $bwg; ?> .bwg-title2,
|
207 |
#bwg_container1_<?php echo $bwg; ?> #bwg_container2_<?php echo $bwg; ?> .bwg-container-<?php echo $bwg; ?> .bwg-ecommerce2 {
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
}
|
216 |
#bwg_container1_<?php echo $bwg; ?> #bwg_container2_<?php echo $bwg; ?> .bwg-container-<?php echo $bwg; ?> .bwg-play-icon2 {
|
217 |
font-size: <?php echo 2 * $theme_row->thumb_title_font_size; ?>px;
|
1 |
<?php
|
2 |
class BWGViewThumbnails extends BWGViewSite {
|
3 |
+
|
4 |
+
public function display($params = array(), $from_shortcode = 0, $bwg = 0) {
|
5 |
$theme_row = $params['theme_row'];
|
6 |
$image_rows = $params['image_rows'];
|
7 |
$image_rows = $image_rows['images'];
|
|
|
8 |
$inline_style = $this->inline_styles($bwg, $theme_row, $params);
|
9 |
if (BWG()->options->use_inline_stiles_and_scripts) {
|
10 |
wp_add_inline_style('bwg_frontend', $inline_style);
|
41 |
$class = ' class="bwg_lightbox"';
|
42 |
$data_image_id = ' data-image-id="' . $image_row->id . '"';
|
43 |
if ( BWG()->options->enable_seo ) {
|
44 |
+
$href = ' href="' . ($is_embed ? $image_row->thumb_url : BWG()->upload_url . $image_row->image_url) . '"';
|
45 |
}
|
46 |
}
|
47 |
elseif ( $params['thumb_click_action'] == 'redirect_to_url' && $image_row->redirect_url ) {
|
49 |
}
|
50 |
?>
|
51 |
<div class="bwg-item">
|
52 |
+
<a <?php echo $class; ?><?php echo $data_image_id; ?><?php echo $href; ?>>
|
53 |
+
<?php
|
54 |
+
$effect_class_name = '';
|
55 |
+
$effect_class_overlay_name = '';
|
56 |
+
// init Zoom effect.
|
57 |
+
if ( $theme_row->thumb_hover_effect == 'zoom' && $params['image_title'] == 'hover') {
|
58 |
+
$effect_class_name = 'bwg-zoom-effect';
|
59 |
+
$effect_class_overlay_name = 'bwg-zoom-effect-overlay';
|
60 |
+
}
|
61 |
+
?>
|
62 |
+
<?php if ( $params['image_title'] == 'show' && $theme_row->thumb_title_pos == 'top' ) { echo $title; } ?>
|
63 |
+
<div class="bwg-item0">
|
64 |
+
<div class="bwg-item1 <?php echo $effect_class_name;?>">
|
65 |
+
<div class="bwg-item2">
|
66 |
+
<img class="bwg_standart_thumb_img_<?php echo $bwg; ?>"
|
67 |
+
data-id="<?php echo $image_row->id; ?>"
|
68 |
+
src="<?php echo ($is_embed ? "" : BWG()->upload_url) . $image_row->thumb_url; ?>"
|
69 |
+
alt="<?php echo $image_row->alt; ?>" />
|
70 |
+
</div>
|
71 |
+
<div class="<?php echo $effect_class_overlay_name;?>">
|
72 |
+
<?php if ( $params['image_title'] == 'hover' ) { echo $title; } ?>
|
73 |
<?php if ( function_exists('BWGEC') && $params['ecommerce_icon'] == 'hover' && $image_row->pricelist_id ) { echo $ecommerce_icon; } ?>
|
74 |
<?php if ( $is_embed_video && $params['play_icon'] ) { echo $play_icon; } ?>
|
75 |
+
</div>
|
76 |
+
</div>
|
77 |
+
</div>
|
78 |
+
<?php if ( function_exists('BWGEC') && $params['ecommerce_icon'] == 'show' ) { echo $ecommerce_icon; } ?>
|
79 |
+
<?php if ( $params['image_title'] == 'show' && $theme_row->thumb_title_pos == 'bottom' ) { echo $title; } ?>
|
|
|
|
|
|
|
|
|
|
|
80 |
</a>
|
81 |
+
</div>
|
82 |
+
<?php } ?>
|
|
|
|
|
83 |
</div>
|
84 |
<?php
|
85 |
+
parent::container($params, $bwg, ob_get_clean());
|
86 |
if ($from_shortcode) {
|
87 |
return;
|
88 |
}
|
158 |
max-width: none;
|
159 |
padding: 0 !important;
|
160 |
}
|
161 |
+
<?php if ( $theme_row->thumb_hover_effect == 'zoom' ) { ?>
|
162 |
+
@media only screen and (min-width: 480px) {
|
163 |
+
#bwg_container1_<?php echo $bwg; ?> #bwg_container2_<?php echo $bwg; ?> .bwg-container-<?php echo $bwg; ?> .bwg-item1 img {
|
164 |
+
<?php echo ($theme_row->thumb_transition) ? '-webkit-transition: all .3s; transition: all .3s;' : ''; ?>
|
165 |
+
}
|
166 |
+
#bwg_container1_<?php echo $bwg; ?> #bwg_container2_<?php echo $bwg; ?> .bwg-container-<?php echo $bwg; ?> .bwg-item1 img:hover {
|
167 |
+
-ms-transform: scale(<?php echo $theme_row->thumb_hover_effect_value; ?>);
|
168 |
+
-webkit-transform: scale(<?php echo $theme_row->thumb_hover_effect_value; ?>);
|
169 |
+
transform: scale(<?php echo $theme_row->thumb_hover_effect_value; ?>);
|
170 |
+
}
|
171 |
+
<?php if ( $params['image_title'] == 'hover' ) { ?>
|
172 |
+
.bwg-zoom-effect .bwg-zoom-effect-overlay {
|
173 |
+
<?php $thumb_bg_color = WDWLibrary::spider_hex2rgb( $theme_row->thumb_bg_color ); ?>
|
174 |
+
background-color:rgba(<?php echo $thumb_bg_color['red'] .','. $thumb_bg_color['green'] . ',' . $thumb_bg_color['blue'] . ', 0.3'; ?>);
|
175 |
+
}
|
176 |
+
.bwg-zoom-effect:hover img {
|
177 |
+
-ms-transform: scale(<?php echo $theme_row->thumb_hover_effect_value; ?>);
|
178 |
+
-webkit-transform: scale(<?php echo $theme_row->thumb_hover_effect_value; ?>);
|
179 |
+
transform: scale(<?php echo $theme_row->thumb_hover_effect_value; ?>);
|
180 |
+
}
|
181 |
+
<?php } ?>
|
182 |
}
|
183 |
+
<?php
|
|
|
184 |
}
|
185 |
else {
|
186 |
+
?>
|
187 |
@media only screen and (min-width: 480px) {
|
188 |
#bwg_container1_<?php echo $bwg; ?> #bwg_container2_<?php echo $bwg; ?> .bwg-container-<?php echo $bwg; ?> .bwg-item0 {
|
189 |
<?php echo ($theme_row->thumb_transition) ? 'transition: all 0.3s ease 0s;-webkit-transition: all 0.3s ease 0s;' : ''; ?>
|
201 |
padding-top: <?php echo $params['thumb_height'] / $params['thumb_width'] * 100; ?>%;
|
202 |
}
|
203 |
<?php
|
204 |
+
/* Show image title on hover.*/
|
205 |
+
if ( $params['image_title'] == 'hover' ) { ?>
|
206 |
#bwg_container1_<?php echo $bwg; ?> #bwg_container2_<?php echo $bwg; ?> .bwg-container-<?php echo $bwg; ?> .bwg-title1 {
|
|
|
|
|
|
|
|
|
|
|
207 |
position: absolute;
|
208 |
top: 0;
|
|
|
209 |
z-index: 100;
|
210 |
+
width: 100%;
|
211 |
+
height: 100%;
|
212 |
+
display: flex;
|
213 |
justify-content: center;
|
214 |
align-content: center;
|
215 |
flex-direction: column;
|
216 |
+
filter: Alpha(opacity=0);
|
217 |
+
opacity: 0;
|
218 |
}
|
219 |
+
<?php } ?>
|
|
|
|
|
220 |
#bwg_container1_<?php echo $bwg; ?> #bwg_container2_<?php echo $bwg; ?> .bwg-container-<?php echo $bwg; ?> .bwg-title2,
|
221 |
#bwg_container1_<?php echo $bwg; ?> #bwg_container2_<?php echo $bwg; ?> .bwg-container-<?php echo $bwg; ?> .bwg-ecommerce2 {
|
222 |
+
color: #<?php echo ( $params['image_title'] == 'hover') ? (isset($theme_row->thumb_title_font_color_hover) ? $theme_row->thumb_title_font_color_hover : $theme_row->thumb_title_font_color) : $theme_row->thumb_title_font_color; ?>;
|
223 |
+
font-family: <?php echo $theme_row->thumb_title_font_style; ?>;
|
224 |
+
font-size: <?php echo $theme_row->thumb_title_font_size; ?>px;
|
225 |
+
font-weight: <?php echo $theme_row->thumb_title_font_weight; ?>;
|
226 |
+
padding: <?php echo $theme_row->thumb_title_margin; ?>;
|
227 |
+
text-shadow: <?php echo $theme_row->thumb_title_shadow; ?>;
|
228 |
+
max-height:100%;
|
229 |
}
|
230 |
#bwg_container1_<?php echo $bwg; ?> #bwg_container2_<?php echo $bwg; ?> .bwg-container-<?php echo $bwg; ?> .bwg-play-icon2 {
|
231 |
font-size: <?php echo 2 * $theme_row->thumb_title_font_size; ?>px;
|
frontend/views/view.php
CHANGED
@@ -1,11 +1,12 @@
|
|
1 |
<?php
|
2 |
class BWGViewSite {
|
3 |
-
public function
|
4 |
if (BWG()->options->use_inline_stiles_and_scripts) {
|
5 |
wp_enqueue_style('bwg_frontend');
|
6 |
wp_enqueue_style('bwg_font-awesome');
|
7 |
wp_enqueue_style('bwg_googlefonts');
|
8 |
-
|
|
|
9 |
wp_enqueue_style('bwg_sumoselect');
|
10 |
if (!wp_script_is('bwg_sumoselect', 'done')) {
|
11 |
wp_print_scripts('bwg_sumoselect');
|
@@ -43,12 +44,13 @@ class BWGViewSite {
|
|
43 |
$params_array = $params['params_array'];
|
44 |
$theme_row = $params['theme_row'];
|
45 |
$images_count = count($params['image_rows']['images']);
|
46 |
-
|
|
|
47 |
$tags_rows = $params['tags_rows'];
|
48 |
$items_per_page = $params['items_per_page'];
|
49 |
?>
|
50 |
<div id="bwg_container1_<?php echo $bwg; ?>"
|
51 |
-
class="bwg_container"
|
52 |
data-right-click-protection="<?php echo BWG()->options->image_right_click; ?>"
|
53 |
data-bwg="<?php echo $bwg; ?>"
|
54 |
data-lightbox-url="<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>"
|
@@ -62,43 +64,53 @@ class BWGViewSite {
|
|
62 |
if ( $params['image_enable_page'] ) {
|
63 |
?>
|
64 |
<form id="gal_front_form_<?php echo $bwg; ?>" class="bwg-hidden" method="post" action="#" data-current="<?php echo $bwg; ?>">
|
|
|
65 |
<?php
|
66 |
}
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
if ( isset($params['showthumbs_name']) ) {
|
77 |
$this->title_description($bwg, $gallery_row, $params, $theme_row);
|
78 |
}
|
79 |
-
if ( $params['image_enable_page'] ) {
|
80 |
?>
|
81 |
<div style="background-color: rgba(0, 0, 0, 0); width: 100%; position: relative;<?php echo !$theme_row->container_margin && $theme_row->thumb_margin ? ' overflow: hidden;' : ''; ?>">
|
82 |
<?php
|
83 |
-
}
|
84 |
if (isset($params['image_enable_page']) && isset($params['images_per_page']) && $params['image_enable_page'] && $params['images_per_page'] && ($theme_row->page_nav_position == 'top')) {
|
85 |
$page_nav = $params['image_rows']['page_nav'];
|
86 |
$this->ajax_html_frontend_page_nav($theme_row, $page_nav['total'], $page_nav['limit'], 'gal_front_form_' . $bwg, $items_per_page, $bwg, 'bwg_standart_thumbnails_' . $bwg, 0, 'album', BWG()->options->enable_seo, $params['image_enable_page']);
|
87 |
}
|
88 |
echo $content;
|
89 |
if ( isset($params['gallery_download']) ) {
|
90 |
-
$this->download_button($params, $images_count);
|
91 |
}
|
92 |
if ( isset($params['image_enable_page']) && isset($params['images_per_page']) && $params['image_enable_page'] && $params['images_per_page'] && ($theme_row->page_nav_position == 'bottom') ) {
|
93 |
$page_nav = $params['image_rows']['page_nav'];
|
94 |
$this->ajax_html_frontend_page_nav($theme_row, $page_nav['total'], $page_nav['limit'], 'gal_front_form_' . $bwg, $items_per_page, $bwg, 'bwg_standart_thumbnails_' . $bwg, 0, 'album', BWG()->options->enable_seo, $params['image_enable_page']);
|
95 |
}
|
96 |
-
if ( $params['image_enable_page'] ) {
|
97 |
?>
|
98 |
</div>
|
99 |
</form>
|
100 |
<?php
|
101 |
-
}
|
102 |
if ( $params['thumb_click_action'] == 'open_lightbox' ) {
|
103 |
?>
|
104 |
<div id="bwg_spider_popup_loading_<?php echo $bwg; ?>" class="bwg_spider_popup_loading"></div>
|
@@ -111,7 +123,7 @@ class BWGViewSite {
|
|
111 |
<?php
|
112 |
}
|
113 |
|
114 |
-
public function loading($bwg) {
|
115 |
?>
|
116 |
<div id="ajax_loading_<?php echo $bwg; ?>" class="bwg_loading_div_1">
|
117 |
<div class="bwg_loading_div_2">
|
@@ -161,12 +173,19 @@ class BWGViewSite {
|
|
161 |
}
|
162 |
}
|
163 |
|
164 |
-
public function download_button($params, $images_count) {
|
165 |
if ( $params['gallery_download'] && $images_count && ($params['gallery_row']->id == 0 || ($params['gallery_row']->gallery_type != 'facebook' && $params['gallery_row']->gallery_type != 'instagram' && $params['gallery_row']->gallery_type != 'instagram_post')) ) {
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
?>
|
171 |
<div class="bwg_download_gallery">
|
172 |
<a href="<?php echo $query_url; ?>">
|
@@ -177,15 +196,16 @@ class BWGViewSite {
|
|
177 |
}
|
178 |
}
|
179 |
|
180 |
-
public function ajax_html_frontend_search_box($form_id, $current_view, $cur_gal_id, $images_count, $search_box_width =
|
|
|
181 |
$bwg_search = ((isset($_POST['bwg_search_' . $current_view]) && esc_html($_POST['bwg_search_' . $current_view]) != '') ? esc_html($_POST['bwg_search_' . $current_view]) : '');
|
182 |
$type = (isset($_POST['type_' . $current_view]) ? esc_html($_POST['type_' . $current_view]) : ($album_gallery_id ? 'gallery' : 'album'));
|
183 |
$album_gallery_id = (isset($_POST['album_gallery_id_' . $current_view]) ? esc_html($_POST['album_gallery_id_' . $current_view]) : ( $album_gallery_id ? $album_gallery_id : 0));
|
184 |
-
|
185 |
ob_start();
|
|
|
186 |
?>
|
187 |
-
#
|
188 |
-
width: <?php echo $search_box_width; ?>px;
|
189 |
}
|
190 |
<?php
|
191 |
$inline_style = ob_get_clean();
|
@@ -199,15 +219,21 @@ class BWGViewSite {
|
|
199 |
?>
|
200 |
<div class="bwg_search_container_1" id="bwg_search_container_1_<?php echo $current_view; ?>">
|
201 |
<div class="bwg_search_container_2" id="bwg_search_container_2_<?php echo $current_view; ?>">
|
202 |
-
<span class="
|
203 |
-
<
|
|
|
204 |
</span>
|
205 |
-
|
206 |
-
<
|
|
|
207 |
</span>
|
208 |
-
<span class="bwg_search_input_container">
|
209 |
-
<input id="bwg_search_input_<?php echo $current_view; ?>" class="bwg_search_input" type="text" onkeypress="return bwg_check_search_input_enter(this, event)" name="bwg_search_<?php echo $current_view; ?>" value="<?php echo $bwg_search; ?>" placeholder="<?php echo $placeholder; ?>" />
|
210 |
<input id="bwg_images_count_<?php echo $current_view; ?>" class="bwg_search_input" type="hidden" name="bwg_images_count_<?php echo $current_view; ?>" value="<?php echo $images_count; ?>" >
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
</span>
|
212 |
</div>
|
213 |
</div>
|
@@ -229,14 +255,10 @@ class BWGViewSite {
|
|
229 |
if (BWG()->options->use_inline_stiles_and_scripts) {
|
230 |
wp_add_inline_style('bwg_frontend', $inline_style);
|
231 |
}
|
232 |
-
else {
|
233 |
-
echo '<style>' . $inline_style . '</style>';
|
234 |
-
}
|
235 |
?>
|
236 |
<div class="bwg_order_cont">
|
237 |
-
<span class="bwg_order_label"><?php echo __('Order by: ', BWG()->prefix); ?></span>
|
238 |
<select id="bwg_order_<?php echo $current_view; ?>" class="bwg_order bwg_order_<?php echo $current_view; ?>" onchange="spider_frontend_ajax('<?php echo $form_id; ?>', '<?php echo $current_view; ?>', '<?php echo $cur_gal_id; ?>', <?php echo $album_gallery_id; ?>, '', '<?php echo $type; ?>', 1, '', this.value)">
|
239 |
-
<option <?php if ($sort_by == 'default') echo 'selected'; ?> value="default"><?php echo __('Default', BWG()->prefix); ?></option>
|
240 |
<option <?php if ($sort_by == 'filename') echo 'selected'; ?> value="filename"><?php echo __('Filename', BWG()->prefix); ?></option>
|
241 |
<option <?php if ($sort_by == 'size') echo 'selected'; ?> value="size"><?php echo __('Size', BWG()->prefix); ?></option>
|
242 |
<option <?php if ($sort_by == 'random' || $sort_by == 'RAND()') echo 'selected'; ?> value="random"><?php echo __('Random', BWG()->prefix); ?></option>
|
@@ -250,8 +272,7 @@ class BWGViewSite {
|
|
250 |
$bwg_search_tags = (isset($_POST['bwg_tag_id_' . $cur_gal_id]) && $_POST['bwg_tag_id_' . $cur_gal_id] != '' )? $_POST['bwg_tag_id_' . $cur_gal_id] : array();
|
251 |
$album_gallery_id = (isset($_POST['album_gallery_id_' . $current_view]) ? esc_html($_POST['album_gallery_id_' . $current_view]) : 0);
|
252 |
?>
|
253 |
-
|
254 |
-
<div id="bwg_tag_container">
|
255 |
<select class="search_tags" id="bwg_tag_id_<?php echo $cur_gal_id; ?>" multiple="multiple">
|
256 |
<?php
|
257 |
foreach($tags_rows as $tags_row) {
|
@@ -262,16 +283,13 @@ class BWGViewSite {
|
|
262 |
}
|
263 |
?>
|
264 |
</select>
|
265 |
-
<
|
266 |
-
|
267 |
-
|
268 |
-
<
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
</div>
|
273 |
-
<div style="clear:both"></div>
|
274 |
-
</div>
|
275 |
<?php
|
276 |
}
|
277 |
|
@@ -436,12 +454,13 @@ class BWGViewSite {
|
|
436 |
if ($count_items > $limit * $page_number) {
|
437 |
?>
|
438 |
<script type="text/javascript">
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
|
|
445 |
});
|
446 |
</script>
|
447 |
<?php
|
1 |
<?php
|
2 |
class BWGViewSite {
|
3 |
+
public function container($params = array(), $bwg = 0, $content = '') {
|
4 |
if (BWG()->options->use_inline_stiles_and_scripts) {
|
5 |
wp_enqueue_style('bwg_frontend');
|
6 |
wp_enqueue_style('bwg_font-awesome');
|
7 |
wp_enqueue_style('bwg_googlefonts');
|
8 |
+
|
9 |
+
if ((isset($params['show_tag_box']) && $params['show_tag_box']) || (isset($params['show_sort_images']) && $params['show_sort_images'])) {
|
10 |
wp_enqueue_style('bwg_sumoselect');
|
11 |
if (!wp_script_is('bwg_sumoselect', 'done')) {
|
12 |
wp_print_scripts('bwg_sumoselect');
|
44 |
$params_array = $params['params_array'];
|
45 |
$theme_row = $params['theme_row'];
|
46 |
$images_count = count($params['image_rows']['images']);
|
47 |
+
|
48 |
+
$gallery_row = $params['gallery_row'];
|
49 |
$tags_rows = $params['tags_rows'];
|
50 |
$items_per_page = $params['items_per_page'];
|
51 |
?>
|
52 |
<div id="bwg_container1_<?php echo $bwg; ?>"
|
53 |
+
class="bwg_container bwg_thumbnail bwg_<?php echo $params['gallery_type']; ?>"
|
54 |
data-right-click-protection="<?php echo BWG()->options->image_right_click; ?>"
|
55 |
data-bwg="<?php echo $bwg; ?>"
|
56 |
data-lightbox-url="<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>"
|
64 |
if ( $params['image_enable_page'] ) {
|
65 |
?>
|
66 |
<form id="gal_front_form_<?php echo $bwg; ?>" class="bwg-hidden" method="post" action="#" data-current="<?php echo $bwg; ?>">
|
67 |
+
|
68 |
<?php
|
69 |
}
|
70 |
+
if ( (isset($params['show_sort_images']) && $params['show_sort_images']) || (isset($params['show_tag_box']) && $params['show_tag_box']) || (isset($params['show_search_box']) && $params['show_search_box']) ) {
|
71 |
+
?>
|
72 |
+
<div class="search_line">
|
73 |
+
<?php
|
74 |
+
if (isset($params['show_sort_images']) && $params['show_sort_images']) {
|
75 |
+
$this->ajax_html_frontend_sort_box('gal_front_form_' . $bwg, $bwg, 'bwg_standart_thumbnails_' . $bwg, $params['sort_by'], $params['search_box_width']);
|
76 |
+
}
|
77 |
+
if (isset($params['show_tag_box']) && $params['show_tag_box']) {
|
78 |
+
$this->ajax_html_frontend_search_tags('gal_front_form_' . $bwg, $bwg, 'bwg_standart_thumbnails_' . $bwg, $images_count, $tags_rows);
|
79 |
+
}
|
80 |
+
if (isset($params['show_search_box']) && $params['show_search_box']) {
|
81 |
+
$this->ajax_html_frontend_search_box('gal_front_form_' . $bwg, $bwg, 'bwg_standart_thumbnails_' . $bwg, $images_count, $params['search_box_width'], $params['placeholder']);
|
82 |
+
}
|
83 |
+
?>
|
84 |
+
</div>
|
85 |
+
<?php
|
86 |
+
}
|
87 |
+
|
88 |
if ( isset($params['showthumbs_name']) ) {
|
89 |
$this->title_description($bwg, $gallery_row, $params, $theme_row);
|
90 |
}
|
91 |
+
/* if ( $params['image_enable_page'] ) {*/
|
92 |
?>
|
93 |
<div style="background-color: rgba(0, 0, 0, 0); width: 100%; position: relative;<?php echo !$theme_row->container_margin && $theme_row->thumb_margin ? ' overflow: hidden;' : ''; ?>">
|
94 |
<?php
|
95 |
+
/* }*/
|
96 |
if (isset($params['image_enable_page']) && isset($params['images_per_page']) && $params['image_enable_page'] && $params['images_per_page'] && ($theme_row->page_nav_position == 'top')) {
|
97 |
$page_nav = $params['image_rows']['page_nav'];
|
98 |
$this->ajax_html_frontend_page_nav($theme_row, $page_nav['total'], $page_nav['limit'], 'gal_front_form_' . $bwg, $items_per_page, $bwg, 'bwg_standart_thumbnails_' . $bwg, 0, 'album', BWG()->options->enable_seo, $params['image_enable_page']);
|
99 |
}
|
100 |
echo $content;
|
101 |
if ( isset($params['gallery_download']) ) {
|
102 |
+
$this->download_button($bwg, $params, $images_count);
|
103 |
}
|
104 |
if ( isset($params['image_enable_page']) && isset($params['images_per_page']) && $params['image_enable_page'] && $params['images_per_page'] && ($theme_row->page_nav_position == 'bottom') ) {
|
105 |
$page_nav = $params['image_rows']['page_nav'];
|
106 |
$this->ajax_html_frontend_page_nav($theme_row, $page_nav['total'], $page_nav['limit'], 'gal_front_form_' . $bwg, $items_per_page, $bwg, 'bwg_standart_thumbnails_' . $bwg, 0, 'album', BWG()->options->enable_seo, $params['image_enable_page']);
|
107 |
}
|
108 |
+
/* if ( $params['image_enable_page'] ) {*/
|
109 |
?>
|
110 |
</div>
|
111 |
</form>
|
112 |
<?php
|
113 |
+
/* }*/
|
114 |
if ( $params['thumb_click_action'] == 'open_lightbox' ) {
|
115 |
?>
|
116 |
<div id="bwg_spider_popup_loading_<?php echo $bwg; ?>" class="bwg_spider_popup_loading"></div>
|
123 |
<?php
|
124 |
}
|
125 |
|
126 |
+
public function loading($bwg = 0) {
|
127 |
?>
|
128 |
<div id="ajax_loading_<?php echo $bwg; ?>" class="bwg_loading_div_1">
|
129 |
<div class="bwg_loading_div_2">
|
173 |
}
|
174 |
}
|
175 |
|
176 |
+
public function download_button($bwg, $params, $images_count) {
|
177 |
if ( $params['gallery_download'] && $images_count && ($params['gallery_row']->id == 0 || ($params['gallery_row']->gallery_type != 'facebook' && $params['gallery_row']->gallery_type != 'instagram' && $params['gallery_row']->gallery_type != 'instagram_post')) ) {
|
178 |
+
$bwg_tags_input_value = WDWLibrary::get('bwg_tag_id_bwg_standart_thumbnails_' . $bwg);
|
179 |
+
$query_url = addslashes(add_query_arg(array(
|
180 |
+
"action" => "download_gallery",
|
181 |
+
"gallery_id" => $params['gallery_id'],
|
182 |
+
"bwg" => $bwg,
|
183 |
+
"type" => 'gallery',
|
184 |
+
"tag_input_name" => 'bwg_tag_id_bwg_standart_thumbnails_' . $bwg,
|
185 |
+
"bwg_tag_id_bwg_standart_thumbnails_" . $bwg => $bwg_tags_input_value,
|
186 |
+
"tag" => $params['tag'],
|
187 |
+
"bwg_search_".$bwg => WDWLibrary::get('bwg_search_'.$bwg),
|
188 |
+
), admin_url('admin-ajax.php')));
|
189 |
?>
|
190 |
<div class="bwg_download_gallery">
|
191 |
<a href="<?php echo $query_url; ?>">
|
196 |
}
|
197 |
}
|
198 |
|
199 |
+
public function ajax_html_frontend_search_box($form_id, $current_view, $cur_gal_id, $images_count, $search_box_width = 330, $placeholder = '', $album_gallery_id = 0) {
|
200 |
+
|
201 |
$bwg_search = ((isset($_POST['bwg_search_' . $current_view]) && esc_html($_POST['bwg_search_' . $current_view]) != '') ? esc_html($_POST['bwg_search_' . $current_view]) : '');
|
202 |
$type = (isset($_POST['type_' . $current_view]) ? esc_html($_POST['type_' . $current_view]) : ($album_gallery_id ? 'gallery' : 'album'));
|
203 |
$album_gallery_id = (isset($_POST['album_gallery_id_' . $current_view]) ? esc_html($_POST['album_gallery_id_' . $current_view]) : ( $album_gallery_id ? $album_gallery_id : 0));
|
|
|
204 |
ob_start();
|
205 |
+
|
206 |
?>
|
207 |
+
#bwg_search_container_1_<?php echo $current_view; ?> {
|
208 |
+
max-width: <?php echo $search_box_width; ?>px;
|
209 |
}
|
210 |
<?php
|
211 |
$inline_style = ob_get_clean();
|
219 |
?>
|
220 |
<div class="bwg_search_container_1" id="bwg_search_container_1_<?php echo $current_view; ?>">
|
221 |
<div class="bwg_search_container_2" id="bwg_search_container_2_<?php echo $current_view; ?>">
|
222 |
+
<span class="bwg_search_input_container">
|
223 |
+
<span class="bwg_search_loupe_container1 hidden">
|
224 |
+
<i title="<?php echo __('SEARCH...', BWG()->prefix); ?>" class="bwg_search fa fa-search" onclick="spider_frontend_ajax('<?php echo $form_id; ?>', '<?php echo $current_view; ?>', '<?php echo $cur_gal_id; ?>', <?php echo $album_gallery_id; ?>, '', '<?php echo $type; ?>', 1)"></i>
|
225 |
</span>
|
226 |
+
<input id="bwg_search_input_<?php echo $current_view; ?>" class="bwg_search_input" type="text" onkeypress="bwg_key_press(this); return bwg_check_search_input_enter(this, event);" name="bwg_search_<?php echo $current_view; ?>" value="<?php echo $bwg_search; ?>" placeholder="<?php echo $placeholder; ?>" />
|
227 |
+
<span class="bwg_search_reset_container hidden">
|
228 |
+
<i title="<?php echo __('Reset', BWG()->prefix); ?>" class="bwg_reset fa fa-times" onclick="bwg_clear_search_input('<?php echo $current_view; ?>'),spider_frontend_ajax('<?php echo $form_id; ?>', '<?php echo $current_view; ?>', '<?php echo $cur_gal_id; ?>', <?php echo $album_gallery_id; ?>, '', '<?php echo $type; ?>', 1)"></i>
|
229 |
</span>
|
|
|
|
|
230 |
<input id="bwg_images_count_<?php echo $current_view; ?>" class="bwg_search_input" type="hidden" name="bwg_images_count_<?php echo $current_view; ?>" value="<?php echo $images_count; ?>" >
|
231 |
+
<span class="search_placeholder_title" onclick="bwg_search_focus(this)">
|
232 |
+
<span class="bwg_search_loupe_container" >
|
233 |
+
<i title="<?php echo __('SEARCH...', BWG()->prefix); ?>" class="bwg_search fa fa-search"></i>
|
234 |
+
</span>
|
235 |
+
<span style="font-size: 12px; font-family: Ubuntu;"><?php echo $placeholder; ?></span>
|
236 |
+
</span>
|
237 |
</span>
|
238 |
</div>
|
239 |
</div>
|
255 |
if (BWG()->options->use_inline_stiles_and_scripts) {
|
256 |
wp_add_inline_style('bwg_frontend', $inline_style);
|
257 |
}
|
|
|
|
|
|
|
258 |
?>
|
259 |
<div class="bwg_order_cont">
|
|
|
260 |
<select id="bwg_order_<?php echo $current_view; ?>" class="bwg_order bwg_order_<?php echo $current_view; ?>" onchange="spider_frontend_ajax('<?php echo $form_id; ?>', '<?php echo $current_view; ?>', '<?php echo $cur_gal_id; ?>', <?php echo $album_gallery_id; ?>, '', '<?php echo $type; ?>', 1, '', this.value)">
|
261 |
+
<option <?php if ($sort_by == 'default') echo 'selected'; ?> value="default"><?php echo __('Order by Default', BWG()->prefix); ?></option>
|
262 |
<option <?php if ($sort_by == 'filename') echo 'selected'; ?> value="filename"><?php echo __('Filename', BWG()->prefix); ?></option>
|
263 |
<option <?php if ($sort_by == 'size') echo 'selected'; ?> value="size"><?php echo __('Size', BWG()->prefix); ?></option>
|
264 |
<option <?php if ($sort_by == 'random' || $sort_by == 'RAND()') echo 'selected'; ?> value="random"><?php echo __('Random', BWG()->prefix); ?></option>
|
272 |
$bwg_search_tags = (isset($_POST['bwg_tag_id_' . $cur_gal_id]) && $_POST['bwg_tag_id_' . $cur_gal_id] != '' )? $_POST['bwg_tag_id_' . $cur_gal_id] : array();
|
273 |
$album_gallery_id = (isset($_POST['album_gallery_id_' . $current_view]) ? esc_html($_POST['album_gallery_id_' . $current_view]) : 0);
|
274 |
?>
|
275 |
+
<div class = "search_tags_container">
|
|
|
276 |
<select class="search_tags" id="bwg_tag_id_<?php echo $cur_gal_id; ?>" multiple="multiple">
|
277 |
<?php
|
278 |
foreach($tags_rows as $tags_row) {
|
283 |
}
|
284 |
?>
|
285 |
</select>
|
286 |
+
<input type="hidden" id="bwg_tags_id_<?php echo $cur_gal_id; ?>" value="" />
|
287 |
+
<input type="hidden" class="current_view" value="<?php echo $current_view; ?>" />
|
288 |
+
<input type="hidden" class="form_id" value="<?php echo $form_id; ?>" />
|
289 |
+
<input type="hidden" class="cur_gal_id" value="<?php echo $cur_gal_id; ?>" />
|
290 |
+
<input type="hidden" class="album_gallery_id" value="<?php echo $album_gallery_id; ?>" />
|
291 |
+
<input type="hidden" class="type" value="<?php echo $type; ?>" />
|
292 |
+
</div>
|
|
|
|
|
|
|
293 |
<?php
|
294 |
}
|
295 |
|
454 |
if ($count_items > $limit * $page_number) {
|
455 |
?>
|
456 |
<script type="text/javascript">
|
457 |
+
jQuery(document).ready(function () {
|
458 |
+
jQuery(window).on("scroll", function() {
|
459 |
+
if (jQuery(document).scrollTop() + jQuery(window).height() > (jQuery('#<?php echo $form_id; ?>').offset().top + jQuery('#<?php echo $form_id; ?>').height())) {
|
460 |
+
spider_page_<?php echo $current_view; ?>('', <?php echo $page_number; ?>, 1, true);
|
461 |
+
return false;
|
462 |
+
}
|
463 |
+
});
|
464 |
});
|
465 |
</script>
|
466 |
<?php
|
insert.php
CHANGED
@@ -129,8 +129,8 @@ class BWGInsert {
|
|
129 |
|
130 |
$exists_default = $wpdb->get_var('SELECT count(id) FROM ' . $wpdb->prefix . 'bwg_theme');
|
131 |
|
132 |
-
$theme1 = '{"thumb_margin":"4","container_margin":"1","thumb_padding":"0","thumb_border_radius":"0","thumb_border_width":0,"thumb_border_style":"none","thumb_border_color":"CCCCCC","thumb_bg_color":"FFFFFF","thumbs_bg_color":"FFFFFF","thumb_bg_transparent":0,"thumb_box_shadow":"","thumb_transparent":100,"thumb_align":"center","thumb_hover_effect":"zoom","thumb_hover_effect_value":"1.08","thumb_transition":1,"thumb_title_margin":"2px","thumb_title_font_style":"Ubuntu","thumb_title_pos":"bottom","thumb_title_font_color":"CCCCCC","thumb_title_shadow":"0px 0px 0px #888888","thumb_title_font_size":16,"thumb_title_font_weight":"bold","thumb_gal_title_font_color":"CCCCCC","thumb_gal_title_font_style":"segoe ui","thumb_gal_title_font_size":16,"thumb_gal_title_font_weight":"bold","thumb_gal_title_margin":"2px","thumb_gal_title_shadow":"0px 0px 0px #888888","thumb_gal_title_align":"center","page_nav_position":"bottom","page_nav_align":"center","page_nav_number":0,"page_nav_font_size":12,"page_nav_font_style":"segoe ui","page_nav_font_color":"666666","page_nav_font_weight":"bold","page_nav_border_width":1,"page_nav_border_style":"solid","page_nav_border_color":"E3E3E3","page_nav_border_radius":"0","page_nav_margin":"0","page_nav_padding":"3px 6px","page_nav_button_bg_color":"FFFFFF","page_nav_button_bg_transparent":100,"page_nav_box_shadow":"0","page_nav_button_transition":1,"page_nav_button_text":0,"lightbox_ctrl_btn_pos":"bottom","lightbox_ctrl_btn_align":"center","lightbox_ctrl_btn_height":20,"lightbox_ctrl_btn_margin_top":10,"lightbox_ctrl_btn_margin_left":7,"lightbox_ctrl_btn_transparent":100,"lightbox_ctrl_btn_color":"808080","lightbox_toggle_btn_height":20,"lightbox_toggle_btn_width":100,"lightbox_ctrl_cont_bg_color":"FFFFFF","lightbox_ctrl_cont_border_radius":4,"lightbox_ctrl_cont_transparent":85,"lightbox_close_btn_bg_color":"FFFFFF","lightbox_close_btn_border_radius":"16px","lightbox_close_btn_border_width":2,"lightbox_close_btn_border_style":"none","lightbox_close_btn_border_color":"FFFFFF","lightbox_close_btn_box_shadow":"0","lightbox_close_btn_color":"808080","lightbox_close_btn_size":20,"lightbox_close_btn_width":30,"lightbox_close_btn_height":30,"lightbox_close_btn_top":"-20","lightbox_close_btn_right":"-15","lightbox_close_btn_full_color":"000000","lightbox_close_btn_transparent":60,"lightbox_rl_btn_bg_color":"FFFFFF","lightbox_rl_btn_transparent":"60","lightbox_rl_btn_border_radius":"20px","lightbox_rl_btn_border_width":0,"lightbox_rl_btn_border_style":"none","lightbox_rl_btn_border_color":"FFFFFF","lightbox_rl_btn_box_shadow":"","lightbox_rl_btn_color":"ADADAD","lightbox_rl_btn_height":35,"lightbox_rl_btn_width":35,"lightbox_rl_btn_size":25,"lightbox_close_rl_btn_hover_color":"808080","lightbox_comment_pos":"left","lightbox_comment_width":350,"lightbox_comment_bg_color":"FFFFFF","lightbox_comment_font_color":"7A7A7A","lightbox_comment_font_style":"Ubuntu","lightbox_comment_font_size":12,"lightbox_comment_button_bg_color":"2F2F2F","lightbox_comment_button_border_color":"666666","lightbox_comment_button_border_width":1,"lightbox_comment_button_border_style":"none","lightbox_comment_button_border_radius":"7px","lightbox_comment_button_padding":"10px 10px","lightbox_comment_input_bg_color":"F7F8F9","lightbox_comment_input_border_color":"EBEBEB","lightbox_comment_input_border_width":2,"lightbox_comment_input_border_style":"none","lightbox_comment_input_border_radius":"7px","lightbox_comment_input_padding":"5px","lightbox_comment_separator_width":20,"lightbox_comment_separator_style":"none","lightbox_comment_separator_color":"383838","lightbox_comment_author_font_size":14,"lightbox_comment_date_font_size":10,"lightbox_comment_body_font_size":12,"lightbox_comment_share_button_color":"808080","lightbox_filmstrip_rl_bg_color":"EBEBEB","lightbox_filmstrip_rl_btn_size":20,"lightbox_filmstrip_rl_btn_color":"808080","lightbox_filmstrip_thumb_margin":"0 1px","lightbox_filmstrip_thumb_border_width":1,"lightbox_filmstrip_thumb_border_style":"none","lightbox_filmstrip_thumb_border_color":"000000","lightbox_filmstrip_thumb_border_radius":"0","lightbox_filmstrip_thumb_deactive_transparent":80,"lightbox_filmstrip_pos":"bottom","lightbox_filmstrip_thumb_active_border_width":0,"lightbox_filmstrip_thumb_active_border_color":"FFFFFF","lightbox_overlay_bg_transparent":60,"lightbox_bg_color":"FFFFFF","lightbox_overlay_bg_color":"EEEEEE","lightbox_rl_btn_style":"fa-angle","lightbox_bg_transparent":100,"blog_style_margin":"2px","blog_style_padding":"0","blog_style_border_radius":"0","blog_style_border_width":1,"blog_style_border_style":"solid","blog_style_border_color":"F5F5F5","blog_style_bg_color":"FFFFFF","blog_style_transparent":80,"blog_style_box_shadow":"","blog_style_align":"center","blog_style_share_buttons_margin":"5px auto 10px auto","blog_style_share_buttons_border_radius":"0","blog_style_share_buttons_border_width":0,"blog_style_share_buttons_border_style":"none","blog_style_share_buttons_border_color":"000000","blog_style_share_buttons_bg_color":"FFFFFF","blog_style_share_buttons_align":"right","blog_style_img_font_size":16,"blog_style_img_font_family":"segoe ui","blog_style_img_font_color":"000000","blog_style_share_buttons_font_size":20,"blog_style_share_buttons_color":"B3AFAF","blog_style_share_buttons_bg_transparent":0,"blog_style_gal_title_font_color":"CCCCCC","blog_style_gal_title_font_style":"segoe ui","blog_style_gal_title_font_size":16,"blog_style_gal_title_font_weight":"bold","blog_style_gal_title_margin":"2px","blog_style_gal_title_shadow":"0px 0px 0px #888888","blog_style_gal_title_align":"center","image_browser_margin":"2px auto","image_browser_padding":"4px","image_browser_border_radius":"0","image_browser_border_width":1,"image_browser_border_style":"none","image_browser_border_color":"F5F5F5","image_browser_bg_color":"EBEBEB","image_browser_box_shadow":"","image_browser_transparent":80,"image_browser_align":"center","image_browser_image_description_margin":"0px 5px 0px 5px","image_browser_image_description_padding":"8px 8px 8px 8px","image_browser_image_description_border_radius":"0","image_browser_image_description_border_width":1,"image_browser_image_description_border_style":"none","image_browser_image_description_border_color":"FFFFFF","image_browser_image_description_bg_color":"EBEBEB","image_browser_image_description_align":"center","image_browser_img_font_size":15,"image_browser_img_font_family":"Ubuntu","image_browser_img_font_color":"000000","image_browser_full_padding":"4px","image_browser_full_border_radius":"0","image_browser_full_border_width":2,"image_browser_full_border_style":"none","image_browser_full_border_color":"F7F7F7","image_browser_full_bg_color":"F5F5F5","image_browser_full_transparent":90,"image_browser_image_title_align":"top","image_browser_gal_title_font_color":"CCCCCC","image_browser_gal_title_font_style":"segoe ui","image_browser_gal_title_font_size":16,"image_browser_gal_title_font_weight":"bold","image_browser_gal_title_margin":"2px","image_browser_gal_title_shadow":"0px 0px 0px #888888","image_browser_gal_title_align":"center","album_compact_title_margin":"2px","album_compact_thumb_margin":2,"album_compact_back_padding":"0","album_compact_thumb_padding":0,"album_compact_thumb_border_radius":"0","album_compact_thumb_border_width":0,"album_compact_title_font_style":"segoe ui","album_compact_back_font_color":"000000","album_compact_title_font_color":"FFFFFF","album_compact_title_shadow":"0px 0px 0px #888888","album_compact_thumb_bg_transparent":0,"album_compact_thumb_box_shadow":"0px 0px 0px #888888","album_compact_thumb_transition":1,"album_compact_thumb_border_style":"none","album_compact_thumb_border_color":"CCCCCC","album_compact_thumb_bg_color":"FFFFFF","album_compact_back_font_weight":"bold","album_compact_back_font_size":16,"album_compact_back_font_style":"segoe ui","album_compact_thumb_title_pos":"bottom","album_compact_thumbs_bg_color":"FFFFFF","album_compact_title_font_size":16,"album_compact_title_font_weight":"bold","album_compact_thumb_align":"center","album_compact_thumb_hover_effect":"scale","album_compact_thumb_transparent":100,"album_compact_thumb_hover_effect_value":"1.08","album_compact_gal_title_font_color":"CCCCCC","album_compact_gal_title_font_style":"segoe ui","album_compact_gal_title_font_size":16,"album_compact_gal_title_font_weight":"bold","album_compact_gal_title_margin":"2px","album_compact_gal_title_shadow":"0px 0px 0px #888888","album_compact_gal_title_align":"center","album_extended_thumb_margin":2,"album_extended_thumb_padding":0,"album_extended_thumb_border_radius":"0","album_extended_thumb_border_width":0,"album_extended_thumb_border_style":"none","album_extended_thumb_border_color":"CCCCCC","album_extended_thumb_bg_color":"FFFFFF","album_extended_thumbs_bg_color":"FFFFFF","album_extended_thumb_bg_transparent":0,"album_extended_thumb_box_shadow":"","album_extended_thumb_transparent":100,"album_extended_thumb_align":"left","album_extended_thumb_hover_effect":"scale","album_extended_thumb_hover_effect_value":"1.08","album_extended_thumb_transition":1,"album_extended_back_font_color":"000000","album_extended_back_font_style":"segoe ui","album_extended_back_font_size":20,"album_extended_back_font_weight":"bold","album_extended_back_padding":"0","album_extended_div_bg_color":"FFFFFF","album_extended_div_bg_transparent":0,"album_extended_div_border_radius":"0 0 0 0","album_extended_div_margin":"0 0 5px 0","album_extended_div_padding":10,"album_extended_div_separator_width":1,"album_extended_div_separator_style":"solid","album_extended_div_separator_color":"E0E0E0","album_extended_thumb_div_bg_color":"FFFFFF","album_extended_thumb_div_border_radius":"0","album_extended_thumb_div_border_width":1,"album_extended_thumb_div_border_style":"solid","album_extended_thumb_div_border_color":"E8E8E8","album_extended_thumb_div_padding":"5px","album_extended_text_div_bg_color":"FFFFFF","album_extended_text_div_border_radius":"0","album_extended_text_div_border_width":1,"album_extended_text_div_border_style":"solid","album_extended_text_div_border_color":"E8E8E8","album_extended_text_div_padding":"5px","album_extended_title_span_border_width":1,"album_extended_title_span_border_style":"none","album_extended_title_span_border_color":"CCCCCC","album_extended_title_font_color":"000000","album_extended_title_font_style":"segoe ui","album_extended_title_font_size":16,"album_extended_title_font_weight":"bold","album_extended_title_margin_bottom":2,"album_extended_title_padding":"2px","album_extended_desc_span_border_width":1,"album_extended_desc_span_border_style":"none","album_extended_desc_span_border_color":"CCCCCC","album_extended_desc_font_color":"000000","album_extended_desc_font_style":"segoe ui","album_extended_desc_font_size":14,"album_extended_desc_font_weight":"normal","album_extended_desc_padding":"2px","album_extended_desc_more_color":"F2D22E","album_extended_desc_more_size":12,"album_extended_gal_title_font_color":"CCCCCC","album_extended_gal_title_font_style":"segoe ui","album_extended_gal_title_font_size":16,"album_extended_gal_title_font_weight":"bold","album_extended_gal_title_margin":"2px","album_extended_gal_title_shadow":"0px 0px 0px #888888","album_extended_gal_title_align":"center","slideshow_cont_bg_color":"F2F2F2","slideshow_close_btn_transparent":100,"slideshow_rl_btn_bg_color":"FFFFFF","slideshow_rl_btn_border_radius":"20px","slideshow_rl_btn_border_width":0,"slideshow_rl_btn_border_style":"none","slideshow_rl_btn_border_color":"FFFFFF","slideshow_rl_btn_box_shadow":"0px 0px 0px #000000","slideshow_rl_btn_color":"D6D6D6","slideshow_rl_btn_height":37,"slideshow_rl_btn_size":12,"slideshow_rl_btn_width":37,"slideshow_close_rl_btn_hover_color":"BABABA","slideshow_filmstrip_pos":"bottom","slideshow_filmstrip_thumb_border_width":0,"slideshow_filmstrip_thumb_border_style":"none","slideshow_filmstrip_thumb_border_color":"000000","slideshow_filmstrip_thumb_border_radius":"0","slideshow_filmstrip_thumb_margin":"0px 2px 0 0 ","slideshow_filmstrip_thumb_active_border_width":0,"slideshow_filmstrip_thumb_active_border_color":"FFFFFF","slideshow_filmstrip_thumb_deactive_transparent":100,"slideshow_filmstrip_rl_bg_color":"F2F2F2","slideshow_filmstrip_rl_btn_color":"BABABA","slideshow_filmstrip_rl_btn_size":20,"slideshow_title_font_size":16,"slideshow_title_font":"segoe ui","slideshow_title_color":"FFFFFF","slideshow_title_opacity":70,"slideshow_title_border_radius":"5px","slideshow_title_background_color":"000000","slideshow_title_padding":"0 0 0 0","slideshow_description_font_size":14,"slideshow_description_font":"segoe ui","slideshow_description_color":"FFFFFF","slideshow_description_opacity":70,"slideshow_description_border_radius":"0","slideshow_description_background_color":"000000","slideshow_description_padding":"5px 10px 5px 10px","slideshow_dots_width":12,"slideshow_dots_height":12,"slideshow_dots_border_radius":"5px","slideshow_dots_background_color":"F2D22E","slideshow_dots_margin":3,"slideshow_dots_active_background_color":"FFFFFF","slideshow_dots_active_border_width":1,"slideshow_dots_active_border_color":"000000","slideshow_play_pause_btn_size":35,"slideshow_rl_btn_style":"fa-chevron","masonry_thumb_padding":"2","masonry_thumb_border_radius":"0","masonry_thumb_border_width":"0","masonry_thumb_border_style":"none","masonry_thumb_border_color":"CCCCCC","masonry_thumbs_bg_color":"FFFFFF","masonry_thumb_bg_transparent":"0","masonry_thumb_transparent":"100","masonry_thumb_align":"center","masonry_thumb_hover_effect":"scale","masonry_thumb_hover_effect_value":"1.08","masonry_thumb_transition":"1","masonry_thumb_gal_title_font_color":"CCCCCC","masonry_thumb_gal_title_font_style":"segoe ui","masonry_thumb_gal_title_font_size":16,"masonry_thumb_gal_title_font_weight":"bold","masonry_thumb_gal_title_margin":"2px","masonry_thumb_gal_title_shadow":"0px 0px 0px #888888","masonry_thumb_gal_title_align":"center","mosaic_thumb_padding":"2","mosaic_thumb_border_radius":"0","mosaic_thumb_border_width":"0","mosaic_thumb_border_style":"none","mosaic_thumb_border_color":"CCCCCC","mosaic_thumbs_bg_color":"FFFFFF","mosaic_thumb_bg_transparent":"0","mosaic_thumb_transparent":"100","mosaic_thumb_align":"center","mosaic_thumb_hover_effect":"scale","mosaic_thumb_hover_effect_value":"1.08","mosaic_thumb_title_margin":"2px","mosaic_thumb_title_font_style":"segoe ui","mosaic_thumb_title_font_color":"CCCCCC","mosaic_thumb_title_shadow":"0px 0px 0px #888888","mosaic_thumb_title_font_size":16,"mosaic_thumb_title_font_weight":"bold","mosaic_thumb_gal_title_font_color":"CCCCCC","mosaic_thumb_gal_title_font_style":"segoe ui","mosaic_thumb_gal_title_font_size":16,"mosaic_thumb_gal_title_font_weight":"bold","mosaic_thumb_gal_title_margin":"2px","mosaic_thumb_gal_title_shadow":"0px 0px 0px #888888","mosaic_thumb_gal_title_align":"center","lightbox_info_pos":"bottom","lightbox_info_align":"left","lightbox_info_bg_color":"FFFFFF","lightbox_info_bg_transparent":"70","lightbox_info_border_width":"1","lightbox_info_border_style":"none","lightbox_info_border_color":"000000","lightbox_info_border_radius":"0px","lightbox_info_padding":"10px 7px 44px 10px","lightbox_info_margin":"10px 10px -5px 10px","lightbox_title_color":"808080","lightbox_title_font_style":"Ubuntu","lightbox_title_font_weight":"bold","lightbox_title_font_size":"16","lightbox_description_color":"B0B0B0","lightbox_description_font_style":"Ubuntu","lightbox_description_font_weight":"bold","lightbox_description_font_size":"13","lightbox_rate_pos":"top","lightbox_rate_align":"left","lightbox_rate_icon":"star","lightbox_rate_color":"F9D062","lightbox_rate_size":"20","lightbox_rate_stars_count":"5","lightbox_rate_padding":"15px","lightbox_rate_hover_color":"F7B50E","lightbox_hit_pos":"bottom","lightbox_hit_align":"left","lightbox_hit_bg_color":"000000","lightbox_hit_bg_transparent":"70","lightbox_hit_border_width":"1","lightbox_hit_border_style":"none","lightbox_hit_border_color":"000000","lightbox_hit_border_radius":"5px","lightbox_hit_padding":"5px","lightbox_hit_margin":"0 5px","lightbox_hit_color":"FFFFFF","lightbox_hit_font_style":"segoe ui","lightbox_hit_font_weight":"normal","lightbox_hit_font_size":"14","masonry_description_font_size":12,"masonry_description_color":"CCCCCC","masonry_description_font_style":"segoe ui","album_masonry_back_font_color":"000000","album_masonry_back_font_style":"segoe ui","album_masonry_back_font_size":16,"album_masonry_back_font_weight":"bold","album_masonry_back_padding":"0","album_masonry_title_font_color":"CCCCCC","album_masonry_title_font_style":"segoe ui","album_masonry_thumb_title_pos":"bottom","album_masonry_title_font_size":16,"album_masonry_title_font_weight":"bold","album_masonry_title_margin":"","album_masonry_title_shadow":"0px 0px 0px #888888","album_masonry_thumb_margin":0,"album_masonry_thumb_padding":0,"album_masonry_thumb_border_radius":"0","album_masonry_thumb_border_width":0,"album_masonry_thumb_border_style":"none","album_masonry_thumb_border_color":"CCCCCC","album_masonry_thumb_bg_color":"FFFFFF","album_masonry_thumbs_bg_color":"FFFFFF","album_masonry_thumb_bg_transparent":0,"album_masonry_thumb_box_shadow":"","album_masonry_thumb_transparent":100,"album_masonry_thumb_align":"center","album_masonry_thumb_hover_effect":"scale","album_masonry_thumb_hover_effect_value":"1.08","album_masonry_thumb_transition":1,"album_masonry_gal_title_font_color":"CCCCCC","album_masonry_gal_title_font_style":"segoe ui","album_masonry_gal_title_font_size":16,"album_masonry_gal_title_font_weight":"bold","album_masonry_gal_title_margin":"2px","album_masonry_gal_title_shadow":"0px 0px 0px #888888","album_masonry_gal_title_align":"center","carousel_cont_bg_color":"000000","carousel_cont_btn_transparent":0,"carousel_close_btn_transparent":50,"carousel_rl_btn_bg_color":"FFFFFF","carousel_rl_btn_border_radius":"20px","carousel_rl_btn_border_width":0,"carousel_rl_btn_border_style":"none","carousel_rl_btn_border_color":"FFFFFF","carousel_rl_btn_color":"303030","carousel_rl_btn_height":35,"carousel_rl_btn_size":15,"carousel_play_pause_btn_size":25,"carousel_rl_btn_width":35,"carousel_close_rl_btn_hover_color":"191919","carousel_rl_btn_style":"fa-chevron","carousel_mergin_bottom":"0.5","carousel_font_family":"arial","carousel_feature_border_width":2,"carousel_feature_border_style":"none","carousel_feature_border_color":"5D204F","carousel_caption_background_color":"000000","carousel_caption_bottom":0,"carousel_caption_p_mergin":0,"carousel_caption_p_pedding":5,"carousel_caption_p_font_weight":"bold","carousel_caption_p_font_size":14,"carousel_caption_p_color":"FFFFFF","carousel_title_opacity":100,"carousel_title_border_radius":"5px","mosaic_thumb_transition":"1"}';
|
133 |
-
$theme2 = '{"thumb_margin":"4","container_margin":"1","thumb_padding":"0","thumb_border_radius":"0","thumb_border_width":5,"thumb_border_style":"none","thumb_border_color":"FFFFFF","thumb_bg_color":"E8E8E8","thumbs_bg_color":"FFFFFF","thumb_bg_transparent":0,"thumb_box_shadow":"0px 0px 0px #888888","thumb_transparent":100,"thumb_align":"center","thumb_hover_effect":"scale","thumb_hover_effect_value":"2deg","thumb_transition":1,"thumb_title_font_color":"CCCCCC","thumb_title_font_style":"segoe ui","thumb_title_pos":"bottom","thumb_title_font_size":16,"thumb_title_font_weight":"bold","thumb_title_margin":"5px","thumb_title_shadow":"","thumb_gal_title_font_color":"CCCCCC","thumb_gal_title_font_style":"segoe ui","thumb_gal_title_font_size":16,"thumb_gal_title_font_weight":"bold","thumb_gal_title_margin":"2px","thumb_gal_title_shadow":"0px 0px 0px #888888","thumb_gal_title_align":"center","page_nav_position":"bottom","page_nav_align":"center","page_nav_number":0,"page_nav_font_size":12,"page_nav_font_style":"segoe ui","page_nav_font_color":"666666","page_nav_font_weight":"bold","page_nav_border_width":1,"page_nav_border_style":"none","page_nav_border_color":"E3E3E3","page_nav_border_radius":"0","page_nav_margin":"0","page_nav_padding":"3px 6px","page_nav_button_bg_color":"FCFCFC","page_nav_button_bg_transparent":100,"page_nav_box_shadow":"0","page_nav_button_transition":1,"page_nav_button_text":0,"lightbox_overlay_bg_color":"000000","lightbox_overlay_bg_transparent":70,"lightbox_bg_color":"000000","lightbox_ctrl_btn_pos":"bottom","lightbox_ctrl_btn_align":"center","lightbox_ctrl_btn_height":20,"lightbox_ctrl_btn_margin_top":10,"lightbox_ctrl_btn_margin_left":7,"lightbox_ctrl_btn_transparent":80,"lightbox_ctrl_btn_color":"FFFFFF","lightbox_toggle_btn_height":14,"lightbox_toggle_btn_width":100,"lightbox_ctrl_cont_bg_color":"000000","lightbox_ctrl_cont_transparent":80,"lightbox_ctrl_cont_border_radius":4,"lightbox_close_btn_transparent":95,"lightbox_close_btn_bg_color":"000000","lightbox_close_btn_border_width":0,"lightbox_close_btn_border_radius":"16px","lightbox_close_btn_border_style":"none","lightbox_close_btn_border_color":"FFFFFF","lightbox_close_btn_box_shadow":"","lightbox_close_btn_color":"FFFFFF","lightbox_close_btn_size":10,"lightbox_close_btn_width":20,"lightbox_close_btn_height":20,"lightbox_close_btn_top":"-10","lightbox_close_btn_right":"-10","lightbox_close_btn_full_color":"FFFFFF","lightbox_rl_btn_bg_color":"000000","lightbox_rl_btn_border_radius":"20px","lightbox_rl_btn_border_width":2,"lightbox_rl_btn_border_style":"none","lightbox_rl_btn_border_color":"FFFFFF","lightbox_rl_btn_box_shadow":"","lightbox_rl_btn_color":"FFFFFF","lightbox_rl_btn_height":40,"lightbox_rl_btn_width":40,"lightbox_rl_btn_size":20,"lightbox_close_rl_btn_hover_color":"FFFFFF","lightbox_comment_pos":"left","lightbox_comment_width":400,"lightbox_comment_bg_color":"000000","lightbox_comment_font_color":"CCCCCC","lightbox_comment_font_style":"segoe ui","lightbox_comment_font_size":12,"lightbox_comment_button_bg_color":"333333","lightbox_comment_button_border_color":"666666","lightbox_comment_button_border_width":1,"lightbox_comment_button_border_style":"none","lightbox_comment_button_border_radius":"3px","lightbox_comment_button_padding":"3px 10px","lightbox_comment_input_bg_color":"333333","lightbox_comment_input_border_color":"666666","lightbox_comment_input_border_width":1,"lightbox_comment_input_border_style":"none","lightbox_comment_input_border_radius":"0","lightbox_comment_input_padding":"3px","lightbox_comment_separator_width":1,"lightbox_comment_separator_style":"solid","lightbox_comment_separator_color":"2B2B2B","lightbox_comment_author_font_size":14,"lightbox_comment_date_font_size":10,"lightbox_comment_body_font_size":12,"lightbox_comment_share_button_color":"FFFFFF","lightbox_filmstrip_pos":"top","lightbox_filmstrip_rl_bg_color":"2B2B2B","lightbox_filmstrip_rl_btn_size":20,"lightbox_filmstrip_rl_btn_color":"FFFFFF","lightbox_filmstrip_thumb_margin":"0 1px","lightbox_filmstrip_thumb_border_width":1,"lightbox_filmstrip_thumb_border_style":"none","lightbox_filmstrip_thumb_border_color":"000000","lightbox_filmstrip_thumb_border_radius":"0","lightbox_filmstrip_thumb_deactive_transparent":80,"lightbox_filmstrip_thumb_active_border_width":0,"lightbox_filmstrip_thumb_active_border_color":"FFFFFF","lightbox_rl_btn_style":"fa-chevron","lightbox_rl_btn_transparent":80,"lightbox_bg_transparent":100,"album_compact_back_font_color":"000000","album_compact_back_font_style":"segoe ui","album_compact_back_font_size":14,"album_compact_back_font_weight":"normal","album_compact_back_padding":"0","album_compact_title_font_color":"CCCCCC","album_compact_title_font_style":"segoe ui","album_compact_thumb_title_pos":"bottom","album_compact_title_font_size":16,"album_compact_title_font_weight":"bold","album_compact_title_margin":"5px","album_compact_title_shadow":"","album_compact_thumb_margin":4,"album_compact_thumb_padding":4,"album_compact_thumb_border_radius":"0","album_compact_thumb_border_width":1,"album_compact_thumb_border_style":"none","album_compact_thumb_border_color":"000000","album_compact_thumb_bg_color":"E8E8E8","album_compact_thumbs_bg_color":"FFFFFF","album_compact_thumb_bg_transparent":100,"album_compact_thumb_box_shadow":"","album_compact_thumb_transparent":100,"album_compact_thumb_align":"center","album_compact_thumb_hover_effect":"rotate","album_compact_thumb_hover_effect_value":"2deg","album_compact_thumb_transition":1,"album_compact_gal_title_font_color":"CCCCCC","album_compact_gal_title_font_style":"segoe ui","album_compact_gal_title_font_size":16,"album_compact_gal_title_font_weight":"bold","album_compact_gal_title_margin":"2px","album_compact_gal_title_shadow":"0px 0px 0px #888888","album_compact_gal_title_align":"center","album_extended_thumb_margin":2,"album_extended_thumb_padding":4,"album_extended_thumb_border_radius":"0","album_extended_thumb_border_width":4,"album_extended_thumb_border_style":"none","album_extended_thumb_border_color":"E8E8E8","album_extended_thumb_bg_color":"E8E8E8","album_extended_thumbs_bg_color":"FFFFFF","album_extended_thumb_bg_transparent":100,"album_extended_thumb_box_shadow":"","album_extended_thumb_transparent":100,"album_extended_thumb_align":"left","album_extended_thumb_hover_effect":"rotate","album_extended_thumb_hover_effect_value":"2deg","album_extended_thumb_transition":0,"album_extended_back_font_color":"000000","album_extended_back_font_style":"segoe ui","album_extended_back_font_size":16,"album_extended_back_font_weight":"bold","album_extended_back_padding":"0","album_extended_div_bg_color":"FFFFFF","album_extended_div_bg_transparent":0,"album_extended_div_border_radius":"0","album_extended_div_margin":"0 0 5px 0","album_extended_div_padding":10,"album_extended_div_separator_width":1,"album_extended_div_separator_style":"none","album_extended_div_separator_color":"CCCCCC","album_extended_thumb_div_bg_color":"FFFFFF","album_extended_thumb_div_border_radius":"0","album_extended_thumb_div_border_width":0,"album_extended_thumb_div_border_style":"none","album_extended_thumb_div_border_color":"CCCCCC","album_extended_thumb_div_padding":"0","album_extended_text_div_bg_color":"FFFFFF","album_extended_text_div_border_radius":"0","album_extended_text_div_border_width":1,"album_extended_text_div_border_style":"none","album_extended_text_div_border_color":"CCCCCC","album_extended_text_div_padding":"5px","album_extended_title_span_border_width":1,"album_extended_title_span_border_style":"none","album_extended_title_span_border_color":"CCCCCC","album_extended_title_font_color":"000000","album_extended_title_font_style":"segoe ui","album_extended_title_font_size":16,"album_extended_title_font_weight":"bold","album_extended_title_margin_bottom":2,"album_extended_title_padding":"2px","album_extended_desc_span_border_width":1,"album_extended_desc_span_border_style":"none","album_extended_desc_span_border_color":"CCCCCC","album_extended_desc_font_color":"000000","album_extended_desc_font_style":"segoe ui","album_extended_desc_font_size":14,"album_extended_desc_font_weight":"normal","album_extended_desc_padding":"2px","album_extended_desc_more_color":"FFC933","album_extended_desc_more_size":12,"album_extended_gal_title_font_color":"CCCCCC","album_extended_gal_title_font_style":"segoe ui","album_extended_gal_title_font_size":16,"album_extended_gal_title_font_weight":"bold","album_extended_gal_title_margin":"2px","album_extended_gal_title_shadow":"0px 0px 0px #888888","album_extended_gal_title_align":"center","masonry_thumb_padding":4,"masonry_thumb_border_radius":"2px","masonry_thumb_border_width":1,"masonry_thumb_border_style":"none","masonry_thumb_border_color":"CCCCCC","masonry_thumbs_bg_color":"FFFFFF","masonry_thumb_bg_transparent":0,"masonry_thumb_transparent":80,"masonry_thumb_align":"center","masonry_thumb_hover_effect":"rotate","masonry_thumb_hover_effect_value":"2deg","masonry_thumb_transition":0,"masonry_thumb_gal_title_font_color":"CCCCCC","masonry_thumb_gal_title_font_style":"segoe ui","masonry_thumb_gal_title_font_size":16,"masonry_thumb_gal_title_font_weight":"bold","masonry_thumb_gal_title_margin":"2px","masonry_thumb_gal_title_shadow":"0px 0px 0px #888888","masonry_thumb_gal_title_align":"center","slideshow_cont_bg_color":"000000","slideshow_close_btn_transparent":100,"slideshow_rl_btn_bg_color":"000000","slideshow_rl_btn_border_radius":"20px","slideshow_rl_btn_border_width":0,"slideshow_rl_btn_border_style":"none","slideshow_rl_btn_border_color":"FFFFFF","slideshow_rl_btn_box_shadow":"","slideshow_rl_btn_color":"FFFFFF","slideshow_rl_btn_height":40,"slideshow_rl_btn_size":20,"slideshow_rl_btn_width":40,"slideshow_close_rl_btn_hover_color":"DBDBDB","slideshow_filmstrip_pos":"bottom","slideshow_filmstrip_thumb_border_width":1,"slideshow_filmstrip_thumb_border_style":"none","slideshow_filmstrip_thumb_border_color":"000000","slideshow_filmstrip_thumb_border_radius":"0","slideshow_filmstrip_thumb_margin":"0 1px","slideshow_filmstrip_thumb_active_border_width":0,"slideshow_filmstrip_thumb_active_border_color":"FFFFFF","slideshow_filmstrip_thumb_deactive_transparent":80,"slideshow_filmstrip_rl_bg_color":"303030","slideshow_filmstrip_rl_btn_color":"FFFFFF","slideshow_filmstrip_rl_btn_size":20,"slideshow_title_font_size":16,"slideshow_title_font":"segoe ui","slideshow_title_color":"FFFFFF","slideshow_title_opacity":70,"slideshow_title_border_radius":"5px","slideshow_title_background_color":"000000","slideshow_title_padding":"5px 10px 5px 10px","slideshow_description_font_size":14,"slideshow_description_font":"segoe ui","slideshow_description_color":"FFFFFF","slideshow_description_opacity":70,"slideshow_description_border_radius":"0","slideshow_description_background_color":"000000","slideshow_description_padding":"5px 10px 5px 10px","slideshow_dots_width":10,"slideshow_dots_height":10,"slideshow_dots_border_radius":"10px","slideshow_dots_background_color":"292929","slideshow_dots_margin":1,"slideshow_dots_active_background_color":"292929","slideshow_dots_active_border_width":2,"slideshow_dots_active_border_color":"FFC933","slideshow_play_pause_btn_size":60,"slideshow_rl_btn_style":"fa-chevron","blog_style_margin":"2px","blog_style_padding":"4px","blog_style_border_radius":"0","blog_style_border_width":1,"blog_style_border_style":"none","blog_style_border_color":"CCCCCC","blog_style_bg_color":"E8E8E8","blog_style_transparent":70,"blog_style_box_shadow":"","blog_style_align":"center","blog_style_share_buttons_margin":"5px auto 10px auto","blog_style_share_buttons_border_radius":"0","blog_style_share_buttons_border_width":0,"blog_style_share_buttons_border_style":"none","blog_style_share_buttons_border_color":"000000","blog_style_share_buttons_bg_color":"FFFFFF","blog_style_share_buttons_align":"right","blog_style_img_font_size":16,"blog_style_img_font_family":"segoe ui","blog_style_img_font_color":"000000","blog_style_share_buttons_color":"A1A1A1","blog_style_share_buttons_bg_transparent":0,"blog_style_share_buttons_font_size":20,"blog_style_image_title_align":"top","blog_style_gal_title_font_color":"CCCCCC","blog_style_gal_title_font_style":"segoe ui","blog_style_gal_title_font_size":16,"blog_style_gal_title_font_weight":"bold","blog_style_gal_title_margin":"2px","blog_style_gal_title_shadow":"0px 0px 0px #888888","blog_style_gal_title_align":"center","image_browser_margin":"2px auto","image_browser_padding":"4px","image_browser_border_radius":"2px","image_browser_border_width":1,"image_browser_border_style":"none","image_browser_border_color":"E8E8E8","image_browser_bg_color":"E8E8E8","image_browser_box_shadow":"","image_browser_transparent":80,"image_browser_align":"center","image_browser_image_description_margin":"24px 0px 0px 0px","image_browser_image_description_padding":"8px 8px 8px 8px","image_browser_image_description_border_radius":"0","image_browser_image_description_border_width":1,"image_browser_image_description_border_style":"none","image_browser_image_description_border_color":"FFFFFF","image_browser_image_description_bg_color":"E8E8E8","image_browser_image_description_align":"center","image_browser_img_font_size":14,"image_browser_img_font_family":"segoe ui","image_browser_img_font_color":"000000","image_browser_full_padding":"4px","image_browser_full_border_radius":"0","image_browser_full_border_width":1,"image_browser_full_border_style":"solid","image_browser_full_border_color":"EDEDED","image_browser_full_bg_color":"FFFFFF","image_browser_full_transparent":90,"image_browser_image_title_align":"top","image_browser_gal_title_font_color":"CCCCCC","image_browser_gal_title_font_style":"segoe ui","image_browser_gal_title_font_size":16,"image_browser_gal_title_font_weight":"bold","image_browser_gal_title_margin":"2px","image_browser_gal_title_shadow":"0px 0px 0px #888888","image_browser_gal_title_align":"center","lightbox_info_pos":"top","lightbox_info_align":"right","lightbox_info_bg_color":"000000","lightbox_info_bg_transparent":70,"lightbox_info_border_width":1,"lightbox_info_border_style":"none","lightbox_info_border_color":"000000","lightbox_info_border_radius":"5px","lightbox_info_padding":"5px","lightbox_info_margin":"15px","lightbox_title_color":"FFFFFF","lightbox_title_font_style":"segoe ui","lightbox_title_font_weight":"bold","lightbox_title_font_size":18,"lightbox_description_color":"FFFFFF","lightbox_description_font_style":"segoe ui","lightbox_description_font_weight":"normal","lightbox_description_font_size":14,"lightbox_rate_pos":"bottom","lightbox_rate_align":"right","lightbox_rate_icon":"star","lightbox_rate_color":"F9D062","lightbox_rate_size":20,"lightbox_rate_stars_count":5,"lightbox_rate_padding":"15px","lightbox_rate_hover_color":"F7B50E","lightbox_hit_pos":"bottom","lightbox_hit_align":"left","lightbox_hit_bg_color":"000000","lightbox_hit_bg_transparent":70,"lightbox_hit_border_width":1,"lightbox_hit_border_style":"none","lightbox_hit_border_color":"000000","lightbox_hit_border_radius":"5px","lightbox_hit_padding":"5px","lightbox_hit_margin":"0 5px","lightbox_hit_color":"FFFFFF","lightbox_hit_font_style":"segoe ui","lightbox_hit_font_weight":"normal","lightbox_hit_font_size":14,"masonry_description_font_size":12,"masonry_description_color":"CCCCCC","masonry_description_font_style":"segoe ui","album_masonry_back_font_color":"000000","album_masonry_back_font_style":"segoe ui","album_masonry_back_font_size":14,"album_masonry_back_font_weight":"normal","album_masonry_back_padding":"0","album_masonry_title_font_color":"CCCCCC","album_masonry_title_font_style":"segoe ui","album_masonry_thumb_title_pos":"bottom","album_masonry_title_font_size":16,"album_masonry_title_font_weight":"bold","album_masonry_title_margin":"5px","album_masonry_title_shadow":"","album_masonry_thumb_margin":4,"album_masonry_thumb_padding":4,"album_masonry_thumb_border_radius":"0","album_masonry_thumb_border_width":1,"album_masonry_thumb_border_style":"none","album_masonry_thumb_border_color":"000000","album_masonry_thumb_bg_color":"E8E8E8","album_masonry_thumbs_bg_color":"FFFFFF","album_masonry_thumb_bg_transparent":100,"album_masonry_thumb_box_shadow":"","album_masonry_thumb_transparent":100,"album_masonry_thumb_align":"center","album_masonry_thumb_hover_effect":"rotate","album_masonry_thumb_hover_effect_value":"2deg","album_masonry_thumb_transition":1,"album_masonry_gal_title_font_color":"CCCCCC","album_masonry_gal_title_font_style":"segoe ui","album_masonry_gal_title_font_size":16,"album_masonry_gal_title_font_weight":"bold","album_masonry_gal_title_margin":"2px","album_masonry_gal_title_shadow":"0px 0px 0px #888888","album_masonry_gal_title_align":"center","mosaic_thumb_padding":4,"mosaic_thumb_border_radius":"2px","mosaic_thumb_border_width":1,"mosaic_thumb_border_style":"none","mosaic_thumb_border_color":"CCCCCC","mosaic_thumbs_bg_color":"FFFFFF","mosaic_thumb_bg_transparent":0,"mosaic_thumb_transparent":80,"mosaic_thumb_align":"center","mosaic_thumb_hover_effect":"rotate","mosaic_thumb_hover_effect_value":"2deg","mosaic_thumb_title_font_color":"CCCCCC","mosaic_thumb_title_font_style":"segoe ui","mosaic_thumb_title_font_weight":"bold","mosaic_thumb_title_margin":"2px","mosaic_thumb_title_shadow":"0px 0px 0px #888888","mosaic_thumb_title_font_size":16,"mosaic_thumb_gal_title_font_color":"CCCCCC","mosaic_thumb_gal_title_font_style":"segoe ui","mosaic_thumb_gal_title_font_size":16,"mosaic_thumb_gal_title_font_weight":"bold","mosaic_thumb_gal_title_margin":"2px","mosaic_thumb_gal_title_shadow":"0px 0px 0px #888888","mosaic_thumb_gal_title_align":"center","carousel_cont_bg_color":"000000","carousel_cont_btn_transparent":0,"carousel_close_btn_transparent":100,"carousel_rl_btn_bg_color":"000000","carousel_rl_btn_border_radius":"20px","carousel_rl_btn_border_width":0,"carousel_rl_btn_border_style":"none","carousel_rl_btn_border_color":"FFFFFF","carousel_rl_btn_color":"FFFFFF","carousel_rl_btn_height":40,"carousel_rl_btn_size":20,"carousel_play_pause_btn_size":20,"carousel_rl_btn_width":40,"carousel_close_rl_btn_hover_color":"CCCCCC","carousel_rl_btn_style":"fa-chevron","carousel_mergin_bottom":"0.5","carousel_font_family":"segoe ui","carousel_feature_border_width":2,"carousel_feature_border_style":"solid","carousel_feature_border_color":"5D204F","carousel_caption_background_color":"000000","carousel_caption_bottom":0,"carousel_caption_p_mergin":0,"carousel_caption_p_pedding":5,"carousel_caption_p_font_weight":"bold","carousel_caption_p_font_size":14,"carousel_caption_p_color":"FFFFFF","carousel_title_opacity":100,"carousel_title_border_radius":"5px","mosaic_thumb_transition":1}';
|
134 |
|
135 |
if (!$exists_default) {
|
136 |
$wpdb->insert($wpdb->prefix . 'bwg_theme', array(
|
129 |
|
130 |
$exists_default = $wpdb->get_var('SELECT count(id) FROM ' . $wpdb->prefix . 'bwg_theme');
|
131 |
|
132 |
+
$theme1 = '{"thumb_margin":"4","container_margin":"1","thumb_padding":"0","thumb_border_radius":"0","thumb_border_width":0,"thumb_border_style":"none","thumb_border_color":"CCCCCC","thumb_bg_color":"000000","thumbs_bg_color":"FFFFFF","thumb_bg_transparent":0,"thumb_box_shadow":"","thumb_transparent":100,"thumb_align":"center","thumb_hover_effect":"zoom","thumb_hover_effect_value":"1.08","thumb_transition":1,"thumb_title_margin":"2px","thumb_title_font_style":"Ubuntu","thumb_title_pos":"bottom","thumb_title_font_color":"323A45","thumb_title_font_color_hover":"FFFFFF","thumb_title_shadow":"","thumb_title_font_size":16,"thumb_title_font_weight":"bold","thumb_gal_title_font_color":"000000","thumb_gal_title_font_style":"Ubuntu","thumb_gal_title_font_size":18,"thumb_gal_title_font_weight":"bold","thumb_gal_title_margin":"2px","thumb_gal_title_shadow":"","thumb_gal_title_align":"center","page_nav_position":"bottom","page_nav_align":"center","page_nav_number":0,"page_nav_font_size":12,"page_nav_font_style":"segoe ui","page_nav_font_color":"666666","page_nav_font_weight":"bold","page_nav_border_width":1,"page_nav_border_style":"solid","page_nav_border_color":"E3E3E3","page_nav_border_radius":"0","page_nav_margin":"0","page_nav_padding":"3px 6px","page_nav_button_bg_color":"FFFFFF","page_nav_button_bg_transparent":100,"page_nav_box_shadow":"0","page_nav_button_transition":1,"page_nav_button_text":0,"lightbox_ctrl_btn_pos":"bottom","lightbox_ctrl_btn_align":"center","lightbox_ctrl_btn_height":20,"lightbox_ctrl_btn_margin_top":10,"lightbox_ctrl_btn_margin_left":7,"lightbox_ctrl_btn_transparent":100,"lightbox_ctrl_btn_color":"808080","lightbox_toggle_btn_height":20,"lightbox_toggle_btn_width":100,"lightbox_ctrl_cont_bg_color":"FFFFFF","lightbox_ctrl_cont_border_radius":4,"lightbox_ctrl_cont_transparent":85,"lightbox_close_btn_bg_color":"FFFFFF","lightbox_close_btn_border_radius":"16px","lightbox_close_btn_border_width":2,"lightbox_close_btn_border_style":"none","lightbox_close_btn_border_color":"FFFFFF","lightbox_close_btn_box_shadow":"0","lightbox_close_btn_color":"808080","lightbox_close_btn_size":20,"lightbox_close_btn_width":30,"lightbox_close_btn_height":30,"lightbox_close_btn_top":"-20","lightbox_close_btn_right":"-15","lightbox_close_btn_full_color":"000000","lightbox_close_btn_transparent":60,"lightbox_rl_btn_bg_color":"FFFFFF","lightbox_rl_btn_transparent":"60","lightbox_rl_btn_border_radius":"20px","lightbox_rl_btn_border_width":0,"lightbox_rl_btn_border_style":"none","lightbox_rl_btn_border_color":"FFFFFF","lightbox_rl_btn_box_shadow":"","lightbox_rl_btn_color":"ADADAD","lightbox_rl_btn_height":35,"lightbox_rl_btn_width":35,"lightbox_rl_btn_size":25,"lightbox_close_rl_btn_hover_color":"808080","lightbox_comment_pos":"left","lightbox_comment_width":350,"lightbox_comment_bg_color":"FFFFFF","lightbox_comment_font_color":"7A7A7A","lightbox_comment_font_style":"Ubuntu","lightbox_comment_font_size":12,"lightbox_comment_button_bg_color":"2F2F2F","lightbox_comment_button_border_color":"666666","lightbox_comment_button_border_width":1,"lightbox_comment_button_border_style":"none","lightbox_comment_button_border_radius":"7px","lightbox_comment_button_padding":"10px 10px","lightbox_comment_input_bg_color":"F7F8F9","lightbox_comment_input_border_color":"EBEBEB","lightbox_comment_input_border_width":2,"lightbox_comment_input_border_style":"none","lightbox_comment_input_border_radius":"7px","lightbox_comment_input_padding":"5px","lightbox_comment_separator_width":20,"lightbox_comment_separator_style":"none","lightbox_comment_separator_color":"383838","lightbox_comment_author_font_size":14,"lightbox_comment_date_font_size":10,"lightbox_comment_body_font_size":12,"lightbox_comment_share_button_color":"808080","lightbox_filmstrip_rl_bg_color":"EBEBEB","lightbox_filmstrip_rl_btn_size":20,"lightbox_filmstrip_rl_btn_color":"808080","lightbox_filmstrip_thumb_margin":"0 1px","lightbox_filmstrip_thumb_border_width":1,"lightbox_filmstrip_thumb_border_style":"none","lightbox_filmstrip_thumb_border_color":"000000","lightbox_filmstrip_thumb_border_radius":"0","lightbox_filmstrip_thumb_deactive_transparent":80,"lightbox_filmstrip_pos":"bottom","lightbox_filmstrip_thumb_active_border_width":0,"lightbox_filmstrip_thumb_active_border_color":"FFFFFF","lightbox_overlay_bg_transparent":60,"lightbox_bg_color":"FFFFFF","lightbox_overlay_bg_color":"EEEEEE","lightbox_rl_btn_style":"fa-angle","lightbox_bg_transparent":100,"blog_style_margin":"2px","blog_style_padding":"0","blog_style_border_radius":"0","blog_style_border_width":1,"blog_style_border_style":"solid","blog_style_border_color":"F5F5F5","blog_style_bg_color":"FFFFFF","blog_style_transparent":80,"blog_style_box_shadow":"","blog_style_align":"center","blog_style_share_buttons_margin":"5px auto 10px auto","blog_style_share_buttons_border_radius":"0","blog_style_share_buttons_border_width":0,"blog_style_share_buttons_border_style":"none","blog_style_share_buttons_border_color":"000000","blog_style_share_buttons_bg_color":"FFFFFF","blog_style_share_buttons_align":"right","blog_style_img_font_size":16,"blog_style_img_font_family":"segoe ui","blog_style_img_font_color":"000000","blog_style_share_buttons_font_size":20,"blog_style_share_buttons_color":"B3AFAF","blog_style_share_buttons_bg_transparent":0,"blog_style_gal_title_font_color":"CCCCCC","blog_style_gal_title_font_style":"segoe ui","blog_style_gal_title_font_size":16,"blog_style_gal_title_font_weight":"bold","blog_style_gal_title_margin":"2px","blog_style_gal_title_shadow":"0px 0px 0px #888888","blog_style_gal_title_align":"center","image_browser_margin":"2px auto","image_browser_padding":"4px","image_browser_border_radius":"0","image_browser_border_width":1,"image_browser_border_style":"none","image_browser_border_color":"F5F5F5","image_browser_bg_color":"EBEBEB","image_browser_box_shadow":"","image_browser_transparent":80,"image_browser_align":"center","image_browser_image_description_margin":"0px 5px 0px 5px","image_browser_image_description_padding":"8px 8px 8px 8px","image_browser_image_description_border_radius":"0","image_browser_image_description_border_width":1,"image_browser_image_description_border_style":"none","image_browser_image_description_border_color":"FFFFFF","image_browser_image_description_bg_color":"EBEBEB","image_browser_image_description_align":"center","image_browser_img_font_size":15,"image_browser_img_font_family":"Ubuntu","image_browser_img_font_color":"000000","image_browser_full_padding":"4px","image_browser_full_border_radius":"0","image_browser_full_border_width":2,"image_browser_full_border_style":"none","image_browser_full_border_color":"F7F7F7","image_browser_full_bg_color":"F5F5F5","image_browser_full_transparent":90,"image_browser_image_title_align":"top","image_browser_gal_title_font_color":"CCCCCC","image_browser_gal_title_font_style":"segoe ui","image_browser_gal_title_font_size":16,"image_browser_gal_title_font_weight":"bold","image_browser_gal_title_margin":"2px","image_browser_gal_title_shadow":"0px 0px 0px #888888","image_browser_gal_title_align":"center","album_compact_title_margin":"2px","album_compact_thumb_margin":2,"album_compact_back_padding":"0","album_compact_thumb_padding":0,"album_compact_thumb_border_radius":"0","album_compact_thumb_border_width":0,"album_compact_title_font_style":"segoe ui","album_compact_back_font_color":"000000","album_compact_title_font_color":"FFFFFF","album_compact_title_shadow":"0px 0px 0px #888888","album_compact_thumb_bg_transparent":0,"album_compact_thumb_box_shadow":"0px 0px 0px #888888","album_compact_thumb_transition":1,"album_compact_thumb_border_style":"none","album_compact_thumb_border_color":"CCCCCC","album_compact_thumb_bg_color":"FFFFFF","album_compact_back_font_weight":"bold","album_compact_back_font_size":16,"album_compact_back_font_style":"segoe ui","album_compact_thumb_title_pos":"bottom","album_compact_thumbs_bg_color":"FFFFFF","album_compact_title_font_size":16,"album_compact_title_font_weight":"bold","album_compact_thumb_align":"center","album_compact_thumb_hover_effect":"scale","album_compact_thumb_transparent":100,"album_compact_thumb_hover_effect_value":"1.08","album_compact_gal_title_font_color":"CCCCCC","album_compact_gal_title_font_style":"segoe ui","album_compact_gal_title_font_size":16,"album_compact_gal_title_font_weight":"bold","album_compact_gal_title_margin":"2px","album_compact_gal_title_shadow":"0px 0px 0px #888888","album_compact_gal_title_align":"center","album_extended_thumb_margin":2,"album_extended_thumb_padding":0,"album_extended_thumb_border_radius":"0","album_extended_thumb_border_width":0,"album_extended_thumb_border_style":"none","album_extended_thumb_border_color":"CCCCCC","album_extended_thumb_bg_color":"FFFFFF","album_extended_thumbs_bg_color":"FFFFFF","album_extended_thumb_bg_transparent":0,"album_extended_thumb_box_shadow":"","album_extended_thumb_transparent":100,"album_extended_thumb_align":"left","album_extended_thumb_hover_effect":"scale","album_extended_thumb_hover_effect_value":"1.08","album_extended_thumb_transition":1,"album_extended_back_font_color":"000000","album_extended_back_font_style":"segoe ui","album_extended_back_font_size":20,"album_extended_back_font_weight":"bold","album_extended_back_padding":"0","album_extended_div_bg_color":"FFFFFF","album_extended_div_bg_transparent":0,"album_extended_div_border_radius":"0 0 0 0","album_extended_div_margin":"0 0 5px 0","album_extended_div_padding":10,"album_extended_div_separator_width":1,"album_extended_div_separator_style":"solid","album_extended_div_separator_color":"E0E0E0","album_extended_thumb_div_bg_color":"FFFFFF","album_extended_thumb_div_border_radius":"0","album_extended_thumb_div_border_width":1,"album_extended_thumb_div_border_style":"solid","album_extended_thumb_div_border_color":"E8E8E8","album_extended_thumb_div_padding":"5px","album_extended_text_div_bg_color":"FFFFFF","album_extended_text_div_border_radius":"0","album_extended_text_div_border_width":1,"album_extended_text_div_border_style":"solid","album_extended_text_div_border_color":"E8E8E8","album_extended_text_div_padding":"5px","album_extended_title_span_border_width":1,"album_extended_title_span_border_style":"none","album_extended_title_span_border_color":"CCCCCC","album_extended_title_font_color":"000000","album_extended_title_font_style":"segoe ui","album_extended_title_font_size":16,"album_extended_title_font_weight":"bold","album_extended_title_margin_bottom":2,"album_extended_title_padding":"2px","album_extended_desc_span_border_width":1,"album_extended_desc_span_border_style":"none","album_extended_desc_span_border_color":"CCCCCC","album_extended_desc_font_color":"000000","album_extended_desc_font_style":"segoe ui","album_extended_desc_font_size":14,"album_extended_desc_font_weight":"normal","album_extended_desc_padding":"2px","album_extended_desc_more_color":"F2D22E","album_extended_desc_more_size":12,"album_extended_gal_title_font_color":"CCCCCC","album_extended_gal_title_font_style":"segoe ui","album_extended_gal_title_font_size":16,"album_extended_gal_title_font_weight":"bold","album_extended_gal_title_margin":"2px","album_extended_gal_title_shadow":"0px 0px 0px #888888","album_extended_gal_title_align":"center","slideshow_cont_bg_color":"F2F2F2","slideshow_close_btn_transparent":100,"slideshow_rl_btn_bg_color":"FFFFFF","slideshow_rl_btn_border_radius":"20px","slideshow_rl_btn_border_width":0,"slideshow_rl_btn_border_style":"none","slideshow_rl_btn_border_color":"FFFFFF","slideshow_rl_btn_box_shadow":"","slideshow_rl_btn_color":"D6D6D6","slideshow_rl_btn_height":37,"slideshow_rl_btn_size":12,"slideshow_rl_btn_width":37,"slideshow_close_rl_btn_hover_color":"BABABA","slideshow_filmstrip_pos":"bottom","slideshow_filmstrip_thumb_border_width":0,"slideshow_filmstrip_thumb_border_style":"none","slideshow_filmstrip_thumb_border_color":"000000","slideshow_filmstrip_thumb_border_radius":"0","slideshow_filmstrip_thumb_margin":"0px 2px 0 0 ","slideshow_filmstrip_thumb_active_border_width":0,"slideshow_filmstrip_thumb_active_border_color":"FFFFFF","slideshow_filmstrip_thumb_deactive_transparent":100,"slideshow_filmstrip_rl_bg_color":"F2F2F2","slideshow_filmstrip_rl_btn_color":"BABABA","slideshow_filmstrip_rl_btn_size":20,"slideshow_title_font_size":16,"slideshow_title_font":"segoe ui","slideshow_title_color":"FFFFFF","slideshow_title_opacity":70,"slideshow_title_border_radius":"5px","slideshow_title_background_color":"000000","slideshow_title_padding":"0 0 0 0","slideshow_description_font_size":14,"slideshow_description_font":"segoe ui","slideshow_description_color":"FFFFFF","slideshow_description_opacity":70,"slideshow_description_border_radius":"0","slideshow_description_background_color":"000000","slideshow_description_padding":"5px 10px 5px 10px","slideshow_dots_width":12,"slideshow_dots_height":12,"slideshow_dots_border_radius":"5px","slideshow_dots_background_color":"F2D22E","slideshow_dots_margin":3,"slideshow_dots_active_background_color":"FFFFFF","slideshow_dots_active_border_width":1,"slideshow_dots_active_border_color":"000000","slideshow_play_pause_btn_size":35,"slideshow_rl_btn_style":"fa-chevron","masonry_thumb_padding":"2","masonry_thumb_border_radius":"0","masonry_thumb_border_width":"0","masonry_thumb_border_style":"none","masonry_thumb_border_color":"CCCCCC","masonry_thumbs_bg_color":"FFFFFF","masonry_thumb_bg_transparent":"0","masonry_thumb_transparent":"100","masonry_thumb_align":"center","masonry_thumb_hover_effect":"scale","masonry_thumb_hover_effect_value":"1.08","masonry_thumb_transition":"1","masonry_thumb_gal_title_font_color":"CCCCCC","masonry_thumb_gal_title_font_style":"segoe ui","masonry_thumb_gal_title_font_size":16,"masonry_thumb_gal_title_font_weight":"bold","masonry_thumb_gal_title_margin":"2px","masonry_thumb_gal_title_shadow":"0px 0px 0px #888888","masonry_thumb_gal_title_align":"center","mosaic_thumb_padding":"2","mosaic_thumb_border_radius":"0","mosaic_thumb_border_width":"0","mosaic_thumb_border_style":"none","mosaic_thumb_border_color":"CCCCCC","mosaic_thumbs_bg_color":"FFFFFF","mosaic_thumb_bg_transparent":"0","mosaic_thumb_transparent":"100","mosaic_thumb_align":"center","mosaic_thumb_hover_effect":"scale","mosaic_thumb_hover_effect_value":"1.08","mosaic_thumb_title_margin":"2px","mosaic_thumb_title_font_style":"segoe ui","mosaic_thumb_title_font_color":"CCCCCC","mosaic_thumb_title_shadow":"0px 0px 0px #888888","mosaic_thumb_title_font_size":16,"mosaic_thumb_title_font_weight":"bold","mosaic_thumb_gal_title_font_color":"CCCCCC","mosaic_thumb_gal_title_font_style":"segoe ui","mosaic_thumb_gal_title_font_size":16,"mosaic_thumb_gal_title_font_weight":"bold","mosaic_thumb_gal_title_margin":"2px","mosaic_thumb_gal_title_shadow":"0px 0px 0px #888888","mosaic_thumb_gal_title_align":"center","lightbox_info_pos":"bottom","lightbox_info_align":"left","lightbox_info_bg_color":"FFFFFF","lightbox_info_bg_transparent":"70","lightbox_info_border_width":"1","lightbox_info_border_style":"none","lightbox_info_border_color":"000000","lightbox_info_border_radius":"0px","lightbox_info_padding":"10px 7px 44px 10px","lightbox_info_margin":"10px 10px -5px 10px","lightbox_title_color":"808080","lightbox_title_font_style":"Ubuntu","lightbox_title_font_weight":"bold","lightbox_title_font_size":"16","lightbox_description_color":"B0B0B0","lightbox_description_font_style":"Ubuntu","lightbox_description_font_weight":"bold","lightbox_description_font_size":"13","lightbox_rate_pos":"top","lightbox_rate_align":"left","lightbox_rate_icon":"star","lightbox_rate_color":"F9D062","lightbox_rate_size":"20","lightbox_rate_stars_count":"5","lightbox_rate_padding":"15px","lightbox_rate_hover_color":"F7B50E","lightbox_hit_pos":"bottom","lightbox_hit_align":"left","lightbox_hit_bg_color":"000000","lightbox_hit_bg_transparent":"70","lightbox_hit_border_width":"1","lightbox_hit_border_style":"none","lightbox_hit_border_color":"000000","lightbox_hit_border_radius":"5px","lightbox_hit_padding":"5px","lightbox_hit_margin":"0 5px","lightbox_hit_color":"FFFFFF","lightbox_hit_font_style":"segoe ui","lightbox_hit_font_weight":"normal","lightbox_hit_font_size":"14","masonry_description_font_size":12,"masonry_description_color":"CCCCCC","masonry_description_font_style":"segoe ui","album_masonry_back_font_color":"000000","album_masonry_back_font_style":"segoe ui","album_masonry_back_font_size":16,"album_masonry_back_font_weight":"bold","album_masonry_back_padding":"0","album_masonry_title_font_color":"CCCCCC","album_masonry_title_font_style":"segoe ui","album_masonry_thumb_title_pos":"bottom","album_masonry_title_font_size":16,"album_masonry_title_font_weight":"bold","album_masonry_title_margin":"","album_masonry_title_shadow":"0px 0px 0px #888888","album_masonry_thumb_margin":0,"album_masonry_thumb_padding":0,"album_masonry_thumb_border_radius":"0","album_masonry_thumb_border_width":0,"album_masonry_thumb_border_style":"none","album_masonry_thumb_border_color":"CCCCCC","album_masonry_thumb_bg_color":"FFFFFF","album_masonry_thumbs_bg_color":"FFFFFF","album_masonry_thumb_bg_transparent":0,"album_masonry_thumb_box_shadow":"","album_masonry_thumb_transparent":100,"album_masonry_thumb_align":"center","album_masonry_thumb_hover_effect":"scale","album_masonry_thumb_hover_effect_value":"1.08","album_masonry_thumb_transition":1,"album_masonry_gal_title_font_color":"CCCCCC","album_masonry_gal_title_font_style":"segoe ui","album_masonry_gal_title_font_size":16,"album_masonry_gal_title_font_weight":"bold","album_masonry_gal_title_margin":"2px","album_masonry_gal_title_shadow":"0px 0px 0px #888888","album_masonry_gal_title_align":"center","carousel_cont_bg_color":"000000","carousel_cont_btn_transparent":0,"carousel_close_btn_transparent":50,"carousel_rl_btn_bg_color":"FFFFFF","carousel_rl_btn_border_radius":"20px","carousel_rl_btn_border_width":0,"carousel_rl_btn_border_style":"none","carousel_rl_btn_border_color":"FFFFFF","carousel_rl_btn_color":"303030","carousel_rl_btn_height":35,"carousel_rl_btn_size":15,"carousel_play_pause_btn_size":25,"carousel_rl_btn_width":35,"carousel_close_rl_btn_hover_color":"191919","carousel_rl_btn_style":"fa-chevron","carousel_mergin_bottom":"0.5","carousel_font_family":"arial","carousel_feature_border_width":2,"carousel_feature_border_style":"none","carousel_feature_border_color":"5D204F","carousel_caption_background_color":"000000","carousel_caption_bottom":0,"carousel_caption_p_mergin":0,"carousel_caption_p_pedding":5,"carousel_caption_p_font_weight":"bold","carousel_caption_p_font_size":14,"carousel_caption_p_color":"FFFFFF","carousel_title_opacity":100,"carousel_title_border_radius":"5px","mosaic_thumb_transition":"1"}';
|
133 |
+
$theme2 = '{"thumb_margin":"4","container_margin":"1","thumb_padding":"0","thumb_border_radius":"0","thumb_border_width":5,"thumb_border_style":"none","thumb_border_color":"FFFFFF","thumb_bg_color":"000000","thumbs_bg_color":"FFFFFF","thumb_bg_transparent":0,"thumb_box_shadow":"","thumb_transparent":100,"thumb_align":"center","thumb_hover_effect":"zoom","thumb_hover_effect_value":"1.08","thumb_transition":1,"thumb_title_font_color":"323A45","thumb_title_font_color_hover":"FFFFFF","thumb_title_font_style":"Ubuntu","thumb_title_pos":"bottom","thumb_title_font_size":16,"thumb_title_font_weight":"bold","thumb_title_margin":"5px","thumb_title_shadow":"","thumb_gal_title_font_color":"000000","thumb_gal_title_font_style":"Ubuntu","thumb_gal_title_font_size":18,"thumb_gal_title_font_weight":"bold","thumb_gal_title_margin":"2px","thumb_gal_title_shadow":"","thumb_gal_title_align":"center","page_nav_position":"bottom","page_nav_align":"center","page_nav_number":0,"page_nav_font_size":12,"page_nav_font_style":"segoe ui","page_nav_font_color":"666666","page_nav_font_weight":"bold","page_nav_border_width":1,"page_nav_border_style":"none","page_nav_border_color":"E3E3E3","page_nav_border_radius":"0","page_nav_margin":"0","page_nav_padding":"3px 6px","page_nav_button_bg_color":"FCFCFC","page_nav_button_bg_transparent":100,"page_nav_box_shadow":"0","page_nav_button_transition":1,"page_nav_button_text":0,"lightbox_overlay_bg_color":"000000","lightbox_overlay_bg_transparent":70,"lightbox_bg_color":"000000","lightbox_ctrl_btn_pos":"bottom","lightbox_ctrl_btn_align":"center","lightbox_ctrl_btn_height":20,"lightbox_ctrl_btn_margin_top":10,"lightbox_ctrl_btn_margin_left":7,"lightbox_ctrl_btn_transparent":80,"lightbox_ctrl_btn_color":"FFFFFF","lightbox_toggle_btn_height":14,"lightbox_toggle_btn_width":100,"lightbox_ctrl_cont_bg_color":"000000","lightbox_ctrl_cont_transparent":80,"lightbox_ctrl_cont_border_radius":4,"lightbox_close_btn_transparent":95,"lightbox_close_btn_bg_color":"000000","lightbox_close_btn_border_width":0,"lightbox_close_btn_border_radius":"16px","lightbox_close_btn_border_style":"none","lightbox_close_btn_border_color":"FFFFFF","lightbox_close_btn_box_shadow":"","lightbox_close_btn_color":"FFFFFF","lightbox_close_btn_size":10,"lightbox_close_btn_width":20,"lightbox_close_btn_height":20,"lightbox_close_btn_top":"-10","lightbox_close_btn_right":"-10","lightbox_close_btn_full_color":"FFFFFF","lightbox_rl_btn_bg_color":"000000","lightbox_rl_btn_border_radius":"20px","lightbox_rl_btn_border_width":2,"lightbox_rl_btn_border_style":"none","lightbox_rl_btn_border_color":"FFFFFF","lightbox_rl_btn_box_shadow":"","lightbox_rl_btn_color":"FFFFFF","lightbox_rl_btn_height":40,"lightbox_rl_btn_width":40,"lightbox_rl_btn_size":20,"lightbox_close_rl_btn_hover_color":"FFFFFF","lightbox_comment_pos":"left","lightbox_comment_width":400,"lightbox_comment_bg_color":"000000","lightbox_comment_font_color":"CCCCCC","lightbox_comment_font_style":"segoe ui","lightbox_comment_font_size":12,"lightbox_comment_button_bg_color":"333333","lightbox_comment_button_border_color":"666666","lightbox_comment_button_border_width":1,"lightbox_comment_button_border_style":"none","lightbox_comment_button_border_radius":"3px","lightbox_comment_button_padding":"3px 10px","lightbox_comment_input_bg_color":"333333","lightbox_comment_input_border_color":"666666","lightbox_comment_input_border_width":1,"lightbox_comment_input_border_style":"none","lightbox_comment_input_border_radius":"0","lightbox_comment_input_padding":"3px","lightbox_comment_separator_width":1,"lightbox_comment_separator_style":"solid","lightbox_comment_separator_color":"2B2B2B","lightbox_comment_author_font_size":14,"lightbox_comment_date_font_size":10,"lightbox_comment_body_font_size":12,"lightbox_comment_share_button_color":"FFFFFF","lightbox_filmstrip_pos":"top","lightbox_filmstrip_rl_bg_color":"2B2B2B","lightbox_filmstrip_rl_btn_size":20,"lightbox_filmstrip_rl_btn_color":"FFFFFF","lightbox_filmstrip_thumb_margin":"0 1px","lightbox_filmstrip_thumb_border_width":1,"lightbox_filmstrip_thumb_border_style":"none","lightbox_filmstrip_thumb_border_color":"000000","lightbox_filmstrip_thumb_border_radius":"0","lightbox_filmstrip_thumb_deactive_transparent":80,"lightbox_filmstrip_thumb_active_border_width":0,"lightbox_filmstrip_thumb_active_border_color":"FFFFFF","lightbox_rl_btn_style":"fa-chevron","lightbox_rl_btn_transparent":80,"lightbox_bg_transparent":100,"album_compact_back_font_color":"000000","album_compact_back_font_style":"segoe ui","album_compact_back_font_size":14,"album_compact_back_font_weight":"normal","album_compact_back_padding":"0","album_compact_title_font_color":"CCCCCC","album_compact_title_font_style":"segoe ui","album_compact_thumb_title_pos":"bottom","album_compact_title_font_size":16,"album_compact_title_font_weight":"bold","album_compact_title_margin":"5px","album_compact_title_shadow":"","album_compact_thumb_margin":4,"album_compact_thumb_padding":4,"album_compact_thumb_border_radius":"0","album_compact_thumb_border_width":1,"album_compact_thumb_border_style":"none","album_compact_thumb_border_color":"000000","album_compact_thumb_bg_color":"E8E8E8","album_compact_thumbs_bg_color":"FFFFFF","album_compact_thumb_bg_transparent":100,"album_compact_thumb_box_shadow":"","album_compact_thumb_transparent":100,"album_compact_thumb_align":"center","album_compact_thumb_hover_effect":"rotate","album_compact_thumb_hover_effect_value":"2deg","album_compact_thumb_transition":1,"album_compact_gal_title_font_color":"CCCCCC","album_compact_gal_title_font_style":"segoe ui","album_compact_gal_title_font_size":16,"album_compact_gal_title_font_weight":"bold","album_compact_gal_title_margin":"2px","album_compact_gal_title_shadow":"0px 0px 0px #888888","album_compact_gal_title_align":"center","album_extended_thumb_margin":2,"album_extended_thumb_padding":4,"album_extended_thumb_border_radius":"0","album_extended_thumb_border_width":4,"album_extended_thumb_border_style":"none","album_extended_thumb_border_color":"E8E8E8","album_extended_thumb_bg_color":"E8E8E8","album_extended_thumbs_bg_color":"FFFFFF","album_extended_thumb_bg_transparent":100,"album_extended_thumb_box_shadow":"","album_extended_thumb_transparent":100,"album_extended_thumb_align":"left","album_extended_thumb_hover_effect":"rotate","album_extended_thumb_hover_effect_value":"2deg","album_extended_thumb_transition":0,"album_extended_back_font_color":"000000","album_extended_back_font_style":"segoe ui","album_extended_back_font_size":16,"album_extended_back_font_weight":"bold","album_extended_back_padding":"0","album_extended_div_bg_color":"FFFFFF","album_extended_div_bg_transparent":0,"album_extended_div_border_radius":"0","album_extended_div_margin":"0 0 5px 0","album_extended_div_padding":10,"album_extended_div_separator_width":1,"album_extended_div_separator_style":"none","album_extended_div_separator_color":"CCCCCC","album_extended_thumb_div_bg_color":"FFFFFF","album_extended_thumb_div_border_radius":"0","album_extended_thumb_div_border_width":0,"album_extended_thumb_div_border_style":"none","album_extended_thumb_div_border_color":"CCCCCC","album_extended_thumb_div_padding":"0","album_extended_text_div_bg_color":"FFFFFF","album_extended_text_div_border_radius":"0","album_extended_text_div_border_width":1,"album_extended_text_div_border_style":"none","album_extended_text_div_border_color":"CCCCCC","album_extended_text_div_padding":"5px","album_extended_title_span_border_width":1,"album_extended_title_span_border_style":"none","album_extended_title_span_border_color":"CCCCCC","album_extended_title_font_color":"000000","album_extended_title_font_style":"segoe ui","album_extended_title_font_size":16,"album_extended_title_font_weight":"bold","album_extended_title_margin_bottom":2,"album_extended_title_padding":"2px","album_extended_desc_span_border_width":1,"album_extended_desc_span_border_style":"none","album_extended_desc_span_border_color":"CCCCCC","album_extended_desc_font_color":"000000","album_extended_desc_font_style":"segoe ui","album_extended_desc_font_size":14,"album_extended_desc_font_weight":"normal","album_extended_desc_padding":"2px","album_extended_desc_more_color":"FFC933","album_extended_desc_more_size":12,"album_extended_gal_title_font_color":"CCCCCC","album_extended_gal_title_font_style":"segoe ui","album_extended_gal_title_font_size":16,"album_extended_gal_title_font_weight":"bold","album_extended_gal_title_margin":"2px","album_extended_gal_title_shadow":"0px 0px 0px #888888","album_extended_gal_title_align":"center","masonry_thumb_padding":4,"masonry_thumb_border_radius":"2px","masonry_thumb_border_width":1,"masonry_thumb_border_style":"none","masonry_thumb_border_color":"CCCCCC","masonry_thumbs_bg_color":"FFFFFF","masonry_thumb_bg_transparent":0,"masonry_thumb_transparent":80,"masonry_thumb_align":"center","masonry_thumb_hover_effect":"rotate","masonry_thumb_hover_effect_value":"2deg","masonry_thumb_transition":0,"masonry_thumb_gal_title_font_color":"CCCCCC","masonry_thumb_gal_title_font_style":"segoe ui","masonry_thumb_gal_title_font_size":16,"masonry_thumb_gal_title_font_weight":"bold","masonry_thumb_gal_title_margin":"2px","masonry_thumb_gal_title_shadow":"0px 0px 0px #888888","masonry_thumb_gal_title_align":"center","slideshow_cont_bg_color":"000000","slideshow_close_btn_transparent":100,"slideshow_rl_btn_bg_color":"000000","slideshow_rl_btn_border_radius":"20px","slideshow_rl_btn_border_width":0,"slideshow_rl_btn_border_style":"none","slideshow_rl_btn_border_color":"FFFFFF","slideshow_rl_btn_box_shadow":"","slideshow_rl_btn_color":"FFFFFF","slideshow_rl_btn_height":40,"slideshow_rl_btn_size":20,"slideshow_rl_btn_width":40,"slideshow_close_rl_btn_hover_color":"DBDBDB","slideshow_filmstrip_pos":"bottom","slideshow_filmstrip_thumb_border_width":1,"slideshow_filmstrip_thumb_border_style":"none","slideshow_filmstrip_thumb_border_color":"000000","slideshow_filmstrip_thumb_border_radius":"0","slideshow_filmstrip_thumb_margin":"0 1px","slideshow_filmstrip_thumb_active_border_width":0,"slideshow_filmstrip_thumb_active_border_color":"FFFFFF","slideshow_filmstrip_thumb_deactive_transparent":80,"slideshow_filmstrip_rl_bg_color":"303030","slideshow_filmstrip_rl_btn_color":"FFFFFF","slideshow_filmstrip_rl_btn_size":20,"slideshow_title_font_size":16,"slideshow_title_font":"segoe ui","slideshow_title_color":"FFFFFF","slideshow_title_opacity":70,"slideshow_title_border_radius":"5px","slideshow_title_background_color":"000000","slideshow_title_padding":"5px 10px 5px 10px","slideshow_description_font_size":14,"slideshow_description_font":"segoe ui","slideshow_description_color":"FFFFFF","slideshow_description_opacity":70,"slideshow_description_border_radius":"0","slideshow_description_background_color":"000000","slideshow_description_padding":"5px 10px 5px 10px","slideshow_dots_width":10,"slideshow_dots_height":10,"slideshow_dots_border_radius":"10px","slideshow_dots_background_color":"292929","slideshow_dots_margin":1,"slideshow_dots_active_background_color":"292929","slideshow_dots_active_border_width":2,"slideshow_dots_active_border_color":"FFC933","slideshow_play_pause_btn_size":60,"slideshow_rl_btn_style":"fa-chevron","blog_style_margin":"2px","blog_style_padding":"4px","blog_style_border_radius":"0","blog_style_border_width":1,"blog_style_border_style":"none","blog_style_border_color":"CCCCCC","blog_style_bg_color":"E8E8E8","blog_style_transparent":70,"blog_style_box_shadow":"","blog_style_align":"center","blog_style_share_buttons_margin":"5px auto 10px auto","blog_style_share_buttons_border_radius":"0","blog_style_share_buttons_border_width":0,"blog_style_share_buttons_border_style":"none","blog_style_share_buttons_border_color":"000000","blog_style_share_buttons_bg_color":"FFFFFF","blog_style_share_buttons_align":"right","blog_style_img_font_size":16,"blog_style_img_font_family":"segoe ui","blog_style_img_font_color":"000000","blog_style_share_buttons_color":"A1A1A1","blog_style_share_buttons_bg_transparent":0,"blog_style_share_buttons_font_size":20,"blog_style_image_title_align":"top","blog_style_gal_title_font_color":"CCCCCC","blog_style_gal_title_font_style":"segoe ui","blog_style_gal_title_font_size":16,"blog_style_gal_title_font_weight":"bold","blog_style_gal_title_margin":"2px","blog_style_gal_title_shadow":"0px 0px 0px #888888","blog_style_gal_title_align":"center","image_browser_margin":"2px auto","image_browser_padding":"4px","image_browser_border_radius":"2px","image_browser_border_width":1,"image_browser_border_style":"none","image_browser_border_color":"E8E8E8","image_browser_bg_color":"E8E8E8","image_browser_box_shadow":"","image_browser_transparent":80,"image_browser_align":"center","image_browser_image_description_margin":"24px 0px 0px 0px","image_browser_image_description_padding":"8px 8px 8px 8px","image_browser_image_description_border_radius":"0","image_browser_image_description_border_width":1,"image_browser_image_description_border_style":"none","image_browser_image_description_border_color":"FFFFFF","image_browser_image_description_bg_color":"E8E8E8","image_browser_image_description_align":"center","image_browser_img_font_size":14,"image_browser_img_font_family":"segoe ui","image_browser_img_font_color":"000000","image_browser_full_padding":"4px","image_browser_full_border_radius":"0","image_browser_full_border_width":1,"image_browser_full_border_style":"solid","image_browser_full_border_color":"EDEDED","image_browser_full_bg_color":"FFFFFF","image_browser_full_transparent":90,"image_browser_image_title_align":"top","image_browser_gal_title_font_color":"CCCCCC","image_browser_gal_title_font_style":"segoe ui","image_browser_gal_title_font_size":16,"image_browser_gal_title_font_weight":"bold","image_browser_gal_title_margin":"2px","image_browser_gal_title_shadow":"0px 0px 0px #888888","image_browser_gal_title_align":"center","lightbox_info_pos":"top","lightbox_info_align":"right","lightbox_info_bg_color":"000000","lightbox_info_bg_transparent":70,"lightbox_info_border_width":1,"lightbox_info_border_style":"none","lightbox_info_border_color":"000000","lightbox_info_border_radius":"5px","lightbox_info_padding":"5px","lightbox_info_margin":"15px","lightbox_title_color":"FFFFFF","lightbox_title_font_style":"segoe ui","lightbox_title_font_weight":"bold","lightbox_title_font_size":18,"lightbox_description_color":"FFFFFF","lightbox_description_font_style":"segoe ui","lightbox_description_font_weight":"normal","lightbox_description_font_size":14,"lightbox_rate_pos":"bottom","lightbox_rate_align":"right","lightbox_rate_icon":"star","lightbox_rate_color":"F9D062","lightbox_rate_size":20,"lightbox_rate_stars_count":5,"lightbox_rate_padding":"15px","lightbox_rate_hover_color":"F7B50E","lightbox_hit_pos":"bottom","lightbox_hit_align":"left","lightbox_hit_bg_color":"000000","lightbox_hit_bg_transparent":70,"lightbox_hit_border_width":1,"lightbox_hit_border_style":"none","lightbox_hit_border_color":"000000","lightbox_hit_border_radius":"5px","lightbox_hit_padding":"5px","lightbox_hit_margin":"0 5px","lightbox_hit_color":"FFFFFF","lightbox_hit_font_style":"segoe ui","lightbox_hit_font_weight":"normal","lightbox_hit_font_size":14,"masonry_description_font_size":12,"masonry_description_color":"CCCCCC","masonry_description_font_style":"segoe ui","album_masonry_back_font_color":"000000","album_masonry_back_font_style":"segoe ui","album_masonry_back_font_size":14,"album_masonry_back_font_weight":"normal","album_masonry_back_padding":"0","album_masonry_title_font_color":"CCCCCC","album_masonry_title_font_style":"segoe ui","album_masonry_thumb_title_pos":"bottom","album_masonry_title_font_size":16,"album_masonry_title_font_weight":"bold","album_masonry_title_margin":"5px","album_masonry_title_shadow":"","album_masonry_thumb_margin":4,"album_masonry_thumb_padding":4,"album_masonry_thumb_border_radius":"0","album_masonry_thumb_border_width":1,"album_masonry_thumb_border_style":"none","album_masonry_thumb_border_color":"000000","album_masonry_thumb_bg_color":"E8E8E8","album_masonry_thumbs_bg_color":"FFFFFF","album_masonry_thumb_bg_transparent":100,"album_masonry_thumb_box_shadow":"","album_masonry_thumb_transparent":100,"album_masonry_thumb_align":"center","album_masonry_thumb_hover_effect":"rotate","album_masonry_thumb_hover_effect_value":"2deg","album_masonry_thumb_transition":1,"album_masonry_gal_title_font_color":"CCCCCC","album_masonry_gal_title_font_style":"segoe ui","album_masonry_gal_title_font_size":16,"album_masonry_gal_title_font_weight":"bold","album_masonry_gal_title_margin":"2px","album_masonry_gal_title_shadow":"0px 0px 0px #888888","album_masonry_gal_title_align":"center","mosaic_thumb_padding":4,"mosaic_thumb_border_radius":"2px","mosaic_thumb_border_width":1,"mosaic_thumb_border_style":"none","mosaic_thumb_border_color":"CCCCCC","mosaic_thumbs_bg_color":"FFFFFF","mosaic_thumb_bg_transparent":0,"mosaic_thumb_transparent":80,"mosaic_thumb_align":"center","mosaic_thumb_hover_effect":"rotate","mosaic_thumb_hover_effect_value":"2deg","mosaic_thumb_title_font_color":"CCCCCC","mosaic_thumb_title_font_style":"segoe ui","mosaic_thumb_title_font_weight":"bold","mosaic_thumb_title_margin":"2px","mosaic_thumb_title_shadow":"0px 0px 0px #888888","mosaic_thumb_title_font_size":16,"mosaic_thumb_gal_title_font_color":"CCCCCC","mosaic_thumb_gal_title_font_style":"segoe ui","mosaic_thumb_gal_title_font_size":16,"mosaic_thumb_gal_title_font_weight":"bold","mosaic_thumb_gal_title_margin":"2px","mosaic_thumb_gal_title_shadow":"0px 0px 0px #888888","mosaic_thumb_gal_title_align":"center","carousel_cont_bg_color":"000000","carousel_cont_btn_transparent":0,"carousel_close_btn_transparent":100,"carousel_rl_btn_bg_color":"000000","carousel_rl_btn_border_radius":"20px","carousel_rl_btn_border_width":0,"carousel_rl_btn_border_style":"none","carousel_rl_btn_border_color":"FFFFFF","carousel_rl_btn_color":"FFFFFF","carousel_rl_btn_height":40,"carousel_rl_btn_size":20,"carousel_play_pause_btn_size":20,"carousel_rl_btn_width":40,"carousel_close_rl_btn_hover_color":"CCCCCC","carousel_rl_btn_style":"fa-chevron","carousel_mergin_bottom":"0.5","carousel_font_family":"segoe ui","carousel_feature_border_width":2,"carousel_feature_border_style":"solid","carousel_feature_border_color":"5D204F","carousel_caption_background_color":"000000","carousel_caption_bottom":0,"carousel_caption_p_mergin":0,"carousel_caption_p_pedding":5,"carousel_caption_p_font_weight":"bold","carousel_caption_p_font_size":14,"carousel_caption_p_color":"FFFFFF","carousel_title_opacity":100,"carousel_title_border_radius":"5px","mosaic_thumb_transition":1}';
|
134 |
|
135 |
if (!$exists_default) {
|
136 |
$wpdb->insert($wpdb->prefix . 'bwg_theme', array(
|
js/bwg.js
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
jQuery(document).ready(function () {
|
2 |
-
|
3 |
jQuery(document).keyup(function(e) {
|
4 |
if ( e.keyCode == 27 ) {
|
5 |
jQuery('#loading_div').hide();
|
6 |
}
|
7 |
});
|
8 |
-
|
9 |
if ( jQuery("form").hasClass("bwg_galleries") ) {
|
10 |
wd_showhide_weights();
|
11 |
wd_pagination();
|
@@ -15,7 +15,7 @@ jQuery(document).ready(function () {
|
|
15 |
spider_check_all("#check_all");
|
16 |
});
|
17 |
|
18 |
-
|
19 |
if ( typeof jQuery(document).tooltip != "undefined" ) {
|
20 |
jQuery(document).tooltip({
|
21 |
show: null,
|
@@ -32,7 +32,7 @@ jQuery(document).ready(function () {
|
|
32 |
return false;
|
33 |
}
|
34 |
var $id = jQuery(ui.tooltip).attr('id');
|
35 |
-
|
36 |
jQuery('div.ui-tooltip').not('#' + $id).remove();
|
37 |
},
|
38 |
close: function (event, ui) {
|
@@ -81,7 +81,7 @@ jQuery(document).ready(function () {
|
|
81 |
form.submit();
|
82 |
});
|
83 |
|
84 |
-
|
85 |
if (jQuery("form#bwg_options_form").length > 0) {
|
86 |
jQuery(".bwg_tabs").each(function () {
|
87 |
jQuery(this).tabs({
|
@@ -101,7 +101,7 @@ jQuery(document).ready(function () {
|
|
101 |
bwg_album_type_options();
|
102 |
}
|
103 |
|
104 |
-
|
105 |
jQuery('input[name=masonry]').on('click', function(){
|
106 |
if(jQuery(this).val() == 'horizontal') {
|
107 |
jQuery('.masonry_col_num').hide();
|
@@ -112,6 +112,14 @@ jQuery(document).ready(function () {
|
|
112 |
}
|
113 |
});
|
114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
});
|
116 |
|
117 |
jQuery(window).load(function () {
|
@@ -119,7 +127,7 @@ jQuery(window).load(function () {
|
|
119 |
bwg_tb_window();
|
120 |
/* Hide loading */
|
121 |
jQuery('#loading_div.bwg_show').hide();
|
122 |
-
|
123 |
if (jQuery("form").hasClass("bwg_albums")) {
|
124 |
jQuery("#bwg_tabs").sortable({
|
125 |
items: ".connectedSortable",
|
@@ -134,8 +142,7 @@ jQuery(window).load(function () {
|
|
134 |
function bwg_albums_galleries() {
|
135 |
var str = '';
|
136 |
jQuery("#bwg_tabs>.connectedSortable").each(function () {
|
137 |
-
|
138 |
-
str += item.attr('data-id') + ':' + item.attr('data-is-album') + ',';
|
139 |
});
|
140 |
jQuery("#albums_galleries").val(str);
|
141 |
}
|
@@ -149,7 +156,7 @@ function bwg_add_album_gallery(alb_gal_id, is_album, preview_image, name, status
|
|
149 |
var html = jQuery('#bwg_template').html()
|
150 |
.replace(/%%alb_gal_id%%/g, alb_gal_id)
|
151 |
.replace(/%%is_album%%/g, is_album)
|
152 |
-
.replace(/%%preview_image
|
153 |
.replace(/%%name%%/g, name)
|
154 |
.replace(/%%status%%/g, status);
|
155 |
jQuery('#bwg_tabs').children('#bwg_template').last().before(html);
|
@@ -188,46 +195,42 @@ var bwg_save_count = 50;
|
|
188 |
* Save gallery and images.
|
189 |
*
|
190 |
* @param form_id
|
191 |
-
* @param tr_group
|
192 |
* @returns {boolean}
|
193 |
*/
|
194 |
function spider_ajax_save(form_id, tr_group) {
|
195 |
-
if (spider_check_required('name', 'Name')
|
|
|
|
|
196 |
var post_data = {};
|
197 |
-
|
198 |
post_data["task"] = "save";
|
199 |
var ajax_task = jQuery("#ajax_task").val();/* Images list action task.*/
|
200 |
post_data["current_id"] = jQuery("#current_id").val();/* Current gallery id.*/
|
201 |
post_data["image_current_id"] = jQuery("#image_current_id").val();/* Current image id.*/
|
202 |
var ids_string = jQuery("#ids_string").val();/* Images ids separated by comma.*/
|
203 |
post_data["image_bulk_action"] = jQuery("[name=image_bulk_action]").val(); /* Bulk action for images.*/
|
|
|
204 |
post_data["s"] = jQuery("input[name='s']").val();/* Images filter.*/
|
205 |
post_data["paged"] = jQuery("#paged").val();/* Images page number.*/
|
206 |
post_data["bwg_nonce"] = jQuery("#bwg_nonce").val();/* Nonce*/
|
207 |
-
post_data["image_pricelist_id"] = jQuery("#image_pricelist_id").val();
|
208 |
-
post_data["remove_pricelist"] = jQuery("#remove_pricelist").val();
|
209 |
|
210 |
-
|
211 |
var ids_array = ids_string.split(",");
|
212 |
-
|
213 |
var tr_count = ids_array.length;
|
214 |
|
215 |
if (!tr_group) {
|
216 |
var tr_group = 1;
|
217 |
}
|
218 |
-
else if ((tr_count > bwg_save_count * tr_group)) {
|
219 |
-
ajax_task = '';
|
220 |
-
}
|
221 |
|
222 |
-
/* Selected images
|
223 |
-
post_data["
|
224 |
-
|
225 |
-
|
226 |
-
//}
|
227 |
-
}).get();
|
228 |
-
post_data["check_all_items"] = jQuery("[name=check_all_items]").is(":checked") ? 1 : 0; /* Select all.*/
|
229 |
|
230 |
-
|
231 |
post_data["name"] = jQuery("#name").val();
|
232 |
post_data["slug"] = jQuery("#slug").val();
|
233 |
post_data["old_slug"] = jQuery("#old_slug").val();
|
@@ -252,7 +255,7 @@ function spider_ajax_save(form_id, tr_group) {
|
|
252 |
post_data["instagram_post_gallery"] = gallery_content_type;
|
253 |
post_data["modified_date"] = jQuery("#modified_date").val();
|
254 |
|
255 |
-
|
256 |
if (tr_count > bwg_save_count) {
|
257 |
ids_array.splice(tr_group * bwg_save_count, ids_array.length);
|
258 |
ids_array.splice(0, (tr_group - 1) * bwg_save_count);
|
@@ -262,22 +265,22 @@ function spider_ajax_save(form_id, tr_group) {
|
|
262 |
post_data["ajax_task"] = ajax_task;
|
263 |
post_data["ids_string"] = ids_string;
|
264 |
|
265 |
-
|
266 |
post_data["image_width"] = jQuery("#image_width").val();
|
267 |
post_data["image_height"] = jQuery("#image_height").val();
|
268 |
-
|
269 |
post_data["title"] = jQuery("#title").val();
|
270 |
post_data["desc"] = jQuery("#desc").val();
|
271 |
post_data["redirecturl"] = jQuery("#redirecturl").val();
|
272 |
-
|
273 |
post_data["added_tags_id"] = jQuery("#added_tags_id").val();
|
274 |
|
275 |
-
|
276 |
for (var i in ids_array) {
|
277 |
if (ids_array.hasOwnProperty(i) && ids_array[i]) {
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
post_data["input_filename_" + ids_array[i]] = jQuery("#input_filename_" + ids_array[i]).val();
|
282 |
post_data["image_url_" + ids_array[i]] = jQuery("#image_url_" + ids_array[i]).val();
|
283 |
post_data["thumb_url_" + ids_array[i]] = jQuery("#thumb_url_" + ids_array[i]).val();
|
@@ -294,7 +297,7 @@ function spider_ajax_save(form_id, tr_group) {
|
|
294 |
}
|
295 |
}
|
296 |
|
297 |
-
|
298 |
jQuery("#loading_div").show();
|
299 |
|
300 |
jQuery.post(
|
@@ -313,20 +316,19 @@ function spider_ajax_save(form_id, tr_group) {
|
|
313 |
else {
|
314 |
var form_action = jQuery(data).find('#bwg_gallery').attr("action");
|
315 |
jQuery('#bwg_gallery').attr("action", form_action);
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
|
|
|
|
320 |
var str = jQuery(data).find('.bwg-page-header').html();
|
321 |
jQuery('.bwg-page-header').html(str);
|
322 |
-
var str = jQuery(data).find('.wd-howtouse-cont').html();
|
323 |
-
jQuery('.wd-howtouse-cont').html(str);
|
324 |
var str = jQuery(data).find('.ajax-msg').html();
|
325 |
jQuery('.ajax-msg').html(str);
|
|
|
326 |
var str = jQuery(data).find('.gal-msg').html();
|
327 |
jQuery('.gal-msg').html(str);
|
328 |
-
var str = jQuery(data).find('.search-box').html();
|
329 |
-
jQuery('.search-box').html(str);
|
330 |
var str = jQuery(data).find('.tablenav.top').html();
|
331 |
jQuery('.tablenav.top').html(str);
|
332 |
var str = jQuery(data).find('#images_table').html();
|
@@ -340,38 +342,48 @@ function spider_ajax_save(form_id, tr_group) {
|
|
340 |
var str = jQuery(data).find('#current_id').html();
|
341 |
jQuery('#current_id').html(str);
|
342 |
|
343 |
-
|
|
|
|
|
344 |
jQuery(".gal-msg").removeClass("wd-hide");
|
345 |
|
346 |
jQuery(".unsaved-msg").addClass("wd-hide");
|
347 |
|
348 |
wd_showhide_weights();
|
349 |
wd_pagination();
|
350 |
-
|
351 |
-
jQuery(".how_to_postbox .hndle").each(function () {
|
352 |
-
jQuery(this).on("click", function () {
|
353 |
-
jQuery(this).parent(".postbox").toggleClass("closed");
|
354 |
-
});
|
355 |
-
});
|
356 |
|
357 |
jQuery("#check_all").on("click", function () {
|
358 |
spider_check_all("#check_all");
|
359 |
});
|
360 |
jQuery("#loading_div").hide();
|
|
|
361 |
}
|
362 |
});
|
363 |
|
364 |
return false;
|
365 |
}
|
366 |
|
367 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
368 |
function spider_set_input_value(input_id, input_value) {
|
369 |
if (document.getElementById(input_id)) {
|
370 |
document.getElementById(input_id).value = input_value;
|
371 |
}
|
372 |
}
|
373 |
|
374 |
-
|
375 |
function spider_form_submit(event, form_id) {
|
376 |
if (document.getElementById(form_id)) {
|
377 |
document.getElementById(form_id).submit();
|
@@ -384,7 +396,7 @@ function spider_form_submit(event, form_id) {
|
|
384 |
}
|
385 |
}
|
386 |
|
387 |
-
|
388 |
function spider_check_required(id, name) {
|
389 |
if (jQuery('#' + id).val() == '') {
|
390 |
alert(name + '* ' + bwg_objectL10B.bwg_field_required);
|
@@ -409,12 +421,18 @@ function wd_showhide_weights(click) {
|
|
409 |
if ( typeof click == "undefined" ) {
|
410 |
var click = false;
|
411 |
}
|
412 |
-
if (
|
413 |
-
|
414 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
415 |
}
|
416 |
|
417 |
-
if ( !jQuery(".wd-drag").hasClass("wd-hide") ) {
|
418 |
jQuery(".wd-order-thead").attr("title", bwg_objectL10B.bwg_show_order);
|
419 |
jQuery("#tbody_arr").sortable({
|
420 |
handle: ".connectedSortable",
|
@@ -429,7 +447,7 @@ function wd_showhide_weights(click) {
|
|
429 |
}
|
430 |
});
|
431 |
}
|
432 |
-
else {
|
433 |
jQuery(".wd-order-thead").attr("title", bwg_objectL10B.bwg_hide_order);
|
434 |
}
|
435 |
}
|
@@ -445,7 +463,7 @@ function wd_showhide_weights(click) {
|
|
445 |
}
|
446 |
});*/
|
447 |
|
448 |
-
|
449 |
function spider_check_all_items(event) {
|
450 |
if (jQuery("#check_all_items").is(':checked')) {
|
451 |
jQuery("#check_all_items").attr('checked', false);
|
@@ -458,21 +476,21 @@ function spider_check_all_items(event) {
|
|
458 |
|
459 |
function spider_check_all_items_checkbox(event) {
|
460 |
if (jQuery("#check_all_items").is(':checked')) {
|
461 |
-
|
462 |
-
if (!jQuery("#check_all").is(':checked')) {
|
463 |
-
jQuery('#check_all').trigger('click');
|
464 |
-
}
|
465 |
-
}
|
466 |
-
else {
|
467 |
var saved_items = (parseInt(jQuery(".displaying-num").html()) ? parseInt(jQuery(".displaying-num").html()) : 0);
|
468 |
var added_items = (jQuery('input[id^="check_pr_"]').length ? parseInt(jQuery('input[id^="check_pr_"]').length) : 0);
|
469 |
var items_count = added_items + saved_items;
|
470 |
-
|
471 |
-
if (items_count) {
|
472 |
jQuery(".ajax-msg")
|
473 |
-
.html("<div class='
|
474 |
.removeClass("wd-hide");
|
475 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
476 |
if (jQuery("#check_all").is(':checked')) {
|
477 |
jQuery('#check_all').trigger('click');
|
478 |
}
|
@@ -483,11 +501,11 @@ function spider_check_all_items_checkbox(event) {
|
|
483 |
function spider_check_all(current) {
|
484 |
if (!jQuery(current).attr('checked')) {
|
485 |
jQuery('#check_all_items').attr('checked', false);
|
486 |
-
jQuery(".ajax-msg").hide
|
487 |
}
|
488 |
}
|
489 |
|
490 |
-
|
491 |
function spider_uploader(button_id, input_id, delete_id, img_id) {
|
492 |
if (typeof img_id == 'undefined') {
|
493 |
img_id = '';
|
@@ -554,7 +572,7 @@ function spider_uploader(button_id, input_id, delete_id, img_id) {
|
|
554 |
});
|
555 |
}
|
556 |
|
557 |
-
|
558 |
function spider_remove_url(button_id, input_id, delete_id, img_id) {
|
559 |
if (typeof img_id == 'undefined') {
|
560 |
img_id = '';
|
@@ -575,7 +593,7 @@ function spider_remove_url(button_id, input_id, delete_id, img_id) {
|
|
575 |
}
|
576 |
}
|
577 |
|
578 |
-
|
579 |
function bwg_add_preview_image(files) {
|
580 |
document.getElementById("preview_image").value = files[0]['thumb_url'];
|
581 |
document.getElementById("button_preview_image").style.display = "none";
|
@@ -680,7 +698,7 @@ function bwg_add_tags(image_id) {
|
|
680 |
*/
|
681 |
function bwg_add_tag(image_id, tagIds, titles) {
|
682 |
window.parent.bwg_create_loading_block();
|
683 |
-
|
684 |
var ids_array;
|
685 |
if (image_id == '0') {
|
686 |
var flag = false;
|
@@ -708,7 +726,7 @@ function bwg_add_tag(image_id, tagIds, titles) {
|
|
708 |
tags_array = tag_ids.split(',');
|
709 |
var counter = 0;
|
710 |
for (i = 0; i < tagIds.length; i++) {
|
711 |
-
if (tags_array.indexOf(tagIds[i]) == -1) {
|
712 |
tag_ids = tag_ids + tagIds[i] + ',';
|
713 |
var html = jQuery("#" + image_id + "_tag_temptagid").clone().html();
|
714 |
html = html.replace(/temptagid/g, tagIds[i])
|
@@ -1018,7 +1036,7 @@ function bwg_change_gallery_type(type_to_set, warning_type, instagram_client_id)
|
|
1018 |
jQuery('#tr_update_flag').hide();
|
1019 |
jQuery('#tr_autogallery_image_number').hide();
|
1020 |
jQuery('#tr_instagram_gallery_add_button').hide();
|
1021 |
-
|
1022 |
jQuery("#facebook_gallery_image_limit").val(20);
|
1023 |
}
|
1024 |
else {
|
@@ -1201,7 +1219,7 @@ function bwg_get_embed_info(input_id) {
|
|
1201 |
};
|
1202 |
|
1203 |
|
1204 |
-
|
1205 |
jQuery.post(ajax_url, data, function(response) {
|
1206 |
if(response == false){
|
1207 |
alert(bwg_objectL10B.bwg_cannot_response);
|
@@ -1270,7 +1288,7 @@ function spider_media_uploader(e, multiple) {
|
|
1270 |
}
|
1271 |
var custom_uploader;
|
1272 |
e.preventDefault();
|
1273 |
-
|
1274 |
if ( custom_uploader ) {
|
1275 |
custom_uploader.open();
|
1276 |
}
|
@@ -1281,7 +1299,7 @@ function spider_media_uploader(e, multiple) {
|
|
1281 |
button: { text: bwg_objectL10B.insert },
|
1282 |
multiple: multiple
|
1283 |
} );
|
1284 |
-
|
1285 |
custom_uploader.on( 'select', function () {
|
1286 |
if ( multiple == false ) {
|
1287 |
attachment = custom_uploader.state().get( 'selection' ).first().toJSON();
|
@@ -1300,9 +1318,12 @@ function spider_media_uploader(e, multiple) {
|
|
1300 |
|
1301 |
postImageUrls(filesSelectedML, function (success, result) {
|
1302 |
jQuery( '#loading_div' ).hide();
|
1303 |
-
|
1304 |
if (success) {
|
|
|
1305 |
for ( var i in result ) {
|
|
|
|
|
|
|
1306 |
result[i].alt = attachment[i].alt ? attachment[i].alt : attachment[i].title;
|
1307 |
result[i].description = attachment[i].description;
|
1308 |
}
|
@@ -1351,10 +1372,21 @@ function spider_media_uploader(e, multiple) {
|
|
1351 |
}
|
1352 |
} );
|
1353 |
|
1354 |
-
|
1355 |
custom_uploader.open();
|
1356 |
}
|
1357 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1358 |
/**
|
1359 |
* Search.
|
1360 |
*
|
@@ -1363,7 +1395,7 @@ function spider_media_uploader(e, multiple) {
|
|
1363 |
function search(that) {
|
1364 |
var form = jQuery(that).parents("form");
|
1365 |
|
1366 |
-
if ( form.attr("id") == "bwg_gallery" ) {
|
1367 |
jQuery("#paged").val(1);
|
1368 |
jQuery("#ajax_task").val('ajax_apply');
|
1369 |
spider_ajax_save(form.attr("id"));
|
@@ -1371,7 +1403,6 @@ function search(that) {
|
|
1371 |
else {
|
1372 |
var action = form.attr("action");
|
1373 |
form.attr("action", action + "&paged=1&s=" + jQuery("input[name='s']").val());
|
1374 |
-
|
1375 |
form.submit();
|
1376 |
}
|
1377 |
}
|
@@ -1404,7 +1435,7 @@ function input_pagination(e, that) {
|
|
1404 |
var to_page = jQuery(that).val();
|
1405 |
var pages_count = jQuery(that).parents(".pagination-links").data("pages-count");
|
1406 |
var form = jQuery(that).parents("form");
|
1407 |
-
if ( form.attr("id") == "bwg_gallery" ) {
|
1408 |
if (to_page > pages_count) {
|
1409 |
to_page = 1;
|
1410 |
}
|
@@ -1465,7 +1496,7 @@ function wd_bulk_action(that) {
|
|
1465 |
return false;
|
1466 |
}
|
1467 |
}
|
1468 |
-
if ( form.attr("id") == "bwg_gallery" ) {
|
1469 |
jQuery("input[name='task']").val("save");
|
1470 |
jQuery("input[name='ajax_task']").val(action);
|
1471 |
spider_ajax_save(form.attr("id"));
|
@@ -1510,7 +1541,7 @@ function bwg_updateQueryStringParameter(uri, key, value) {
|
|
1510 |
}
|
1511 |
}
|
1512 |
|
1513 |
-
|
1514 |
function bwg_toggle_postbox() {
|
1515 |
jQuery(".hndle, .handlediv").each(function () {
|
1516 |
jQuery(this).on("click", function () {
|
@@ -1524,13 +1555,6 @@ function spider_select_value(obj) {
|
|
1524 |
obj.select();
|
1525 |
}
|
1526 |
|
1527 |
-
function how_to_use() {
|
1528 |
-
jQuery(".how_to_postbox").removeClass("closed");
|
1529 |
-
jQuery('html, body').animate({
|
1530 |
-
scrollTop: jQuery(".how_to_postbox").offset().top - 40
|
1531 |
-
}, 300);
|
1532 |
-
}
|
1533 |
-
|
1534 |
var j_int = 0;
|
1535 |
var bwg_j = 'pr_' + j_int;
|
1536 |
|
@@ -1540,15 +1564,17 @@ var bwg_j = 'pr_' + j_int;
|
|
1540 |
* @param files
|
1541 |
*/
|
1542 |
function bwg_add_image(files) {
|
1543 |
-
|
1544 |
-
//jQuery(document).trigger("bwgImagesAdded");
|
1545 |
for ( var i in files ) {
|
|
|
|
|
|
|
1546 |
var is_embed = files[i]['filetype'].indexOf("EMBED_") > -1 ? true : false;
|
1547 |
var is_direct_url = files[i]['filetype'].indexOf("DIRECT_URL_") > -1 ? true : false;
|
1548 |
var is_facebook_post = files[i]['filetype'].indexOf("_FACEBOOK_POST") > -1 ? 1 : 0;
|
1549 |
var fb_post_url = (is_facebook_post) ? files[i]['filename'] : '';
|
1550 |
-
|
1551 |
-
|
1552 |
|
1553 |
var html = jQuery(".wd-template").clone().html();
|
1554 |
html = html.replace(/tempid/g, bwg_j)
|
@@ -1593,14 +1619,14 @@ function bwg_add_image(files) {
|
|
1593 |
j_int++;
|
1594 |
bwg_j = 'pr_' + j_int;
|
1595 |
}
|
1596 |
-
|
1597 |
wd_showhide_weights();
|
1598 |
-
|
1599 |
var i = jQuery("td.col_drag").data("page-number");
|
1600 |
jQuery(".wd-order").each(function () {
|
1601 |
jQuery(this).val(++i);
|
1602 |
});
|
1603 |
-
|
1604 |
var i = 0;
|
1605 |
jQuery("#tbody_arr .col_num").each(function () {
|
1606 |
jQuery(this).html(++i);
|
@@ -1608,6 +1634,7 @@ function bwg_add_image(files) {
|
|
1608 |
window.parent.jQuery(".no-items").remove();
|
1609 |
jQuery(".unsaved-msg", window.parent.document).removeClass("wd-hide");
|
1610 |
jQuery(".ajax-msg", window.parent.document).addClass("wd-hide");
|
|
|
1611 |
}
|
1612 |
|
1613 |
/**
|
@@ -1672,21 +1699,21 @@ function bwg_tb_window(id) {
|
|
1672 |
text = jQuery(this).attr('title') || '';
|
1673 |
link = ' <span class="tb-theme-preview-link">' + text + '</span>';
|
1674 |
}
|
1675 |
-
|
1676 |
jQuery('#TB_closeAjaxWindow').css({'float': 'right'});
|
1677 |
jQuery('#TB_ajaxWindowTitle').css({'float': 'left'}).html(link);
|
1678 |
jQuery('#TB_iframeContent').width('100%');
|
1679 |
thickDims();
|
1680 |
return false;
|
1681 |
});
|
1682 |
-
|
1683 |
jQuery('.theme-detail').click(function () {
|
1684 |
jQuery(this).siblings('.themedetaildiv').toggle();
|
1685 |
return false;
|
1686 |
});
|
1687 |
}
|
1688 |
|
1689 |
-
|
1690 |
function prevent_new_line(e) {
|
1691 |
if ( e.keyCode == 13 ) {
|
1692 |
e.preventDefault();
|
@@ -1708,7 +1735,8 @@ function bwg_gallery_type_options(gallery_type) {
|
|
1708 |
jQuery(".wd-free-msg").show();
|
1709 |
}
|
1710 |
}
|
1711 |
-
jQuery('
|
|
|
1712 |
}
|
1713 |
|
1714 |
function bwg_album_type_options(album_type) {
|
@@ -1725,7 +1753,8 @@ function bwg_album_type_options(album_type) {
|
|
1725 |
jQuery(".wd-free-msg").show();
|
1726 |
}
|
1727 |
}
|
1728 |
-
jQuery('
|
|
|
1729 |
}
|
1730 |
|
1731 |
function bwg_pagination_description(that) {
|
@@ -1741,4 +1770,133 @@ function bwg_thumb_click_action( ) {
|
|
1741 |
else {
|
1742 |
jQuery('.bwg-lightbox-redirect').hide();
|
1743 |
}
|
1744 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
jQuery(document).ready(function () {
|
2 |
+
/* press ESC hide loading. */
|
3 |
jQuery(document).keyup(function(e) {
|
4 |
if ( e.keyCode == 27 ) {
|
5 |
jQuery('#loading_div').hide();
|
6 |
}
|
7 |
});
|
8 |
+
/* Galleries form. */
|
9 |
if ( jQuery("form").hasClass("bwg_galleries") ) {
|
10 |
wd_showhide_weights();
|
11 |
wd_pagination();
|
15 |
spider_check_all("#check_all");
|
16 |
});
|
17 |
|
18 |
+
/* Add tooltip to elements with "wd-info" class. */
|
19 |
if ( typeof jQuery(document).tooltip != "undefined" ) {
|
20 |
jQuery(document).tooltip({
|
21 |
show: null,
|
32 |
return false;
|
33 |
}
|
34 |
var $id = jQuery(ui.tooltip).attr('id');
|
35 |
+
/* close any lingering tooltips. */
|
36 |
jQuery('div.ui-tooltip').not('#' + $id).remove();
|
37 |
},
|
38 |
close: function (event, ui) {
|
81 |
form.submit();
|
82 |
});
|
83 |
|
84 |
+
/* Options form. */
|
85 |
if (jQuery("form#bwg_options_form").length > 0) {
|
86 |
jQuery(".bwg_tabs").each(function () {
|
87 |
jQuery(this).tabs({
|
101 |
bwg_album_type_options();
|
102 |
}
|
103 |
|
104 |
+
/* Changing label Number of image rows to columns in masonry view. */
|
105 |
jQuery('input[name=masonry]').on('click', function(){
|
106 |
if(jQuery(this).val() == 'horizontal') {
|
107 |
jQuery('.masonry_col_num').hide();
|
112 |
}
|
113 |
});
|
114 |
|
115 |
+
jQuery( '#bwg_image_editor_notice .notice-dismiss' ).on( 'click', function() {
|
116 |
+
var dismiss_url = bwg_ajax_url + '=' + jQuery('#bwg_image_editor_notice').data('action');
|
117 |
+
jQuery.ajax({
|
118 |
+
method: "POST",
|
119 |
+
url: dismiss_url,
|
120 |
+
});
|
121 |
+
} );
|
122 |
+
|
123 |
});
|
124 |
|
125 |
jQuery(window).load(function () {
|
127 |
bwg_tb_window();
|
128 |
/* Hide loading */
|
129 |
jQuery('#loading_div.bwg_show').hide();
|
130 |
+
/* Albums form. */
|
131 |
if (jQuery("form").hasClass("bwg_albums")) {
|
132 |
jQuery("#bwg_tabs").sortable({
|
133 |
items: ".connectedSortable",
|
142 |
function bwg_albums_galleries() {
|
143 |
var str = '';
|
144 |
jQuery("#bwg_tabs>.connectedSortable").each(function () {
|
145 |
+
str += jQuery(this).data('id') + ':' + jQuery(this).data('is-album') + ',';
|
|
|
146 |
});
|
147 |
jQuery("#albums_galleries").val(str);
|
148 |
}
|
156 |
var html = jQuery('#bwg_template').html()
|
157 |
.replace(/%%alb_gal_id%%/g, alb_gal_id)
|
158 |
.replace(/%%is_album%%/g, is_album)
|
159 |
+
.replace(/%%preview_image%%=""/g, 'style="background-image:url("' + preview_image + '")"')
|
160 |
.replace(/%%name%%/g, name)
|
161 |
.replace(/%%status%%/g, status);
|
162 |
jQuery('#bwg_tabs').children('#bwg_template').last().before(html);
|
195 |
* Save gallery and images.
|
196 |
*
|
197 |
* @param form_id
|
198 |
+
* @param tr_group Save counter.
|
199 |
* @returns {boolean}
|
200 |
*/
|
201 |
function spider_ajax_save(form_id, tr_group) {
|
202 |
+
if (spider_check_required('name', 'Name')) {
|
203 |
+
return false;
|
204 |
+
}
|
205 |
var post_data = {};
|
|
|
206 |
post_data["task"] = "save";
|
207 |
var ajax_task = jQuery("#ajax_task").val();/* Images list action task.*/
|
208 |
post_data["current_id"] = jQuery("#current_id").val();/* Current gallery id.*/
|
209 |
post_data["image_current_id"] = jQuery("#image_current_id").val();/* Current image id.*/
|
210 |
var ids_string = jQuery("#ids_string").val();/* Images ids separated by comma.*/
|
211 |
post_data["image_bulk_action"] = jQuery("[name=image_bulk_action]").val(); /* Bulk action for images.*/
|
212 |
+
post_data["order_by"] = jQuery("select[name='order_by']").val();/* Images sorting.*/
|
213 |
post_data["s"] = jQuery("input[name='s']").val();/* Images filter.*/
|
214 |
post_data["paged"] = jQuery("#paged").val();/* Images page number.*/
|
215 |
post_data["bwg_nonce"] = jQuery("#bwg_nonce").val();/* Nonce*/
|
216 |
+
post_data["image_pricelist_id"] = jQuery("#image_pricelist_id").val();
|
217 |
+
post_data["remove_pricelist"] = jQuery("#remove_pricelist").val();
|
218 |
|
219 |
+
/* Images ids array. */
|
220 |
var ids_array = ids_string.split(",");
|
221 |
+
/* Images count on page. */
|
222 |
var tr_count = ids_array.length;
|
223 |
|
224 |
if (!tr_group) {
|
225 |
var tr_group = 1;
|
226 |
}
|
|
|
|
|
|
|
227 |
|
228 |
+
/* Selected images count for message.*/
|
229 |
+
post_data["checked_items_count"] = jQuery("[name^=check]:not([id=check_all_items]):checked").length;
|
230 |
+
/* Select all.*/
|
231 |
+
post_data["check_all_items"] = jQuery("[name=check_all_items]").is(":checked") ? 1 : 0;
|
|
|
|
|
|
|
232 |
|
233 |
+
/* Gallery paramters. */
|
234 |
post_data["name"] = jQuery("#name").val();
|
235 |
post_data["slug"] = jQuery("#slug").val();
|
236 |
post_data["old_slug"] = jQuery("#old_slug").val();
|
255 |
post_data["instagram_post_gallery"] = gallery_content_type;
|
256 |
post_data["modified_date"] = jQuery("#modified_date").val();
|
257 |
|
258 |
+
/* Remove images ids from begin and end of array. */
|
259 |
if (tr_count > bwg_save_count) {
|
260 |
ids_array.splice(tr_group * bwg_save_count, ids_array.length);
|
261 |
ids_array.splice(0, (tr_group - 1) * bwg_save_count);
|
265 |
post_data["ajax_task"] = ajax_task;
|
266 |
post_data["ids_string"] = ids_string;
|
267 |
|
268 |
+
/* Images dimensions to resize. */
|
269 |
post_data["image_width"] = jQuery("#image_width").val();
|
270 |
post_data["image_height"] = jQuery("#image_height").val();
|
271 |
+
/* Images bulk edit values. */
|
272 |
post_data["title"] = jQuery("#title").val();
|
273 |
post_data["desc"] = jQuery("#desc").val();
|
274 |
post_data["redirecturl"] = jQuery("#redirecturl").val();
|
275 |
+
/* Images bulk add tags ids. */
|
276 |
post_data["added_tags_id"] = jQuery("#added_tags_id").val();
|
277 |
|
278 |
+
/* Images data. */
|
279 |
for (var i in ids_array) {
|
280 |
if (ids_array.hasOwnProperty(i) && ids_array[i]) {
|
281 |
+
if ( jQuery("#check_" + ids_array[i]).attr('checked') == 'checked' ) {
|
282 |
+
post_data["check_" + ids_array[i]] = true; /* jQuery("#check_" + ids_array[i]).val(); */
|
283 |
+
}
|
284 |
post_data["input_filename_" + ids_array[i]] = jQuery("#input_filename_" + ids_array[i]).val();
|
285 |
post_data["image_url_" + ids_array[i]] = jQuery("#image_url_" + ids_array[i]).val();
|
286 |
post_data["thumb_url_" + ids_array[i]] = jQuery("#thumb_url_" + ids_array[i]).val();
|
297 |
}
|
298 |
}
|
299 |
|
300 |
+
/* Loading. */
|
301 |
jQuery("#loading_div").show();
|
302 |
|
303 |
jQuery.post(
|
316 |
else {
|
317 |
var form_action = jQuery(data).find('#bwg_gallery').attr("action");
|
318 |
jQuery('#bwg_gallery').attr("action", form_action);
|
319 |
+
/*
|
320 |
+
var str = jQuery(data).find('#bwg_gallery').html();
|
321 |
+
jQuery('#bwg_gallery').html(str);
|
322 |
+
var current_id = jQuery(data).find("#current_id").val();
|
323 |
+
window.history.pushState(null, null, window.location.href + '¤t_id=' + current_id);
|
324 |
+
*/
|
325 |
var str = jQuery(data).find('.bwg-page-header').html();
|
326 |
jQuery('.bwg-page-header').html(str);
|
|
|
|
|
327 |
var str = jQuery(data).find('.ajax-msg').html();
|
328 |
jQuery('.ajax-msg').html(str);
|
329 |
+
jQuery(".ajax-msg").addClass("wd-hide");
|
330 |
var str = jQuery(data).find('.gal-msg').html();
|
331 |
jQuery('.gal-msg').html(str);
|
|
|
|
|
332 |
var str = jQuery(data).find('.tablenav.top').html();
|
333 |
jQuery('.tablenav.top').html(str);
|
334 |
var str = jQuery(data).find('#images_table').html();
|
342 |
var str = jQuery(data).find('#current_id').html();
|
343 |
jQuery('#current_id').html(str);
|
344 |
|
345 |
+
if ( ajax_task != '' ) {
|
346 |
+
jQuery(".ajax-msg").removeClass("wd-hide");
|
347 |
+
}
|
348 |
jQuery(".gal-msg").removeClass("wd-hide");
|
349 |
|
350 |
jQuery(".unsaved-msg").addClass("wd-hide");
|
351 |
|
352 |
wd_showhide_weights();
|
353 |
wd_pagination();
|
354 |
+
/* bwg_toggle_postbox();*/
|
|
|
|
|
|
|
|
|
|
|
355 |
|
356 |
jQuery("#check_all").on("click", function () {
|
357 |
spider_check_all("#check_all");
|
358 |
});
|
359 |
jQuery("#loading_div").hide();
|
360 |
+
wd_howto_src_change();
|
361 |
}
|
362 |
});
|
363 |
|
364 |
return false;
|
365 |
}
|
366 |
|
367 |
+
function bwg_sort_images(sorting) {
|
368 |
+
var msg = jQuery('.sorting-msg');
|
369 |
+
if (sorting != 'order_asc') {
|
370 |
+
msg.removeClass('wd-hide');
|
371 |
+
}
|
372 |
+
else {
|
373 |
+
msg.addClass('wd-hide');
|
374 |
+
}
|
375 |
+
spider_set_input_value('task', '');
|
376 |
+
spider_ajax_save('galleries_form');
|
377 |
+
}
|
378 |
+
|
379 |
+
/* Set value by id. */
|
380 |
function spider_set_input_value(input_id, input_value) {
|
381 |
if (document.getElementById(input_id)) {
|
382 |
document.getElementById(input_id).value = input_value;
|
383 |
}
|
384 |
}
|
385 |
|
386 |
+
/* Submit form by id. */
|
387 |
function spider_form_submit(event, form_id) {
|
388 |
if (document.getElementById(form_id)) {
|
389 |
document.getElementById(form_id).submit();
|
396 |
}
|
397 |
}
|
398 |
|
399 |
+
/* Check if required field is empty. */
|
400 |
function spider_check_required(id, name) {
|
401 |
if (jQuery('#' + id).val() == '') {
|
402 |
alert(name + '* ' + bwg_objectL10B.bwg_field_required);
|
421 |
if ( typeof click == "undefined" ) {
|
422 |
var click = false;
|
423 |
}
|
424 |
+
if (jQuery("select[name='order_by']").val() == 'order_asc') {
|
425 |
+
if ( click ) {
|
426 |
+
jQuery( ".wd-order" ).toggleClass( "wd-hide" );
|
427 |
+
jQuery( ".wd-drag" ).toggleClass( "wd-hide" );
|
428 |
+
}
|
429 |
+
}
|
430 |
+
else {
|
431 |
+
jQuery( ".wd-order" ).removeClass( "wd-hide" );
|
432 |
+
jQuery( ".wd-drag" ).addClass( "wd-hide" );
|
433 |
}
|
434 |
|
435 |
+
if ( !jQuery(".wd-drag").hasClass("wd-hide") ) { /* Drag and drop. */
|
436 |
jQuery(".wd-order-thead").attr("title", bwg_objectL10B.bwg_show_order);
|
437 |
jQuery("#tbody_arr").sortable({
|
438 |
handle: ".connectedSortable",
|
447 |
}
|
448 |
});
|
449 |
}
|
450 |
+
else { /* Order inputs. */
|
451 |
jQuery(".wd-order-thead").attr("title", bwg_objectL10B.bwg_hide_order);
|
452 |
}
|
453 |
}
|
463 |
}
|
464 |
});*/
|
465 |
|
466 |
+
/* Check all items. */
|
467 |
function spider_check_all_items(event) {
|
468 |
if (jQuery("#check_all_items").is(':checked')) {
|
469 |
jQuery("#check_all_items").attr('checked', false);
|
476 |
|
477 |
function spider_check_all_items_checkbox(event) {
|
478 |
if (jQuery("#check_all_items").is(':checked')) {
|
479 |
+
/* Generate message about how many images are selected. */
|
|
|
|
|
|
|
|
|
|
|
480 |
var saved_items = (parseInt(jQuery(".displaying-num").html()) ? parseInt(jQuery(".displaying-num").html()) : 0);
|
481 |
var added_items = (jQuery('input[id^="check_pr_"]').length ? parseInt(jQuery('input[id^="check_pr_"]').length) : 0);
|
482 |
var items_count = added_items + saved_items;
|
483 |
+
if ( items_count ) {
|
|
|
484 |
jQuery(".ajax-msg")
|
485 |
+
.html("<div class='notice notice-warning'><p><strong>" + (items_count == 1 ? bwg_objectL10B.selected_item : bwg_objectL10B.selected_items).replace("%d", items_count) + "</strong></p></div>")
|
486 |
.removeClass("wd-hide");
|
487 |
}
|
488 |
+
|
489 |
+
if (!jQuery("#check_all").is(':checked')) {
|
490 |
+
jQuery('#check_all').trigger('click');
|
491 |
+
}
|
492 |
+
}
|
493 |
+
else {
|
494 |
if (jQuery("#check_all").is(':checked')) {
|
495 |
jQuery('#check_all').trigger('click');
|
496 |
}
|
501 |
function spider_check_all(current) {
|
502 |
if (!jQuery(current).attr('checked')) {
|
503 |
jQuery('#check_all_items').attr('checked', false);
|
504 |
+
jQuery(".ajax-msg").addClass("wd-hide");
|
505 |
}
|
506 |
}
|
507 |
|
508 |
+
/* Set uploader to button class. */
|
509 |
function spider_uploader(button_id, input_id, delete_id, img_id) {
|
510 |
if (typeof img_id == 'undefined') {
|
511 |
img_id = '';
|
572 |
});
|
573 |
}
|
574 |
|
575 |
+
/* Remove uploaded file. */
|
576 |
function spider_remove_url(button_id, input_id, delete_id, img_id) {
|
577 |
if (typeof img_id == 'undefined') {
|
578 |
img_id = '';
|
593 |
}
|
594 |
}
|
595 |
|
596 |
+
/* Add album preview image. */
|
597 |
function bwg_add_preview_image(files) {
|
598 |
document.getElementById("preview_image").value = files[0]['thumb_url'];
|
599 |
document.getElementById("button_preview_image").style.display = "none";
|
698 |
*/
|
699 |
function bwg_add_tag(image_id, tagIds, titles) {
|
700 |
window.parent.bwg_create_loading_block();
|
701 |
+
/* Images ids array. */
|
702 |
var ids_array;
|
703 |
if (image_id == '0') {
|
704 |
var flag = false;
|
726 |
tags_array = tag_ids.split(',');
|
727 |
var counter = 0;
|
728 |
for (i = 0; i < tagIds.length; i++) {
|
729 |
+
if (tags_array.indexOf(tagIds[i]) == -1) { /* To prevent add same tag multiple times. */
|
730 |
tag_ids = tag_ids + tagIds[i] + ',';
|
731 |
var html = jQuery("#" + image_id + "_tag_temptagid").clone().html();
|
732 |
html = html.replace(/temptagid/g, tagIds[i])
|
1036 |
jQuery('#tr_update_flag').hide();
|
1037 |
jQuery('#tr_autogallery_image_number').hide();
|
1038 |
jQuery('#tr_instagram_gallery_add_button').hide();
|
1039 |
+
/* default limit 20 */
|
1040 |
jQuery("#facebook_gallery_image_limit").val(20);
|
1041 |
}
|
1042 |
else {
|
1219 |
};
|
1220 |
|
1221 |
|
1222 |
+
/* get from the server data for the url. Here we use the server as a proxy, since Cross-Origin Resource Sharing AJAX is forbidden. */
|
1223 |
jQuery.post(ajax_url, data, function(response) {
|
1224 |
if(response == false){
|
1225 |
alert(bwg_objectL10B.bwg_cannot_response);
|
1288 |
}
|
1289 |
var custom_uploader;
|
1290 |
e.preventDefault();
|
1291 |
+
/* If the uploader object has already been created, reopen the dialog. */
|
1292 |
if ( custom_uploader ) {
|
1293 |
custom_uploader.open();
|
1294 |
}
|
1299 |
button: { text: bwg_objectL10B.insert },
|
1300 |
multiple: multiple
|
1301 |
} );
|
1302 |
+
/* When a file is selected, grab the URL and set it as the text field's value */
|
1303 |
custom_uploader.on( 'select', function () {
|
1304 |
if ( multiple == false ) {
|
1305 |
attachment = custom_uploader.state().get( 'selection' ).first().toJSON();
|
1318 |
|
1319 |
postImageUrls(filesSelectedML, function (success, result) {
|
1320 |
jQuery( '#loading_div' ).hide();
|
|
|
1321 |
if (success) {
|
1322 |
+
jQuery(".bwg-type-allowed").remove();
|
1323 |
for ( var i in result ) {
|
1324 |
+
if ( result[i].error ) {
|
1325 |
+
add_ajax_msg( bwg_objectL10B.only_the_following_types_are_allowed, 'error' );
|
1326 |
+
}
|
1327 |
result[i].alt = attachment[i].alt ? attachment[i].alt : attachment[i].title;
|
1328 |
result[i].description = attachment[i].description;
|
1329 |
}
|
1372 |
}
|
1373 |
} );
|
1374 |
|
1375 |
+
/* Open the uploader dialog. */
|
1376 |
custom_uploader.open();
|
1377 |
}
|
1378 |
|
1379 |
+
function add_ajax_msg( msg, status ) {
|
1380 |
+
if ( !jQuery('.ajax-msg').hasClass('bwg-type-allowed') ) {
|
1381 |
+
var html = '<div class="ajax-msg bwg-type-allowed">' +
|
1382 |
+
'<div class="' + status + ' inline">' +
|
1383 |
+
'<p><strong>' + msg + '</strong></p>' +
|
1384 |
+
'</div>' +
|
1385 |
+
'</div>';
|
1386 |
+
jQuery( html ).insertAfter( "#add_desc" );
|
1387 |
+
}
|
1388 |
+
}
|
1389 |
+
|
1390 |
/**
|
1391 |
* Search.
|
1392 |
*
|
1395 |
function search(that) {
|
1396 |
var form = jQuery(that).parents("form");
|
1397 |
|
1398 |
+
if ( form.attr("id") == "bwg_gallery" ) { /* Gallery edit page. */
|
1399 |
jQuery("#paged").val(1);
|
1400 |
jQuery("#ajax_task").val('ajax_apply');
|
1401 |
spider_ajax_save(form.attr("id"));
|
1403 |
else {
|
1404 |
var action = form.attr("action");
|
1405 |
form.attr("action", action + "&paged=1&s=" + jQuery("input[name='s']").val());
|
|
|
1406 |
form.submit();
|
1407 |
}
|
1408 |
}
|
1435 |
var to_page = jQuery(that).val();
|
1436 |
var pages_count = jQuery(that).parents(".pagination-links").data("pages-count");
|
1437 |
var form = jQuery(that).parents("form");
|
1438 |
+
if ( form.attr("id") == "bwg_gallery" ) { /* Gallery edit page. */
|
1439 |
if (to_page > pages_count) {
|
1440 |
to_page = 1;
|
1441 |
}
|
1496 |
return false;
|
1497 |
}
|
1498 |
}
|
1499 |
+
if ( form.attr("id") == "bwg_gallery" ) { /* Gallery edit page. */
|
1500 |
jQuery("input[name='task']").val("save");
|
1501 |
jQuery("input[name='ajax_task']").val(action);
|
1502 |
spider_ajax_save(form.attr("id"));
|
1541 |
}
|
1542 |
}
|
1543 |
|
1544 |
+
/* Open/close section container on its header click. */
|
1545 |
function bwg_toggle_postbox() {
|
1546 |
jQuery(".hndle, .handlediv").each(function () {
|
1547 |
jQuery(this).on("click", function () {
|
1555 |
obj.select();
|
1556 |
}
|
1557 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1558 |
var j_int = 0;
|
1559 |
var bwg_j = 'pr_' + j_int;
|
1560 |
|
1564 |
* @param files
|
1565 |
*/
|
1566 |
function bwg_add_image(files) {
|
1567 |
+
jQuery('#check_all_items, #check_all').attr('checked', false);
|
|
|
1568 |
for ( var i in files ) {
|
1569 |
+
if ( files[i]['error'] == true ) {
|
1570 |
+
continue;
|
1571 |
+
}
|
1572 |
var is_embed = files[i]['filetype'].indexOf("EMBED_") > -1 ? true : false;
|
1573 |
var is_direct_url = files[i]['filetype'].indexOf("DIRECT_URL_") > -1 ? true : false;
|
1574 |
var is_facebook_post = files[i]['filetype'].indexOf("_FACEBOOK_POST") > -1 ? 1 : 0;
|
1575 |
var fb_post_url = (is_facebook_post) ? files[i]['filename'] : '';
|
1576 |
+
var instagram_post_width = files[i]['resolution'].split(' x ')[0];
|
1577 |
+
var instagram_post_height = files[i]['resolution'].split(' x ')[1].split(' ')[0];
|
1578 |
|
1579 |
var html = jQuery(".wd-template").clone().html();
|
1580 |
html = html.replace(/tempid/g, bwg_j)
|
1619 |
j_int++;
|
1620 |
bwg_j = 'pr_' + j_int;
|
1621 |
}
|
1622 |
+
/* Add drag and drop to new rows. */
|
1623 |
wd_showhide_weights();
|
1624 |
+
/* Set order input values after adding rows. */
|
1625 |
var i = jQuery("td.col_drag").data("page-number");
|
1626 |
jQuery(".wd-order").each(function () {
|
1627 |
jQuery(this).val(++i);
|
1628 |
});
|
1629 |
+
/* Set number column values after adding rows. */
|
1630 |
var i = 0;
|
1631 |
jQuery("#tbody_arr .col_num").each(function () {
|
1632 |
jQuery(this).html(++i);
|
1634 |
window.parent.jQuery(".no-items").remove();
|
1635 |
jQuery(".unsaved-msg", window.parent.document).removeClass("wd-hide");
|
1636 |
jQuery(".ajax-msg", window.parent.document).addClass("wd-hide");
|
1637 |
+
jQuery(".bwg-type-allowed", window.parent.document).removeClass("wd-hide");
|
1638 |
}
|
1639 |
|
1640 |
/**
|
1699 |
text = jQuery(this).attr('title') || '';
|
1700 |
link = ' <span class="tb-theme-preview-link">' + text + '</span>';
|
1701 |
}
|
1702 |
+
/* jQuery('#TB_title').css({'background-color': '#222', 'color': '#dfdfdf'}); */
|
1703 |
jQuery('#TB_closeAjaxWindow').css({'float': 'right'});
|
1704 |
jQuery('#TB_ajaxWindowTitle').css({'float': 'left'}).html(link);
|
1705 |
jQuery('#TB_iframeContent').width('100%');
|
1706 |
thickDims();
|
1707 |
return false;
|
1708 |
});
|
1709 |
+
/* Theme details*/
|
1710 |
jQuery('.theme-detail').click(function () {
|
1711 |
jQuery(this).siblings('.themedetaildiv').toggle();
|
1712 |
return false;
|
1713 |
});
|
1714 |
}
|
1715 |
|
1716 |
+
/* Prevent new line. */
|
1717 |
function prevent_new_line(e) {
|
1718 |
if ( e.keyCode == 13 ) {
|
1719 |
e.preventDefault();
|
1735 |
jQuery(".wd-free-msg").show();
|
1736 |
}
|
1737 |
}
|
1738 |
+
jQuery('#bwg_tab_galleries_content .gallery_type').removeClass('gallery_type_active');
|
1739 |
+
jQuery('input[name=gallery_type][id=' + gallery_type + ']').attr('checked', 'checked').closest('.gallery_type').addClass('gallery_type_active');
|
1740 |
}
|
1741 |
|
1742 |
function bwg_album_type_options(album_type) {
|
1753 |
jQuery(".wd-free-msg").show();
|
1754 |
}
|
1755 |
}
|
1756 |
+
jQuery('#bwg_tab_albums_content .gallery_type').removeClass('gallery_type_active');
|
1757 |
+
jQuery('input[name=album_type][id=' + album_type + ']').attr('checked', 'checked').closest('.gallery_type').addClass('gallery_type_active');
|
1758 |
}
|
1759 |
|
1760 |
function bwg_pagination_description(that) {
|
1770 |
else {
|
1771 |
jQuery('.bwg-lightbox-redirect').hide();
|
1772 |
}
|
1773 |
+
}
|
1774 |
+
|
1775 |
+
/**
|
1776 |
+
* Recreate thumbs part by part limit 50.
|
1777 |
+
*
|
1778 |
+
* @param limit
|
1779 |
+
* @returns {boolean}
|
1780 |
+
*/
|
1781 |
+
function bwg_recreate_thumb( limit ) {
|
1782 |
+
var img_option_width = jQuery("#upload_thumb_width").val();
|
1783 |
+
var img_option_height = jQuery("#upload_thumb_height").val();
|
1784 |
+
|
1785 |
+
var imgcount = jQuery('#bwg_imgcount').val();
|
1786 |
+
var post_data = {
|
1787 |
+
'task': 'resize_image_thumb',
|
1788 |
+
'img_option_width': img_option_width,
|
1789 |
+
'img_option_height': img_option_height,
|
1790 |
+
'limitstart': limit,
|
1791 |
+
};
|
1792 |
+
|
1793 |
+
if( limit == 0 ) {
|
1794 |
+
jQuery( '#loading_div' ).show();
|
1795 |
+
jQuery( '.updated' ).remove();
|
1796 |
+
}
|
1797 |
+
jQuery.ajax({
|
1798 |
+
type: "POST",
|
1799 |
+
url: bwg_options_url_ajax,
|
1800 |
+
data: post_data,
|
1801 |
+
success: function () {
|
1802 |
+
if ( limit < imgcount ) {
|
1803 |
+
limit += 50;
|
1804 |
+
bwg_recreate_thumb( limit );
|
1805 |
+
}
|
1806 |
+
else {
|
1807 |
+
jQuery( '#loading_div' ).hide();
|
1808 |
+
jQuery( "<div class=\"updated inline\">\n" +
|
1809 |
+
" <p><strong>"+bwg_objectL10B.recreate_success+"</strong></p>" +
|
1810 |
+
" </div>" ).insertBefore( jQuery("#bwg_options_form").parent() );
|
1811 |
+
}
|
1812 |
+
}
|
1813 |
+
});
|
1814 |
+
return false;
|
1815 |
+
}
|
1816 |
+
|
1817 |
+
/**
|
1818 |
+
* Set watermark on images part by part limit 50.
|
1819 |
+
*
|
1820 |
+
* @param limit
|
1821 |
+
* @returns {boolean}
|
1822 |
+
*/
|
1823 |
+
function bwg_set_watermark( limit ){
|
1824 |
+
var built_in_watermark_type = jQuery('input[name=built_in_watermark_type]:checked').val();
|
1825 |
+
var imgcount = jQuery('#bwg_imgcount').val();
|
1826 |
+
var post_data = {
|
1827 |
+
'task': 'image_set_watermark',
|
1828 |
+
'built_in_watermark_type': built_in_watermark_type,
|
1829 |
+
'built_in_watermark_position': jQuery('input[name=built_in_watermark_position]:checked').val(),
|
1830 |
+
'limitstart': limit
|
1831 |
+
};
|
1832 |
+
if ( built_in_watermark_type == 'text' ) {
|
1833 |
+
post_data.built_in_watermark_text = jQuery('#built_in_watermark_text').val();
|
1834 |
+
post_data.built_in_watermark_font_size = jQuery('#built_in_watermark_font_size').val();
|
1835 |
+
post_data.built_in_watermark_font = jQuery('#built_in_watermark_font').val();
|
1836 |
+
post_data.built_in_watermark_color = jQuery('#built_in_watermark_color').val();
|
1837 |
+
}
|
1838 |
+
else {
|
1839 |
+
post_data.built_in_watermark_size = jQuery('#built_in_watermark_size').val();
|
1840 |
+
post_data.built_in_watermark_url = jQuery('#built_in_watermark_url').val();
|
1841 |
+
}
|
1842 |
+
|
1843 |
+
if( limit == 0 ) {
|
1844 |
+
jQuery('#loading_div').show();
|
1845 |
+
jQuery('.updated').remove();
|
1846 |
+
}
|
1847 |
+
jQuery.ajax({
|
1848 |
+
type: "POST",
|
1849 |
+
url: bwg_options_url_ajax,
|
1850 |
+
data: post_data,
|
1851 |
+
dataType: 'json',
|
1852 |
+
success: function ( response ) {
|
1853 |
+
if ( limit < imgcount && response.error === false ) {
|
1854 |
+
limit += 50;
|
1855 |
+
bwg_set_watermark( limit );
|
1856 |
+
}
|
1857 |
+
else {
|
1858 |
+
jQuery('#loading_div').hide();
|
1859 |
+
jQuery('.bwg_error').remove();
|
1860 |
+
jQuery('<div class="bwg_error">' + response.message + '</div>' ).insertBefore( jQuery("#bwg_options_form").parent() );
|
1861 |
+
}
|
1862 |
+
}
|
1863 |
+
});
|
1864 |
+
return false;
|
1865 |
+
}
|
1866 |
+
|
1867 |
+
/**
|
1868 |
+
* Reset watermarks from images part by part limit 50.
|
1869 |
+
*
|
1870 |
+
* @param limit
|
1871 |
+
* @returns {boolean}
|
1872 |
+
*/
|
1873 |
+
function bwg_reset_watermark_all( limit ){
|
1874 |
+
var imgcount = jQuery('#bwg_imgcount').val();
|
1875 |
+
var post_data = {
|
1876 |
+
'task': 'image_recover_all',
|
1877 |
+
'limitstart': limit,
|
1878 |
+
};
|
1879 |
+
if( limit == 0 ) {
|
1880 |
+
jQuery( '#loading_div' ).show();
|
1881 |
+
jQuery( '.updated' ).remove();
|
1882 |
+
}
|
1883 |
+
jQuery.ajax({
|
1884 |
+
type: "POST",
|
1885 |
+
url: bwg_options_url_ajax,
|
1886 |
+
data: post_data,
|
1887 |
+
success: function () {
|
1888 |
+
if ( limit < imgcount ) {
|
1889 |
+
limit += 50;
|
1890 |
+
bwg_reset_watermark_all( limit );
|
1891 |
+
}
|
1892 |
+
else {
|
1893 |
+
jQuery( '#loading_div' ).hide();
|
1894 |
+
jQuery( "<div class=\"updated inline\">\n" +
|
1895 |
+
" <p><strong>"+bwg_objectL10B.watermark_option_reset+"</strong></p>" +
|
1896 |
+
" </div>" ).insertBefore( jQuery("#bwg_options_form").parent() );
|
1897 |
+
}
|
1898 |
+
}
|
1899 |
+
});
|
1900 |
+
return false;
|
1901 |
+
}
|
1902 |
+
|
js/bwg_editor_button.js
CHANGED
@@ -106,5 +106,7 @@ function bwg_shortcode_ready() {
|
|
106 |
}
|
107 |
});
|
108 |
tinymce.PluginManager.add('bwg_mce', tinymce.plugins.bwg_mce);
|
109 |
-
bwg_set_shortcode_popup_dimensions
|
|
|
|
|
110 |
}
|
106 |
}
|
107 |
});
|
108 |
tinymce.PluginManager.add('bwg_mce', tinymce.plugins.bwg_mce);
|
109 |
+
if ( typeof bwg_set_shortcode_popup_dimensions == "function" ) {
|
110 |
+
bwg_set_shortcode_popup_dimensions();
|
111 |
+
}
|
112 |
}
|
js/bwg_embed.js
CHANGED
@@ -305,7 +305,7 @@ function bwg_add_instagram_gallery(instagram_access_token, from_popup){
|
|
305 |
'async':true
|
306 |
};
|
307 |
|
308 |
-
|
309 |
jQuery.post(ajax_url, data, function(response) {
|
310 |
if ( response == false ) {
|
311 |
alert('Error: cannot get response from the server.');
|
305 |
'async':true
|
306 |
};
|
307 |
|
308 |
+
/* get response data. Here we use the server as a proxy, since Cross-Origin Resource Sharing AJAX is forbidden. */
|
309 |
jQuery.post(ajax_url, data, function(response) {
|
310 |
if ( response == false ) {
|
311 |
alert('Error: cannot get response from the server.');
|
js/bwg_frontend.js
CHANGED
@@ -1,12 +1,310 @@
|
|
1 |
var bwg_param;
|
2 |
-
|
3 |
jQuery(document).ready(function () {
|
4 |
bwg_document_ready();
|
5 |
jQuery(".bwg-thumbnails").each(function () {
|
6 |
bwg_all_thumnails_loaded(this);
|
7 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
});
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
jQuery(window).on("resize", function () {
|
11 |
jQuery(".bwg-thumbnails").each(function () {
|
12 |
bwg_all_thumnails_loaded(this);
|
@@ -73,9 +371,9 @@ function bwg_thumbnail(that) {
|
|
73 |
bwg_container_loaded(jQuery(that).data('bwg'));
|
74 |
}
|
75 |
|
76 |
-
function
|
77 |
var bwg_touch_flag = false;
|
78 |
-
jQuery( ".bwg_lightbox .bwg-item0, .bwg_lightbox .bwg_slide" ).on(
|
79 |
event.stopPropagation();
|
80 |
event.preventDefault();
|
81 |
var that = jQuery(this).parent();
|
@@ -87,9 +385,9 @@ function bwg_document_ready() {
|
|
87 |
bwg_gallery_box( jQuery( that ).attr( "data-image-id" ), jQuery( that ).closest( '.bwg_container' ) );
|
88 |
return false;
|
89 |
}
|
90 |
-
}
|
91 |
|
92 |
-
jQuery( ".bwg_lightbox .bwg_ecommerce" ).on(
|
93 |
event.stopPropagation();
|
94 |
if ( !bwg_touch_flag ) {
|
95 |
bwg_touch_flag = true;
|
@@ -100,7 +398,10 @@ function bwg_document_ready() {
|
|
100 |
bwg_gallery_box( image_id, jQuery( this ).closest( '.bwg_container' ), true );
|
101 |
return false;
|
102 |
}
|
103 |
-
}
|
|
|
|
|
|
|
104 |
jQuery( 'div[id^="bwg_container"]' ).each( function () {
|
105 |
var bwg_container = jQuery( this );
|
106 |
if ( bwg_container.data( 'right-click-protection' ) ) {
|
@@ -111,16 +412,87 @@ function bwg_document_ready() {
|
|
111 |
bwg_container.css( 'webkitTouchCallout', 'none' );
|
112 |
}
|
113 |
|
|
|
|
|
|
|
114 |
var search_tags = bwg_container.find('.search_tags');
|
115 |
if (search_tags.length) {
|
116 |
-
search_tags.SumoSelect(
|
|
|
117 |
placeholder: bwg_objectsL10n.bwg_select_tag,
|
118 |
search: 1,
|
119 |
-
searchText: bwg_objectsL10n.bwg_search,
|
120 |
-
forceCustomRendering: true
|
|
|
|
|
|
|
121 |
} );
|
122 |
}
|
123 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
|
125 |
var bwg_hash = window.location.hash.substring( 1 );
|
126 |
if ( bwg_hash ) {
|
@@ -157,12 +529,14 @@ function bwg_gallery_box(image_id, bwg_container, openEcommerce) {
|
|
157 |
filterTags = filterTags ? filterTags : 0;
|
158 |
var ecommerce = openEcommerce == true ? "&open_ecommerce=1" : "";
|
159 |
var filtersearchname = jQuery("#bwg_search_input_" + bwg ).val();
|
|
|
160 |
filtersearchname = filtersearchname ? filtersearchname : '';
|
161 |
-
spider_createpopup(bwg_lightbox_url + '&image_id=' + image_id + "&filter_tag=" + filterTags + ecommerce + '&filter_search_name=' + filtersearchname, bwg, bwg_container.data('popup-width'), bwg_container.data('popup-height'), 1, 'testpopup', 5, bwg_container.data('buttons-position'));
|
162 |
}
|
163 |
|
164 |
function spider_frontend_ajax(form_id, current_view, id, album_gallery_id, cur_album_id, type, srch_btn, title, sortByParam, load_more, description) {
|
165 |
jQuery(window).off("scroll");
|
|
|
166 |
var masonry_loaded = 0;
|
167 |
var mosaic_loaded = 0;
|
168 |
if (typeof load_more == "undefined") {
|
@@ -173,7 +547,7 @@ function spider_frontend_ajax(form_id, current_view, id, album_gallery_id, cur_a
|
|
173 |
var bwg_previous_album_ids = jQuery('#bwg_previous_album_id_' + current_view).val();
|
174 |
var bwg_previous_album_page_numbers = jQuery('#bwg_previous_album_page_number_' + current_view).val();
|
175 |
var post_data = {};
|
176 |
-
if (album_gallery_id == 'back') {
|
177 |
var bwg_previous_album_id = bwg_previous_album_ids.split(",");
|
178 |
album_gallery_id = bwg_previous_album_id[1];
|
179 |
jQuery('#bwg_previous_album_id_' + current_view).val(bwg_previous_album_ids.replace(bwg_previous_album_id[0] + ',', ''));
|
@@ -182,14 +556,14 @@ function spider_frontend_ajax(form_id, current_view, id, album_gallery_id, cur_a
|
|
182 |
jQuery('#bwg_previous_album_page_number_' + current_view).val(bwg_previous_album_page_numbers.replace(bwg_previous_album_page_number[0] + ',', ''));
|
183 |
post_data["action_" + current_view] = 'back';
|
184 |
}
|
185 |
-
else if (cur_album_id != '') {
|
186 |
jQuery('#bwg_previous_album_id_' + current_view).val(album_gallery_id + ',' + bwg_previous_album_ids);
|
187 |
if (page_number) {
|
188 |
jQuery('#bwg_previous_album_page_number_' + current_view).val(page_number + ',' + bwg_previous_album_page_numbers);
|
189 |
}
|
190 |
page_number = 1;
|
191 |
}
|
192 |
-
if (srch_btn) {
|
193 |
page_number = 1;
|
194 |
}
|
195 |
if (typeof title == "undefined" || title == '') {
|
@@ -210,17 +584,18 @@ function spider_frontend_ajax(form_id, current_view, id, album_gallery_id, cur_a
|
|
210 |
post_data["title_" + current_view] = title;
|
211 |
post_data["description_" + current_view] = description;
|
212 |
post_data["sortImagesByValue_" + current_view] = sortByParam;
|
213 |
-
if (jQuery("#bwg_search_input_" + current_view).length > 0) {
|
214 |
post_data["bwg_search_" + current_view] = jQuery("#bwg_search_input_" + current_view).val();
|
215 |
}
|
216 |
post_data["bwg_tag_id_" + id] = jQuery("#bwg_tag_id_" + id).val();
|
217 |
-
|
218 |
if ( id != "bwg_standart_thumbnails_" + current_view ) {
|
219 |
jQuery("#ajax_loading_" + current_view).css('display', '');
|
220 |
}
|
221 |
else {
|
222 |
jQuery("#ajax_loading_" + current_view).removeClass('bwg-hidden');
|
223 |
}
|
|
|
224 |
jQuery.ajax({
|
225 |
type: "POST",
|
226 |
url: window.location,
|
@@ -234,27 +609,58 @@ function spider_frontend_ajax(form_id, current_view, id, album_gallery_id, cur_a
|
|
234 |
|
235 |
jQuery("div[id^='bwg_container1_'] form").each(function () {
|
236 |
if (jQuery(this).data("current") == current_view) {
|
237 |
-
|
238 |
-
|
239 |
}
|
240 |
else {
|
241 |
-
|
242 |
-
|
243 |
}
|
244 |
});
|
245 |
}
|
246 |
else {
|
247 |
-
|
248 |
-
|
249 |
}
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
258 |
}
|
259 |
},
|
260 |
beforeSend: function(){
|
@@ -266,15 +672,15 @@ function spider_frontend_ajax(form_id, current_view, id, album_gallery_id, cur_a
|
|
266 |
}
|
267 |
else if (jQuery(this).attr("data-src") != '') {
|
268 |
jQuery(this).attr("src", jQuery(this).attr("data-src"));
|
269 |
-
|
270 |
});
|
271 |
jQuery(".blog_style_image_buttons_conteiner_" + current_view).find(jQuery(".bwg_blog_style_img_" + current_view)).on("load", function() {
|
272 |
jQuery(".bwg_blog_style_img_" + current_view).closest(jQuery(".blog_style_image_buttons_conteiner_" + current_view)).show();
|
273 |
});
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
jQuery("#bwg_tags_id_" + id).val(jQuery("#bwg_tag_id_" + id).val());
|
279 |
|
280 |
if (jQuery(".pagination-links_" + current_view).length) {
|
@@ -282,22 +688,22 @@ function spider_frontend_ajax(form_id, current_view, id, album_gallery_id, cur_a
|
|
282 |
}
|
283 |
/* For thumbnails view.*/
|
284 |
if (id == "bwg_standart_thumbnails_" + current_view) {
|
285 |
-
|
286 |
bwg_all_thumnails_loaded(".bwg-container-" + current_view);
|
287 |
}
|
288 |
else if ( id.indexOf('album') === -1 && id.indexOf('bwg_masonry_thumbnails') === -1) {
|
289 |
/* Do not apply to album views. */
|
290 |
window["bwg_document_ready_" + current_view]();
|
291 |
}
|
292 |
-
|
293 |
if (id == "bwg_masonry_thumbnails_" + current_view || id == "bwg_album_masonry_" + current_view) {
|
294 |
-
window["bwg_masonry_ajax_"+ current_view](masonry_loaded);
|
295 |
}
|
296 |
/* For mosaic view.*/
|
297 |
if (id == "bwg_mosaic_thumbnails_" + current_view) {
|
298 |
window["bwg_mosaic_ajax_" + current_view](mosaic_loaded);
|
299 |
}
|
300 |
-
|
301 |
jQuery(".blog_style_images_conteiner_" + current_view + " .bwg_embed_frame_16x9_" + current_view).each(function (e) {
|
302 |
jQuery(this).width(jQuery(this).parent().width());
|
303 |
jQuery(this).height(jQuery(this).width() * 0.5625);
|
@@ -315,6 +721,17 @@ function spider_frontend_ajax(form_id, current_view, id, album_gallery_id, cur_a
|
|
315 |
/* 16 is 2*padding inside iframe */
|
316 |
/* 96 is 2*padding(top) + 1*padding(bottom) + 40(footer) + 32(header) */
|
317 |
jQuery('.bwg_embed_frame_instapost_' + current_view).height((jQuery('.bwg_embed_frame_instapost_' + current_view).width() - 16) * jQuery('.bwg_embed_frame_instapost_' + current_view).attr('data-height') / jQuery('.bwg_embed_frame_instapost_' + current_view).attr('data-width') + 96);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
318 |
}
|
319 |
});
|
320 |
return false;
|
@@ -324,13 +741,13 @@ function bwg_select_tag(current_view, form_id, cur_gal_id, album_gallery_id, typ
|
|
324 |
if (reset) {
|
325 |
jQuery("#bwg_tag_id_" + cur_gal_id).val('');
|
326 |
}
|
|
|
327 |
spider_frontend_ajax(form_id, current_view, cur_gal_id, album_gallery_id, '', type, 1, '');
|
328 |
}
|
329 |
|
330 |
-
function
|
331 |
-
bwg = bwg_param['bwg'];
|
332 |
bwg_current_key = bwg_param['bwg_current_key'];
|
333 |
-
|
334 |
jQuery(".bwg_image_info").css("height","auto");
|
335 |
setTimeout(function(){
|
336 |
if(jQuery(".bwg_image_info_container1").height() < (jQuery(".bwg_image_info").height() + jQuery(".bwg_toggle_container").height() + bwg_image_info_pos + 2*(parseInt(bwg_param['lightbox_info_margin'])))) {
|
@@ -387,7 +804,7 @@ function bwg_change_image(current_key, key, data, from_effect) {
|
|
387 |
jQuery(this)[0].contentWindow.postMessage('{ "method": "pause" }', "*");
|
388 |
jQuery(this)[0].contentWindow.postMessage('pause', '*');
|
389 |
});
|
390 |
-
jQuery("#bwg_image_container"
|
391 |
jQuery(this).trigger('pause');
|
392 |
});
|
393 |
|
@@ -396,6 +813,7 @@ function bwg_change_image(current_key, key, data, from_effect) {
|
|
396 |
if (jQuery(".bwg_play_pause").length && !jQuery(".bwg_play_pause").hasClass("fa-play")) {
|
397 |
bwg_play();
|
398 |
}
|
|
|
399 |
if (!from_effect) {
|
400 |
/* Change image key.*/
|
401 |
jQuery("#bwg_current_image_key").val(key);
|
@@ -403,7 +821,7 @@ function bwg_change_image(current_key, key, data, from_effect) {
|
|
403 |
current_key = jQuery(".bwg_thumb_active").children("img").attr("image_key");
|
404 |
}*/
|
405 |
}
|
406 |
-
if (bwg_trans_in_progress) {
|
407 |
event_stack.push(current_key + '-' + key);
|
408 |
return;
|
409 |
}
|
@@ -484,7 +902,7 @@ function bwg_change_image(current_key, key, data, from_effect) {
|
|
484 |
/* hide download button if image source is embed */
|
485 |
jQuery("#bwg_download").addClass("hidden");
|
486 |
/*innhtml += '<span style="height: ' + cur_height + 'px; width: ' + cur_width + 'px;" class="bwg_popup_embed bwg_popup_watermark">';*/
|
487 |
-
innhtml += '<span class="bwg_popup_embed bwg_popup_watermark" style="display:
|
488 |
if (is_embed_instagram_post) {
|
489 |
var post_width = 0;
|
490 |
var post_height = 0;
|
@@ -499,7 +917,7 @@ function bwg_change_image(current_key, key, data, from_effect) {
|
|
499 |
innhtml += spider_display_embed(data[key]['filetype'], data[key]['image_url'], data[key]['filename'], {class:"bwg_embed_frame", 'data-width': data[key]['image_width'], 'data-height': data[key]['image_height'], frameborder: "0", allowfullscreen: "allowfullscreen", style: "width:" + post_width + "px; height:" + post_height + "px; vertical-align:middle; display:inline-block; position:relative;"});
|
500 |
}
|
501 |
else {
|
502 |
-
innhtml += spider_display_embed(data[key]['filetype'],data[key]['image_url'], data[key]['filename'], {class:"bwg_embed_frame", frameborder:"0", allowfullscreen:"allowfullscreen", style:"display:
|
503 |
}
|
504 |
innhtml += "</span>";
|
505 |
}
|
@@ -607,45 +1025,24 @@ function bwg_change_image(current_key, key, data, from_effect) {
|
|
607 |
}
|
608 |
}
|
609 |
|
610 |
-
function
|
611 |
var count_all = data.length;
|
612 |
-
var preloadCount = (bwg_param['preload_images_count'] == 0
|
613 |
-
var is_embed;
|
614 |
var indexedImgCount = 0;
|
615 |
-
var
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
rightIndex = 0;
|
622 |
-
}
|
623 |
-
/* Right from key indexes */
|
624 |
-
if ( rightIndex < count_all ) { /* check if right index is greater than max index */
|
625 |
-
is_embed = data[rightIndex]['filetype'].indexOf("EMBED_") > -1 ? true : false;
|
626 |
-
if ( typeof data[rightIndex] != "undefined" ) {
|
627 |
-
if ( !is_embed ) {
|
628 |
-
jQuery("<img/>").attr("src", bwg_param['site_url'] + jQuery('<span style="display: block;" />').html(data[rightIndex]["image_url"]).text());
|
629 |
-
indexedImgCount++;
|
630 |
-
if ( indexedImgCount >= preloadCount ) {
|
631 |
-
break;
|
632 |
-
}
|
633 |
-
}
|
634 |
-
}
|
635 |
-
}
|
636 |
-
/* Left from key indexes */
|
637 |
-
if ( leftIndex > 0 ) {
|
638 |
-
is_embed = data[leftIndex]['filetype'].indexOf("EMBED_") > -1 ? true : false;
|
639 |
-
if ( typeof data[leftIndex] != "undefined" ) {
|
640 |
if ( !is_embed ) {
|
641 |
-
jQuery("<img/>").attr("src", bwg_param['site_url'] + jQuery('<span style="display: block;" />').html(data[
|
642 |
-
indexedImgCount++;
|
643 |
-
if ( indexedImgCount >= preloadCount ) {
|
644 |
-
break;
|
645 |
-
}
|
646 |
}
|
647 |
}
|
|
|
|
|
648 |
}
|
|
|
649 |
}
|
650 |
}
|
651 |
|
@@ -658,6 +1055,7 @@ function bwg_cube(tz, ntx, nty, nrx, nry, wrx, wry, current_image_class, next_im
|
|
658 |
bwg_params[bwg]['bwg_trans_in_progress'] = true;
|
659 |
bwg_prefix = "_"+bwg;
|
660 |
bwg_transition_dur = bwg_params[bwg]['bwg_transition_duration'];
|
|
|
661 |
} else {
|
662 |
bwg_transition_dur = bwg_transition_duration;
|
663 |
}
|
@@ -679,7 +1077,7 @@ function bwg_cube(tz, ntx, nty, nrx, nry, wrx, wry, current_image_class, next_im
|
|
679 |
jQuery(".bwg_slideshow_filmstrip_thumbnail_"+bwg).removeClass("bwg_slideshow_thumb_active_"+bwg).addClass("bwg_slideshow_thumb_deactive_"+bwg);
|
680 |
jQuery("#bwg_filmstrip_thumbnail_" + bwg_params[bwg]['bwg_current_key']+ "_"+bwg).removeClass("bwg_slideshow_thumb_deactive_"+bwg).addClass("bwg_slideshow_thumb_active_"+bwg);
|
681 |
jQuery(".bwg_slideshow_dots_"+bwg).removeClass("bwg_slideshow_dots_active_"+bwg).addClass("bwg_slideshow_dots_deactive_"+bwg);
|
682 |
-
jQuery("#bwg_dots_" + bwg_params[bwg]['bwg_current_key']).removeClass("bwg_slideshow_dots_deactive_"+bwg).addClass("bwg_slideshow_dots_active_"+bwg);
|
683 |
jQuery(".bwg_slide_bg_"+bwg).css('perspective', 1000);
|
684 |
}
|
685 |
jQuery(current_image_class).css({
|
@@ -716,16 +1114,16 @@ function bwg_cube(tz, ntx, nty, nrx, nry, wrx, wry, current_image_class, next_im
|
|
716 |
jQuery(current_image_class).html('');
|
717 |
|
718 |
if ( type_slideshow ) { /*check if cube works from slideshow*/
|
719 |
-
|
720 |
bwg_params[bwg]['bwg_trans_in_progress'] = false;
|
|
|
721 |
}
|
722 |
|
723 |
if (typeof event_stack !== 'undefined') {
|
724 |
if (event_stack.length > 0) {
|
725 |
key = event_stack[0].split("-");
|
726 |
event_stack.shift();
|
727 |
-
|
728 |
-
window["bwg_change_image"+bwg_prefix](key[0], key[1], data, true);
|
729 |
}
|
730 |
}
|
731 |
bwg_change_watermark_container();
|
@@ -735,33 +1133,15 @@ function bwg_cube(tz, ntx, nty, nrx, nry, wrx, wry, current_image_class, next_im
|
|
735 |
}
|
736 |
}
|
737 |
|
738 |
-
/* For browsers that does not support transitions.*/
|
739 |
-
function bwg_fallback(current_image_class, next_image_class, direction, bwg) {
|
740 |
-
bwg_fade(current_image_class, next_image_class, direction, bwg);
|
741 |
-
}
|
742 |
-
/* For browsers that support transitions, but not 3d transforms (only used if primary transition makes use of 3d-transforms).*/
|
743 |
-
function bwg_fallback3d(current_image_class, next_image_class, direction, bwg) {
|
744 |
-
bwg_sliceV(current_image_class, next_image_class, direction, bwg);
|
745 |
-
}
|
746 |
-
function bwg_none(current_image_class, next_image_class, direction, bwg) {
|
747 |
-
jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
|
748 |
-
jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});
|
749 |
-
jQuery(".bwg_image_info").show();
|
750 |
-
bwg_trans_in_progress = false;
|
751 |
-
jQuery(current_image_class).html('');
|
752 |
-
bwg_change_watermark_container();
|
753 |
-
}
|
754 |
function bwg_fade(current_image_class, next_image_class, direction, bwg) {
|
755 |
var type_slideshow = false;
|
756 |
-
var bwg_prefix = "";
|
757 |
var bwg_transition_dur;
|
758 |
-
if(typeof bwg != 'undefined') {
|
759 |
type_slideshow = true;
|
760 |
bwg_params[bwg]['bwg_trans_in_progress'] = true;
|
761 |
-
bwg_prefix = "_"+bwg;
|
762 |
bwg_transition_dur = bwg_params[bwg]['bwg_transition_duration'];
|
763 |
} else {
|
764 |
-
bwg_transition_dur = bwg_transition_duration;
|
765 |
}
|
766 |
|
767 |
if(type_slideshow) {
|
@@ -777,7 +1157,7 @@ function bwg_fade(current_image_class, next_image_class, direction, bwg) {
|
|
777 |
}
|
778 |
function bwg_after_trans() {
|
779 |
jQuery(".bwg_image_info").show();
|
780 |
-
|
781 |
if( type_slideshow ) {
|
782 |
bwg_params[bwg]['bwg_trans_in_progress'] = false;
|
783 |
}
|
@@ -797,6 +1177,7 @@ function bwg_fade(current_image_class, next_image_class, direction, bwg) {
|
|
797 |
duration: bwg_transition_dur,
|
798 |
complete: function () {
|
799 |
bwg_trans_in_progress = false;
|
|
|
800 |
jQuery(current_image_class).html('');
|
801 |
bwg_after_trans()
|
802 |
}
|
@@ -809,99 +1190,8 @@ function bwg_fade(current_image_class, next_image_class, direction, bwg) {
|
|
809 |
bwg_after_trans();
|
810 |
}
|
811 |
}
|
812 |
-
function bwg_testBrowser_cssTransitions() {
|
813 |
-
return bwg_testDom('Transition');
|
814 |
-
}
|
815 |
-
function bwg_testBrowser_cssTransforms3d() {
|
816 |
-
return bwg_testDom('Perspective');
|
817 |
-
}
|
818 |
-
function bwg_testDom(prop) {
|
819 |
-
/* Browser vendor CSS prefixes.*/
|
820 |
-
var browserVendors = ['', '-webkit-', '-moz-', '-ms-', '-o-', '-khtml-'];
|
821 |
-
/* Browser vendor DOM prefixes.*/
|
822 |
-
var domPrefixes = ['', 'Webkit', 'Moz', 'ms', 'O', 'Khtml'];
|
823 |
-
var i = domPrefixes.length;
|
824 |
-
while (i--) {
|
825 |
-
if (typeof document.body.style[domPrefixes[i] + prop] !== 'undefined') {
|
826 |
-
return true;
|
827 |
-
}
|
828 |
-
}
|
829 |
-
return false;
|
830 |
-
}
|
831 |
-
|
832 |
-
function bwg_change_watermark_container() {
|
833 |
-
jQuery(".bwg_slider").children().each(function() {
|
834 |
-
if (jQuery(this).css("zIndex") == 2) {
|
835 |
-
/* This may be neither img nor iframe.*/
|
836 |
-
var bwg_current_image_span = jQuery(this).find("img");
|
837 |
-
if (!bwg_current_image_span.length) {
|
838 |
-
bwg_current_image_span = jQuery(this).find("iframe");
|
839 |
-
}
|
840 |
-
if (!bwg_current_image_span.length) {
|
841 |
-
bwg_current_image_span = jQuery(this).find("video");
|
842 |
-
}
|
843 |
-
/*set timeout for video to get size according to style, and then put watermark*/
|
844 |
-
setTimeout(function () {
|
845 |
-
var width = bwg_current_image_span.width();
|
846 |
-
var height = bwg_current_image_span.height();
|
847 |
-
|
848 |
-
|
849 |
-
jQuery(".bwg_watermark_spun").width(width);
|
850 |
-
jQuery(".bwg_watermark_spun").height(height);
|
851 |
-
jQuery(".bwg_watermark").css({display: ''});
|
852 |
-
/* Set watermark image size.*/
|
853 |
-
var comment_container_width = 0;
|
854 |
-
if (jQuery(".bwg_comment_container").hasClass("bwg_open") || jQuery(".bwg_ecommerce_container").hasClass("bwg_open") ) {
|
855 |
-
comment_container_width = bwg_param['lightbox_comment_width'];
|
856 |
-
}
|
857 |
-
if (width <= (jQuery(window).width() - comment_container_width)) {
|
858 |
-
jQuery(".bwg_watermark_image").css({
|
859 |
-
width: ((jQuery(".spider_popup_wrap").width() - comment_container_width) * bwg_param['watermark_font_size'] / bwg_param['image_width'])
|
860 |
-
});
|
861 |
-
jQuery(".bwg_watermark_text, .bwg_watermark_text:hover").css({
|
862 |
-
fontSize: ((jQuery(".spider_popup_wrap").width() - comment_container_width) * bwg_param['watermark_font_size'] / bwg_param['image_width'])
|
863 |
-
});
|
864 |
-
}
|
865 |
-
}, 100);
|
866 |
-
}
|
867 |
-
});
|
868 |
-
}
|
869 |
|
870 |
-
|
871 |
-
if ( bwg_param['outerWidth_or_outerHeight'] == 'outerWidth' ) {
|
872 |
-
var selectedImagePos = -bwg_current_filmstrip_pos - (jQuery(".bwg_filmstrip_thumbnail").outerWidth(true)) / 2;
|
873 |
-
} else if ( bwg_param['outerWidth_or_outerHeight'] == 'outerHeight' ) {
|
874 |
-
var selectedImagePos = -bwg_current_filmstrip_pos - (jQuery(".bwg_filmstrip_thumbnail").outerHeight(true)) / 2;
|
875 |
-
}
|
876 |
-
|
877 |
-
if ( bwg_param['width_or_height'] == 'width' ) {
|
878 |
-
var imagesContainerLeft = Math.min(0, Math.max(filmStripWidth - jQuery(".bwg_filmstrip_thumbnails").width(), selectedImagePos + filmStripWidth / 2));
|
879 |
-
} else if (bwg_param['width_or_height'] == 'height') {
|
880 |
-
var imagesContainerLeft = Math.min(0, Math.max(filmStripWidth - jQuery(".bwg_filmstrip_thumbnails").height(), selectedImagePos + filmStripWidth / 2));
|
881 |
-
}
|
882 |
-
if ( bwg_param['left_or_top'] == 'left' ) {
|
883 |
-
jQuery(".bwg_filmstrip_thumbnails").animate({
|
884 |
-
left: imagesContainerLeft
|
885 |
-
}, {
|
886 |
-
duration: 500,
|
887 |
-
complete: function () {
|
888 |
-
bwg_filmstrip_arrows();
|
889 |
-
}
|
890 |
-
});
|
891 |
-
} else if ( bwg_param['left_or_top'] == 'top' ) {
|
892 |
-
jQuery(".bwg_filmstrip_thumbnails").animate({
|
893 |
-
top: imagesContainerLeft
|
894 |
-
}, {
|
895 |
-
duration: 500,
|
896 |
-
complete: function () {
|
897 |
-
bwg_filmstrip_arrows();
|
898 |
-
}
|
899 |
-
});
|
900 |
-
|
901 |
-
}
|
902 |
-
}
|
903 |
-
|
904 |
-
// open popup sidebar
|
905 |
function bwg_popup_sidebar_open(obj){
|
906 |
var comment_container_width = bwg_param['lightbox_comment_width'];
|
907 |
var lightbox_comment_pos = bwg_param['lightbox_comment_pos'];
|
@@ -921,7 +1211,6 @@ function bwg_popup_sidebar_open(obj){
|
|
921 |
jQuery(".spider_popup_close_fullscreen").show();
|
922 |
}
|
923 |
|
924 |
-
//obj.animate({<?php echo $theme_row->lightbox_comment_pos; ?>: 0}, 100);
|
925 |
if(lightbox_comment_pos == 'left') {
|
926 |
obj.animate({left: 0}, 100);
|
927 |
} else {
|
@@ -1071,7 +1360,7 @@ function bwg_ecommerce() {
|
|
1071 |
if (jQuery(".bwg_comment_container").hasClass("bwg_open")) {
|
1072 |
bwg_popup_sidebar_close(jQuery(".bwg_comment_container"));
|
1073 |
jQuery(".bwg_comment_container").attr("class", "bwg_comment_container bwg_close");
|
1074 |
-
|
1075 |
jQuery(".bwg_comment").attr("title", bwg_objectsL10n.bwg_how_comments);
|
1076 |
}
|
1077 |
if (jQuery(".bwg_ecommerce_container").hasClass("bwg_open")) {
|
@@ -1079,9 +1368,9 @@ function bwg_ecommerce() {
|
|
1079 |
bwg_popup_sidebar_close(jQuery(".bwg_ecommerce_container"));
|
1080 |
bwg_animate_image_box_for_hide_sidebar();
|
1081 |
jQuery(".bwg_ecommerce_container").attr("class", "bwg_ecommerce_container bwg_close");
|
1082 |
-
|
1083 |
jQuery(".bwg_ecommerce").attr("title", bwg_objectsL10n.bwg_show_ecommerce);
|
1084 |
-
|
1085 |
}
|
1086 |
else {
|
1087 |
/* Open ecommerce.*/
|
@@ -1103,86 +1392,6 @@ function bwg_reset_zoom() {
|
|
1103 |
}
|
1104 |
}
|
1105 |
|
1106 |
-
function bwg_move_filmstrip() {
|
1107 |
-
var image_right = (bwg_param['left_or_top'] == 'left' ? jQuery(".bwg_thumb_active").position().left : jQuery(".bwg_thumb_active").position().top) + (bwg_param['outerWidth_or_outerHeight'] == 'outerWidth' ? jQuery(".bwg_thumb_active").outerWidth(true) : jQuery(".bwg_thumb_active").outerHeight(true));
|
1108 |
-
var bwg_filmstrip_width = (bwg_param['outerWidth_or_outerHeight'] == 'outerWidth' ? jQuery(".bwg_filmstrip").outerWidth(true) : jQuery(".bwg_filmstrip").outerHeight(true));
|
1109 |
-
var bwg_filmstrip_thumbnails_width = (bwg_param['outerWidth_or_outerHeight'] == 'outerWidth' ? jQuery(".bwg_filmstrip_thumbnails").outerWidth(true) : jQuery(".bwg_filmstrip_thumbnails").outerHeight(true));
|
1110 |
-
|
1111 |
-
if ( bwg_param['left_or_top'] == 'left' ) {
|
1112 |
-
var image_left = jQuery(".bwg_thumb_active").position().left;
|
1113 |
-
var long_filmstrip_cont_left = jQuery(".bwg_filmstrip_thumbnails").position().left;
|
1114 |
-
var long_filmstrip_cont_right = Math.abs(jQuery(".bwg_filmstrip_thumbnails").position().left) + bwg_filmstrip_width;
|
1115 |
-
} else if ( bwg_param['left_or_top'] == 'top' ) {
|
1116 |
-
var image_left = jQuery(".bwg_thumb_active").position().top;
|
1117 |
-
var long_filmstrip_cont_left = jQuery(".bwg_filmstrip_thumbnails").position().top;
|
1118 |
-
var long_filmstrip_cont_right = Math.abs(jQuery(".bwg_filmstrip_thumbnails").position().top) + bwg_filmstrip_width;
|
1119 |
-
}
|
1120 |
-
if (bwg_filmstrip_width > bwg_filmstrip_thumbnails_width) {
|
1121 |
-
return;
|
1122 |
-
}
|
1123 |
-
|
1124 |
-
if (image_left < Math.abs(long_filmstrip_cont_left)) {
|
1125 |
-
if ( bwg_param['left_or_top'] == 'left' ) {
|
1126 |
-
jQuery(".bwg_filmstrip_thumbnails").animate({
|
1127 |
-
left: -image_left
|
1128 |
-
}, {
|
1129 |
-
duration: 500,
|
1130 |
-
complete: function () {
|
1131 |
-
bwg_filmstrip_arrows();
|
1132 |
-
}
|
1133 |
-
});
|
1134 |
-
} else {
|
1135 |
-
jQuery(".bwg_filmstrip_thumbnails").animate({
|
1136 |
-
top: -image_left
|
1137 |
-
}, {
|
1138 |
-
duration: 500,
|
1139 |
-
complete: function () {
|
1140 |
-
bwg_filmstrip_arrows();
|
1141 |
-
}
|
1142 |
-
});
|
1143 |
-
}
|
1144 |
-
}
|
1145 |
-
else if (image_right > long_filmstrip_cont_right) {
|
1146 |
-
if ( bwg_param['left_or_top'] == 'left' ) {
|
1147 |
-
jQuery(".bwg_filmstrip_thumbnails").animate({
|
1148 |
-
left: -(image_right - bwg_filmstrip_width)
|
1149 |
-
}, {
|
1150 |
-
duration: 500,
|
1151 |
-
complete: function () {
|
1152 |
-
bwg_filmstrip_arrows();
|
1153 |
-
}
|
1154 |
-
});
|
1155 |
-
} else {
|
1156 |
-
jQuery(".bwg_filmstrip_thumbnails").animate({
|
1157 |
-
top: -(image_right - bwg_filmstrip_width)
|
1158 |
-
}, {
|
1159 |
-
duration: 500,
|
1160 |
-
complete: function () {
|
1161 |
-
bwg_filmstrip_arrows();
|
1162 |
-
}
|
1163 |
-
});
|
1164 |
-
}
|
1165 |
-
}
|
1166 |
-
}
|
1167 |
-
|
1168 |
-
/* Show/hide filmstrip arrows.*/
|
1169 |
-
function bwg_filmstrip_arrows() {
|
1170 |
-
if ( bwg_param['width_or_height'] == 'width' ){
|
1171 |
-
var condition1 = jQuery(".bwg_filmstrip_thumbnails").width();
|
1172 |
-
var condition2 = jQuery(".bwg_filmstrip").width()
|
1173 |
-
} else {
|
1174 |
-
var condition1 = jQuery(".bwg_filmstrip_thumbnails").height();
|
1175 |
-
var condition2 = jQuery(".bwg_filmstrip").height()
|
1176 |
-
}
|
1177 |
-
if (condition1 < condition2) {
|
1178 |
-
jQuery(".bwg_filmstrip_left").hide();
|
1179 |
-
jQuery(".bwg_filmstrip_right").hide();
|
1180 |
-
} else {
|
1181 |
-
jQuery(".bwg_filmstrip_left").show();
|
1182 |
-
jQuery(".bwg_filmstrip_right").show();
|
1183 |
-
}
|
1184 |
-
}
|
1185 |
-
|
1186 |
/* Open with fullscreen.*/
|
1187 |
function bwg_open_with_fullscreen() {
|
1188 |
jQuery(".bwg_watermark").css({display: 'none'});
|
@@ -1238,48 +1447,13 @@ function bwg_open_with_fullscreen() {
|
|
1238 |
jQuery(".spider_popup_close").attr("class", "bwg_ctrl_btn spider_popup_close_fullscreen");
|
1239 |
}
|
1240 |
|
1241 |
-
function bwg_resize_instagram_post() {
|
1242 |
-
if (jQuery('.inner_instagram_iframe_bwg_embed_frame').length) {
|
1243 |
-
var post_width = jQuery(".bwg_image_container").width();
|
1244 |
-
var post_height = jQuery(".bwg_image_container").height();
|
1245 |
-
var FeedbackSocialProofHeight = 132;
|
1246 |
-
jQuery('.inner_instagram_iframe_bwg_embed_frame').each(function() {
|
1247 |
-
var parent_container = jQuery(this).parent();
|
1248 |
-
if (post_height / (parseInt(parent_container.attr('data-height')) + FeedbackSocialProofHeight) < post_width / parseInt(parent_container.attr('data-width'))) {
|
1249 |
-
parent_container.height(post_height);
|
1250 |
-
parent_container.width((parent_container.height() - FeedbackSocialProofHeight) * parent_container.attr('data-width') / parent_container.attr('data-height') + 16);
|
1251 |
-
}
|
1252 |
-
else {
|
1253 |
-
parent_container.width(post_width);
|
1254 |
-
parent_container.height((parent_container.width() - 16) * parent_container.attr('data-height') / parent_container.attr('data-width') + 96);
|
1255 |
-
}
|
1256 |
-
parent_container.css({top: 0.5 * (post_height - parent_container.height())});
|
1257 |
-
});
|
1258 |
-
bwg_change_watermark_container();
|
1259 |
-
}
|
1260 |
-
}
|
1261 |
-
|
1262 |
-
function bwg_play() {
|
1263 |
-
window.clearInterval(bwg_playInterval);
|
1264 |
-
bwg_playInterval = setInterval(function () {
|
1265 |
-
if (!data[parseInt(jQuery('#bwg_current_image_key').val()) + 1]) {
|
1266 |
-
if (bwg_param['enable_loop'] == 1) {
|
1267 |
-
/* Wrap around.*/
|
1268 |
-
bwg_change_image(parseInt(jQuery('#bwg_current_image_key').val()), 0, data);
|
1269 |
-
}
|
1270 |
-
return;
|
1271 |
-
}
|
1272 |
-
bwg_change_image(parseInt(jQuery('#bwg_current_image_key').val()), parseInt(jQuery('#bwg_current_image_key').val()) + 1, data)
|
1273 |
-
}, bwg_param['slideshow_interval'] * 1000);
|
1274 |
-
}
|
1275 |
-
|
1276 |
function bwg_resize_full() {
|
1277 |
jQuery(".bwg_watermark").css({display: 'none'});
|
1278 |
var comment_container_width = 0;
|
1279 |
if (jQuery(".bwg_comment_container").hasClass("bwg_open") || jQuery(".bwg_ecommerce_container").hasClass("bwg_open") ) {
|
1280 |
comment_container_width = jQuery(".bwg_comment_container").width() || jQuery(".bwg_ecommerce_container").width();
|
1281 |
}
|
1282 |
-
|
1283 |
if (jQuery(".bwg_resize-full").hasClass("fa-resize-small")) {
|
1284 |
if (jQuery(window).width() > bwg_param['image_width']) {
|
1285 |
bwg_popup_current_width = bwg_param['image_width'];
|
@@ -1343,7 +1517,7 @@ function bwg_resize_full() {
|
|
1343 |
jQuery(".bwg_resize-full").attr("title", "<?php echo __('Maximize', BWG()->prefix); ?>");
|
1344 |
|
1345 |
}
|
1346 |
-
else {
|
1347 |
bwg_popup_current_width = jQuery(window).width();
|
1348 |
bwg_popup_current_height = window.innerHeight;
|
1349 |
/* Maximize.*/
|
@@ -1388,10 +1562,9 @@ function bwg_resize_full() {
|
|
1388 |
jQuery(".bwg_resize-full").attr("title", "<?php echo __('Restore', BWG()->prefix); ?>");
|
1389 |
jQuery(".spider_popup_close").attr("class", "bwg_ctrl_btn spider_popup_close_fullscreen");
|
1390 |
}
|
1391 |
-
|
1392 |
}
|
1393 |
|
1394 |
-
function
|
1395 |
if (typeof jQuery().fullscreen !== 'undefined') {
|
1396 |
if (jQuery.isFunction(jQuery().fullscreen)) {
|
1397 |
if (!jQuery.fullscreen.isFullScreen()) {
|
@@ -1526,4 +1699,645 @@ function bwg_popup_resize() {
|
|
1526 |
jQuery(".bwg_toggle_container").css("top", jQuery(".bwg_ctrl_btn_container").height() + "px");
|
1527 |
}
|
1528 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1529 |
}
|
1 |
var bwg_param;
|
2 |
+
var bwg = 0;
|
3 |
jQuery(document).ready(function () {
|
4 |
bwg_document_ready();
|
5 |
jQuery(".bwg-thumbnails").each(function () {
|
6 |
bwg_all_thumnails_loaded(this);
|
7 |
});
|
8 |
+
|
9 |
+
if(typeof bwg_params != 'undefined') { /*For slideshow*/
|
10 |
+
jQuery('.bwg_slideshow').each(function () {
|
11 |
+
bwg = jQuery(this).attr('data-bwg');
|
12 |
+
ready_slideshow(bwg);
|
13 |
+
});
|
14 |
+
}
|
15 |
});
|
16 |
|
17 |
+
function ready_slideshow( bwg ) {
|
18 |
+
bwg_container_loaded( bwg );
|
19 |
+
if ( bwg_params[bwg]['image_right_click'] != 0 ) {
|
20 |
+
/* Disable right click.*/
|
21 |
+
jQuery('div[id^="bwg_container"]').bind("contextmenu", function () {
|
22 |
+
return false;
|
23 |
+
});
|
24 |
+
jQuery('div[id^="bwg_container"]').css('webkitTouchCallout','none');
|
25 |
+
}
|
26 |
+
var data = bwg_params[bwg]['data'];
|
27 |
+
if (typeof jQuery().swiperight !== 'undefined') {
|
28 |
+
if (jQuery.isFunction(jQuery().swiperight)) {
|
29 |
+
jQuery("#bwg_container1_"+bwg).swiperight(function () {
|
30 |
+
bwg_change_image(parseInt(jQuery("#bwg_current_image_key_"+bwg).val()), (parseInt(jQuery("#bwg_current_image_key_"+bwg).val()) - bwg_iterator(bwg)) >= 0 ? (parseInt(jQuery("#bwg_current_image_key_"+bwg).val()) - bwg_iterator(bwg)) % data.length : data.length - 1, data, '', bwg);
|
31 |
+
return false;
|
32 |
+
});
|
33 |
+
}
|
34 |
+
}
|
35 |
+
if (typeof jQuery().swipeleft !== 'undefined') {
|
36 |
+
if (jQuery.isFunction(jQuery().swipeleft)) {
|
37 |
+
jQuery("#bwg_container1_"+bwg).swipeleft(function () {
|
38 |
+
bwg_change_image( parseInt(jQuery("#bwg_current_image_key_"+bwg).val()), (parseInt(jQuery("#bwg_current_image_key_"+bwg).val()) + bwg_iterator( bwg ) % data.length), data, '', bwg);
|
39 |
+
return false;
|
40 |
+
});
|
41 |
+
}
|
42 |
+
}
|
43 |
+
var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
|
44 |
+
var bwg_click = isMobile ? 'touchend' : 'click';
|
45 |
+
bwg_popup_resize( bwg );
|
46 |
+
jQuery(".bwg_slideshow_watermark_"+bwg).css({display: 'none'});
|
47 |
+
jQuery(".bwg_slideshow_title_text_"+bwg).css({display: 'none'});
|
48 |
+
jQuery(".bwg_slideshow_description_text_"+bwg).css({display: 'none'});
|
49 |
+
setTimeout(function () {
|
50 |
+
bwg_change_watermark_container( bwg );
|
51 |
+
}, 500);
|
52 |
+
/* Set image container height.*/
|
53 |
+
if (bwg_params[bwg]['filmstrip_direction'] == 'horizontal') {
|
54 |
+
jQuery(".bwg_slideshow_image_container_"+bwg).height(jQuery(".bwg_slideshow_image_wrap_"+bwg).height() - bwg_params[bwg]['slideshow_filmstrip_height']);
|
55 |
+
}
|
56 |
+
else {
|
57 |
+
jQuery(".bwg_slideshow_image_container_"+bwg).width(jQuery(".bwg_slideshow_image_wrap_"+bwg).width() - bwg_params[bwg]['slideshow_filmstrip_width']);
|
58 |
+
}
|
59 |
+
var mousewheelevt = (/Firefox/i.test(navigator.userAgent)) ? "DOMMouseScroll" : "mousewheel"; /* FF doesn't recognize mousewheel as of FF3.x */
|
60 |
+
jQuery(".bwg_slideshow_filmstrip_"+bwg).bind(mousewheelevt, function(e) {
|
61 |
+
var evt = window.event || e; /* Equalize event object.*/
|
62 |
+
evt = evt.originalEvent ? evt.originalEvent : evt; /* Convert to originalEvent if possible.*/
|
63 |
+
var delta = evt.detail ? evt.detail*(-40) : evt.wheelDelta; /* Check for detail first, because it is used by Opera and FF.*/
|
64 |
+
if (delta > 0) {
|
65 |
+
/* Scroll up.*/
|
66 |
+
jQuery(".bwg_slideshow_filmstrip_left_"+bwg).trigger("click");
|
67 |
+
}
|
68 |
+
else {
|
69 |
+
/* Scroll down.*/
|
70 |
+
jQuery(".bwg_slideshow_filmstrip_right_"+bwg).trigger("click");
|
71 |
+
}
|
72 |
+
return false;
|
73 |
+
});
|
74 |
+
jQuery(".bwg_slideshow_filmstrip_right_"+bwg).on(bwg_click, function () {
|
75 |
+
|
76 |
+
jQuery( ".bwg_slideshow_filmstrip_thumbnails_"+bwg ).stop(true, false);
|
77 |
+
if ( bwg_params[bwg]['left_or_top'] == 'left' ) { /* For left, width */
|
78 |
+
if ( bwg_params[bwg]['width_or_height'] == 'width' ) {
|
79 |
+
if (jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).position().left >= -(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).width() - jQuery(".bwg_slideshow_filmstrip_"+bwg).width())) {
|
80 |
+
jQuery(".bwg_slideshow_filmstrip_left_"+bwg).css({opacity: 1, filter: "Alpha(opacity=100)"});
|
81 |
+
if (jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).position().left < -(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).width() - jQuery(".bwg_slideshow_filmstrip_"+bwg).width() - (bwg_params[bwg]['filmstrip_thumb_margin_hor'] + bwg_params[bwg]['slideshow_filmstrip_width']))) {
|
82 |
+
jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).animate({left: -(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).width() - jQuery(".bwg_slideshow_filmstrip_"+bwg).width())}, 500, 'linear');
|
83 |
+
}
|
84 |
+
else {
|
85 |
+
jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).animate({left: (jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).position().left - (bwg_params[bwg]['filmstrip_thumb_margin_hor'] + bwg_params[bwg]['slideshow_filmstrip_width']))}, 500, 'linear');
|
86 |
+
}
|
87 |
+
}
|
88 |
+
/* Disable right arrow.*/
|
89 |
+
window.setTimeout(function(){
|
90 |
+
if ((jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).position().left) == -( jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).width() - jQuery(".bwg_slideshow_filmstrip_"+bwg).width() )) {
|
91 |
+
jQuery(".bwg_slideshow_filmstrip_right_"+bwg).css({ opacity: 0.3, filter: "Alpha(opacity=30)" });
|
92 |
+
}
|
93 |
+
}, 500);
|
94 |
+
} else { /* For left, height */
|
95 |
+
if (jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).position().left >= -(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).height() - jQuery(".bwg_slideshow_filmstrip_"+bwg).height())) {
|
96 |
+
jQuery(".bwg_slideshow_filmstrip_left_"+bwg).css({opacity: 1, filter: "Alpha(opacity=100)"});
|
97 |
+
if (jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).position().left < -(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).height() - jQuery(".bwg_slideshow_filmstrip_"+bwg).height() - (bwg_params[bwg]['filmstrip_thumb_margin_hor'] + bwg_params[bwg]['slideshow_filmstrip_width']))) {
|
98 |
+
jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).animate({left: -(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).height() - jQuery(".bwg_slideshow_filmstrip_"+bwg).width())}, 500, 'linear');
|
99 |
+
}
|
100 |
+
else {
|
101 |
+
jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).animate({left: (jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).position().left - (bwg_params[bwg]['filmstrip_thumb_margin_hor'] + bwg_params[bwg]['slideshow_filmstrip_width']))}, 500, 'linear');
|
102 |
+
}
|
103 |
+
}
|
104 |
+
/* Disable right arrow.*/
|
105 |
+
window.setTimeout(function(){
|
106 |
+
if ((jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).position().left) == -( jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).height() - jQuery(".bwg_slideshow_filmstrip_"+bwg).height() )) {
|
107 |
+
jQuery(".bwg_slideshow_filmstrip_right_"+bwg).css({ opacity: 0.3, filter: "Alpha(opacity=30)" });
|
108 |
+
}
|
109 |
+
}, 500);
|
110 |
+
}
|
111 |
+
|
112 |
+
} else {
|
113 |
+
if ( bwg_params[bwg]['width_or_height'] == 'width' ) { /* For top, width */
|
114 |
+
if (jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).position().top >= -(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).width() - jQuery(".bwg_slideshow_filmstrip_"+bwg).width())) {
|
115 |
+
jQuery(".bwg_slideshow_filmstrip_left_"+bwg).css({opacity: 1, filter: "Alpha(opacity=100)"});
|
116 |
+
if (jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).position().top < -(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).width() - jQuery(".bwg_slideshow_filmstrip_"+bwg).width() - bwg_params[bwg]['filmstrip_thumb_margin_hor'] + bwg_params[bwg]['slideshow_filmstrip_width'])) {
|
117 |
+
jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).animate({top: -(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).width() - jQuery(".bwg_slideshow_filmstrip_"+bwg).width())}, 500, 'linear');
|
118 |
+
}
|
119 |
+
else {
|
120 |
+
jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).animate({top: (jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).position().top - bwg_params[bwg]['filmstrip_thumb_margin_hor'] + bwg_params[bwg]['slideshow_filmstrip_width'])}, 500, 'linear');
|
121 |
+
}
|
122 |
+
}
|
123 |
+
/* Disable right arrow.*/
|
124 |
+
window.setTimeout(function(){
|
125 |
+
if ((jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).position().top) == -( jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).width() - jQuery(".bwg_slideshow_filmstrip_"+bwg).width() )) {
|
126 |
+
jQuery(".bwg_slideshow_filmstrip_right_"+bwg).css({ opacity: 0.3, filter: "Alpha(opacity=30)" });
|
127 |
+
}
|
128 |
+
}, 500);
|
129 |
+
} else { /* For top, height */
|
130 |
+
if (jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).position().top >= -(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).height() - jQuery(".bwg_slideshow_filmstrip_"+bwg).height())) {
|
131 |
+
jQuery(".bwg_slideshow_filmstrip_left_"+bwg).css({opacity: 1, filter: "Alpha(opacity=100)"});
|
132 |
+
if (jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).position().top < -(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).height() - jQuery(".bwg_slideshow_filmstrip_"+bwg).height() - (bwg_params[bwg]['filmstrip_thumb_margin_hor'] + bwg_params[bwg]['slideshow_filmstrip_width']))) {
|
133 |
+
jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).animate({top: -(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).height() - jQuery(".bwg_slideshow_filmstrip_"+bwg).width())}, 500, 'linear');
|
134 |
+
}
|
135 |
+
else {
|
136 |
+
jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).animate({top: (jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).position().top - (bwg_params[bwg]['filmstrip_thumb_margin_hor'] + bwg_params[bwg]['slideshow_filmstrip_width']))}, 500, 'linear');
|
137 |
+
}
|
138 |
+
}
|
139 |
+
/* Disable right arrow.*/
|
140 |
+
window.setTimeout(function(){
|
141 |
+
if ((jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).position().top) == -( jQuery(".bwg_slideshow_filmstrip_thumbnails_"+bwg).height() - jQuery(".bwg_slideshow_filmstrip_"+bwg).height() )) {
|
142 |
+
jQuery(".bwg_slideshow_filmstrip_right_"+bwg).css({ opacity: 0.3, filter: "Alpha(opacity=30)" });
|
143 |
+
}
|
144 |
+
}, 500);
|
145 |
+
}
|
146 |
+
}
|
147 |
+
|
148 |
+
|
149 |
+
});
|
150 |
+
|
151 |
+
jQuery(".bwg_slideshow_filmstrip_left_"+bwg).on(bwg_click, function () {
|
152 |
+
jQuery( ".bwg_slideshow_filmstrip_thumbnails_"+bwg ).stop(true, false);
|
153 |
+
|
154 |
+
if( bwg_params[bwg]['left_or_top'] == 'left') {
|
155 |
+
if (jQuery(".bwg_slideshow_filmstrip_thumbnails_" + bwg).position().left < 0) {
|
156 |
+
jQuery(".bwg_slideshow_filmstrip_right_" + bwg).css({opacity: 1, filter: "Alpha(opacity=100)"});
|
157 |
+
if (jQuery(".bwg_slideshow_filmstrip_thumbnails_" + bwg).position().left > -bwg_params[bwg]['filmstrip_thumb_margin_hor'] + bwg_params[bwg]['slideshow_filmstrip_width']) {
|
158 |
+
jQuery(".bwg_slideshow_filmstrip_thumbnails_" + bwg).animate({left: 0}, 500, 'linear');
|
159 |
+
}
|
160 |
+
else {
|
161 |
+
jQuery(".bwg_slideshow_filmstrip_thumbnails_" + bwg).animate({left: (jQuery(".bwg_slideshow_filmstrip_thumbnails_" + bwg).position().left + bwg_params[bwg]['filmstrip_thumb_margin_hor'] + bwg_params[bwg]['slideshow_filmstrip_width'])}, 500, 'linear');
|
162 |
+
}
|
163 |
+
}
|
164 |
+
/* Disable left arrow.*/
|
165 |
+
window.setTimeout(function () {
|
166 |
+
if (jQuery(".bwg_slideshow_filmstrip_thumbnails_" + bwg).position().left == 0) {
|
167 |
+
jQuery(".bwg_slideshow_filmstrip_left_" + bwg).css({opacity: 0.3, filter: "Alpha(opacity=30)"});
|
168 |
+
}
|
169 |
+
}, 500);
|
170 |
+
} else {
|
171 |
+
if (jQuery(".bwg_slideshow_filmstrip_thumbnails_" + bwg).position().top < 0) {
|
172 |
+
jQuery(".bwg_slideshow_filmstrip_right_" + bwg).css({opacity: 1, filter: "Alpha(opacity=100)"});
|
173 |
+
if (jQuery(".bwg_slideshow_filmstrip_thumbnails_" + bwg).position().top > -bwg_params[bwg]['filmstrip_thumb_margin_hor'] + bwg_params[bwg]['slideshow_filmstrip_width']) {
|
174 |
+
jQuery(".bwg_slideshow_filmstrip_thumbnails_" + bwg).animate({top: 0}, 500, 'linear');
|
175 |
+
}
|
176 |
+
else {
|
177 |
+
jQuery(".bwg_slideshow_filmstrip_thumbnails_" + bwg).animate({ top: (jQuery(".bwg_slideshow_filmstrip_thumbnails_" + bwg).position().top + bwg_params[bwg]['filmstrip_thumb_margin_hor'] + bwg_params[bwg]['slideshow_filmstrip_width'])}, 500, 'linear');
|
178 |
+
}
|
179 |
+
}
|
180 |
+
/* Disable top arrow.*/
|
181 |
+
window.setTimeout(function () {
|
182 |
+
if (jQuery(".bwg_slideshow_filmstrip_thumbnails_" + bwg).position().top == 0) {
|
183 |
+
jQuery(".bwg_slideshow_filmstrip_left_" + bwg).css({opacity: 0.3, filter: "Alpha(opacity=30)"});
|
184 |
+
}
|
185 |
+
}, 500);
|
186 |
+
}
|
187 |
+
|
188 |
+
});
|
189 |
+
if(bwg_params[bwg]['width_or_height'] == 'width') {
|
190 |
+
/* Set filmstrip initial position.*/
|
191 |
+
bwg_set_filmstrip_pos(jQuery(".bwg_slideshow_filmstrip_"+bwg).width(), bwg);
|
192 |
+
} else {
|
193 |
+
/* Set filmstrip initial position.*/
|
194 |
+
bwg_set_filmstrip_pos(jQuery(".bwg_slideshow_filmstrip_"+bwg).height(), bwg);
|
195 |
+
}
|
196 |
+
|
197 |
+
/* Play/pause.*/
|
198 |
+
jQuery("#bwg_slideshow_play_pause_"+bwg).on(bwg_click, function () {
|
199 |
+
if (jQuery(".bwg_ctrl_btn_"+bwg).hasClass("fa-play")) {
|
200 |
+
bwg_play( bwg );
|
201 |
+
jQuery(".bwg_slideshow_play_pause_"+bwg).attr("title", "Pause");
|
202 |
+
jQuery(".bwg_slideshow_play_pause_"+bwg).attr("class", "bwg_ctrl_btn_"+bwg+" bwg_slideshow_play_pause_"+bwg+" fa fa-pause");
|
203 |
+
if (bwg_params[bwg]['enable_slideshow_music']) {
|
204 |
+
document.getElementById("bwg_audio_"+bwg).play();
|
205 |
+
}
|
206 |
+
}
|
207 |
+
else {
|
208 |
+
/* Pause.*/
|
209 |
+
window.clearInterval(bwg_params[bwg]['bwg_playInterval']);
|
210 |
+
jQuery(".bwg_slideshow_play_pause_"+bwg).attr("title", "Play");
|
211 |
+
jQuery(".bwg_slideshow_play_pause_"+bwg).attr("class", "bwg_ctrl_btn_"+bwg+" bwg_slideshow_play_pause_"+bwg+" fa fa-play");
|
212 |
+
if (bwg_params[bwg]['enable_slideshow_music']) {
|
213 |
+
document.getElementById("bwg_audio_"+bwg).pause();
|
214 |
+
}
|
215 |
+
}
|
216 |
+
});
|
217 |
+
if ( bwg_params[bwg]['enable_slideshow_autoplay'] ) {
|
218 |
+
bwg_play( bwg );
|
219 |
+
jQuery(".bwg_slideshow_play_pause_"+bwg).attr("title", "Pause");
|
220 |
+
jQuery(".bwg_slideshow_play_pause_"+bwg).attr("class", "bwg_ctrl_btn_"+bwg+" bwg_slideshow_play_pause_"+bwg+" fa fa-pause");
|
221 |
+
if ( bwg_params[bwg]['enable_slideshow_music'] ) {
|
222 |
+
document.getElementById("bwg_audio_"+bwg).play();
|
223 |
+
}
|
224 |
+
}
|
225 |
+
if (bwg_params[bwg]['preload_images']) {
|
226 |
+
bwg_preload_images(parseInt(jQuery("#bwg_current_image_key_" . $bwg).val()), bwg );
|
227 |
+
}
|
228 |
+
jQuery(".bwg_slideshow_image_"+bwg).removeAttr("width");
|
229 |
+
jQuery(".bwg_slideshow_image_"+bwg).removeAttr("height");
|
230 |
+
|
231 |
+
}
|
232 |
+
|
233 |
+
if(typeof bwg_params !== 'undefined') { /*For slideshow*/
|
234 |
+
jQuery('.bwg_slideshow').each(function () {
|
235 |
+
bwg = jQuery(this).attr('data-bwg');
|
236 |
+
jQuery(window).resize(function () {
|
237 |
+
bwg_popup_resize(bwg);
|
238 |
+
});
|
239 |
+
jQuery(window).focus(function () {
|
240 |
+
if (!jQuery(".bwg_ctrl_btn_" + bwg).hasClass("fa-play")) {
|
241 |
+
bwg_play(bwg);
|
242 |
+
}
|
243 |
+
var i = 0;
|
244 |
+
jQuery(".bwg_slider_" + bwg).children("span").each(function () {
|
245 |
+
if (jQuery(this).css('opacity') == 1) {
|
246 |
+
jQuery("#bwg_current_image_key_" + bwg).val(i);
|
247 |
+
}
|
248 |
+
i++;
|
249 |
+
});
|
250 |
+
});
|
251 |
+
jQuery(window).blur(function () {
|
252 |
+
/*
|
253 |
+
event_stack_<?php echo $bwg; ?> = [];
|
254 |
+
*/
|
255 |
+
bwg_params[bwg]['event_stack'] = [];
|
256 |
+
window.clearInterval(bwg_params[bwg]['bwg_playInterval']);
|
257 |
+
});
|
258 |
+
});
|
259 |
+
}
|
260 |
+
|
261 |
+
|
262 |
+
function bwg_sumoselect_ready() {
|
263 |
+
jQuery( 'div[id^="bwg_container"]' ).each( function () {
|
264 |
+
var bwg_container = jQuery(this);
|
265 |
+
if (bwg_container.data('right-click-protection')) {
|
266 |
+
/* Disable right click.*/
|
267 |
+
bwg_container.bind("contextmenu", function () {
|
268 |
+
return false;
|
269 |
+
});
|
270 |
+
bwg_container.css('webkitTouchCallout', 'none');
|
271 |
+
}
|
272 |
+
var search_tags = bwg_container.find('.search_tags');
|
273 |
+
if (search_tags.length) {
|
274 |
+
search_tags.SumoSelect({
|
275 |
+
triggerChangeCombined: true,
|
276 |
+
placeholder: bwg_objectsL10n.bwg_select_tag,
|
277 |
+
search: 1,
|
278 |
+
searchText: bwg_objectsL10n.bwg_search,
|
279 |
+
forceCustomRendering: true,
|
280 |
+
noMatch: bwg_objectsL10n.bwg_tag_no_match,
|
281 |
+
captionFormatAllSelected: bwg_objectsL10n.bwg_all_tags_selected,
|
282 |
+
captionFormat: '{0} ' + bwg_objectsL10n.bwg_tags_selected,
|
283 |
+
});
|
284 |
+
}
|
285 |
+
var bwg_order = bwg_container.find('.bwg_order');
|
286 |
+
if (bwg_order.length) {
|
287 |
+
bwg_order.SumoSelect({
|
288 |
+
triggerChangeCombined: true,
|
289 |
+
forceCustomRendering: true,
|
290 |
+
});
|
291 |
+
}
|
292 |
+
});
|
293 |
+
}
|
294 |
+
|
295 |
+
/* hide search_placeholder_title class container */
|
296 |
+
function bwg_search_focus(that) {
|
297 |
+
jQuery(that).parent().find('.bwg_search_input').focus();
|
298 |
+
jQuery(that).hide();
|
299 |
+
}
|
300 |
+
|
301 |
+
/* show search and reset icons */
|
302 |
+
function bwg_key_press(that) {
|
303 |
+
jQuery(that).parent().find('.bwg_search_reset_container').show();
|
304 |
+
jQuery(that).parent().find('.bwg_search_loupe_container1').show();
|
305 |
+
|
306 |
+
}
|
307 |
+
|
308 |
jQuery(window).on("resize", function () {
|
309 |
jQuery(".bwg-thumbnails").each(function () {
|
310 |
bwg_all_thumnails_loaded(this);
|
371 |
bwg_container_loaded(jQuery(that).data('bwg'));
|
372 |
}
|
373 |
|
374 |
+
function bwg_add_lightbox() {
|
375 |
var bwg_touch_flag = false;
|
376 |
+
jQuery( ".bwg_lightbox .bwg-item0, .bwg_lightbox .bwg_slide" ).on("click", function ( event ) {
|
377 |
event.stopPropagation();
|
378 |
event.preventDefault();
|
379 |
var that = jQuery(this).parent();
|
385 |
bwg_gallery_box( jQuery( that ).attr( "data-image-id" ), jQuery( that ).closest( '.bwg_container' ) );
|
386 |
return false;
|
387 |
}
|
388 |
+
});
|
389 |
|
390 |
+
jQuery( ".bwg_lightbox .bwg_ecommerce" ).on("click", function ( event ) {
|
391 |
event.stopPropagation();
|
392 |
if ( !bwg_touch_flag ) {
|
393 |
bwg_touch_flag = true;
|
398 |
bwg_gallery_box( image_id, jQuery( this ).closest( '.bwg_container' ), true );
|
399 |
return false;
|
400 |
}
|
401 |
+
});
|
402 |
+
}
|
403 |
+
function bwg_document_ready() {
|
404 |
+
bwg_add_lightbox();
|
405 |
jQuery( 'div[id^="bwg_container"]' ).each( function () {
|
406 |
var bwg_container = jQuery( this );
|
407 |
if ( bwg_container.data( 'right-click-protection' ) ) {
|
412 |
bwg_container.css( 'webkitTouchCallout', 'none' );
|
413 |
}
|
414 |
|
415 |
+
/* Add dashicon to select container */
|
416 |
+
jQuery(".SumoSelect > .CaptionCont > label > i").addClass("fa fa-angle-down closed");
|
417 |
+
|
418 |
var search_tags = bwg_container.find('.search_tags');
|
419 |
if (search_tags.length) {
|
420 |
+
search_tags.SumoSelect({
|
421 |
+
triggerChangeCombined:true,
|
422 |
placeholder: bwg_objectsL10n.bwg_select_tag,
|
423 |
search: 1,
|
424 |
+
searchText : bwg_objectsL10n.bwg_search,
|
425 |
+
forceCustomRendering: true,
|
426 |
+
noMatch: bwg_objectsL10n.bwg_tag_no_match,
|
427 |
+
captionFormatAllSelected : bwg_objectsL10n.bwg_all_tags_selected,
|
428 |
+
captionFormat: '{0} '+ bwg_objectsL10n. bwg_tags_selected,
|
429 |
} );
|
430 |
}
|
431 |
+
|
432 |
+
var bwg_order = bwg_container.find('.bwg_order');
|
433 |
+
if (bwg_order.length) {
|
434 |
+
bwg_order.SumoSelect({
|
435 |
+
triggerChangeCombined:true,
|
436 |
+
forceCustomRendering: true,
|
437 |
+
} );
|
438 |
+
}
|
439 |
+
|
440 |
+
/* Show/Hide search_placeholder_title class container */
|
441 |
+
if (jQuery(this).find('.bwg_search_input').val() == '') {
|
442 |
+
jQuery(this).find('search_placeholder_title').show();
|
443 |
+
}
|
444 |
+
else {
|
445 |
+
jQuery(this).find('search_placeholder_title').hide();
|
446 |
+
}
|
447 |
+
|
448 |
+
/* Show search_placeholder_title class container on focusout and hide reset, search icons*/
|
449 |
+
jQuery(".bwg_thumbnail .bwg_search_container_2").focusout(function (e) {
|
450 |
+
if(jQuery(this).find('.bwg_search_input').val() == ''){
|
451 |
+
jQuery(this).find('.search_placeholder_title').show();
|
452 |
+
jQuery(this).find('.bwg_search_loupe_container1').hide();
|
453 |
+
jQuery(this).find('.bwg_search_reset_container').hide();
|
454 |
+
}
|
455 |
+
});
|
456 |
+
});
|
457 |
+
|
458 |
+
var currentTags;
|
459 |
+
var newTags;
|
460 |
+
|
461 |
+
/* Show No tags text if tags empty */
|
462 |
+
jQuery('.search_tags').on('sumo:opened',function(event){
|
463 |
+
currentTags = jQuery(this).parent().find('.CaptionCont').attr('title');
|
464 |
+
if( jQuery(this).parent().find('ul li').length == 0 ) {
|
465 |
+
jQuery(".no-match").html(bwg_objectsL10n.bwg_tag_no_match);
|
466 |
+
jQuery(".no-match").show();
|
467 |
+
}
|
468 |
+
});
|
469 |
+
|
470 |
+
/* Run function of tag filters if select box closed and there are difference between new/old selection */
|
471 |
+
jQuery('.bwg_thumbnail .search_tags').on('sumo:closed',function(event){
|
472 |
+
var curCont = jQuery(this).parent().parent();
|
473 |
+
var current_view = curCont.find('.current_view').val();
|
474 |
+
var form_id = curCont.find('.form_id').val();
|
475 |
+
var cur_gal_id = curCont.find('.cur_gal_id').val();
|
476 |
+
var album_gallery_id = curCont.find('.album_gallery_id').val();
|
477 |
+
var type = curCont.find('.type').val();
|
478 |
+
newTags = jQuery(this).parent().find('.CaptionCont').attr('title');
|
479 |
+
/* Run function if selected */
|
480 |
+
if ( currentTags != newTags ) {
|
481 |
+
bwg_select_tag(current_view, form_id, cur_gal_id, album_gallery_id, type, false);
|
482 |
+
}
|
483 |
+
});
|
484 |
+
|
485 |
+
/* Change dashicon from up arrow to down arrow when select box is close */
|
486 |
+
jQuery('.bwg_thumbnail .SumoSelect').on('sumo:closed', function(){
|
487 |
+
jQuery(this).find('label i').removeClass('opened fa fa-angle-up');
|
488 |
+
jQuery(this).find('label i').addClass("fa fa-angle-down closed");
|
489 |
+
});
|
490 |
+
|
491 |
+
/* Change dashicon from down arrow to up arrow when select box is open */
|
492 |
+
jQuery('.bwg_thumbnail .SumoSelect').on('sumo:opened', function() {
|
493 |
+
jQuery(this).find('label i').removeClass('closed fa fa-angle-down');
|
494 |
+
jQuery(this).find('label i').addClass("fa fa-angle-up opened");
|
495 |
+
});
|
496 |
|
497 |
var bwg_hash = window.location.hash.substring( 1 );
|
498 |
if ( bwg_hash ) {
|
529 |
filterTags = filterTags ? filterTags : 0;
|
530 |
var ecommerce = openEcommerce == true ? "&open_ecommerce=1" : "";
|
531 |
var filtersearchname = jQuery("#bwg_search_input_" + bwg ).val();
|
532 |
+
var filtersortby = jQuery("#bwg_order_" + bwg).val() ? "&filtersortby=" + jQuery("#bwg_order_" + bwg).val() : '';
|
533 |
filtersearchname = filtersearchname ? filtersearchname : '';
|
534 |
+
spider_createpopup(bwg_lightbox_url + '&image_id=' + image_id + "&filter_tag=" + filterTags + ecommerce + '&filter_search_name=' + filtersearchname + filtersortby, bwg, bwg_container.data('popup-width'), bwg_container.data('popup-height'), 1, 'testpopup', 5, bwg_container.data('buttons-position'));
|
535 |
}
|
536 |
|
537 |
function spider_frontend_ajax(form_id, current_view, id, album_gallery_id, cur_album_id, type, srch_btn, title, sortByParam, load_more, description) {
|
538 |
jQuery(window).off("scroll");
|
539 |
+
jQuery('.bwg_thumbnail .search_tags').off('sumo:closed');
|
540 |
var masonry_loaded = 0;
|
541 |
var mosaic_loaded = 0;
|
542 |
if (typeof load_more == "undefined") {
|
547 |
var bwg_previous_album_ids = jQuery('#bwg_previous_album_id_' + current_view).val();
|
548 |
var bwg_previous_album_page_numbers = jQuery('#bwg_previous_album_page_number_' + current_view).val();
|
549 |
var post_data = {};
|
550 |
+
if (album_gallery_id == 'back') { /* Back from album. */
|
551 |
var bwg_previous_album_id = bwg_previous_album_ids.split(",");
|
552 |
album_gallery_id = bwg_previous_album_id[1];
|
553 |
jQuery('#bwg_previous_album_id_' + current_view).val(bwg_previous_album_ids.replace(bwg_previous_album_id[0] + ',', ''));
|
556 |
jQuery('#bwg_previous_album_page_number_' + current_view).val(bwg_previous_album_page_numbers.replace(bwg_previous_album_page_number[0] + ',', ''));
|
557 |
post_data["action_" + current_view] = 'back';
|
558 |
}
|
559 |
+
else if (cur_album_id != '') { /* Enter album (not change the page). */
|
560 |
jQuery('#bwg_previous_album_id_' + current_view).val(album_gallery_id + ',' + bwg_previous_album_ids);
|
561 |
if (page_number) {
|
562 |
jQuery('#bwg_previous_album_page_number_' + current_view).val(page_number + ',' + bwg_previous_album_page_numbers);
|
563 |
}
|
564 |
page_number = 1;
|
565 |
}
|
566 |
+
if (srch_btn) { /* Start search. */
|
567 |
page_number = 1;
|
568 |
}
|
569 |
if (typeof title == "undefined" || title == '') {
|
584 |
post_data["title_" + current_view] = title;
|
585 |
post_data["description_" + current_view] = description;
|
586 |
post_data["sortImagesByValue_" + current_view] = sortByParam;
|
587 |
+
if (jQuery("#bwg_search_input_" + current_view).length > 0) { /* Search box exists.*/
|
588 |
post_data["bwg_search_" + current_view] = jQuery("#bwg_search_input_" + current_view).val();
|
589 |
}
|
590 |
post_data["bwg_tag_id_" + id] = jQuery("#bwg_tag_id_" + id).val();
|
591 |
+
/* Loading. */
|
592 |
if ( id != "bwg_standart_thumbnails_" + current_view ) {
|
593 |
jQuery("#ajax_loading_" + current_view).css('display', '');
|
594 |
}
|
595 |
else {
|
596 |
jQuery("#ajax_loading_" + current_view).removeClass('bwg-hidden');
|
597 |
}
|
598 |
+
|
599 |
jQuery.ajax({
|
600 |
type: "POST",
|
601 |
url: window.location,
|
609 |
|
610 |
jQuery("div[id^='bwg_container1_'] form").each(function () {
|
611 |
if (jQuery(this).data("current") == current_view) {
|
612 |
+
var str = jQuery(data).find('.bwg_nav_cont_' + current_view).html();
|
613 |
+
jQuery('.bwg_nav_cont_' + current_view).html(str);
|
614 |
}
|
615 |
else {
|
616 |
+
var str = jQuery(this).find('span[class^="bwg_nav_cont_"]').html();
|
617 |
+
jQuery(this).find('span[class^="bwg_nav_cont_"]').html(str);
|
618 |
}
|
619 |
});
|
620 |
}
|
621 |
else {
|
622 |
+
var str = jQuery(data).find('#' + form_id).html();
|
623 |
+
jQuery('#' + form_id).html(str);
|
624 |
}
|
625 |
+
/* TODO. is not runing new version.
|
626 |
+
There are no images.
|
627 |
+
*/
|
628 |
+
/* Search box exists and not album view and search isn't empty. */
|
629 |
+
if ( jQuery("#bwg_search_input_" + current_view).length > 0 && album_gallery_id == 0 ) {
|
630 |
+
var bwg_images_count = jQuery('#bwg_images_count_' + current_view).val();
|
631 |
+
|
632 |
+
if( jQuery(data).text().indexOf('There are no images in this gallery.') > -1 || jQuery(data).text().indexOf('There are no images.') > -1 ) {
|
633 |
+
bwg_images_count = 0;
|
634 |
+
}
|
635 |
+
|
636 |
+
if (bwg_images_count == 0) {
|
637 |
+
var cont = jQuery("#" + id).parent().html();
|
638 |
+
var error_msg = '<div style="width:95%"><div class="wd_error"><p><strong>' + bwg_objectL10n.bwg_search_result + '</strong></p></div></div>';
|
639 |
+
|
640 |
+
/* For thumbnail view */
|
641 |
+
if( ("#" + id).indexOf('standart_thumbnails') ) {
|
642 |
+
/* Check if there error div */
|
643 |
+
if (jQuery("#" + id).parent().find('.wd_error').length != 0) {
|
644 |
+
jQuery("#" + id).parent().find('.wd_error').parent().remove();
|
645 |
+
}
|
646 |
+
/* Check if download gallery div */
|
647 |
+
if (jQuery("#" + id).parent().parent().find('.bwg_download_gallery').length != 0) {
|
648 |
+
jQuery("#" + id).parent().parent().find('.bwg_download_gallery').remove();
|
649 |
+
}
|
650 |
+
|
651 |
+
/* remove pagination */
|
652 |
+
jQuery("#" + id).parent().parent().find('.bwg_nav_cont_'+current_view).remove();
|
653 |
+
|
654 |
+
jQuery("#" + id).empty();
|
655 |
+
cont = jQuery("#" + id).parent().html();
|
656 |
+
/* Hide loading div */
|
657 |
+
var index = jQuery("#" + id).attr('data-bwg');
|
658 |
+
jQuery('#ajax_loading_' + index).addClass('bwg-hidden');
|
659 |
+
jQuery("#" + id).parent().html(error_msg + cont);
|
660 |
+
} else {
|
661 |
+
jQuery("#" + id).parent().html(error_msg + cont);
|
662 |
+
}
|
663 |
+
}
|
664 |
}
|
665 |
},
|
666 |
beforeSend: function(){
|
672 |
}
|
673 |
else if (jQuery(this).attr("data-src") != '') {
|
674 |
jQuery(this).attr("src", jQuery(this).attr("data-src"));
|
675 |
+
}
|
676 |
});
|
677 |
jQuery(".blog_style_image_buttons_conteiner_" + current_view).find(jQuery(".bwg_blog_style_img_" + current_view)).on("load", function() {
|
678 |
jQuery(".bwg_blog_style_img_" + current_view).closest(jQuery(".blog_style_image_buttons_conteiner_" + current_view)).show();
|
679 |
});
|
680 |
+
if ( id != "bwg_standart_thumbnails_" + current_view ) {
|
681 |
+
jQuery("#ajax_loading_" + current_view).css('display', 'none');
|
682 |
+
/* jQuery("#ajax_loading_" + current_view).addClass('bwg-hidden'); */
|
683 |
+
}
|
684 |
jQuery("#bwg_tags_id_" + id).val(jQuery("#bwg_tag_id_" + id).val());
|
685 |
|
686 |
if (jQuery(".pagination-links_" + current_view).length) {
|
688 |
}
|
689 |
/* For thumbnails view.*/
|
690 |
if (id == "bwg_standart_thumbnails_" + current_view) {
|
691 |
+
bwg_document_ready();
|
692 |
bwg_all_thumnails_loaded(".bwg-container-" + current_view);
|
693 |
}
|
694 |
else if ( id.indexOf('album') === -1 && id.indexOf('bwg_masonry_thumbnails') === -1) {
|
695 |
/* Do not apply to album views. */
|
696 |
window["bwg_document_ready_" + current_view]();
|
697 |
}
|
698 |
+
/* For masonry view.*/
|
699 |
if (id == "bwg_masonry_thumbnails_" + current_view || id == "bwg_album_masonry_" + current_view) {
|
700 |
+
window["bwg_masonry_ajax_" + current_view](masonry_loaded);
|
701 |
}
|
702 |
/* For mosaic view.*/
|
703 |
if (id == "bwg_mosaic_thumbnails_" + current_view) {
|
704 |
window["bwg_mosaic_ajax_" + current_view](mosaic_loaded);
|
705 |
}
|
706 |
+
/* For Blog style view.*/
|
707 |
jQuery(".blog_style_images_conteiner_" + current_view + " .bwg_embed_frame_16x9_" + current_view).each(function (e) {
|
708 |
jQuery(this).width(jQuery(this).parent().width());
|
709 |
jQuery(this).height(jQuery(this).width() * 0.5625);
|
721 |
/* 16 is 2*padding inside iframe */
|
722 |
/* 96 is 2*padding(top) + 1*padding(bottom) + 40(footer) + 32(header) */
|
723 |
jQuery('.bwg_embed_frame_instapost_' + current_view).height((jQuery('.bwg_embed_frame_instapost_' + current_view).width() - 16) * jQuery('.bwg_embed_frame_instapost_' + current_view).attr('data-height') / jQuery('.bwg_embed_frame_instapost_' + current_view).attr('data-width') + 96);
|
724 |
+
|
725 |
+
/* return value to search input field */
|
726 |
+
jQuery("#bwg_search_input_" + current_view).val(post_data["bwg_search_" + current_view]);
|
727 |
+
|
728 |
+
if ( jQuery("#bwg_search_input_" + current_view).val() != '' ){
|
729 |
+
jQuery("#bwg_search_input_" + current_view).parent().find('.search_placeholder_title').hide();
|
730 |
+
jQuery("#bwg_search_input_" + current_view).parent().parent().find('.bwg_search_reset_container').show();
|
731 |
+
jQuery("#bwg_search_input_" + current_view).parent().parent().find('.bwg_search_loupe_container1').show();
|
732 |
+
} else {
|
733 |
+
jQuery("#bwg_search_input_" + current_view).parent().find('.search_placeholder_title').show();
|
734 |
+
}
|
735 |
}
|
736 |
});
|
737 |
return false;
|
741 |
if (reset) {
|
742 |
jQuery("#bwg_tag_id_" + cur_gal_id).val('');
|
743 |
}
|
744 |
+
|
745 |
spider_frontend_ajax(form_id, current_view, cur_gal_id, album_gallery_id, '', type, 1, '');
|
746 |
}
|
747 |
|
748 |
+
function bwg_change_image_lightbox(current_key, key, data, from_effect) {
|
|
|
749 |
bwg_current_key = bwg_param['bwg_current_key'];
|
750 |
+
/* var bwg_image_info_pos = jQuery(".bwg_ctrl_btn_container").height(); */
|
751 |
jQuery(".bwg_image_info").css("height","auto");
|
752 |
setTimeout(function(){
|
753 |
if(jQuery(".bwg_image_info_container1").height() < (jQuery(".bwg_image_info").height() + jQuery(".bwg_toggle_container").height() + bwg_image_info_pos + 2*(parseInt(bwg_param['lightbox_info_margin'])))) {
|
804 |
jQuery(this)[0].contentWindow.postMessage('{ "method": "pause" }', "*");
|
805 |
jQuery(this)[0].contentWindow.postMessage('pause', '*');
|
806 |
});
|
807 |
+
jQuery("#bwg_image_container").find("video").each(function () {
|
808 |
jQuery(this).trigger('pause');
|
809 |
});
|
810 |
|
813 |
if (jQuery(".bwg_play_pause").length && !jQuery(".bwg_play_pause").hasClass("fa-play")) {
|
814 |
bwg_play();
|
815 |
}
|
816 |
+
|
817 |
if (!from_effect) {
|
818 |
/* Change image key.*/
|
819 |
jQuery("#bwg_current_image_key").val(key);
|
821 |
current_key = jQuery(".bwg_thumb_active").children("img").attr("image_key");
|
822 |
}*/
|
823 |
}
|
824 |
+
if (bwg_param['bwg_trans_in_progress']) {
|
825 |
event_stack.push(current_key + '-' + key);
|
826 |
return;
|
827 |
}
|
902 |
/* hide download button if image source is embed */
|
903 |
jQuery("#bwg_download").addClass("hidden");
|
904 |
/*innhtml += '<span style="height: ' + cur_height + 'px; width: ' + cur_width + 'px;" class="bwg_popup_embed bwg_popup_watermark">';*/
|
905 |
+
innhtml += '<span class="bwg_popup_embed bwg_popup_watermark" style="display: block; table-layout: fixed; height: 100%;">' + (is_embed_instagram_video ? '<div class="bwg_inst_play_btn_cont" onclick="bwg_play_instagram_video(this)" ><div class="bwg_inst_play"></div></div>' : ' ');
|
906 |
if (is_embed_instagram_post) {
|
907 |
var post_width = 0;
|
908 |
var post_height = 0;
|
917 |
innhtml += spider_display_embed(data[key]['filetype'], data[key]['image_url'], data[key]['filename'], {class:"bwg_embed_frame", 'data-width': data[key]['image_width'], 'data-height': data[key]['image_height'], frameborder: "0", allowfullscreen: "allowfullscreen", style: "width:" + post_width + "px; height:" + post_height + "px; vertical-align:middle; display:inline-block; position:relative;"});
|
918 |
}
|
919 |
else {
|
920 |
+
innhtml += spider_display_embed(data[key]['filetype'],data[key]['image_url'], data[key]['filename'], {class:"bwg_embed_frame", frameborder:"0", allowfullscreen:"allowfullscreen", style:"display:block; width:inherit; height:inherit; vertical-align:middle;" });
|
921 |
}
|
922 |
innhtml += "</span>";
|
923 |
}
|
1025 |
}
|
1026 |
}
|
1027 |
|
1028 |
+
function bwg_preload_images_lightbox( key ) {
|
1029 |
var count_all = data.length;
|
1030 |
+
var preloadCount = ( bwg_param['preload_images_count'] == 0 || bwg_param['preload_images_count'] >= count_all ) ? count_all : bwg_param['preload_images_count'];
|
|
|
1031 |
var indexedImgCount = 0;
|
1032 |
+
for ( var i = 1; indexedImgCount < preloadCount; i++ ) {
|
1033 |
+
var sign = 1;
|
1034 |
+
do {
|
1035 |
+
var index = ( key + i * sign + count_all ) % count_all;
|
1036 |
+
if ( typeof data[index] != "undefined" ) {
|
1037 |
+
var is_embed = data[index]['filetype'].indexOf( "EMBED_" ) > -1 ? true : false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1038 |
if ( !is_embed ) {
|
1039 |
+
jQuery( "<img/>" ).attr( "src", bwg_param['site_url'] + jQuery( '<span style="display: block;" />' ).html( data[index]["image_url"] ).text() );
|
|
|
|
|
|
|
|
|
1040 |
}
|
1041 |
}
|
1042 |
+
sign *= -1;
|
1043 |
+
indexedImgCount++;
|
1044 |
}
|
1045 |
+
while ( sign != 1 );
|
1046 |
}
|
1047 |
}
|
1048 |
|
1055 |
bwg_params[bwg]['bwg_trans_in_progress'] = true;
|
1056 |
bwg_prefix = "_"+bwg;
|
1057 |
bwg_transition_dur = bwg_params[bwg]['bwg_transition_duration'];
|
1058 |
+
var event_stack = bwg_params[bwg]['event_stack']
|
1059 |
} else {
|
1060 |
bwg_transition_dur = bwg_transition_duration;
|
1061 |
}
|
1077 |
jQuery(".bwg_slideshow_filmstrip_thumbnail_"+bwg).removeClass("bwg_slideshow_thumb_active_"+bwg).addClass("bwg_slideshow_thumb_deactive_"+bwg);
|
1078 |
jQuery("#bwg_filmstrip_thumbnail_" + bwg_params[bwg]['bwg_current_key']+ "_"+bwg).removeClass("bwg_slideshow_thumb_deactive_"+bwg).addClass("bwg_slideshow_thumb_active_"+bwg);
|
1079 |
jQuery(".bwg_slideshow_dots_"+bwg).removeClass("bwg_slideshow_dots_active_"+bwg).addClass("bwg_slideshow_dots_deactive_"+bwg);
|
1080 |
+
jQuery("#bwg_dots_" + bwg_params[bwg]['bwg_current_key'] + "_" + bwg).removeClass("bwg_slideshow_dots_deactive_"+bwg).addClass("bwg_slideshow_dots_active_"+bwg);
|
1081 |
jQuery(".bwg_slide_bg_"+bwg).css('perspective', 1000);
|
1082 |
}
|
1083 |
jQuery(current_image_class).css({
|
1114 |
jQuery(current_image_class).html('');
|
1115 |
|
1116 |
if ( type_slideshow ) { /*check if cube works from slideshow*/
|
1117 |
+
bwg_change_watermark_container( bwg );
|
1118 |
bwg_params[bwg]['bwg_trans_in_progress'] = false;
|
1119 |
+
var data = bwg_params[bwg]['data'];
|
1120 |
}
|
1121 |
|
1122 |
if (typeof event_stack !== 'undefined') {
|
1123 |
if (event_stack.length > 0) {
|
1124 |
key = event_stack[0].split("-");
|
1125 |
event_stack.shift();
|
1126 |
+
bwg_change_image(key[0], key[1], data, true, bwg);
|
|
|
1127 |
}
|
1128 |
}
|
1129 |
bwg_change_watermark_container();
|
1133 |
}
|
1134 |
}
|
1135 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1136 |
function bwg_fade(current_image_class, next_image_class, direction, bwg) {
|
1137 |
var type_slideshow = false;
|
|
|
1138 |
var bwg_transition_dur;
|
1139 |
+
if( typeof bwg != 'undefined' ) {
|
1140 |
type_slideshow = true;
|
1141 |
bwg_params[bwg]['bwg_trans_in_progress'] = true;
|
|
|
1142 |
bwg_transition_dur = bwg_params[bwg]['bwg_transition_duration'];
|
1143 |
} else {
|
1144 |
+
bwg_transition_dur = bwg_param['bwg_transition_duration'];
|
1145 |
}
|
1146 |
|
1147 |
if(type_slideshow) {
|
1157 |
}
|
1158 |
function bwg_after_trans() {
|
1159 |
jQuery(".bwg_image_info").show();
|
1160 |
+
bwg_change_watermark_container( bwg );
|
1161 |
if( type_slideshow ) {
|
1162 |
bwg_params[bwg]['bwg_trans_in_progress'] = false;
|
1163 |
}
|
1177 |
duration: bwg_transition_dur,
|
1178 |
complete: function () {
|
1179 |
bwg_trans_in_progress = false;
|
1180 |
+
bwg_params[bwg]['bwg_trans_in_progress'] = false;
|
1181 |
jQuery(current_image_class).html('');
|
1182 |
bwg_after_trans()
|
1183 |
}
|
1190 |
bwg_after_trans();
|
1191 |
}
|
1192 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1193 |
|
1194 |
+
/* open popup sidebar */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1195 |
function bwg_popup_sidebar_open(obj){
|
1196 |
var comment_container_width = bwg_param['lightbox_comment_width'];
|
1197 |
var lightbox_comment_pos = bwg_param['lightbox_comment_pos'];
|
1211 |
jQuery(".spider_popup_close_fullscreen").show();
|
1212 |
}
|
1213 |
|
|
|
1214 |
if(lightbox_comment_pos == 'left') {
|
1215 |
obj.animate({left: 0}, 100);
|
1216 |
} else {
|
1360 |
if (jQuery(".bwg_comment_container").hasClass("bwg_open")) {
|
1361 |
bwg_popup_sidebar_close(jQuery(".bwg_comment_container"));
|
1362 |
jQuery(".bwg_comment_container").attr("class", "bwg_comment_container bwg_close");
|
1363 |
+
/* Must be translatable */
|
1364 |
jQuery(".bwg_comment").attr("title", bwg_objectsL10n.bwg_how_comments);
|
1365 |
}
|
1366 |
if (jQuery(".bwg_ecommerce_container").hasClass("bwg_open")) {
|
1368 |
bwg_popup_sidebar_close(jQuery(".bwg_ecommerce_container"));
|
1369 |
bwg_animate_image_box_for_hide_sidebar();
|
1370 |
jQuery(".bwg_ecommerce_container").attr("class", "bwg_ecommerce_container bwg_close");
|
1371 |
+
/* Must be translatable */
|
1372 |
jQuery(".bwg_ecommerce").attr("title", bwg_objectsL10n.bwg_show_ecommerce);
|
1373 |
+
/* jQuery(".spider_popup_close_fullscreen").show(); */
|
1374 |
}
|
1375 |
else {
|
1376 |
/* Open ecommerce.*/
|
1392 |
}
|
1393 |
}
|
1394 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1395 |
/* Open with fullscreen.*/
|
1396 |
function bwg_open_with_fullscreen() {
|
1397 |
jQuery(".bwg_watermark").css({display: 'none'});
|
1447 |
jQuery(".spider_popup_close").attr("class", "bwg_ctrl_btn spider_popup_close_fullscreen");
|
1448 |
}
|
1449 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1450 |
function bwg_resize_full() {
|
1451 |
jQuery(".bwg_watermark").css({display: 'none'});
|
1452 |
var comment_container_width = 0;
|
1453 |
if (jQuery(".bwg_comment_container").hasClass("bwg_open") || jQuery(".bwg_ecommerce_container").hasClass("bwg_open") ) {
|
1454 |
comment_container_width = jQuery(".bwg_comment_container").width() || jQuery(".bwg_ecommerce_container").width();
|
1455 |
}
|
1456 |
+
/* resize to small from full */
|
1457 |
if (jQuery(".bwg_resize-full").hasClass("fa-resize-small")) {
|
1458 |
if (jQuery(window).width() > bwg_param['image_width']) {
|
1459 |
bwg_popup_current_width = bwg_param['image_width'];
|
1517 |
jQuery(".bwg_resize-full").attr("title", "<?php echo __('Maximize', BWG()->prefix); ?>");
|
1518 |
|
1519 |
}
|
1520 |
+
else { /* resize to full from small */
|
1521 |
bwg_popup_current_width = jQuery(window).width();
|
1522 |
bwg_popup_current_height = window.innerHeight;
|
1523 |
/* Maximize.*/
|
1562 |
jQuery(".bwg_resize-full").attr("title", "<?php echo __('Restore', BWG()->prefix); ?>");
|
1563 |
jQuery(".spider_popup_close").attr("class", "bwg_ctrl_btn spider_popup_close_fullscreen");
|
1564 |
}
|
|
|
1565 |
}
|
1566 |
|
1567 |
+
function bwg_popup_resize_lightbox() {
|
1568 |
if (typeof jQuery().fullscreen !== 'undefined') {
|
1569 |
if (jQuery.isFunction(jQuery().fullscreen)) {
|
1570 |
if (!jQuery.fullscreen.isFullScreen()) {
|
1699 |
jQuery(".bwg_toggle_container").css("top", jQuery(".bwg_ctrl_btn_container").height() + "px");
|
1700 |
}
|
1701 |
}
|
1702 |
+
}
|
1703 |
+
|
1704 |
+
/* Set watermark container size.*/
|
1705 |
+
function bwg_change_watermark_container( bwg ) {
|
1706 |
+
var defix = ( typeof bwg != 'undefined' ) ? '_'+bwg : '';
|
1707 |
+
jQuery(".bwg_slider"+defix).children().each(function() {
|
1708 |
+
if (jQuery(this).css("zIndex") == 2) {
|
1709 |
+
/* For images.*/
|
1710 |
+
var bwg_current_image_span = jQuery(this).find("img");
|
1711 |
+
if (bwg_current_image_span.length) {
|
1712 |
+
if (bwg_current_image_span.prop('complete')) {
|
1713 |
+
var width = bwg_current_image_span.width();
|
1714 |
+
var height = bwg_current_image_span.height();
|
1715 |
+
bwg_change_each_watermark_container(width, height, bwg);
|
1716 |
+
}
|
1717 |
+
else {
|
1718 |
+
bwg_current_image_span.on("load", function () {
|
1719 |
+
var width = bwg_current_image_span.width();
|
1720 |
+
var height = bwg_current_image_span.height();
|
1721 |
+
bwg_change_each_watermark_container(width, height, bwg);
|
1722 |
+
});
|
1723 |
+
}
|
1724 |
+
}
|
1725 |
+
else {
|
1726 |
+
/* For embeds and videos.*/
|
1727 |
+
bwg_current_image_span = jQuery(this).find("iframe");
|
1728 |
+
if (!bwg_current_image_span.length) {
|
1729 |
+
bwg_current_image_span = jQuery(this).find("video");
|
1730 |
+
}
|
1731 |
+
var width = bwg_current_image_span.width();
|
1732 |
+
var height = bwg_current_image_span.height();
|
1733 |
+
bwg_change_each_watermark_container(width, height, bwg);
|
1734 |
+
}
|
1735 |
+
}
|
1736 |
+
});
|
1737 |
+
}
|
1738 |
+
|
1739 |
+
/* Set each watermark container size.*/
|
1740 |
+
function bwg_change_each_watermark_container(width, height, bwg) {
|
1741 |
+
|
1742 |
+
var defix = ( typeof bwg != 'undefined' ) ? '_'+bwg : '';
|
1743 |
+
var source = ( typeof bwg != 'undefined' ) ? '_slideshow' : '';
|
1744 |
+
|
1745 |
+
jQuery(".bwg"+source+"_watermark_spun" + defix).width(width);
|
1746 |
+
jQuery(".bwg"+source+"_watermark_spun" + defix).height(height);
|
1747 |
+
jQuery(".bwg"+source+"_watermark" + defix).css({display: ''});
|
1748 |
+
|
1749 |
+
if( typeof bwg == 'undefined' ) {
|
1750 |
+
/* Set watermark image size.*/
|
1751 |
+
var comment_container_width = 0;
|
1752 |
+
if (jQuery(".bwg_comment_container").hasClass("bwg_open") || jQuery(".bwg_ecommerce_container").hasClass("bwg_open")) {
|
1753 |
+
comment_container_width = bwg_param['lightbox_comment_width'];
|
1754 |
+
}
|
1755 |
+
if (width <= (jQuery(window).width() - comment_container_width)) {
|
1756 |
+
jQuery(".bwg_watermark_image").css({
|
1757 |
+
width: ((jQuery(".spider_popup_wrap").width() - comment_container_width) * bwg_param['watermark_font_size'] / bwg_param['image_width'])
|
1758 |
+
});
|
1759 |
+
jQuery(".bwg_watermark_text, .bwg_watermark_text:hover").css({
|
1760 |
+
fontSize: ((jQuery(".spider_popup_wrap").width() - comment_container_width) * bwg_param['watermark_font_size'] / bwg_param['image_width'])
|
1761 |
+
});
|
1762 |
+
}
|
1763 |
+
} else {
|
1764 |
+
jQuery(".bwg" + source + "_title_spun" + defix).width(width);
|
1765 |
+
jQuery(".bwg" + source + "_title_spun" + defix).height(height);
|
1766 |
+
jQuery(".bwg" + source + "_description_spun" + defix).width(width);
|
1767 |
+
jQuery(".bwg" + source + "_description_spun" + defix).height(height);
|
1768 |
+
}
|
1769 |
+
if (jQuery.trim(jQuery(".bwg"+source+"_title_text" + defix).text())) {
|
1770 |
+
jQuery(".bwg_slideshow_title_text" + defix).css({display: ''});
|
1771 |
+
}
|
1772 |
+
if (jQuery.trim(jQuery(".bwg"+source+"_description_text" + defix).text())) {
|
1773 |
+
jQuery(".bwg"+source+"_description_text" + defix).css({display: ''});
|
1774 |
+
}
|
1775 |
+
|
1776 |
+
}
|
1777 |
+
|
1778 |
+
/* Set filmstrip initial position.*/
|
1779 |
+
function bwg_set_filmstrip_pos( filmStripWidth, bwg ) {
|
1780 |
+
var defix = ( typeof bwg != 'undefined' ) ? '_'+bwg : '';
|
1781 |
+
var source = ( typeof bwg != 'undefined' ) ? '_slideshow' : '';
|
1782 |
+
var left_or_top = ( typeof bwg != 'undefined' ) ? bwg_params[bwg]['left_or_top'] : bwg_param['left_or_top'];
|
1783 |
+
var top_bottom_space = parseInt(jQuery(".bwg_filmstrip_thumbnails").attr('data-all-images-top-bottom-space'));
|
1784 |
+
var right_left_space = parseInt(jQuery(".bwg_filmstrip_thumbnails").attr('data-all-images-right-left-space'));
|
1785 |
+
if( typeof bwg == 'undefined' ) { /* for lightbox */
|
1786 |
+
if ( bwg_param['outerWidth_or_outerHeight'] == 'outerWidth' ) {
|
1787 |
+
var selectedImagePos = -bwg_current_filmstrip_pos - (jQuery(".bwg_filmstrip_thumbnail").outerWidth(true)) / 2;
|
1788 |
+
} else if ( bwg_param['outerWidth_or_outerHeight'] == 'outerHeight' ) {
|
1789 |
+
var selectedImagePos = -bwg_current_filmstrip_pos - (jQuery(".bwg_filmstrip_thumbnail").outerHeight(true)) / 2;
|
1790 |
+
}
|
1791 |
+
if ( bwg_param['width_or_height'] == 'width' ) {
|
1792 |
+
var imagesContainerLeft = Math.min(0, Math.max(filmStripWidth - jQuery(".bwg_filmstrip_thumbnails").width(), selectedImagePos + filmStripWidth / 2));
|
1793 |
+
} else if (bwg_param['width_or_height'] == 'height') {
|
1794 |
+
var imagesContainerLeft = Math.min(0, Math.max(filmStripWidth - jQuery(".bwg_filmstrip_thumbnails").height(), selectedImagePos + filmStripWidth / 2));
|
1795 |
+
}
|
1796 |
+
} else { /* for slideshow */
|
1797 |
+
if (bwg_params[bwg]['width_or_height'] == 'width') {
|
1798 |
+
var selectedImagePos = -bwg_params[bwg]['bwg_current_filmstrip_pos'] - (jQuery(".bwg_slideshow_filmstrip_thumbnail" + defix).width() + bwg_params[bwg]['filmstrip_thumb_margin_hor']) / 2;
|
1799 |
+
var imagesContainerLeft = Math.min(0, Math.max(filmStripWidth - jQuery(".bwg_slideshow_filmstrip_thumbnails" + defix).width(), selectedImagePos + filmStripWidth / 2));
|
1800 |
+
}
|
1801 |
+
else {
|
1802 |
+
var selectedImagePos = -bwg_params[bwg]['bwg_current_filmstrip_pos'] - (jQuery(".bwg_slideshow_filmstrip_thumbnail" + defix).height() + bwg_params[bwg]['filmstrip_thumb_margin_hor']) / 2;
|
1803 |
+
var imagesContainerLeft = Math.min(0, Math.max(filmStripWidth - jQuery(".bwg_slideshow_filmstrip_thumbnails" + defix).height(), selectedImagePos + filmStripWidth / 2));
|
1804 |
+
}
|
1805 |
+
}
|
1806 |
+
|
1807 |
+
if ( imagesContainerLeft + right_left_space > 0 ) {
|
1808 |
+
right_left_space = 0;
|
1809 |
+
}
|
1810 |
+
if ( imagesContainerLeft + top_bottom_space > 0 ) {
|
1811 |
+
top_bottom_space = 0;
|
1812 |
+
}
|
1813 |
+
|
1814 |
+
if( left_or_top == 'left' ) {
|
1815 |
+
jQuery(".bwg"+source+"_filmstrip_thumbnails" + defix).animate({
|
1816 |
+
left: imagesContainerLeft + right_left_space
|
1817 |
+
}, {
|
1818 |
+
duration: 500,
|
1819 |
+
complete: function () { bwg_filmstrip_arrows( bwg ); }
|
1820 |
+
});
|
1821 |
+
} else {
|
1822 |
+
jQuery(".bwg"+source+"_filmstrip_thumbnails" + defix).animate({
|
1823 |
+
top: imagesContainerLeft + top_bottom_space
|
1824 |
+
}, {
|
1825 |
+
duration: 500,
|
1826 |
+
complete: function () { bwg_filmstrip_arrows( bwg ); }
|
1827 |
+
});
|
1828 |
+
}
|
1829 |
+
}
|
1830 |
+
|
1831 |
+
/* Show/hide filmstrip arrows.*/
|
1832 |
+
function bwg_filmstrip_arrows( bwg ) {
|
1833 |
+
|
1834 |
+
var defix = ( typeof bwg != 'undefined' ) ? '_'+bwg : '';
|
1835 |
+
var source = ( typeof bwg != 'undefined' ) ? '_slideshow' : '';
|
1836 |
+
var width_or_height = ( typeof bwg != 'undefined' ) ? bwg_params[bwg]['width_or_heigh'] : bwg_param['width_or_height'];
|
1837 |
+
|
1838 |
+
if ( width_or_height == 'width' ){
|
1839 |
+
var condition1 = jQuery(".bwg"+source+"_filmstrip_thumbnails"+defix).width();
|
1840 |
+
var condition2 = jQuery(".bwg"+source+"_filmstrip"+defix).width()
|
1841 |
+
} else {
|
1842 |
+
var condition1 = jQuery(".bwg"+source+"_filmstrip_thumbnails"+defix).height();
|
1843 |
+
var condition2 = jQuery(".bwg"+source+"_filmstrip"+defix).height()
|
1844 |
+
}
|
1845 |
+
if (condition1 < condition2) {
|
1846 |
+
jQuery(".bwg"+source+"_filmstrip_left" + defix).hide();
|
1847 |
+
jQuery(".bwg"+source+"_filmstrip_right" + defix).hide();
|
1848 |
+
}
|
1849 |
+
else {
|
1850 |
+
jQuery(".bwg"+source+"_filmstrip_left" + defix).show();
|
1851 |
+
jQuery(".bwg"+source+"_filmstrip_right" + defix).show();
|
1852 |
+
}
|
1853 |
+
}
|
1854 |
+
|
1855 |
+
function bwg_move_filmstrip( bwg ) {
|
1856 |
+
var bwg_filmstrip_width;
|
1857 |
+
var bwg_filmstrip_thumbnails_width;
|
1858 |
+
var image_left;
|
1859 |
+
var image_right;
|
1860 |
+
var long_filmstrip_cont_left;
|
1861 |
+
var long_filmstrip_cont_right;
|
1862 |
+
|
1863 |
+
var defix = ( typeof bwg != 'undefined' ) ? '_'+bwg : '';
|
1864 |
+
var source = ( typeof bwg != 'undefined' ) ? '_slideshow' : '';
|
1865 |
+
var outerWidth_or_outerHeight = ( typeof bwg != 'undefined' ) ? bwg_params[bwg]['outerWidth_or_outerHeight'] : bwg_param['outerWidth_or_outerHeight'];
|
1866 |
+
var left_or_top = ( typeof bwg != 'undefined' ) ? bwg_params[bwg]['left_or_top'] : bwg_param['left_or_top'];
|
1867 |
+
|
1868 |
+
if(outerWidth_or_outerHeight == 'outerWidth') {
|
1869 |
+
bwg_filmstrip_width = jQuery(".bwg" + source + "_filmstrip" + defix).outerWidth(true);
|
1870 |
+
bwg_filmstrip_thumbnails_width = jQuery(".bwg" + source + "_filmstrip_thumbnails" + defix).outerWidth(true);
|
1871 |
+
} else {
|
1872 |
+
bwg_filmstrip_width = jQuery(".bwg" + source + "_filmstrip" + defix).outerHeight(true);
|
1873 |
+
bwg_filmstrip_thumbnails_width = jQuery(".bwg" + source + "_filmstrip_thumbnails" + defix).outerHeight(true);
|
1874 |
+
}
|
1875 |
+
if( left_or_top == 'left' ) {
|
1876 |
+
image_left = jQuery(".bwg" + source + "_thumb_active" + defix).position().left;
|
1877 |
+
if( outerWidth_or_outerHeight == 'outerWidth' ) {
|
1878 |
+
image_right = jQuery(".bwg" + source + "_thumb_active" + defix).position().left + jQuery(".bwg" + source + "_thumb_active" + defix).outerWidth(true);
|
1879 |
+
} else {
|
1880 |
+
image_right = jQuery(".bwg" + source + "_thumb_active" + defix).position().left + jQuery(".bwg" + source + "_thumb_active" + defix).outerHeight(true);
|
1881 |
+
}
|
1882 |
+
long_filmstrip_cont_left = jQuery(".bwg" + source + "_filmstrip_thumbnails" + defix).position().left;
|
1883 |
+
long_filmstrip_cont_right = Math.abs(jQuery(".bwg" + source + "_filmstrip_thumbnails" + defix).position().left) + bwg_filmstrip_width;
|
1884 |
+
} else {
|
1885 |
+
image_left = jQuery(".bwg" + source + "_thumb_active" + defix).position().top;
|
1886 |
+
if( outerWidth_or_outerHeight == 'outerWidth' ) {
|
1887 |
+
image_right = jQuery(".bwg" + source + "_thumb_active" + defix).position().top + jQuery(".bwg" + source + "_thumb_active" + defix).outerWidth(true);
|
1888 |
+
} else {
|
1889 |
+
image_right = jQuery(".bwg" + source + "_thumb_active" + defix).position().top + jQuery(".bwg" + source + "_thumb_active" + defix).outerHeight(true);
|
1890 |
+
}
|
1891 |
+
long_filmstrip_cont_left = jQuery(".bwg" + source + "_filmstrip_thumbnails" + defix).position().top;
|
1892 |
+
long_filmstrip_cont_right = Math.abs(jQuery(".bwg" + source + "_filmstrip_thumbnails" + defix).position().top) + bwg_filmstrip_width;
|
1893 |
+
}
|
1894 |
+
if (bwg_filmstrip_width > bwg_filmstrip_thumbnails_width) {
|
1895 |
+
return;
|
1896 |
+
}
|
1897 |
+
if (image_left < Math.abs(long_filmstrip_cont_left)) {
|
1898 |
+
if ( left_or_top == 'left' ) {
|
1899 |
+
jQuery(".bwg" + source + "_filmstrip_thumbnails" + defix).animate({
|
1900 |
+
left: -image_left
|
1901 |
+
}, {
|
1902 |
+
duration: 500,
|
1903 |
+
complete: function () { bwg_filmstrip_arrows( bwg ); }
|
1904 |
+
});
|
1905 |
+
} else {
|
1906 |
+
jQuery(".bwg" + source + "_filmstrip_thumbnails" + defix).animate({
|
1907 |
+
top: -image_left
|
1908 |
+
}, {
|
1909 |
+
duration: 500,
|
1910 |
+
complete: function () { bwg_filmstrip_arrows( bwg ); }
|
1911 |
+
});
|
1912 |
+
}
|
1913 |
+
}
|
1914 |
+
else if (image_right > long_filmstrip_cont_right) {
|
1915 |
+
if ( left_or_top == 'left' ) {
|
1916 |
+
jQuery(".bwg" + source + "_filmstrip_thumbnails" + defix).animate({
|
1917 |
+
left: -(image_right - bwg_filmstrip_width)
|
1918 |
+
}, {
|
1919 |
+
duration: 500,
|
1920 |
+
complete: function () {
|
1921 |
+
bwg_filmstrip_arrows(bwg);
|
1922 |
+
}
|
1923 |
+
});
|
1924 |
+
} else {
|
1925 |
+
jQuery(".bwg" + source + "_filmstrip_thumbnails" + defix).animate({
|
1926 |
+
top: -(image_right - bwg_filmstrip_width)
|
1927 |
+
}, {
|
1928 |
+
duration: 500,
|
1929 |
+
complete: function () {
|
1930 |
+
bwg_filmstrip_arrows(bwg);
|
1931 |
+
}
|
1932 |
+
});
|
1933 |
+
}
|
1934 |
+
}
|
1935 |
+
}
|
1936 |
+
|
1937 |
+
function bwg_move_dots( bwg ) {
|
1938 |
+
var image_left = jQuery(".bwg_slideshow_dots_active_" + bwg).position().left;
|
1939 |
+
var image_right = jQuery(".bwg_slideshow_dots_active_" + bwg).position().left + jQuery(".bwg_slideshow_dots_active_" + bwg).outerWidth(true);
|
1940 |
+
var bwg_dots_width = jQuery(".bwg_slideshow_dots_container_" + bwg).outerWidth(true);
|
1941 |
+
var bwg_dots_thumbnails_width = jQuery(".bwg_slideshow_dots_thumbnails_" + bwg).outerWidth(false);
|
1942 |
+
var long_filmstrip_cont_left = jQuery(".bwg_slideshow_dots_thumbnails_" + bwg).position().left;
|
1943 |
+
var long_filmstrip_cont_right = Math.abs(jQuery(".bwg_slideshow_dots_thumbnails_" + bwg).position().left) + bwg_dots_width;
|
1944 |
+
if (bwg_dots_width > bwg_dots_thumbnails_width) {
|
1945 |
+
return;
|
1946 |
+
}
|
1947 |
+
if (image_left < Math.abs(long_filmstrip_cont_left)) {
|
1948 |
+
jQuery(".bwg_slideshow_dots_thumbnails_" + bwg).animate({
|
1949 |
+
left: -image_left
|
1950 |
+
}, {
|
1951 |
+
duration: 500,
|
1952 |
+
complete: function () { }
|
1953 |
+
});
|
1954 |
+
}
|
1955 |
+
else if (image_right > long_filmstrip_cont_right) {
|
1956 |
+
jQuery(".bwg_slideshow_dots_thumbnails_" + bwg).animate({
|
1957 |
+
left: -(image_right - bwg_dots_width)
|
1958 |
+
}, {
|
1959 |
+
duration: 500,
|
1960 |
+
complete: function () { }
|
1961 |
+
});
|
1962 |
+
}
|
1963 |
+
}
|
1964 |
+
|
1965 |
+
function bwg_testBrowser_cssTransitions( bwg ) {
|
1966 |
+
return bwg_testDom('Transition', bwg);
|
1967 |
+
}
|
1968 |
+
function bwg_testBrowser_cssTransforms3d( bwg ) {
|
1969 |
+
return bwg_testDom('Perspective', bwg);
|
1970 |
+
}
|
1971 |
+
function bwg_testDom(prop, bwg) {
|
1972 |
+
/* Browser vendor CSS prefixes.*/
|
1973 |
+
var browserVendors = ['', '-webkit-', '-moz-', '-ms-', '-o-', '-khtml-'];
|
1974 |
+
/* Browser vendor DOM prefixes.*/
|
1975 |
+
var domPrefixes = ['', 'Webkit', 'Moz', 'ms', 'O', 'Khtml'];
|
1976 |
+
var i = domPrefixes.length;
|
1977 |
+
while (i--) {
|
1978 |
+
if (typeof document.body.style[domPrefixes[i] + prop] !== 'undefined') {
|
1979 |
+
return true;
|
1980 |
+
}
|
1981 |
+
}
|
1982 |
+
return false;
|
1983 |
+
}
|
1984 |
+
|
1985 |
+
/* For browsers that does not support transitions.*/
|
1986 |
+
function bwg_fallback(current_image_class, next_image_class, direction, bwg) {
|
1987 |
+
bwg_fade(current_image_class, next_image_class, direction, bwg);
|
1988 |
+
}
|
1989 |
+
/* For browsers that support transitions, but not 3d transforms (only used if primary transition makes use of 3d-transforms).*/
|
1990 |
+
function bwg_fallback3d(current_image_class, next_image_class, direction, bwg) {
|
1991 |
+
bwg_sliceV(current_image_class, next_image_class, direction, bwg);
|
1992 |
+
}
|
1993 |
+
|
1994 |
+
function bwg_none(current_image_class, next_image_class, direction, bwg) {
|
1995 |
+
|
1996 |
+
var defix = ( typeof bwg != 'undefined' ) ? '_'+bwg : '';
|
1997 |
+
|
1998 |
+
jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
|
1999 |
+
jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});
|
2000 |
+
|
2001 |
+
if ( typeof bwg != 'undefined' ) {
|
2002 |
+
var bwg_current_key = bwg_params[bwg]['bwg_current_key'];
|
2003 |
+
bwg_change_watermark_container(bwg);
|
2004 |
+
/* Set active thumbnail.*/
|
2005 |
+
jQuery(".bwg_slideshow_filmstrip_thumbnail" + defix).removeClass("bwg_slideshow_thumb_active" + defix).addClass("bwg_slideshow_thumb_deactive" + defix);
|
2006 |
+
jQuery("#bwg_filmstrip_thumbnail_" + bwg_current_key + defix).removeClass("bwg_slideshow_thumb_deactive" + defix).addClass("bwg_slideshow_thumb_active" + defix);
|
2007 |
+
jQuery(".bwg_slideshow_dots" + defix).removeClass("bwg_slideshow_dots_active" + defix).addClass("bwg_slideshow_dots_deactive" + defix);
|
2008 |
+
jQuery("#bwg_dots_" + bwg_current_key + defix).removeClass("bwg_slideshow_dots_deactive" + defix).addClass("bwg_slideshow_dots_active" + defix);
|
2009 |
+
} else {
|
2010 |
+
/* Lightbox */
|
2011 |
+
jQuery(".bwg_image_info").show();
|
2012 |
+
bwg_trans_in_progress = false;
|
2013 |
+
jQuery(current_image_class).html('');
|
2014 |
+
bwg_change_watermark_container();
|
2015 |
+
}
|
2016 |
+
|
2017 |
+
|
2018 |
+
}
|
2019 |
+
|
2020 |
+
function bwg_iterator( bwg ) {
|
2021 |
+
var iterator = 1;
|
2022 |
+
if (bwg_params[bwg]['enable_slideshow_shuffle']) {
|
2023 |
+
iterator = Math.floor((bwg_params[bwg]['data'].length - 1) * Math.random() + 1);
|
2024 |
+
}
|
2025 |
+
return iterator;
|
2026 |
+
}
|
2027 |
+
|
2028 |
+
function bwg_change_image_slideshow(current_key, key, data, from_effect, bwg) {
|
2029 |
+
/* Pause videos.*/
|
2030 |
+
jQuery("#bwg_slideshow_image_container_" + bwg).find("iframe").each(function () {
|
2031 |
+
jQuery(this)[0].contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
|
2032 |
+
jQuery(this)[0].contentWindow.postMessage('{ "method": "pause" }', "*");
|
2033 |
+
jQuery(this)[0].contentWindow.postMessage('pause', '*');
|
2034 |
+
});
|
2035 |
+
/* Pause videos facebook video.*/
|
2036 |
+
jQuery('#image_id_' +bwg + '_' + data[current_key]["id"]).find('.bwg_fb_video').each(function () {
|
2037 |
+
jQuery(this).attr('src', jQuery(this).attr('src'));
|
2038 |
+
});
|
2039 |
+
if (data[key]) {
|
2040 |
+
if (jQuery('.bwg_ctrl_btn_' + bwg).hasClass('fa-pause')) {
|
2041 |
+
bwg_play( bwg );
|
2042 |
+
}
|
2043 |
+
|
2044 |
+
if (!from_effect) {
|
2045 |
+
/* Change image key.*/
|
2046 |
+
jQuery("#bwg_current_image_key_" + bwg).val(key);
|
2047 |
+
if (current_key == '-1') { /* Filmstrip.*/
|
2048 |
+
current_key = jQuery(".bwg_slideshow_thumb_active_" + bwg).children("img").attr("image_key");
|
2049 |
+
}
|
2050 |
+
else if (current_key == '-2') { /* Dots.*/
|
2051 |
+
current_key = jQuery(".bwg_slideshow_dots_active_" + bwg).attr("image_key");
|
2052 |
+
}
|
2053 |
+
}
|
2054 |
+
|
2055 |
+
if (bwg_params[bwg]['bwg_trans_in_progress']) {
|
2056 |
+
bwg_params[bwg]['event_stack'].push(current_key + '-' + key);
|
2057 |
+
return;
|
2058 |
+
}
|
2059 |
+
var direction = 'right';
|
2060 |
+
if (current_key > key) {
|
2061 |
+
var direction = 'left';
|
2062 |
+
} else if (current_key == key) {
|
2063 |
+
return;
|
2064 |
+
}
|
2065 |
+
|
2066 |
+
jQuery(".bwg_slideshow_watermark_" + bwg).css({display: 'none'});
|
2067 |
+
jQuery(".bwg_slideshow_title_text_" + bwg).css({display: 'none'});
|
2068 |
+
jQuery(".bwg_slideshow_description_text_" + bwg).css({display: 'none'});
|
2069 |
+
/* Set active thumbnail position.*/
|
2070 |
+
if ( bwg_params[bwg]['width_or_height'] == 'width' ) {
|
2071 |
+
bwg_params[bwg]['bwg_current_filmstrip_pos'] = key * (jQuery(".bwg_slideshow_filmstrip_thumbnail_" + bwg).width() + 2 + 2 * bwg_params[bwg]['lightbox_filmstrip_thumb_border_width']);
|
2072 |
+
} else {
|
2073 |
+
bwg_params[bwg]['bwg_current_filmstrip_pos'] = key * (jQuery(".bwg_slideshow_filmstrip_thumbnail_" + bwg).height() + 2 + 2 * bwg_params[bwg]['lightbox_filmstrip_thumb_border_width']);
|
2074 |
+
}
|
2075 |
+
|
2076 |
+
current_key = key;
|
2077 |
+
bwg_params[bwg]['bwg_current_key'] = current_key;
|
2078 |
+
/* Change image id, title, description.*/
|
2079 |
+
jQuery("#bwg_slideshow_image_" + bwg).attr('image_id', data[key]["id"]);
|
2080 |
+
jQuery(".bwg_slideshow_title_text_" + bwg).html(jQuery('<span style="display: block;" />').html(data[key]["alt"]).text());
|
2081 |
+
jQuery(".bwg_slideshow_description_text_" + bwg).html(jQuery('<span style="display: block;" />').html(data[key]["description"]).text());
|
2082 |
+
var current_image_class = jQuery(".bwg_slideshow_image_spun_" + bwg).css("zIndex") == 2 ? ".bwg_slideshow_image_spun_" + bwg : ".bwg_slideshow_image_second_spun_" + bwg;
|
2083 |
+
var next_image_class = current_image_class == ".bwg_slideshow_image_second_spun_" + bwg ? ".bwg_slideshow_image_spun_" + bwg : ".bwg_slideshow_image_second_spun_" + bwg;
|
2084 |
+
var is_embed = data[key]['filetype'].indexOf("EMBED_") > -1 ? true : false;
|
2085 |
+
var is_embed_instagram_post = data[key]['filetype'].indexOf('INSTAGRAM_POST') > -1 ? true :false;
|
2086 |
+
var is_embed_instagram_video = data[key]['filetype'].indexOf('INSTAGRAM_VIDEO') > -1 ? true :false;
|
2087 |
+
var cur_height = jQuery(current_image_class).height();
|
2088 |
+
var cur_width = jQuery(current_image_class).width();
|
2089 |
+
var innhtml = '<span class="bwg_slideshow_image_spun1_' + bwg +'" style="display: ' + (!is_embed ? 'table' : 'block') + ' ;width: inherit; height: inherit;"><span class="bwg_slideshow_image_spun2_' + bwg + '" style="display: ' + (!is_embed ? 'table-cell' : 'block') + '; vertical-align: middle; text-align: center; ">';
|
2090 |
+
if (!is_embed) {
|
2091 |
+
if (bwg_params[bwg]['thumb_click_action'] != 'do_nothing' ) {
|
2092 |
+
var argument = '';
|
2093 |
+
if (bwg_params[bwg]['thumb_click_action'] == 'open_lightbox')
|
2094 |
+
{
|
2095 |
+
argument += ' class="bwg_lightbox" data-image-id="' + data[key]["id"] + '"';
|
2096 |
+
} else {
|
2097 |
+
if ( bwg_params[bwg]["thumb_click_action"] == "redirect_to_url" && data[key]["redirect_url"] ) {
|
2098 |
+
argument += 'href = ' + data[key]["redirect_url"] + (bwg_params[bwg]['thumb_link_target']) ? ' target = _blank' : '';
|
2099 |
+
}
|
2100 |
+
}
|
2101 |
+
innhtml += '<a ' + argument + '>';
|
2102 |
+
}
|
2103 |
+
innhtml += '<img style="max-height: ' + cur_height + 'px !important; max-width: ' + cur_width + 'px !important; display:inline-block;" ';
|
2104 |
+
innhtml += ' class="bwg_slide bwg_slideshow_image_'+bwg+'" ';
|
2105 |
+
innhtml += ' id="bwg_slideshow_image_' + bwg + '" ';
|
2106 |
+
innhtml += ' src="' + bwg_params[bwg]['upload_url'] + jQuery("<span style=\'display: block;\' />").html(data[key]["image_url"]).text() + '" alt="' + data[key]["alt"] + '" image_id="' + data[key]["id"] + '" /></a>';
|
2107 |
+
} else { /*is_embed*/
|
2108 |
+
innhtml += '<span style="height: ' + cur_height + 'px; width: ' + cur_width + 'px;" class="bwg_popup_embed bwg_popup_watermark">';
|
2109 |
+
if (is_embed_instagram_video ) {
|
2110 |
+
innhtml += '<span class="bwg_inst_play_btn_cont" onclick="bwg_play_instagram_video(this)"><span class="bwg_inst_play"></span></span>';
|
2111 |
+
}
|
2112 |
+
if (is_embed_instagram_post) {
|
2113 |
+
var post_width = 0;
|
2114 |
+
var post_height = 0;
|
2115 |
+
if (cur_height < cur_width + 88) {
|
2116 |
+
post_height = cur_height;
|
2117 |
+
post_width = post_height - 88;
|
2118 |
+
}
|
2119 |
+
else {
|
2120 |
+
post_width = cur_width;
|
2121 |
+
post_height = post_width + 88;
|
2122 |
+
}
|
2123 |
+
innhtml += spider_display_embed(data[key]['filetype'], data[key]['image_url'], data[key]['filename'], {class:"bwg_embed_frame", 'data-width': data[key]['image_width'], 'data-height': data[key]['image_height'], frameborder: "0", allowfullscreen: "allowfullscreen", style: "width:" + post_width + "px; height:" + post_height + "px; vertical-align:middle; display:inline-block; position:relative;"});
|
2124 |
+
} else {
|
2125 |
+
innhtml += spider_display_embed(data[key]['filetype'], data[key]['image_url'], data[key]['filename'], {class:"bwg_embed_frame", frameborder:"0", allowfullscreen:"allowfullscreen", style:"width:inherit; height:inherit; vertical-align:middle; display:table-cell;" });
|
2126 |
+
}
|
2127 |
+
innhtml += "</span>";
|
2128 |
+
}
|
2129 |
+
innhtml += '</span></span>';
|
2130 |
+
jQuery(next_image_class).html(innhtml);
|
2131 |
+
if (bwg_params[bwg]['preload_images']) {
|
2132 |
+
bwg_preload_images(key, bwg);
|
2133 |
+
}
|
2134 |
+
window["bwg_" + bwg_params[bwg]['slideshow_effect']](current_image_class, next_image_class, direction, bwg);
|
2135 |
+
if (bwg_params[bwg]['enable_slideshow_filmstrip']) {
|
2136 |
+
bwg_move_filmstrip( bwg );
|
2137 |
+
}
|
2138 |
+
else {
|
2139 |
+
bwg_move_dots( bwg);
|
2140 |
+
}
|
2141 |
+
if (data[key]["is_embed_video"]) {
|
2142 |
+
jQuery("#bwg_slideshow_play_pause_" + bwg).css({display: 'none'});
|
2143 |
+
}
|
2144 |
+
else {
|
2145 |
+
jQuery("#bwg_slideshow_play_pause_" + bwg).css({display: ''});
|
2146 |
+
}
|
2147 |
+
}
|
2148 |
+
|
2149 |
+
bwg_add_lightbox();
|
2150 |
+
}
|
2151 |
+
|
2152 |
+
function bwg_preload_images_slideshow( key, bwg ) {
|
2153 |
+
var data = bwg_params[bwg]['data'];
|
2154 |
+
count = bwg_params[bwg]['preload_images_count'] / 2;
|
2155 |
+
var count_all = data.length;
|
2156 |
+
if (count_all < bwg_params[bwg]['preload_images_count']) {
|
2157 |
+
count = 0;
|
2158 |
+
}
|
2159 |
+
if (count != 0) {
|
2160 |
+
for (var i = key - count; i < key + count; i++) {
|
2161 |
+
var index = parseInt((i + count_all) % count_all);
|
2162 |
+
var is_embed = data[index]['filetype'].indexOf("EMBED_") > -1 ? true : false;
|
2163 |
+
if (typeof data[index] != "undefined") {
|
2164 |
+
if (!is_embed) {
|
2165 |
+
jQuery("<img/>").attr("src", bwg_params[bwg]['upload_url'] + jQuery('<span style="display: block;" />').html(data[index]["image_url"]).text());
|
2166 |
+
}
|
2167 |
+
}
|
2168 |
+
}
|
2169 |
+
} else {
|
2170 |
+
for (var i = 0; i < data.length; i++) {
|
2171 |
+
var is_embed = data[i]['filetype'].indexOf("EMBED_") > -1 ? true : false;
|
2172 |
+
if (typeof data[i] != "undefined") {
|
2173 |
+
if (!is_embed) {
|
2174 |
+
jQuery("<img/>").attr("src", bwg_params[bwg]['upload_url'] + jQuery('<span style="display: block;" />').html(data[i]["image_url"]).text());
|
2175 |
+
}
|
2176 |
+
}
|
2177 |
+
}
|
2178 |
+
}
|
2179 |
+
}
|
2180 |
+
|
2181 |
+
function bwg_preload_images( key, bwg ) {
|
2182 |
+
if ( typeof bwg != 'undefined' ) { /* SLIDESHOW */
|
2183 |
+
bwg_preload_images_slideshow( key, bwg );
|
2184 |
+
} else { /* LIGHTBOX */
|
2185 |
+
bwg_preload_images_lightbox( key );
|
2186 |
+
}
|
2187 |
+
}
|
2188 |
+
|
2189 |
+
function bwg_popup_resize_slidshow( bwg ) {
|
2190 |
+
var parent_width = jQuery(".bwg_slideshow_image_wrap_" + bwg).parent().width();
|
2191 |
+
var data = bwg_params[bwg]['data'];
|
2192 |
+
if (parent_width >= bwg_params[bwg]['image_width']) {
|
2193 |
+
jQuery(".bwg_slideshow_image_wrap_"+bwg).css({width: bwg_params[bwg]['image_width']});
|
2194 |
+
jQuery(".bwg_slideshow_image_wrap_"+bwg).css({height: bwg_params[bwg]['image_height']});
|
2195 |
+
jQuery(".bwg_slideshow_image_container_"+bwg).css({width: (bwg_params[bwg]['filmstrip_direction'] == 'horizontal') ? bwg_params[bwg]['image_width'] : (bwg_params[bwg]['image_width'] - bwg_params[bwg]['slideshow_filmstrip_width']) });
|
2196 |
+
jQuery(".bwg_slideshow_image_container_"+bwg).css({height: (bwg_params[bwg]['filmstrip_direction'] == 'horizontal') ? bwg_params[bwg]['image_height'] - bwg_params[bwg]['slideshow_filmstrip_height'] : bwg_params[bwg]['image_height'] });
|
2197 |
+
jQuery(".bwg_slideshow_image_"+bwg).css({
|
2198 |
+
cssText: "max-width: " + (bwg_params[bwg]['filmstrip_direction'] == 'horizontal ') ? bwg_params[bwg]['image_width'] : (bwg_params[bwg]['image_width'] - bwg_params[bwg]['slideshow_filmstrip_width'])+"px !important; max-height: " + (bwg_params[bwg]['filmstrip_direction'] == 'horizontal') ? (bwg_params[bwg]['image_height'] - bwg_params[bwg]['slideshow_filmstrip_height']) : bwg_params[bwg]['image_height']+"px !important;"
|
2199 |
+
});
|
2200 |
+
jQuery(".bwg_slideshow_embed_"+bwg).css({
|
2201 |
+
cssText: "width: "+(bwg_params[bwg]['filmstrip_direction'] == 'horizontal') ? bwg_params[bwg]['image_width'] : (bwg_params[bwg]['image_width'] - bwg_params[bwg]['slideshow_filmstrip_width'])+"px !important; height:"+ (bwg_params[bwg]['filmstrip_direction'] == 'horizontal') ? (bwg_params[bwg]['image_height'] - bwg_params[bwg]['slideshow_filmstrip_height']) : bwg_params[bwg]['image_height']+"px !important;"
|
2202 |
+
});
|
2203 |
+
bwg_resize_instagram_post( bwg );
|
2204 |
+
/* Set watermark container size. */
|
2205 |
+
bwg_change_watermark_container( bwg );
|
2206 |
+
var filmstrip_container_css = (bwg_params[bwg]['filmstrip_direction'] == 'horizontal') ? 'width: ' + bwg_params[bwg]['image_width'] : 'height: ' + bwg_params[bwg]['image_height'];
|
2207 |
+
var filmstrip_css = (bwg_params[bwg]['filmstrip_direction'] == 'horizontal') ? 'width: ' + (bwg_params[bwg]['image_width'] - 40) : 'height: ' + (bwg_params[bwg]['image_height'] - 40);
|
2208 |
+
jQuery(".bwg_slideshow_filmstrip_container_" + bwg).css({ filmstrip_container_css });
|
2209 |
+
jQuery(".bwg_slideshow_filmstrip_"+bwg).css({ filmstrip_css });
|
2210 |
+
jQuery(".bwg_slideshow_dots_container_"+bwg).css({width: bwg_params[bwg]['image_width'] });
|
2211 |
+
jQuery("#bwg_slideshow_play_pause-ico_"+bwg).css({fontSize: (bwg_params[bwg]['slideshow_play_pause_btn_size'])});
|
2212 |
+
jQuery(".bwg_slideshow_watermark_image_"+bwg).css({maxWidth: bwg_params[bwg]['watermark_width'], maxHeight: bwg_params[bwg]['watermark_height']});
|
2213 |
+
if ( bwg_params[bwg]['watermark_type'] == 'text' ) {
|
2214 |
+
jQuery(".bwg_slideshow_watermark_text_" + bwg + ", .bwg_slideshow_watermark_text_" + bwg + " : hover").css({fontSize: (bwg_params[bwg]['watermark_font_size'])});
|
2215 |
+
}
|
2216 |
+
jQuery(".bwg_slideshow_title_text_"+bwg).css({fontSize: ( bwg_params[bwg]['slideshow_title_font_size'] * 2 )});
|
2217 |
+
jQuery(".bwg_slideshow_description_text_"+bwg).css({fontSize: (bwg_params[bwg]['slideshow_description_font_size'] * 2)});
|
2218 |
+
}
|
2219 |
+
else {
|
2220 |
+
jQuery(".bwg_slideshow_image_wrap_"+bwg).css({width: (parent_width)});
|
2221 |
+
jQuery(".bwg_slideshow_image_wrap_"+bwg).css({ height: ((parent_width) * bwg_params[bwg]['image_height'] / bwg_params[bwg]['image_width'] )});
|
2222 |
+
jQuery(".bwg_slideshow_image_container_"+bwg).css({width: (parent_width - (bwg_params[bwg]['filmstrip_direction'] == 'horizontal' ? 0 : bwg_params[bwg]['slideshow_filmstrip_width']))});
|
2223 |
+
jQuery(".bwg_slideshow_image_container_"+bwg).css({height: ((parent_width) * bwg_params[bwg]['image_height'] / bwg_params[bwg]['image_width'] - (bwg_params[bwg]['filmstrip_direction'] == 'horizontal' ? bwg_params[bwg]['slideshow_filmstrip_height'] : 0))});
|
2224 |
+
jQuery(".bwg_slideshow_image_"+bwg).css({
|
2225 |
+
cssText: "max-width: " + (parent_width - (bwg_params[bwg]['filmstrip_direction'] == 'horizontal' ? 0 : bwg_params[bwg]['slideshow_filmstrip_width'])) + "px !important; max-height: " + (parent_width * (bwg_params[bwg]['image_height'] / bwg_params[bwg]['image_width']) - (bwg_params[bwg]['filmstrip_direction'] == 'horizontal' ? bwg_params[bwg]['slideshow_filmstrip_height'] : 0) - 1) + "px !important;"
|
2226 |
+
});
|
2227 |
+
jQuery(".bwg_slideshow_embed_"+bwg).css({
|
2228 |
+
cssText: "width: " + (parent_width - (bwg_params[bwg]['filmstrip_direction'] == 'horizontal' ? 0 : bwg_params[bwg]['slideshow_filmstrip_width']) ) + "px !important; height: " + (parent_width * (bwg_params[bwg]['image_height'] / bwg_params[bwg]['image_width']) - (bwg_params[bwg]['filmstrip_direction'] == 'horizontal' ? bwg_params[bwg]['slideshow_filmstrip_height'] : 0) - 1) + "px !important;"
|
2229 |
+
});
|
2230 |
+
bwg_resize_instagram_post( bwg );
|
2231 |
+
/* Set watermark container size.*/
|
2232 |
+
bwg_change_watermark_container( bwg );
|
2233 |
+
if (bwg_params[bwg]['filmstrip_direction'] == 'horizontal') {
|
2234 |
+
jQuery(".bwg_slideshow_filmstrip_container_"+bwg).css({width: (parent_width)});
|
2235 |
+
jQuery(".bwg_slideshow_filmstrip_"+bwg).css({width: (parent_width - 40)});
|
2236 |
+
} else {
|
2237 |
+
jQuery(".bwg_slideshow_filmstrip_container_"+bwg).css({height: (parent_width * bwg_params[bwg]['image_height'] / bwg_params[bwg]['image_width'])});
|
2238 |
+
jQuery(".bwg_slideshow_filmstrip_"+bwg).css({height: (parent_width * bwg_params[bwg]['image_height'] / bwg_params[bwg]['image_width'] - 40)});
|
2239 |
+
}
|
2240 |
+
jQuery(".bwg_slideshow_dots_container_"+bwg).css({width: (parent_width)});
|
2241 |
+
jQuery("#bwg_slideshow_play_pause-ico_"+bwg).css({fontSize: ((parent_width) * bwg_params[bwg]['slideshow_play_pause_btn_size'] / bwg_params[bwg]['image_width'])});
|
2242 |
+
jQuery(".bwg_slideshow_watermark_image_"+bwg).css({maxWidth: ((parent_width) * bwg_params[bwg]['watermark_width'] / bwg_params[bwg]['image_width']), maxHeight: ((parent_width) * bwg_params[bwg]['watermark_height'] / bwg_params[bwg]['image_width'])});
|
2243 |
+
jQuery(".bwg_slideshow_watermark_text_"+bwg+", .bwg_slideshow_watermark_text_"+bwg+":hover").css({fontSize: ((parent_width) * bwg_params[bwg]['watermark_font_size'] / bwg_params[bwg]['image_width'])});
|
2244 |
+
jQuery(".bwg_slideshow_title_text_"+bwg).css({fontSize: ((parent_width) * 2 * bwg_params[bwg]['slideshow_title_font_size'] / bwg_params[bwg]['image_width'])});
|
2245 |
+
jQuery(".bwg_slideshow_description_text_"+bwg).css({fontSize: ((parent_width) * 2 * bwg_params[bwg]['slideshow_description_font_size'] / bwg_params[bwg]['image_width'])});
|
2246 |
+
jQuery(".bwg_slideshow_image_"+bwg).css({'display':'inline-block'});
|
2247 |
+
}
|
2248 |
+
if (data[parseInt(jQuery("#bwg_current_image_key_"+bwg).val())]["is_embed_video"]) {
|
2249 |
+
jQuery("#bwg_slideshow_play_pause_"+bwg).css({display: 'none'});
|
2250 |
+
}
|
2251 |
+
else {
|
2252 |
+
jQuery("#bwg_slideshow_play_pause_"+bwg).css({display: ''});
|
2253 |
+
}
|
2254 |
+
}
|
2255 |
+
|
2256 |
+
function bwg_popup_resize( bwg ) {
|
2257 |
+
|
2258 |
+
if ( typeof bwg != 'undefined' ) { /* SLIDESHOW */
|
2259 |
+
bwg_popup_resize_slidshow( bwg );
|
2260 |
+
} else { /* LIGHTBOX */
|
2261 |
+
bwg_popup_resize_lightbox();
|
2262 |
+
}
|
2263 |
+
}
|
2264 |
+
|
2265 |
+
function bwg_change_image(current_key, key, data, from_effect, bwg) {
|
2266 |
+
|
2267 |
+
if ( typeof bwg != 'undefined' ) { /* SLIDESHOW */
|
2268 |
+
bwg_change_image_slideshow(current_key, key, data, from_effect, bwg);
|
2269 |
+
} else { /* LIGHTBOX */
|
2270 |
+
bwg_change_image_lightbox(current_key, key, data, from_effect);
|
2271 |
+
}
|
2272 |
+
}
|
2273 |
+
|
2274 |
+
function bwg_resize_instagram_post( bwg ) {
|
2275 |
+
if ( typeof bwg != 'undefined' ) { /* SLIDESHOW */
|
2276 |
+
if (jQuery(".inner_instagram_iframe_bwg_embed_frame_"+bwg).length) {
|
2277 |
+
var post_width = jQuery(".bwg_slideshow_embed_"+bwg).width();
|
2278 |
+
var post_height = jQuery(".bwg_slideshow_embed_").height();
|
2279 |
+
jQuery(".inner_instagram_iframe_bwg_embed_frame_"+bwg).each(function() {
|
2280 |
+
var parent_container = jQuery(this).parent();
|
2281 |
+
if (post_height / (parseInt(parent_container.attr('data-height')) + 96) < post_width / parseInt(parent_container.attr('data-width'))) {
|
2282 |
+
parent_container.height(post_height);
|
2283 |
+
parent_container.width((parent_container.height() - 96) * parent_container.attr('data-width') / parent_container.attr('data-height') + 16);
|
2284 |
+
}
|
2285 |
+
else {
|
2286 |
+
parent_container.width(post_width);
|
2287 |
+
parent_container.height((parent_container.width() - 16) * parent_container.attr('data-height') / parent_container.attr('data-width') + 96);
|
2288 |
+
}
|
2289 |
+
});
|
2290 |
+
bwg_change_watermark_container( bwg );
|
2291 |
+
}
|
2292 |
+
} else { /* LIGHTBOX */
|
2293 |
+
if (jQuery('.inner_instagram_iframe_bwg_embed_frame').length) {
|
2294 |
+
var post_width = jQuery(".bwg_image_container").width();
|
2295 |
+
var post_height = jQuery(".bwg_image_container").height();
|
2296 |
+
var FeedbackSocialProofHeight = 132;
|
2297 |
+
jQuery('.inner_instagram_iframe_bwg_embed_frame').each(function() {
|
2298 |
+
var parent_container = jQuery(this).parent();
|
2299 |
+
if (post_height / (parseInt(parent_container.attr('data-height')) + FeedbackSocialProofHeight) < post_width / parseInt(parent_container.attr('data-width'))) {
|
2300 |
+
parent_container.height(post_height);
|
2301 |
+
parent_container.width((parent_container.height() - FeedbackSocialProofHeight) * parent_container.attr('data-width') / parent_container.attr('data-height') + 16);
|
2302 |
+
}
|
2303 |
+
else {
|
2304 |
+
parent_container.width(post_width);
|
2305 |
+
parent_container.height((parent_container.width() - 16) * parent_container.attr('data-height') / parent_container.attr('data-width') + 96);
|
2306 |
+
}
|
2307 |
+
parent_container.css({top: 0.5 * (post_height - parent_container.height())});
|
2308 |
+
});
|
2309 |
+
bwg_change_watermark_container();
|
2310 |
+
}
|
2311 |
+
}
|
2312 |
+
}
|
2313 |
+
|
2314 |
+
function bwg_play( bwg ) {
|
2315 |
+
var data = ( typeof bwg != 'undefined' ) ? bwg_params[bwg]['data'] : bwg_param['data'];
|
2316 |
+
if ( typeof bwg != 'undefined' ) {
|
2317 |
+
window.clearInterval(bwg_params[bwg]['bwg_playInterval']);
|
2318 |
+
} else {
|
2319 |
+
window.clearInterval(bwg_param['bwg_playInterval']);
|
2320 |
+
}
|
2321 |
+
|
2322 |
+
/* Play.*/
|
2323 |
+
if ( typeof bwg != 'undefined' ) { /* SLIDESHOW */
|
2324 |
+
bwg_params[bwg]['bwg_playInterval'] = setInterval(function () {
|
2325 |
+
var iterator = 1;
|
2326 |
+
if (bwg_params[bwg]['enable_slideshow_shuffle']) {
|
2327 |
+
iterator = Math.floor((data.length - 1) * Math.random() + 1);
|
2328 |
+
}
|
2329 |
+
bwg_change_image( parseInt(jQuery("#bwg_current_image_key_"+bwg).val()), (parseInt(jQuery("#bwg_current_image_key_"+bwg).val()) + iterator) % data.length, data, '', bwg )
|
2330 |
+
}, bwg_params[bwg]['slideshow_interval'] * 1000);
|
2331 |
+
} else {
|
2332 |
+
bwg_param['bwg_playInterval'] = setInterval(function () {
|
2333 |
+
if (!data[parseInt(jQuery('#bwg_current_image_key').val()) + 1]) {
|
2334 |
+
if (bwg_param['enable_loop'] == 1) {
|
2335 |
+
/* Wrap around.*/
|
2336 |
+
bwg_change_image(parseInt(jQuery('#bwg_current_image_key').val()), 0, data);
|
2337 |
+
}
|
2338 |
+
return;
|
2339 |
+
}
|
2340 |
+
bwg_change_image(parseInt(jQuery('#bwg_current_image_key').val()), parseInt(jQuery('#bwg_current_image_key').val()) + 1, data)
|
2341 |
+
}, bwg_param['slideshow_interval'] * 1000);
|
2342 |
+
}
|
2343 |
}
|
js/bwg_gallery_box.js
CHANGED
@@ -38,19 +38,35 @@ function spider_createpopup(url, current_view, width, height, duration, descript
|
|
38 |
}
|
39 |
|
40 |
function spider_showpopup(description, lifetime, popup, duration, lightbox_ctrl_btn_pos) {
|
41 |
-
|
42 |
-
if (
|
43 |
-
|
44 |
-
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
}
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
|
|
|
|
52 |
}
|
53 |
-
|
54 |
}
|
55 |
|
56 |
function spider_hasalreadyreceivedpopup(description) {
|
@@ -121,7 +137,7 @@ function get_ajax_pricelist(){
|
|
121 |
post_data["ajax_task"] = "display";
|
122 |
post_data["image_id"] = jQuery('#bwg_popup_image').attr('image_id');
|
123 |
|
124 |
-
|
125 |
jQuery("#ecommerce_ajax_loading").css('height', jQuery(".bwg_ecommerce_panel").css('height'));
|
126 |
jQuery("#ecommerce_opacity_div").css('width', jQuery(".bwg_ecommerce_panel").css('width'));
|
127 |
jQuery("#ecommerce_opacity_div").css('height', jQuery(".bwg_ecommerce_panel").css('height'));
|
@@ -159,16 +175,17 @@ function get_ajax_pricelist(){
|
|
159 |
complete:function(){
|
160 |
document.getElementById("ecommerce_opacity_div").style.display = 'none';
|
161 |
document.getElementById("ecommerce_loading_div").style.display = 'none';
|
162 |
-
|
163 |
-
|
164 |
-
|
|
|
|
|
165 |
}
|
166 |
});
|
167 |
return false;
|
168 |
}
|
169 |
|
170 |
-
|
171 |
-
// Submit popup.
|
172 |
function spider_ajax_save(form_id) {
|
173 |
var post_data = {};
|
174 |
post_data["bwg_name"] = jQuery("#bwg_name").val();
|
@@ -179,7 +196,7 @@ function spider_ajax_save(form_id) {
|
|
179 |
post_data["image_id"] = jQuery("#image_id").val();
|
180 |
post_data["comment_id"] = jQuery("#comment_id").val();
|
181 |
|
182 |
-
|
183 |
jQuery("#ajax_loading").css('height', jQuery(".bwg_comments").css('height'));
|
184 |
jQuery("#opacity_div").css('width', jQuery(".bwg_comments").css('width'));
|
185 |
jQuery("#opacity_div").css('height', jQuery(".bwg_comments").css('height'));
|
@@ -200,16 +217,16 @@ function spider_ajax_save(form_id) {
|
|
200 |
complete:function(){
|
201 |
document.getElementById("opacity_div").style.display = 'none';
|
202 |
document.getElementById("loading_div").style.display = 'none';
|
203 |
-
|
204 |
jQuery(".bwg_comments").mCustomScrollbar({scrollInertia: 150});
|
205 |
-
|
206 |
jQuery(".bwg_comments_close_btn").click(bwg_comment);
|
207 |
}
|
208 |
});
|
209 |
return false;
|
210 |
}
|
211 |
|
212 |
-
|
213 |
function spider_rate_ajax_save(form_id) {
|
214 |
var post_data = {};
|
215 |
post_data["image_id"] = jQuery("#" + form_id + " input[name='image_id']").val();
|
@@ -231,14 +248,14 @@ function spider_rate_ajax_save(form_id) {
|
|
231 |
return false;
|
232 |
}
|
233 |
|
234 |
-
|
235 |
function spider_set_input_value(input_id, input_value) {
|
236 |
if (document.getElementById(input_id)) {
|
237 |
document.getElementById(input_id).value = input_value;
|
238 |
}
|
239 |
}
|
240 |
|
241 |
-
|
242 |
function spider_form_submit(event, form_id) {
|
243 |
if (document.getElementById(form_id)) {
|
244 |
document.getElementById(form_id).submit();
|
@@ -251,7 +268,7 @@ function spider_form_submit(event, form_id) {
|
|
251 |
}
|
252 |
}
|
253 |
|
254 |
-
|
255 |
function spider_check_required(id, name) {
|
256 |
if (jQuery('#' + id).val() == '') {
|
257 |
alert(name + '* ' + bwg_objectL10n.bwg_field_required);
|
@@ -264,7 +281,7 @@ function spider_check_required(id, name) {
|
|
264 |
}
|
265 |
}
|
266 |
|
267 |
-
|
268 |
function comment_check_privacy_policy() {
|
269 |
var bwg_submit = jQuery('#bwg_submit');
|
270 |
bwg_submit.removeClass('bwg-submit-disabled');
|
@@ -275,7 +292,7 @@ function comment_check_privacy_policy() {
|
|
275 |
}
|
276 |
}
|
277 |
|
278 |
-
|
279 |
function spider_check_email(id) {
|
280 |
if (jQuery('#' + id).val() != '') {
|
281 |
var email = jQuery('#' + id).val().replace(/^\s+|\s+$/g, '');
|
@@ -287,7 +304,7 @@ function spider_check_email(id) {
|
|
287 |
}
|
288 |
}
|
289 |
|
290 |
-
|
291 |
function bwg_captcha_refresh(id) {
|
292 |
if (document.getElementById(id + "_img") && document.getElementById(id + "_input")) {
|
293 |
srcArr = document.getElementById(id + "_img").src.split("&r=");
|
38 |
}
|
39 |
|
40 |
function spider_showpopup(description, lifetime, popup, duration, lightbox_ctrl_btn_pos) {
|
41 |
+
var cur_image_key = parseInt( jQuery( '#bwg_current_image_key' ).val() );
|
42 |
+
if ( typeof data[cur_image_key] != 'undefined' ) {
|
43 |
+
isPopUpOpened = true;
|
44 |
+
var is_embed = data[cur_image_key]['filetype'].indexOf( "EMBED_" ) > -1 ? true : false;
|
45 |
+
if ( !is_embed ) {
|
46 |
+
if ( jQuery( '#spider_popup_wrap .bwg_popup_image_spun img' ).prop( 'complete' ) ) {
|
47 |
+
/* Already loaded. */
|
48 |
+
bwg_first_image_load( popup );
|
49 |
+
}
|
50 |
+
else {
|
51 |
+
jQuery( '#spider_popup_wrap .bwg_popup_image_spun img' ).on( 'load error', function () {
|
52 |
+
bwg_first_image_load( popup );
|
53 |
+
} );
|
54 |
+
}
|
55 |
+
}
|
56 |
+
else {
|
57 |
+
bwg_first_image_load( popup );
|
58 |
+
}
|
59 |
+
spider_receivedpopup( description, lifetime, lightbox_ctrl_btn_pos );
|
60 |
}
|
61 |
+
}
|
62 |
+
|
63 |
+
function bwg_first_image_load(popup) {
|
64 |
+
popup.show();
|
65 |
+
jQuery( ".bwg_spider_popup_loading" ).hide();
|
66 |
+
if ( bwg_param['preload_images'] ) {
|
67 |
+
bwg_preload_images( parseInt( jQuery( '#bwg_current_image_key' ).val() ) );
|
68 |
}
|
69 |
+
bwg_load_filmstrip();
|
70 |
}
|
71 |
|
72 |
function spider_hasalreadyreceivedpopup(description) {
|
137 |
post_data["ajax_task"] = "display";
|
138 |
post_data["image_id"] = jQuery('#bwg_popup_image').attr('image_id');
|
139 |
|
140 |
+
/* Loading. */
|
141 |
jQuery("#ecommerce_ajax_loading").css('height', jQuery(".bwg_ecommerce_panel").css('height'));
|
142 |
jQuery("#ecommerce_opacity_div").css('width', jQuery(".bwg_ecommerce_panel").css('width'));
|
143 |
jQuery("#ecommerce_opacity_div").css('height', jQuery(".bwg_ecommerce_panel").css('height'));
|
175 |
complete:function(){
|
176 |
document.getElementById("ecommerce_opacity_div").style.display = 'none';
|
177 |
document.getElementById("ecommerce_loading_div").style.display = 'none';
|
178 |
+
/*
|
179 |
+
Update scrollbar.
|
180 |
+
jQuery(".bwg_ecommece_panel").mCustomScrollbar({scrollInertia: 150 });
|
181 |
+
jQuery(".bwg_ecommerce_close_btn").click(bwg_ecommerce);
|
182 |
+
*/
|
183 |
}
|
184 |
});
|
185 |
return false;
|
186 |
}
|
187 |
|
188 |
+
/* Submit popup. */
|
|
|
189 |
function spider_ajax_save(form_id) {
|
190 |
var post_data = {};
|
191 |
post_data["bwg_name"] = jQuery("#bwg_name").val();
|
196 |
post_data["image_id"] = jQuery("#image_id").val();
|
197 |
post_data["comment_id"] = jQuery("#comment_id").val();
|
198 |
|
199 |
+
/* Loading. */
|
200 |
jQuery("#ajax_loading").css('height', jQuery(".bwg_comments").css('height'));
|
201 |
jQuery("#opacity_div").css('width', jQuery(".bwg_comments").css('width'));
|
202 |
jQuery("#opacity_div").css('height', jQuery(".bwg_comments").css('height'));
|
217 |
complete:function(){
|
218 |
document.getElementById("opacity_div").style.display = 'none';
|
219 |
document.getElementById("loading_div").style.display = 'none';
|
220 |
+
/* Update scrollbar. */
|
221 |
jQuery(".bwg_comments").mCustomScrollbar({scrollInertia: 150});
|
222 |
+
/* Bind comment container close function to close button. */
|
223 |
jQuery(".bwg_comments_close_btn").click(bwg_comment);
|
224 |
}
|
225 |
});
|
226 |
return false;
|
227 |
}
|
228 |
|
229 |
+
/* Submit rating. */
|
230 |
function spider_rate_ajax_save(form_id) {
|
231 |
var post_data = {};
|
232 |
post_data["image_id"] = jQuery("#" + form_id + " input[name='image_id']").val();
|
248 |
return false;
|
249 |
}
|
250 |
|
251 |
+
/* Set value by ID. */
|
252 |
function spider_set_input_value(input_id, input_value) {
|
253 |
if (document.getElementById(input_id)) {
|
254 |
document.getElementById(input_id).value = input_value;
|
255 |
}
|
256 |
}
|
257 |
|
258 |
+
/* Submit form by ID. */
|
259 |
function spider_form_submit(event, form_id) {
|
260 |
if (document.getElementById(form_id)) {
|
261 |
document.getElementById(form_id).submit();
|
268 |
}
|
269 |
}
|
270 |
|
271 |
+
/* Check if required field is empty. */
|
272 |
function spider_check_required(id, name) {
|
273 |
if (jQuery('#' + id).val() == '') {
|
274 |
alert(name + '* ' + bwg_objectL10n.bwg_field_required);
|
281 |
}
|
282 |
}
|
283 |
|
284 |
+
/* Check if privacy polic field is checked. */
|
285 |
function comment_check_privacy_policy() {
|
286 |
var bwg_submit = jQuery('#bwg_submit');
|
287 |
bwg_submit.removeClass('bwg-submit-disabled');
|
292 |
}
|
293 |
}
|
294 |
|
295 |
+
/* Check Email. */
|
296 |
function spider_check_email(id) {
|
297 |
if (jQuery('#' + id).val() != '') {
|
298 |
var email = jQuery('#' + id).val().replace(/^\s+|\s+$/g, '');
|
304 |
}
|
305 |
}
|
306 |
|
307 |
+
/* Refresh captcha. */
|
308 |
function bwg_captcha_refresh(id) {
|
309 |
if (document.getElementById(id + "_img") && document.getElementById(id + "_input")) {
|
310 |
srcArr = document.getElementById(id + "_img").src.split("&r=");
|
js/bwg_shortcode.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
var bwg_shortcode_type;
|
2 |
jQuery(document).ready(function () {
|
3 |
jQuery(".mce-toolbar-grp.mce-inline-toolbar-grp.mce-container.mce-panel", parent.document).hide();
|
4 |
-
|
5 |
jQuery(".bwg_tabs").each(function () {
|
6 |
jQuery(this).tabs({
|
7 |
activate: function( event, ui ) {
|
@@ -36,7 +36,7 @@ jQuery(document).ready(function () {
|
|
36 |
body.animate({ scrollTop: top }, 500 );
|
37 |
});
|
38 |
|
39 |
-
|
40 |
jQuery('input[name=masonry]').on('click', function(){
|
41 |
if(jQuery(this).val() == 'horizontal') {
|
42 |
jQuery('.masonry_col_num').hide();
|
@@ -372,7 +372,7 @@ function bwg_gallery_type(gallery_type) {
|
|
372 |
jQuery("#tr_ecommerce_icon_hover .ecommerce_icon_show").css('display', 'none');
|
373 |
jQuery("#tr_tag").css('display', 'none');
|
374 |
|
375 |
-
|
376 |
jQuery("#tr_watermark_type").css('display', '');
|
377 |
if (jQuery("input[name=watermark_type]:checked").val() == 'image') {
|
378 |
bwg_watermark('watermark_type_image');
|
@@ -389,7 +389,7 @@ function bwg_gallery_type(gallery_type) {
|
|
389 |
case 'thumbnails': {
|
390 |
jQuery('#options_link').attr('href', jQuery('#options_link').attr('data-href') + '&active_tab=1&gallery_type=' + gallery_type);
|
391 |
jQuery("#tr_gallery").css('display', '');
|
392 |
-
|
393 |
jQuery("#tr_ecommerce_icon_hover .ecommerce_icon_show").css('display', '');
|
394 |
jQuery("#tr_tag").css('display', '');
|
395 |
jQuery("#bwg_pro_version").html('Thumbnails');
|
@@ -401,7 +401,7 @@ function bwg_gallery_type(gallery_type) {
|
|
401 |
}
|
402 |
case 'thumbnails_masonry': {
|
403 |
jQuery('#options_link').attr('href', jQuery('#options_link').attr('data-href') + '&active_tab=1&gallery_type=' + gallery_type);
|
404 |
-
|
405 |
jQuery("#tr_gallery").css('display', '');
|
406 |
jQuery("#tr_tag").css('display', '');
|
407 |
jQuery("#bwg_pro_version").html('Masonry');
|
@@ -415,7 +415,7 @@ function bwg_gallery_type(gallery_type) {
|
|
415 |
}
|
416 |
case 'thumbnails_mosaic': {
|
417 |
jQuery('#options_link').attr('href', jQuery('#options_link').attr('data-href') + '&active_tab=1&gallery_type=' + gallery_type);
|
418 |
-
|
419 |
jQuery("#tr_gallery").css('display', '');
|
420 |
jQuery("#tr_tag").css('display', '');
|
421 |
jQuery("#bwg_pro_version").html('Mosaic');
|
@@ -470,7 +470,7 @@ function bwg_gallery_type(gallery_type) {
|
|
470 |
jQuery(".bwg-section.bwg-pro-views").show();
|
471 |
break;
|
472 |
}
|
473 |
-
|
474 |
jQuery('#options_link').attr('href', jQuery('#options_link').attr('data-href') + '&active_tab=2&album_type=' + gallery_type);
|
475 |
jQuery("#tr_album").css('display', '');
|
476 |
jQuery("#bwg_pro_version").html('Masonry gallery group');
|
@@ -495,9 +495,9 @@ function bwg_gallery_type(gallery_type) {
|
|
495 |
}
|
496 |
break;
|
497 |
}
|
498 |
-
|
499 |
jQuery('#options_link').attr('href', jQuery('#options_link').attr('data-href') + '&active_tab=1&gallery_type=' + gallery_type);
|
500 |
-
|
501 |
jQuery("#tr_tag").css('display', '');
|
502 |
jQuery("#bwg_pro_version").html('Carousel');
|
503 |
jQuery("#bwg_pro_version_link").attr("href", "https://demo.10web.io/photo-gallery/carousel/");
|
@@ -507,7 +507,7 @@ function bwg_gallery_type(gallery_type) {
|
|
507 |
jQuery(".bwg-pro-views").hide();
|
508 |
}
|
509 |
break;
|
510 |
-
|
511 |
}
|
512 |
|
513 |
bwg_lightbox_hide_show_params();
|
@@ -571,13 +571,13 @@ function bwg_get_textarea_selection(id) {
|
|
571 |
var textComponent = top.document.getElementById(id);
|
572 |
var selectedText;
|
573 |
if (textComponent.selectionStart !== undefined) {
|
574 |
-
|
575 |
var startPos = textComponent.selectionStart;
|
576 |
var endPos = textComponent.selectionEnd;
|
577 |
selectedText = textComponent.value.substring(startPos, endPos);
|
578 |
}
|
579 |
else if (document.selection !== undefined) {
|
580 |
-
|
581 |
textComponent.focus();
|
582 |
var sel = document.selection.createRange();
|
583 |
selectedText = sel.text;
|
1 |
var bwg_shortcode_type;
|
2 |
jQuery(document).ready(function () {
|
3 |
jQuery(".mce-toolbar-grp.mce-inline-toolbar-grp.mce-container.mce-panel", parent.document).hide();
|
4 |
+
/* Add tabs. */
|
5 |
jQuery(".bwg_tabs").each(function () {
|
6 |
jQuery(this).tabs({
|
7 |
activate: function( event, ui ) {
|
36 |
body.animate({ scrollTop: top }, 500 );
|
37 |
});
|
38 |
|
39 |
+
/* Changing label Number of image rows to columns in masonry view */
|
40 |
jQuery('input[name=masonry]').on('click', function(){
|
41 |
if(jQuery(this).val() == 'horizontal') {
|
42 |
jQuery('.masonry_col_num').hide();
|
372 |
jQuery("#tr_ecommerce_icon_hover .ecommerce_icon_show").css('display', 'none');
|
373 |
jQuery("#tr_tag").css('display', 'none');
|
374 |
|
375 |
+
/* Watermark. */
|
376 |
jQuery("#tr_watermark_type").css('display', '');
|
377 |
if (jQuery("input[name=watermark_type]:checked").val() == 'image') {
|
378 |
bwg_watermark('watermark_type_image');
|
389 |
case 'thumbnails': {
|
390 |
jQuery('#options_link').attr('href', jQuery('#options_link').attr('data-href') + '&active_tab=1&gallery_type=' + gallery_type);
|
391 |
jQuery("#tr_gallery").css('display', '');
|
392 |
+
jQuery("#tr_ecommerce_icon_hover").css('display', '');
|
393 |
jQuery("#tr_ecommerce_icon_hover .ecommerce_icon_show").css('display', '');
|
394 |
jQuery("#tr_tag").css('display', '');
|
395 |
jQuery("#bwg_pro_version").html('Thumbnails');
|
401 |
}
|
402 |
case 'thumbnails_masonry': {
|
403 |
jQuery('#options_link').attr('href', jQuery('#options_link').attr('data-href') + '&active_tab=1&gallery_type=' + gallery_type);
|
404 |
+
jQuery("#tr_ecommerce_icon_hover").css('display', '');
|
405 |
jQuery("#tr_gallery").css('display', '');
|
406 |
jQuery("#tr_tag").css('display', '');
|
407 |
jQuery("#bwg_pro_version").html('Masonry');
|
415 |
}
|
416 |
case 'thumbnails_mosaic': {
|
417 |
jQuery('#options_link').attr('href', jQuery('#options_link').attr('data-href') + '&active_tab=1&gallery_type=' + gallery_type);
|
418 |
+
jQuery("#tr_ecommerce_icon_hover ").css('display', '');
|
419 |
jQuery("#tr_gallery").css('display', '');
|
420 |
jQuery("#tr_tag").css('display', '');
|
421 |
jQuery("#bwg_pro_version").html('Mosaic');
|
470 |
jQuery(".bwg-section.bwg-pro-views").show();
|
471 |
break;
|
472 |
}
|
473 |
+
case 'album_masonry_preview': {
|
474 |
jQuery('#options_link').attr('href', jQuery('#options_link').attr('data-href') + '&active_tab=2&album_type=' + gallery_type);
|
475 |
jQuery("#tr_album").css('display', '');
|
476 |
jQuery("#bwg_pro_version").html('Masonry gallery group');
|
495 |
}
|
496 |
break;
|
497 |
}
|
498 |
+
case 'carousel': {
|
499 |
jQuery('#options_link').attr('href', jQuery('#options_link').attr('data-href') + '&active_tab=1&gallery_type=' + gallery_type);
|
500 |
+
jQuery("#tr_gallery").css('display', '');
|
501 |
jQuery("#tr_tag").css('display', '');
|
502 |
jQuery("#bwg_pro_version").html('Carousel');
|
503 |
jQuery("#bwg_pro_version_link").attr("href", "https://demo.10web.io/photo-gallery/carousel/");
|
507 |
jQuery(".bwg-pro-views").hide();
|
508 |
}
|
509 |
break;
|
510 |
+
}
|
511 |
}
|
512 |
|
513 |
bwg_lightbox_hide_show_params();
|
571 |
var textComponent = top.document.getElementById(id);
|
572 |
var selectedText;
|
573 |
if (textComponent.selectionStart !== undefined) {
|
574 |
+
/* Standards Compliant Version */
|
575 |
var startPos = textComponent.selectionStart;
|
576 |
var endPos = textComponent.selectionEnd;
|
577 |
selectedText = textComponent.value.substring(startPos, endPos);
|
578 |
}
|
579 |
else if (document.selection !== undefined) {
|
580 |
+
/* IE Version */
|
581 |
textComponent.focus();
|
582 |
var sel = document.selection.createRange();
|
583 |
selectedText = sel.text;
|
js/jquery.fullscreen-0.4.1.js
CHANGED
@@ -25,9 +25,9 @@ function extend(child, parent, prototype) {
|
|
25 |
}
|
26 |
|
27 |
var SUBST = [
|
28 |
-
['', ''],
|
29 |
-
['exit', 'cancel'],
|
30 |
-
['screen', 'Screen']
|
31 |
];
|
32 |
|
33 |
var VENDOR_PREFIXES = ['', 'o', 'ms', 'moz', 'webkit', 'webkitCurrent'];
|
@@ -83,11 +83,11 @@ FullScreenAbstract.prototype = {
|
|
83 |
_preventDocumentScroll: function() {
|
84 |
this.__documentOverflow = $('body')[0].style.overflow;
|
85 |
this.__htmlOverflow = $('html')[0].style.overflow;
|
86 |
-
|
87 |
},
|
88 |
_allowDocumentScroll: function() {
|
89 |
-
|
90 |
-
|
91 |
},
|
92 |
_fullScreenChange: function() {
|
93 |
if (!this.isFullScreen()) {
|
@@ -115,9 +115,9 @@ FullScreenAbstract.prototype = {
|
|
115 |
var $elem = $(this._fullScreenElement);
|
116 |
this.__savedStyles = {};
|
117 |
for (var property in this.__options.styles) {
|
118 |
-
|
119 |
this.__savedStyles[property] = this._fullScreenElement.style[property];
|
120 |
-
|
121 |
this._fullScreenElement.style[property] = this.__options.styles[property];
|
122 |
}
|
123 |
if (this.__options.toggleClass) {
|
@@ -134,19 +134,19 @@ FullScreenAbstract.prototype = {
|
|
134 |
}
|
135 |
},
|
136 |
open: function(elem, options) {
|
137 |
-
|
138 |
if (elem === this._fullScreenElement) {
|
139 |
return;
|
140 |
}
|
141 |
-
|
142 |
if (this.isFullScreen()) {
|
143 |
this.exit();
|
144 |
}
|
145 |
-
|
146 |
this._fullScreenElement = elem;
|
147 |
-
|
148 |
this.__options = $.extend(true, {}, this._DEFAULT_OPTIONS, options);
|
149 |
-
|
150 |
this._saveAndApplyStyles();
|
151 |
},
|
152 |
exit: null,
|
@@ -226,7 +226,7 @@ extend(FullScreenFallback, FullScreenAbstract, {
|
|
226 |
},
|
227 |
_revertStyles: function() {
|
228 |
FullScreenFallback._super._revertStyles.apply(this, arguments);
|
229 |
-
|
230 |
this._fullScreenElement.offsetHeight;
|
231 |
},
|
232 |
open: function(elem) {
|
@@ -253,12 +253,12 @@ $.fn.fullscreen = function(options) {
|
|
253 |
|
254 |
options = $.extend({
|
255 |
toggleClass: null,
|
256 |
-
|
257 |
}, options);
|
258 |
options.styles = {
|
259 |
-
|
260 |
};
|
261 |
-
|
262 |
|
263 |
if (elem) {
|
264 |
$.fullscreen.open(elem, options);
|
25 |
}
|
26 |
|
27 |
var SUBST = [
|
28 |
+
['', ''], /* spec*/
|
29 |
+
['exit', 'cancel'], /* firefox & old webkits expect cancelFullScreen instead of exitFullscreen*/
|
30 |
+
['screen', 'Screen'] /* firefox expects FullScreen instead of Fullscreen*/
|
31 |
];
|
32 |
|
33 |
var VENDOR_PREFIXES = ['', 'o', 'ms', 'moz', 'webkit', 'webkitCurrent'];
|
83 |
_preventDocumentScroll: function() {
|
84 |
this.__documentOverflow = $('body')[0].style.overflow;
|
85 |
this.__htmlOverflow = $('html')[0].style.overflow;
|
86 |
+
/* $('body, html').css('overflow', 'hidden');*/
|
87 |
},
|
88 |
_allowDocumentScroll: function() {
|
89 |
+
/* $('body')[0].style.overflow = this.__documentOverflow;*/
|
90 |
+
/* $('html')[0].style.overflow = this.__htmlOverflow; */
|
91 |
},
|
92 |
_fullScreenChange: function() {
|
93 |
if (!this.isFullScreen()) {
|
115 |
var $elem = $(this._fullScreenElement);
|
116 |
this.__savedStyles = {};
|
117 |
for (var property in this.__options.styles) {
|
118 |
+
/* save */
|
119 |
this.__savedStyles[property] = this._fullScreenElement.style[property];
|
120 |
+
/* apply */
|
121 |
this._fullScreenElement.style[property] = this.__options.styles[property];
|
122 |
}
|
123 |
if (this.__options.toggleClass) {
|
134 |
}
|
135 |
},
|
136 |
open: function(elem, options) {
|
137 |
+
/* do nothing if request is for already fullscreened element */
|
138 |
if (elem === this._fullScreenElement) {
|
139 |
return;
|
140 |
}
|
141 |
+
/* exit active fullscreen before opening another one */
|
142 |
if (this.isFullScreen()) {
|
143 |
this.exit();
|
144 |
}
|
145 |
+
/* save fullscreened element */
|
146 |
this._fullScreenElement = elem;
|
147 |
+
/* apply options, if any */
|
148 |
this.__options = $.extend(true, {}, this._DEFAULT_OPTIONS, options);
|
149 |
+
/* save current element styles and apply new */
|
150 |
this._saveAndApplyStyles();
|
151 |
},
|
152 |
exit: null,
|
226 |
},
|
227 |
_revertStyles: function() {
|
228 |
FullScreenFallback._super._revertStyles.apply(this, arguments);
|
229 |
+
/* force redraw (fixes bug in IE7 with content dissapearing) */
|
230 |
this._fullScreenElement.offsetHeight;
|
231 |
},
|
232 |
open: function(elem) {
|
253 |
|
254 |
options = $.extend({
|
255 |
toggleClass: null,
|
256 |
+
/* overflow: 'hidden'*/
|
257 |
}, options);
|
258 |
options.styles = {
|
259 |
+
/* overflow: options.overflow */
|
260 |
};
|
261 |
+
/* delete options.overflow; */
|
262 |
|
263 |
if (elem) {
|
264 |
$.fullscreen.open(elem, options);
|
js/jquery.sumoselect.min.js
CHANGED
@@ -1,6 +1,765 @@
|
|
1 |
-
|
2 |
-
* jquery.sumoselect - v3.0.
|
3 |
* http://hemantnegi.github.io/jquery.sumoselect
|
|
|
|
|
|
|
|
|
|
|
4 |
*/
|
5 |
|
6 |
-
!function(e){"namespace sumo";e.fn.SumoSelect=function(t){var l=e.extend({placeholder:"Select Here",csvDispCount:3,captionFormat:"{0} Selected",captionFormatAllSelected:"{0} all selected!",floatWidth:400,forceCustomRendering:!1,nativeOnDevice:["Android","BlackBerry","iPhone","iPad","iPod","Opera Mini","IEMobile","Silk"],outputAsCSV:!1,csvSepChar:",",okCancelInMulti:!1,triggerChangeCombined:!0,selectAll:!1,search:!1,searchText:"Search...",noMatch:'No matches for "{0}"',prefix:"",locale:["OK","Cancel","Select All"],up:!1},t),s=this.each(function(){var t=this;!this.sumo&&e(this).is("select")&&(this.sumo={E:e(t),is_multi:e(t).attr("multiple"),select:"",caption:"",placeholder:"",optDiv:"",CaptionCont:"",ul:"",is_floating:!1,is_opened:!1,mob:!1,Pstate:[],createElems:function(){var t=this;return t.E.wrap('<div class="SumoSelect" tabindex="0">'),t.select=t.E.parent(),t.caption=e("<span>"),t.CaptionCont=e('<p class="CaptionCont"><label><i></i></label></p>').addClass("SelectBox").attr("style",t.E.attr("style")).prepend(t.caption),t.select.append(t.CaptionCont),t.is_multi||(l.okCancelInMulti=!1),t.E.attr("disabled")&&t.select.addClass("disabled").removeAttr("tabindex"),l.outputAsCSV&&t.is_multi&&t.E.attr("name")&&(t.select.append(e('<input class="HEMANT123" type="hidden" />').attr("name",t.E.attr("name")).val(t.getSelStr())),t.E.removeAttr("name")),t.isMobile()&&!l.forceCustomRendering?void t.setNativeMobile():(t.E.attr("name")&&t.select.addClass("sumo_"+t.E.attr("name")),t.E.addClass("SumoUnder").attr("tabindex","-1"),t.optDiv=e('<div class="optWrapper '+(l.up?"up":"")+'">'),t.floatingList(),t.ul=e('<ul class="options">'),t.optDiv.append(t.ul),l.selectAll&&t.SelAll(),l.search&&t.Search(),t.ul.append(t.prepItems(t.E.children())),t.is_multi&&t.multiSelelect(),t.select.append(t.optDiv),t.basicEvents(),void t.selAllState())},prepItems:function(t,l){var i=[],s=this;return e(t).each(function(t,n){n=e(n),i.push(n.is("optgroup")?e('<li class="group '+(n[0].disabled?"disabled":"")+'"><label>'+n.attr("label")+"</label><ul></ul><li>").find("ul").append(s.prepItems(n.children(),n[0].disabled)).end():s.createLi(n,l))}),i},createLi:function(t,l){var i=this;return t.attr("value")||t.attr("value",t.val()),li=e('<li class="opt"><label>'+t.text()+"</label></li>"),li.data("opt",t),t.data("li",li),i.is_multi&&li.prepend("<span><i></i></span>"),(t[0].disabled||l)&&(li=li.addClass("disabled")),i.onOptClick(li),t[0].selected&&li.addClass("selected"),t.attr("class")&&li.addClass(t.attr("class")),li},getSelStr:function(){return sopt=[],this.E.find("option:selected").each(function(){sopt.push(e(this).val())}),sopt.join(l.csvSepChar)},multiSelelect:function(){var t=this;t.optDiv.addClass("multiple"),t.okbtn=e('<p class="btnOk">'+l.locale[0]+"</p>").click(function(){l.triggerChangeCombined&&(changed=!1,t.E.find("option:selected").length!=t.Pstate.length?changed=!0:t.E.find("option").each(function(e,l){l.selected&&t.Pstate.indexOf(e)<0&&(changed=!0)}),changed&&(t.callChange(),t.setText())),t.hideOpts()}),t.cancelBtn=e('<p class="btnCancel">'+l.locale[1]+"</p>").click(function(){t._cnbtn(),t.hideOpts()}),t.optDiv.append(e('<div class="MultiControls">').append(t.okbtn).append(t.cancelBtn))},_cnbtn:function(){var e=this;e.E.find("option:selected").each(function(){this.selected=!1}),e.optDiv.find("li.selected").removeClass("selected");for(var t=0;t<e.Pstate.length;t++)e.E.find("option")[e.Pstate[t]].selected=!0,e.ul.find("li.opt").eq(e.Pstate[t]).addClass("selected");e.selAllState()},SelAll:function(){var t=this;t.is_multi&&(t.selAll=e('<p class="select-all"><span><i></i></span><label>'+l.locale[2]+"</label></p>"),t.selAll.on("click",function(){t.selAll.toggleClass("selected"),t.optDiv.find("li.opt").not(".hidden").each(function(l,i){i=e(i),t.selAll.hasClass("selected")?i.hasClass("selected")||i.trigger("click"):i.hasClass("selected")&&i.trigger("click")})}),t.optDiv.prepend(t.selAll))},Search:function(){var t=this,i=t.CaptionCont.addClass("search"),s=e('<p class="no-match">');t.ftxt=e('<input type="text" class="search-txt" value="" placeholder="'+l.searchText+'">').on("click",function(e){e.stopPropagation()}),i.append(t.ftxt),t.optDiv.children("ul").after(s),t.ftxt.on("keyup.sumo",function(){var i=t.optDiv.find("ul.options li.opt").each(function(l,i){i=e(i),i.text().toLowerCase().indexOf(t.ftxt.val().toLowerCase())>-1?i.removeClass("hidden"):i.addClass("hidden")}).not(".hidden");s.html(l.noMatch.replace(/\{0\}/g,t.ftxt.val())).toggle(!i.length),t.selAllState()})},selAllState:function(){var t=this;if(l.selectAll){var i=0,s=0;t.optDiv.find("li.opt").not(".hidden").each(function(t,l){e(l).hasClass("selected")&&i++,e(l).hasClass("disabled")||s++}),i==s?t.selAll.removeClass("partial").addClass("selected"):0==i?t.selAll.removeClass("selected partial"):t.selAll.addClass("partial")}},showOpts:function(){var t=this;t.E.attr("disabled")||(t.is_opened=!0,t.select.addClass("open"),t.ftxt?t.ftxt.focus():t.select.focus(),e(document).on("click.sumo",function(e){if(!t.select.is(e.target)&&0===t.select.has(e.target).length){if(!t.is_opened)return;t.hideOpts(),l.okCancelInMulti&&t._cnbtn()}}),t.is_floating&&(H=t.optDiv.children("ul").outerHeight()+2,t.is_multi&&(H+=parseInt(t.optDiv.css("padding-bottom"))),t.optDiv.css("height",H),e("body").addClass("sumoStopScroll")),t.setPstate())},setPstate:function(){var e=this;e.is_multi&&(e.is_floating||l.okCancelInMulti)&&(e.Pstate=[],e.E.find("option").each(function(t,l){l.selected&&e.Pstate.push(t)}))},callChange:function(){this.E.trigger("change").trigger("click")},hideOpts:function(){var t=this;t.is_opened&&(t.is_opened=!1,t.select.removeClass("open").find("ul li.sel").removeClass("sel"),e(document).off("click.sumo"),t.select.focus(),e("body").removeClass("sumoStopScroll"),l.search&&(t.ftxt.val(""),t.optDiv.find("ul.options li").removeClass("hidden"),t.optDiv.find(".no-match").toggle(!1)))},setOnOpen:function(){var e=this,t=e.optDiv.find("li.opt:not(.hidden)").eq(l.search?0:e.E[0].selectedIndex);e.optDiv.find("li.sel").removeClass("sel"),t.addClass("sel"),e.showOpts()},nav:function(e){var t,l=this,i=l.ul.find("li.opt:not(.disabled, .hidden)"),s=l.ul.find("li.opt.sel:not(.hidden)"),n=i.index(s);if(l.is_opened&&s.length){if(e&&n>0)t=i.eq(n-1);else{if(!(!e&&n<i.length-1&&n>-1))return;t=i.eq(n+1)}s.removeClass("sel"),s=t.addClass("sel");var o=l.ul,a=o.scrollTop(),c=s.position().top+a;c>=a+o.height()-s.outerHeight()&&o.scrollTop(c-o.height()+s.outerHeight()),a>c&&o.scrollTop(c)}else l.setOnOpen()},basicEvents:function(){var t=this;t.CaptionCont.click(function(e){t.E.trigger("click"),t.is_opened?t.hideOpts():t.showOpts(),e.stopPropagation()}),t.select.on("keydown.sumo",function(e){switch(e.which){case 38:t.nav(!0);break;case 40:t.nav(!1);break;case 32:if(l.search&&t.ftxt.is(e.target))return;case 13:t.is_opened?t.optDiv.find("ul li.sel").trigger("click"):t.setOnOpen();break;case 9:case 27:return l.okCancelInMulti&&t._cnbtn(),void t.hideOpts();default:return}e.preventDefault()}),e(window).on("resize.sumo",function(){t.floatingList()})},onOptClick:function(t){var i=this;t.click(function(){var t=e(this);t.hasClass("disabled")||(txt="",i.is_multi?(t.toggleClass("selected"),t.data("opt")[0].selected=t.hasClass("selected"),i.selAllState()):(t.parent().find("li.selected").removeClass("selected"),t.toggleClass("selected"),t.data("opt")[0].selected=!0),i.is_multi&&l.triggerChangeCombined&&(i.is_floating||l.okCancelInMulti)||(i.setText(),i.callChange()),i.is_multi||i.hideOpts())})},setText:function(){var t=this;if(t.placeholder="",t.is_multi){for(sels=t.E.find(":selected").not(":disabled"),i=0;i<sels.length;i++){if(i+1>=l.csvDispCount&&l.csvDispCount){sels.length==t.E.find("option").length&&l.captionFormatAllSelected?t.placeholder=l.captionFormatAllSelected.replace(/\{0\}/g,sels.length)+",":t.placeholder=l.captionFormat.replace(/\{0\}/g,sels.length)+",";break}t.placeholder+=e(sels[i]).text()+", "}t.placeholder=t.placeholder.replace(/,([^,]*)$/,"$1")}else t.placeholder=t.E.find(":selected").not(":disabled").text();return is_placeholder=!1,t.placeholder||(is_placeholder=!0,t.placeholder=t.E.attr("placeholder"),t.placeholder||(t.placeholder=t.E.find("option:disabled:selected").text())),t.placeholder=t.placeholder?l.prefix+" "+t.placeholder:l.placeholder,t.caption.html(t.placeholder),t.CaptionCont.attr("title",t.placeholder),csvField=t.select.find("input.HEMANT123"),csvField.length&&csvField.val(t.getSelStr()),is_placeholder?t.caption.addClass("placeholder"):t.caption.removeClass("placeholder"),t.placeholder},isMobile:function(){for(var e=navigator.userAgent||navigator.vendor||window.opera,t=0;t<l.nativeOnDevice.length;t++)if(e.toString().toLowerCase().indexOf(l.nativeOnDevice[t].toLowerCase())>0)return l.nativeOnDevice[t];return!1},setNativeMobile:function(){var e=this;e.E.addClass("SelectClass"),e.mob=!0,e.E.change(function(){e.setText()})},floatingList:function(){var t=this;t.is_floating=e(window).width()<=l.floatWidth,t.optDiv.toggleClass("isFloating",t.is_floating),t.is_floating||t.optDiv.css("height",""),t.optDiv.toggleClass("okCancelInMulti",l.okCancelInMulti&&!t.is_floating)},vRange:function(e){var t=this;if(opts=t.E.find("option"),opts.length<=e||0>e)throw"index out of bounds";return t},toggSel:function(t,l){var i=this;"number"==typeof l?(i.vRange(l),opt=i.E.find("option")[l]):opt=i.E.find('option[value="'+l+'"]')[0]||0,opt&&!opt.disabled&&opt.selected!=t&&(opt.selected=t,i.mob||e(opt).data("li").toggleClass("selected",t),i.callChange(),i.setPstate(),i.setText(),i.selAllState())},toggDis:function(e,t){var l=this.vRange(t);l.E.find("option")[t].disabled=e,e&&(l.E.find("option")[t].selected=!1),l.mob||l.optDiv.find("ul.options li").eq(t).toggleClass("disabled",e).removeClass("selected"),l.setText()},toggSumo:function(e){var t=this;return t.enabled=e,t.select.toggleClass("disabled",e),e?(t.E.attr("disabled","disabled"),t.select.removeAttr("tabindex")):(t.E.removeAttr("disabled"),t.select.attr("tabindex","0")),t},toggSelAll:function(t){var l=this;l.E.find("option").each(function(){l.E.find("option")[e(this).index()].disabled||(l.E.find("option")[e(this).index()].selected=t,l.mob||l.optDiv.find("ul.options li").eq(e(this).index()).toggleClass("selected",t),l.setText())}),!l.mob&&l.selAll&&l.selAll.removeClass("partial").toggleClass("selected",t),l.callChange(),l.setPstate()},reload:function(){var t=this.unload();return e(t).SumoSelect(l)},unload:function(){var e=this;return e.select.before(e.E),e.E.show(),l.outputAsCSV&&e.is_multi&&e.select.find("input.HEMANT123").length&&e.E.attr("name",e.select.find("input.HEMANT123").attr("name")),e.select.remove(),delete t.sumo,t},add:function(l,i,s){if("undefined"==typeof l)throw"No value to add";var n=this;if(opts=n.E.find("option"),"number"==typeof i&&(s=i,i=l),"undefined"==typeof i&&(i=l),opt=e("<option></option>").val(l).html(i),opts.length<s)throw"index out of bounds";return"undefined"==typeof s||opts.length==s?(n.E.append(opt),n.mob||n.ul.append(n.createLi(opt))):(opts.eq(s).before(opt),n.mob||n.ul.find("li.opt").eq(s).before(n.createLi(opt))),t},remove:function(e){var t=this.vRange(e);t.E.find("option").eq(e).remove(),t.mob||t.optDiv.find("ul.options li").eq(e).remove(),t.setText()},selectItem:function(e){this.toggSel(!0,e)},unSelectItem:function(e){this.toggSel(!1,e)},selectAll:function(){this.toggSelAll(!0)},unSelectAll:function(){this.toggSelAll(!1)},disableItem:function(e){this.toggDis(!0,e)},enableItem:function(e){this.toggDis(!1,e)},enabled:!0,enable:function(){return this.toggSumo(!1)},disable:function(){return this.toggSumo(!0)},init:function(){var e=this;return e.createElems(),e.setText(),e}},t.sumo.init())});return 1==s.length?s[0]:s}}(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* jquery.sumoselect - v3.0.3
|
3 |
* http://hemantnegi.github.io/jquery.sumoselect
|
4 |
+
* 2016-12-12
|
5 |
+
*
|
6 |
+
* Copyright 2015 Hemant Negi
|
7 |
+
* Email : hemant.frnz@gmail.com
|
8 |
+
* Compressor http://refresh-sf.com/
|
9 |
*/
|
10 |
|
11 |
+
(function(factory) {
|
12 |
+
'use strict';
|
13 |
+
if (typeof define === 'function' && define.amd) {
|
14 |
+
define(['jquery'], factory);
|
15 |
+
} else if (typeof exports !== 'undefined') {
|
16 |
+
module.exports = factory(require('jquery'));
|
17 |
+
} else {
|
18 |
+
factory(jQuery);
|
19 |
+
}
|
20 |
+
|
21 |
+
})(function ($) {
|
22 |
+
|
23 |
+
'namespace sumo';
|
24 |
+
$.fn.SumoSelect = function (options) {
|
25 |
+
|
26 |
+
/* This is the easiest way to have default options.*/
|
27 |
+
var settings = $.extend({
|
28 |
+
placeholder: 'Select Here', /* Dont change it here.*/
|
29 |
+
csvDispCount: 3, /* display no. of items in multiselect. 0 to display all.*/
|
30 |
+
captionFormat:'{0} Selected', /* format of caption text. you can set your locale.*/
|
31 |
+
captionFormatAllSelected:'{0} all selected!', /* format of caption text when all elements are selected. set null to use captionFormat. It will not work if there are disabled elements in select.*/
|
32 |
+
floatWidth: 400, /* Screen width of device at which the list is rendered in floating popup fashion.*/
|
33 |
+
forceCustomRendering: false, /* force the custom modal on all devices below floatWidth resolution.*/
|
34 |
+
nativeOnDevice: ['Android', 'BlackBerry', 'iPhone', 'iPad', 'iPod', 'Opera Mini', 'IEMobile', 'Silk'],
|
35 |
+
outputAsCSV: false, /* true to POST data as csv ( false for Html control array ie. default select )*/
|
36 |
+
csvSepChar: ',', /* separation char in csv mode*/
|
37 |
+
okCancelInMulti: false, /* display ok cancel buttons in desktop mode multiselect also.*/
|
38 |
+
isClickAwayOk: false, /* for okCancelInMulti=true. sets whether click outside will trigger Ok or Cancel (default is cancel).*/
|
39 |
+
triggerChangeCombined: true, /* im multi select mode whether to trigger change event on individual selection or combined selection.*/
|
40 |
+
selectAll: false, /* to display select all button in multiselect mode.|| also select all will not be available on mobile devices.*/
|
41 |
+
search: false, /* to display input for filtering content. selectAlltext will be input text placeholder*/
|
42 |
+
searchText: 'Search...', /* placeholder for search input*/
|
43 |
+
noMatch: 'No matches for "{0}"',
|
44 |
+
prefix: '', /* some prefix usually the field name. eg. '<b>Hello</b>'*/
|
45 |
+
locale: ['OK', 'Cancel', 'Select All'], /* all text that is used. don't change the index.*/
|
46 |
+
up: false, /* set true to open upside.*/
|
47 |
+
showTitle: true /* set to false to prevent title (tooltip) from appearing*/
|
48 |
+
}, options);
|
49 |
+
|
50 |
+
var ret = this.each(function () {
|
51 |
+
var selObj = this; /* the original select object.*/
|
52 |
+
if (this.sumo || !$(this).is('select')) return; /* already initialized*/
|
53 |
+
|
54 |
+
this.sumo = {
|
55 |
+
E: $(selObj), /* the jquery object of original select element.*/
|
56 |
+
is_multi: $(selObj).attr('multiple'), /* if its a multiple select*/
|
57 |
+
select: '',
|
58 |
+
caption: '',
|
59 |
+
placeholder: '',
|
60 |
+
optDiv: '',
|
61 |
+
CaptionCont: '',
|
62 |
+
ul:'',
|
63 |
+
is_floating: false,
|
64 |
+
is_opened: false,
|
65 |
+
/* backdrop: '', */
|
66 |
+
mob:false, /* if to open device default select */
|
67 |
+
Pstate: [],
|
68 |
+
|
69 |
+
createElems: function () {
|
70 |
+
var O = this;
|
71 |
+
O.E.wrap('<div class="SumoSelect" tabindex="0" role="button" aria-expanded="false">');
|
72 |
+
O.select = O.E.parent();
|
73 |
+
O.caption = $('<span>');
|
74 |
+
O.CaptionCont = $('<p class="CaptionCont SelectBox" ><label><i></i></label></p>')
|
75 |
+
.attr('style', O.E.attr('style'))
|
76 |
+
.prepend(O.caption);
|
77 |
+
O.select.append(O.CaptionCont);
|
78 |
+
|
79 |
+
/* default turn off if no multiselect */
|
80 |
+
if(!O.is_multi)settings.okCancelInMulti = false
|
81 |
+
|
82 |
+
if(O.E.attr('disabled'))
|
83 |
+
O.select.addClass('disabled').removeAttr('tabindex');
|
84 |
+
|
85 |
+
/* if output as csv and is a multiselect.*/
|
86 |
+
if (settings.outputAsCSV && O.is_multi && O.E.attr('name')) {
|
87 |
+
/* create a hidden field to store csv value.*/
|
88 |
+
O.select.append($('<input class="HEMANT123" type="hidden" />').attr('name', O.E.attr('name')).val(O.getSelStr()));
|
89 |
+
|
90 |
+
/* so it can not post the original select.*/
|
91 |
+
O.E.removeAttr('name');
|
92 |
+
}
|
93 |
+
|
94 |
+
/* break for mobile rendring.. if forceCustomRendering is false*/
|
95 |
+
if (O.isMobile() && !settings.forceCustomRendering) {
|
96 |
+
O.setNativeMobile();
|
97 |
+
return;
|
98 |
+
}
|
99 |
+
|
100 |
+
/* if there is a name attr in select add a class to container div*/
|
101 |
+
if(O.E.attr('name')) O.select.addClass('sumo_'+O.E.attr('name').replace(/\[\]/, ''))
|
102 |
+
|
103 |
+
/* hide original select */
|
104 |
+
O.E.addClass('SumoUnder').attr('tabindex','-1');
|
105 |
+
|
106 |
+
/* Creating the list... */
|
107 |
+
O.optDiv = $('<div class="optWrapper '+ (settings.up?'up':'') +'">');
|
108 |
+
|
109 |
+
/* branch for floating list in low res devices.*/
|
110 |
+
O.floatingList();
|
111 |
+
|
112 |
+
/* Creating the markup for the available options*/
|
113 |
+
O.ul = $('<ul class="options">');
|
114 |
+
O.optDiv.append(O.ul);
|
115 |
+
|
116 |
+
/* Select all functionality*/
|
117 |
+
if(settings.selectAll && O.is_multi) O.SelAll();
|
118 |
+
|
119 |
+
/* search functionality*/
|
120 |
+
if(settings.search) O.Search();
|
121 |
+
|
122 |
+
O.ul.append(O.prepItems(O.E.children()));
|
123 |
+
|
124 |
+
/* if multiple then add the class multiple and add OK / CANCEL button */
|
125 |
+
if (O.is_multi) O.multiSelelect();
|
126 |
+
|
127 |
+
O.select.append(O.optDiv);
|
128 |
+
O.basicEvents();
|
129 |
+
O.selAllState();
|
130 |
+
},
|
131 |
+
|
132 |
+
prepItems: function(opts, d){
|
133 |
+
var lis = [], O=this;
|
134 |
+
$(opts).each(function (i, opt) { /* parsing options to li */
|
135 |
+
opt = $(opt);
|
136 |
+
lis.push(opt.is('optgroup')?
|
137 |
+
$('<li class="group '+ (opt[0].disabled?'disabled':'') +'"><label>' + opt.attr('label') +'</label><ul></ul></li>')
|
138 |
+
.find('ul')
|
139 |
+
.append(O.prepItems(opt.children(), opt[0].disabled))
|
140 |
+
.end()
|
141 |
+
:
|
142 |
+
O.createLi(opt, d)
|
143 |
+
);
|
144 |
+
});
|
145 |
+
return lis;
|
146 |
+
},
|
147 |
+
|
148 |
+
/* Creates a LI element from a given option and binds events to it*/
|
149 |
+
/*returns the jquery instance of li (not inserted in dom)*/
|
150 |
+
createLi: function (opt, d) {
|
151 |
+
var O = this;
|
152 |
+
|
153 |
+
if(!opt.attr('value'))opt.attr('value',opt.val());
|
154 |
+
var li = $('<li class="opt"><label>' + opt.text() + '</label></li>');
|
155 |
+
|
156 |
+
li.data('opt', opt); /* store a direct reference to option.*/
|
157 |
+
opt.data('li', li); /* store a direct reference to list item.*/
|
158 |
+
if (O.is_multi) li.prepend('<span><i></i></span>');
|
159 |
+
|
160 |
+
if (opt[0].disabled || d)
|
161 |
+
li = li.addClass('disabled');
|
162 |
+
|
163 |
+
O.onOptClick(li);
|
164 |
+
|
165 |
+
if (opt[0].selected)
|
166 |
+
li.addClass('selected');
|
167 |
+
|
168 |
+
if (opt.attr('class'))
|
169 |
+
li.addClass(opt.attr('class'));
|
170 |
+
|
171 |
+
if (opt.attr('title'))
|
172 |
+
li.attr('title', opt.attr('title'));
|
173 |
+
|
174 |
+
return li;
|
175 |
+
},
|
176 |
+
|
177 |
+
/* Returns the selected items as string in a Multiselect.*/
|
178 |
+
getSelStr: function () {
|
179 |
+
/* get the pre selected items.*/
|
180 |
+
sopt = [];
|
181 |
+
this.E.find('option:selected').each(function () { sopt.push($(this).val()); });
|
182 |
+
return sopt.join(settings.csvSepChar);
|
183 |
+
},
|
184 |
+
|
185 |
+
/* THOSE OK/CANCEL BUTTONS ON MULTIPLE SELECT.*/
|
186 |
+
multiSelelect: function () {
|
187 |
+
var O = this;
|
188 |
+
O.optDiv.addClass('multiple');
|
189 |
+
O.okbtn = $('<p tabindex="0" class="btnOk">'+settings.locale[0]+'</p>').click(function () {
|
190 |
+
/* if combined change event is set.*/
|
191 |
+
O._okbtn();
|
192 |
+
O.hideOpts();
|
193 |
+
});
|
194 |
+
O.cancelBtn = $('<p tabindex="0" class="btnCancel">'+settings.locale[1]+'</p>').click(function () {
|
195 |
+
O._cnbtn();
|
196 |
+
O.hideOpts();
|
197 |
+
});
|
198 |
+
var btns = O.okbtn.add(O.cancelBtn);
|
199 |
+
O.optDiv.append($('<div class="MultiControls">').append(btns));
|
200 |
+
|
201 |
+
/* handling keyboard navigation on ok cancel buttons. */
|
202 |
+
btns.on('keydown.sumo', function (e) {
|
203 |
+
var el = $(this);
|
204 |
+
switch (e.which) {
|
205 |
+
case 32: /* space */
|
206 |
+
case 13: /* enter */
|
207 |
+
el.trigger('click');
|
208 |
+
break;
|
209 |
+
|
210 |
+
case 9: /* tab */
|
211 |
+
if(el.hasClass('btnOk'))return;
|
212 |
+
case 27: /* esc */
|
213 |
+
O._cnbtn();
|
214 |
+
O.hideOpts();
|
215 |
+
return;
|
216 |
+
}
|
217 |
+
e.stopPropagation();
|
218 |
+
e.preventDefault();
|
219 |
+
});
|
220 |
+
},
|
221 |
+
|
222 |
+
_okbtn:function(){
|
223 |
+
var O = this, cg = 0;
|
224 |
+
/* if combined change event is set. */
|
225 |
+
if (settings.triggerChangeCombined) {
|
226 |
+
/* check for a change in the selection. */
|
227 |
+
if (O.E.find('option:selected').length != O.Pstate.length) {
|
228 |
+
cg = 1;
|
229 |
+
}
|
230 |
+
else {
|
231 |
+
O.E.find('option').each(function (i,e) {
|
232 |
+
if(e.selected && O.Pstate.indexOf(i) < 0) cg = 1;
|
233 |
+
});
|
234 |
+
}
|
235 |
+
|
236 |
+
if (cg) {
|
237 |
+
O.callChange();
|
238 |
+
O.setText();
|
239 |
+
}
|
240 |
+
}
|
241 |
+
},
|
242 |
+
_cnbtn:function(){
|
243 |
+
var O = this;
|
244 |
+
/* remove all selections */
|
245 |
+
O.E.find('option:selected').each(function () { this.selected = false; });
|
246 |
+
O.optDiv.find('li.selected').removeClass('selected')
|
247 |
+
|
248 |
+
/* restore selections from saved state. */
|
249 |
+
for(var i = 0; i < O.Pstate.length; i++) {
|
250 |
+
O.E.find('option')[O.Pstate[i]].selected = true;
|
251 |
+
O.ul.find('li.opt').eq(O.Pstate[i]).addClass('selected');
|
252 |
+
}
|
253 |
+
O.selAllState();
|
254 |
+
},
|
255 |
+
|
256 |
+
SelAll:function(){
|
257 |
+
var O = this;
|
258 |
+
if(!O.is_multi)return;
|
259 |
+
O.selAll = $('<p class="select-all"><span><i></i></span><label>' + settings.locale[2] + '</label></p>');
|
260 |
+
O.optDiv.addClass('selall');
|
261 |
+
O.selAll.on('click',function(){
|
262 |
+
O.selAll.toggleClass('selected');
|
263 |
+
O.toggSelAll(O.selAll.hasClass('selected'), 1);
|
264 |
+
//O.selAllState();
|
265 |
+
});
|
266 |
+
|
267 |
+
O.optDiv.prepend(O.selAll);
|
268 |
+
},
|
269 |
+
|
270 |
+
/* search module (can be removed if not required.) */
|
271 |
+
Search: function(){
|
272 |
+
var O = this,
|
273 |
+
cc = O.CaptionCont.addClass('search'),
|
274 |
+
P = $('<p class="no-match">');
|
275 |
+
|
276 |
+
O.ftxt = $('<input type="text" class="search-txt" value="" placeholder="' + settings.searchText + '">')
|
277 |
+
.on('click', function(e){
|
278 |
+
e.stopPropagation();
|
279 |
+
});
|
280 |
+
cc.append(O.ftxt);
|
281 |
+
O.optDiv.children('ul').after(P);
|
282 |
+
|
283 |
+
O.ftxt.on('keyup.sumo',function(){
|
284 |
+
var hid = O.optDiv.find('ul.options li.opt').each(function(ix,e){
|
285 |
+
var e = $(e),
|
286 |
+
opt = e.data('opt')[0];
|
287 |
+
opt.hidden = e.text().toLowerCase().indexOf(O.ftxt.val().toLowerCase()) < 0;
|
288 |
+
e.toggleClass('hidden', opt.hidden);
|
289 |
+
}).not('.hidden');
|
290 |
+
|
291 |
+
P.html(settings.noMatch.replace(/\{0\}/g, '<em></em>')).toggle(!hid.length);
|
292 |
+
P.find('em').text(O.ftxt.val());
|
293 |
+
O.selAllState();
|
294 |
+
});
|
295 |
+
},
|
296 |
+
|
297 |
+
selAllState: function () {
|
298 |
+
var O = this;
|
299 |
+
if (settings.selectAll && O.is_multi) {
|
300 |
+
var sc = 0, vc = 0;
|
301 |
+
O.optDiv.find('li.opt').not('.hidden').each(function (ix, e) {
|
302 |
+
if ($(e).hasClass('selected')) sc++;
|
303 |
+
if (!$(e).hasClass('disabled')) vc++;
|
304 |
+
});
|
305 |
+
/* select all checkbox state change. */
|
306 |
+
if (sc == vc) O.selAll.removeClass('partial').addClass('selected');
|
307 |
+
else if (sc == 0) O.selAll.removeClass('selected partial');
|
308 |
+
else O.selAll.addClass('partial') /* .removeClass('selected'); */
|
309 |
+
}
|
310 |
+
},
|
311 |
+
|
312 |
+
showOpts: function () {
|
313 |
+
var O = this;
|
314 |
+
if (O.E.attr('disabled')) return; /* if select is disabled then retrun */
|
315 |
+
O.E.trigger('sumo:opening', O);
|
316 |
+
O.is_opened = true;
|
317 |
+
O.select.addClass('open').attr('aria-expanded', 'true');
|
318 |
+
O.E.trigger('sumo:opened', O);
|
319 |
+
|
320 |
+
if(O.ftxt)O.ftxt.focus();
|
321 |
+
else O.select.focus();
|
322 |
+
|
323 |
+
/* hide options on click outside.*/
|
324 |
+
$(document).on('click.sumo', function (e) {
|
325 |
+
if (!O.select.is(e.target) /* if the target of the click isn't the container... */
|
326 |
+
&& O.select.has(e.target).length === 0){ /* ... nor a descendant of the container */
|
327 |
+
if(!O.is_opened)return;
|
328 |
+
O.hideOpts();
|
329 |
+
if (settings.okCancelInMulti){
|
330 |
+
if(settings.isClickAwayOk)
|
331 |
+
O._okbtn();
|
332 |
+
else
|
333 |
+
O._cnbtn();
|
334 |
+
}
|
335 |
+
}
|
336 |
+
});
|
337 |
+
|
338 |
+
if (O.is_floating) {
|
339 |
+
H = O.optDiv.children('ul').outerHeight() + 2; /* +2 is clear fix*/
|
340 |
+
if (O.is_multi) H = H + parseInt(O.optDiv.css('padding-bottom'));
|
341 |
+
O.optDiv.css('height', H);
|
342 |
+
$('body').addClass('sumoStopScroll');
|
343 |
+
}
|
344 |
+
|
345 |
+
O.setPstate();
|
346 |
+
},
|
347 |
+
|
348 |
+
/* maintain state when ok/cancel buttons are available storing the indexes. */
|
349 |
+
setPstate: function(){
|
350 |
+
var O = this;
|
351 |
+
if (O.is_multi && (O.is_floating || settings.okCancelInMulti)){
|
352 |
+
O.Pstate = [];
|
353 |
+
/* assuming that find returns elements in tree order */
|
354 |
+
O.E.find('option').each(function (i, e){if(e.selected) O.Pstate.push(i);});
|
355 |
+
}
|
356 |
+
},
|
357 |
+
|
358 |
+
callChange:function(){
|
359 |
+
this.E.trigger('change').trigger('click');
|
360 |
+
},
|
361 |
+
|
362 |
+
hideOpts: function () {
|
363 |
+
var O = this;
|
364 |
+
if(O.is_opened){
|
365 |
+
O.E.trigger('sumo:closing', O);
|
366 |
+
O.is_opened = false;
|
367 |
+
O.select.removeClass('open').attr('aria-expanded', 'true').find('ul li.sel').removeClass('sel');
|
368 |
+
O.E.trigger('sumo:closed', O);
|
369 |
+
$(document).off('click.sumo');
|
370 |
+
O.select.focus();
|
371 |
+
$('body').removeClass('sumoStopScroll');
|
372 |
+
|
373 |
+
/* clear the search */
|
374 |
+
if(settings.search){
|
375 |
+
O.ftxt.val('');
|
376 |
+
O.ftxt.trigger('keyup.sumo');
|
377 |
+
}
|
378 |
+
}
|
379 |
+
},
|
380 |
+
setOnOpen: function () {
|
381 |
+
var O = this,
|
382 |
+
li = O.optDiv.find('li.opt:not(.hidden)').eq(settings.search?0:O.E[0].selectedIndex);
|
383 |
+
if(li.hasClass('disabled')){
|
384 |
+
li = li.next(':not(disabled)')
|
385 |
+
if(!li.length) return;
|
386 |
+
}
|
387 |
+
O.optDiv.find('li.sel').removeClass('sel');
|
388 |
+
li.addClass('sel');
|
389 |
+
O.showOpts();
|
390 |
+
},
|
391 |
+
nav: function (up) {
|
392 |
+
var O = this, c,
|
393 |
+
s=O.ul.find('li.opt:not(.disabled, .hidden)'),
|
394 |
+
sel = O.ul.find('li.opt.sel:not(.hidden)'),
|
395 |
+
idx = s.index(sel);
|
396 |
+
if (O.is_opened && sel.length) {
|
397 |
+
|
398 |
+
if (up && idx > 0)
|
399 |
+
c = s.eq(idx-1);
|
400 |
+
else if(!up && idx < s.length-1 && idx > -1)
|
401 |
+
c = s.eq(idx+1);
|
402 |
+
else return; /* if no items before or after*/
|
403 |
+
|
404 |
+
sel.removeClass('sel');
|
405 |
+
sel = c.addClass('sel');
|
406 |
+
|
407 |
+
/* setting sel item to visible view. */
|
408 |
+
var ul = O.ul,
|
409 |
+
st = ul.scrollTop(),
|
410 |
+
t = sel.position().top + st;
|
411 |
+
if(t >= st + ul.height()-sel.outerHeight())
|
412 |
+
ul.scrollTop(t - ul.height() + sel.outerHeight());
|
413 |
+
if(t<st)
|
414 |
+
ul.scrollTop(t);
|
415 |
+
|
416 |
+
}
|
417 |
+
else
|
418 |
+
O.setOnOpen();
|
419 |
+
},
|
420 |
+
|
421 |
+
basicEvents: function () {
|
422 |
+
var O = this;
|
423 |
+
O.CaptionCont.click(function (evt) {
|
424 |
+
O.E.trigger('click');
|
425 |
+
if (O.is_opened) O.hideOpts(); else O.showOpts();
|
426 |
+
evt.stopPropagation();
|
427 |
+
});
|
428 |
+
|
429 |
+
O.select.on('keydown.sumo', function (e) {
|
430 |
+
switch (e.which) {
|
431 |
+
case 38: /* up */
|
432 |
+
O.nav(true);
|
433 |
+
break;
|
434 |
+
|
435 |
+
case 40: /* down */
|
436 |
+
O.nav(false);
|
437 |
+
break;
|
438 |
+
|
439 |
+
case 65: /* shortcut ctrl + a to select all and ctrl + shift + a to unselect all.*/
|
440 |
+
if (O.is_multi && e.ctrlKey){
|
441 |
+
O.toggSelAll(!e.shiftKey, 1);
|
442 |
+
break;
|
443 |
+
}
|
444 |
+
else
|
445 |
+
return;
|
446 |
+
|
447 |
+
case 32: /* space*/
|
448 |
+
if(settings.search && O.ftxt.is(e.target))return;
|
449 |
+
case 13: /* enter*/
|
450 |
+
if (O.is_opened)
|
451 |
+
O.optDiv.find('ul li.sel').trigger('click');
|
452 |
+
else
|
453 |
+
O.setOnOpen();
|
454 |
+
break;
|
455 |
+
case 9: /* tab*/
|
456 |
+
if(!settings.okCancelInMulti)
|
457 |
+
O.hideOpts();
|
458 |
+
return;
|
459 |
+
case 27: /* esc*/
|
460 |
+
if(settings.okCancelInMulti)O._cnbtn();
|
461 |
+
O.hideOpts();
|
462 |
+
return;
|
463 |
+
|
464 |
+
default:
|
465 |
+
return; /* exit this handler for other keys */
|
466 |
+
}
|
467 |
+
e.preventDefault(); /* prevent the default action (scroll / move caret) */
|
468 |
+
});
|
469 |
+
|
470 |
+
$(window).on('resize.sumo', function () {
|
471 |
+
O.floatingList();
|
472 |
+
});
|
473 |
+
},
|
474 |
+
|
475 |
+
onOptClick: function (li) {
|
476 |
+
var O = this;
|
477 |
+
li.click(function () {
|
478 |
+
var li = $(this);
|
479 |
+
if(li.hasClass('disabled'))return;
|
480 |
+
var txt = "";
|
481 |
+
if (O.is_multi) {
|
482 |
+
li.toggleClass('selected');
|
483 |
+
li.data('opt')[0].selected = li.hasClass('selected');
|
484 |
+
O.selAllState();
|
485 |
+
}
|
486 |
+
else {
|
487 |
+
li.parent().find('li.selected').removeClass('selected'); //if not multiselect then remove all selections from this list
|
488 |
+
li.toggleClass('selected');
|
489 |
+
li.data('opt')[0].selected = true;
|
490 |
+
}
|
491 |
+
|
492 |
+
//branch for combined change event.
|
493 |
+
if (!(O.is_multi && settings.triggerChangeCombined && (O.is_floating || settings.okCancelInMulti))) {
|
494 |
+
O.setText();
|
495 |
+
O.callChange();
|
496 |
+
}
|
497 |
+
|
498 |
+
if (!O.is_multi) O.hideOpts(); //if its not a multiselect then hide on single select.
|
499 |
+
});
|
500 |
+
},
|
501 |
+
|
502 |
+
setText: function () {
|
503 |
+
var O = this;
|
504 |
+
O.placeholder = "";
|
505 |
+
if (O.is_multi) {
|
506 |
+
sels = O.E.find(':selected').not(':disabled'); //selected options.
|
507 |
+
|
508 |
+
for (i = 0; i < sels.length; i++) {
|
509 |
+
if (i + 1 >= settings.csvDispCount && settings.csvDispCount) {
|
510 |
+
if (sels.length == O.E.find('option').length && settings.captionFormatAllSelected) {
|
511 |
+
O.placeholder = settings.captionFormatAllSelected.replace(/\{0\}/g, sels.length)+',';
|
512 |
+
} else {
|
513 |
+
O.placeholder = settings.captionFormat.replace(/\{0\}/g, sels.length)+',';
|
514 |
+
}
|
515 |
+
|
516 |
+
break;
|
517 |
+
}
|
518 |
+
else O.placeholder += $(sels[i]).text() + ", ";
|
519 |
+
}
|
520 |
+
O.placeholder = O.placeholder.replace(/,([^,]*)$/, '$1'); //remove unexpected "," from last.
|
521 |
+
}
|
522 |
+
else {
|
523 |
+
O.placeholder = O.E.find(':selected').not(':disabled').text();
|
524 |
+
}
|
525 |
+
|
526 |
+
var is_placeholder = false;
|
527 |
+
|
528 |
+
if (!O.placeholder) {
|
529 |
+
|
530 |
+
is_placeholder = true;
|
531 |
+
|
532 |
+
O.placeholder = O.E.attr('placeholder');
|
533 |
+
if (!O.placeholder) //if placeholder is there then set it
|
534 |
+
O.placeholder = O.E.find('option:disabled:selected').text();
|
535 |
+
}
|
536 |
+
|
537 |
+
O.placeholder = O.placeholder ? (settings.prefix + ' ' + O.placeholder) : settings.placeholder
|
538 |
+
|
539 |
+
//set display text
|
540 |
+
O.caption.html(O.placeholder);
|
541 |
+
if (settings.showTitle) O.CaptionCont.attr('title', O.placeholder);
|
542 |
+
|
543 |
+
//set the hidden field if post as csv is true.
|
544 |
+
var csvField = O.select.find('input.HEMANT123');
|
545 |
+
if (csvField.length) csvField.val(O.getSelStr());
|
546 |
+
|
547 |
+
//add class placeholder if its a placeholder text.
|
548 |
+
if (is_placeholder) O.caption.addClass('placeholder'); else O.caption.removeClass('placeholder');
|
549 |
+
return O.placeholder;
|
550 |
+
},
|
551 |
+
|
552 |
+
isMobile: function () {
|
553 |
+
|
554 |
+
/* Adapted from http://www.detectmobilebrowsers.com */
|
555 |
+
var ua = navigator.userAgent || navigator.vendor || window.opera;
|
556 |
+
|
557 |
+
/* Checks for iOs, Android, Blackberry, Opera Mini, and Windows mobile devices */
|
558 |
+
for (var i = 0; i < settings.nativeOnDevice.length; i++) if (ua.toString().toLowerCase().indexOf(settings.nativeOnDevice[i].toLowerCase()) > 0) return settings.nativeOnDevice[i];
|
559 |
+
return false;
|
560 |
+
},
|
561 |
+
|
562 |
+
setNativeMobile: function () {
|
563 |
+
var O = this;
|
564 |
+
O.E.addClass('SelectClass'); /* .css('height', O.select.outerHeight()); */
|
565 |
+
O.mob = true;
|
566 |
+
O.E.change(function () {
|
567 |
+
O.setText();
|
568 |
+
});
|
569 |
+
},
|
570 |
+
|
571 |
+
floatingList: function () {
|
572 |
+
var O = this;
|
573 |
+
/*called on init and also on resize.*/
|
574 |
+
/*O.is_floating = true if window width is < specified float width*/
|
575 |
+
O.is_floating = $(window).width() <= settings.floatWidth;
|
576 |
+
|
577 |
+
/*set class isFloating*/
|
578 |
+
O.optDiv.toggleClass('isFloating', O.is_floating);
|
579 |
+
|
580 |
+
/*remove height if not floating*/
|
581 |
+
if (!O.is_floating) O.optDiv.css('height', '');
|
582 |
+
|
583 |
+
/*toggle class according to okCancelInMulti flag only when it is not floating*/
|
584 |
+
O.optDiv.toggleClass('okCancelInMulti', settings.okCancelInMulti && !O.is_floating);
|
585 |
+
},
|
586 |
+
|
587 |
+
/* HELPERS FOR OUTSIDERS*/
|
588 |
+
/* validates range of given item operations*/
|
589 |
+
vRange: function (i) {
|
590 |
+
var O = this;
|
591 |
+
var opts = O.E.find('option');
|
592 |
+
if (opts.length <= i || i < 0) throw "index out of bounds"
|
593 |
+
return O;
|
594 |
+
},
|
595 |
+
|
596 |
+
/*toggles selection on c as boolean.*/
|
597 |
+
toggSel: function (c, i) {
|
598 |
+
var O = this;
|
599 |
+
var opt;
|
600 |
+
if (typeof(i) === "number"){
|
601 |
+
O.vRange(i);
|
602 |
+
opt = O.E.find('option')[i];
|
603 |
+
}
|
604 |
+
else{
|
605 |
+
opt = O.E.find('option[value="'+i+'"]')[0]||0;
|
606 |
+
}
|
607 |
+
if (!opt || opt.disabled)
|
608 |
+
return;
|
609 |
+
|
610 |
+
if(opt.selected != c){
|
611 |
+
opt.selected = c;
|
612 |
+
if(!O.mob) $(opt).data('li').toggleClass('selected',c);
|
613 |
+
|
614 |
+
O.callChange();
|
615 |
+
O.setPstate();
|
616 |
+
O.setText();
|
617 |
+
O.selAllState();
|
618 |
+
}
|
619 |
+
},
|
620 |
+
|
621 |
+
/*toggles disabled on c as boolean.*/
|
622 |
+
toggDis: function (c, i) {
|
623 |
+
var O = this.vRange(i);
|
624 |
+
O.E.find('option')[i].disabled = c;
|
625 |
+
if(c)O.E.find('option')[i].selected = false;
|
626 |
+
if(!O.mob)O.optDiv.find('ul.options li').eq(i).toggleClass('disabled', c).removeClass('selected');
|
627 |
+
O.setText();
|
628 |
+
},
|
629 |
+
|
630 |
+
/* toggle disable/enable on complete select control*/
|
631 |
+
toggSumo: function(val) {
|
632 |
+
var O = this;
|
633 |
+
O.enabled = val;
|
634 |
+
O.select.toggleClass('disabled', val);
|
635 |
+
|
636 |
+
if (val) {
|
637 |
+
O.E.attr('disabled', 'disabled');
|
638 |
+
O.select.removeAttr('tabindex');
|
639 |
+
}
|
640 |
+
else{
|
641 |
+
O.E.removeAttr('disabled');
|
642 |
+
O.select.attr('tabindex','0');
|
643 |
+
}
|
644 |
+
|
645 |
+
return O;
|
646 |
+
},
|
647 |
+
|
648 |
+
/* toggles all option on c as boolean.*/
|
649 |
+
/* set direct=false/0 bypasses okCancelInMulti behaviour.*/
|
650 |
+
toggSelAll: function (c, direct) {
|
651 |
+
var O = this;
|
652 |
+
O.E.find('option:not(:disabled,:hidden)')
|
653 |
+
.each(function(ix,e){
|
654 |
+
var is_selected=e.selected,
|
655 |
+
e = $(e).data('li');
|
656 |
+
if(e.hasClass('hidden'))return;
|
657 |
+
if(!!c){
|
658 |
+
if(!is_selected)e.trigger('click');
|
659 |
+
}
|
660 |
+
else{
|
661 |
+
if(is_selected)e.trigger('click');
|
662 |
+
}
|
663 |
+
});
|
664 |
+
|
665 |
+
if(!direct){
|
666 |
+
if(!O.mob && O.selAll)O.selAll.removeClass('partial').toggleClass('selected',!!c);
|
667 |
+
O.callChange();
|
668 |
+
O.setText();
|
669 |
+
O.setPstate();
|
670 |
+
}
|
671 |
+
},
|
672 |
+
|
673 |
+
/* outside accessibility options
|
674 |
+
which can be accessed from the element instance.
|
675 |
+
*/
|
676 |
+
reload:function(){
|
677 |
+
var elm = this.unload();
|
678 |
+
return $(elm).SumoSelect(settings);
|
679 |
+
},
|
680 |
+
|
681 |
+
unload: function () {
|
682 |
+
var O = this;
|
683 |
+
O.select.before(O.E);
|
684 |
+
O.E.show();
|
685 |
+
|
686 |
+
if (settings.outputAsCSV && O.is_multi && O.select.find('input.HEMANT123').length) {
|
687 |
+
O.E.attr('name', O.select.find('input.HEMANT123').attr('name')); /* restore the name; */
|
688 |
+
}
|
689 |
+
O.select.remove();
|
690 |
+
delete selObj.sumo;
|
691 |
+
return selObj;
|
692 |
+
},
|
693 |
+
|
694 |
+
/* add a new option to select at a given index.*/
|
695 |
+
add: function (val, txt, i) {
|
696 |
+
if (typeof val == "undefined") throw "No value to add"
|
697 |
+
|
698 |
+
var O = this;
|
699 |
+
opts=O.E.find('option')
|
700 |
+
if (typeof txt == "number") { i = txt; txt = val; }
|
701 |
+
if (typeof txt == "undefined") { txt = val; }
|
702 |
+
|
703 |
+
opt = $("<option></option>").val(val).html(txt);
|
704 |
+
|
705 |
+
if (opts.length < i) throw "index out of bounds"
|
706 |
+
|
707 |
+
if (typeof i == "undefined" || opts.length == i) { /* add it to the last if given index is last no or no index provides.*/
|
708 |
+
O.E.append(opt);
|
709 |
+
if(!O.mob)O.ul.append(O.createLi(opt));
|
710 |
+
}
|
711 |
+
else {
|
712 |
+
opts.eq(i).before(opt);
|
713 |
+
if(!O.mob)O.ul.find('li.opt').eq(i).before(O.createLi(opt));
|
714 |
+
}
|
715 |
+
|
716 |
+
return selObj;
|
717 |
+
},
|
718 |
+
|
719 |
+
/* removes an item at a given index. */
|
720 |
+
remove: function (i) {
|
721 |
+
var O = this.vRange(i);
|
722 |
+
O.E.find('option').eq(i).remove();
|
723 |
+
if(!O.mob)O.optDiv.find('ul.options li').eq(i).remove();
|
724 |
+
O.setText();
|
725 |
+
},
|
726 |
+
|
727 |
+
/* Select an item at a given index.*/
|
728 |
+
selectItem: function (i) { this.toggSel(true, i); },
|
729 |
+
|
730 |
+
/* UnSelect an iten at a given index.*/
|
731 |
+
unSelectItem: function (i) { this.toggSel(false, i); },
|
732 |
+
|
733 |
+
/* Select all items of the select.*/
|
734 |
+
selectAll: function () { this.toggSelAll(true); },
|
735 |
+
|
736 |
+
/* UnSelect all items of the select.*/
|
737 |
+
unSelectAll: function () { this.toggSelAll(false); },
|
738 |
+
|
739 |
+
/* Disable an iten at a given index.*/
|
740 |
+
disableItem: function (i) { this.toggDis(true, i) },
|
741 |
+
|
742 |
+
/* Removes disabled an iten at a given index.*/
|
743 |
+
enableItem: function (i) { this.toggDis(false, i) },
|
744 |
+
|
745 |
+
/* New simple methods as getter and setter are not working fine in ie8-*/
|
746 |
+
/* variable to check state of control if enabled or disabled.*/
|
747 |
+
enabled : true,
|
748 |
+
/* Enables the control*/
|
749 |
+
enable: function(){return this.toggSumo(false)},
|
750 |
+
|
751 |
+
/* Disables the control*/
|
752 |
+
disable: function(){return this.toggSumo(true)},
|
753 |
+
init: function () {
|
754 |
+
var O = this;
|
755 |
+
O.createElems();
|
756 |
+
O.setText();
|
757 |
+
return O
|
758 |
+
}
|
759 |
+
};
|
760 |
+
selObj.sumo.init();
|
761 |
+
});
|
762 |
+
|
763 |
+
return ret.length == 1 ? ret[0] : ret;
|
764 |
+
};
|
765 |
+
});
|
js/jscolor/jscolor.js
CHANGED
@@ -9,13 +9,13 @@
|
|
9 |
* @link http://jscolor.com
|
10 |
*/
|
11 |
var jscolor = {
|
12 |
-
|
13 |
dir : '',
|
14 |
-
|
15 |
bindClass : 'color',
|
16 |
-
|
17 |
binding : true,
|
18 |
-
|
19 |
preloading : true,
|
20 |
|
21 |
install : function() {
|
@@ -136,7 +136,7 @@ var jscolor = {
|
|
136 |
var ev = document.createEventObject();
|
137 |
el.fireEvent('on' + evnt, ev);
|
138 |
} else if (el['on' + evnt]) {
|
139 |
-
|
140 |
el['on' + evnt]();
|
141 |
}
|
142 |
},
|
@@ -285,7 +285,6 @@ var jscolor = {
|
|
285 |
t.path = removeDotSegments(r.path);
|
286 |
} else {
|
287 |
if (base.authority !== null && base.path === '') {
|
288 |
-
// === ?
|
289 |
t.path = '/' + r.path;
|
290 |
} else {
|
291 |
t.path = base.path.replace(/[^\/]+$/, '') + r.path;
|
@@ -357,10 +356,10 @@ var jscolor = {
|
|
357 |
this.pickerFaceColor = 'ThreeDFace';
|
358 |
this.pickerBorder = 1;
|
359 |
this.pickerBorderColor = 'ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight';
|
360 |
-
|
361 |
this.pickerInset = 1;
|
362 |
this.pickerInsetColor = 'ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow';
|
363 |
-
|
364 |
this.pickerZIndex = 10000;
|
365 |
|
366 |
for (var p in prop) {
|
@@ -440,7 +439,7 @@ var jscolor = {
|
|
440 |
this.exportColor(leaveValue | leaveStyle);
|
441 |
|
442 |
} else if (this.fromString(valueElement.value)) {
|
443 |
-
|
444 |
} else {
|
445 |
this.exportColor();
|
446 |
}
|
@@ -597,10 +596,9 @@ var jscolor = {
|
|
597 |
jscolor.picker.box.appendChild(jscolor.picker.btn);
|
598 |
jscolor.picker.boxB.appendChild(jscolor.picker.box);
|
599 |
}
|
600 |
-
|
601 |
var p = jscolor.picker;
|
602 |
|
603 |
-
|
604 |
p.box.onmouseup = p.box.onmouseout = function() {
|
605 |
target.focus();
|
606 |
};
|
@@ -639,12 +637,12 @@ var jscolor = {
|
|
639 |
setSld(e);
|
640 |
};
|
641 |
|
642 |
-
|
643 |
var dims = getPickerDims(THIS);
|
644 |
p.box.style.width = dims[0] + 'px';
|
645 |
p.box.style.height = dims[1] + 'px';
|
646 |
|
647 |
-
|
648 |
p.boxB.style.position = 'absolute';
|
649 |
p.boxB.style.clear = 'both';
|
650 |
p.boxB.style.left = x + 'px';
|
@@ -654,18 +652,18 @@ var jscolor = {
|
|
654 |
p.boxB.style.borderColor = THIS.pickerBorderColor;
|
655 |
p.boxB.style.background = THIS.pickerFaceColor;
|
656 |
|
657 |
-
|
658 |
p.pad.style.width = jscolor.images.pad[0] + 'px';
|
659 |
p.pad.style.height = jscolor.images.pad[1] + 'px';
|
660 |
|
661 |
-
|
662 |
p.padB.style.position = 'absolute';
|
663 |
p.padB.style.left = THIS.pickerFace + 'px';
|
664 |
p.padB.style.top = THIS.pickerFace + 'px';
|
665 |
p.padB.style.border = THIS.pickerInset + 'px solid';
|
666 |
p.padB.style.borderColor = THIS.pickerInsetColor;
|
667 |
|
668 |
-
|
669 |
p.padM.style.position = 'absolute';
|
670 |
p.padM.style.left = '0';
|
671 |
p.padM.style.top = '0';
|
@@ -674,12 +672,12 @@ var jscolor = {
|
|
674 |
p.padM.style.height = p.box.style.height;
|
675 |
p.padM.style.cursor = 'crosshair';
|
676 |
|
677 |
-
|
678 |
p.sld.style.overflow = 'hidden';
|
679 |
p.sld.style.width = jscolor.images.sld[0] + 'px';
|
680 |
p.sld.style.height = jscolor.images.sld[1] + 'px';
|
681 |
|
682 |
-
|
683 |
p.sldB.style.display = THIS.slider ? 'block' : 'none';
|
684 |
p.sldB.style.position = 'absolute';
|
685 |
p.sldB.style.right = THIS.pickerFace + 'px';
|
@@ -687,7 +685,7 @@ var jscolor = {
|
|
687 |
p.sldB.style.border = THIS.pickerInset + 'px solid';
|
688 |
p.sldB.style.borderColor = THIS.pickerInsetColor;
|
689 |
|
690 |
-
|
691 |
p.sldM.style.display = THIS.slider ? 'block' : 'none';
|
692 |
p.sldM.style.position = 'absolute';
|
693 |
p.sldM.style.right = '0';
|
@@ -701,7 +699,7 @@ var jscolor = {
|
|
701 |
p.sldM.style.cursor = 'hand';
|
702 |
}
|
703 |
|
704 |
-
|
705 |
function setBtnBorder() {
|
706 |
var insetColors = THIS.pickerInsetColor.split(/\s+/);
|
707 |
var pickerOutsetColor = insetColors.length < 2 ? insetColors[0]
|
@@ -730,7 +728,7 @@ var jscolor = {
|
|
730 |
};
|
731 |
p.btnS.style.lineHeight = p.btn.style.height;
|
732 |
|
733 |
-
|
734 |
switch (modeID) {
|
735 |
case 0:
|
736 |
var padImg = 'hs.png';
|
@@ -748,7 +746,7 @@ var jscolor = {
|
|
748 |
p.pad.style.backgroundRepeat = "no-repeat";
|
749 |
p.pad.style.backgroundPosition = "0 0";
|
750 |
|
751 |
-
|
752 |
redrawPad();
|
753 |
redrawSld();
|
754 |
|
@@ -772,7 +770,7 @@ var jscolor = {
|
|
772 |
}
|
773 |
|
774 |
function redrawPad() {
|
775 |
-
|
776 |
switch (modeID) {
|
777 |
case 0:
|
778 |
var yComponent = 1;
|
@@ -791,7 +789,7 @@ var jscolor = {
|
|
791 |
+ (THIS.pickerFace + THIS.pickerInset + y - Math
|
792 |
.floor(jscolor.images.cross[1] / 2)) + 'px';
|
793 |
|
794 |
-
|
795 |
var seg = jscolor.picker.sld.childNodes;
|
796 |
|
797 |
switch (modeID) {
|
@@ -848,7 +846,7 @@ var jscolor = {
|
|
848 |
}
|
849 |
|
850 |
function redrawSld() {
|
851 |
-
|
852 |
switch (modeID) {
|
853 |
case 0:
|
854 |
var yComponent = 2;
|
@@ -921,10 +919,10 @@ var jscolor = {
|
|
921 |
var valueElement = jscolor.fetchElement(this.valueElement), styleElement = jscolor
|
922 |
.fetchElement(this.styleElement);
|
923 |
var holdPad = false, holdSld = false;
|
924 |
-
|
925 |
var leaveValue = 1, leaveStyle = 2, leavePad = 4, leaveSld = 8;
|
926 |
|
927 |
-
|
928 |
jscolor.addEvent(target, 'focus', function() {
|
929 |
if (THIS.pickerOnfocus) {
|
930 |
THIS.showPicker();
|
@@ -941,7 +939,7 @@ var jscolor = {
|
|
941 |
}
|
942 |
});
|
943 |
|
944 |
-
|
945 |
if (valueElement) {
|
946 |
var updateField = function() {
|
947 |
THIS.fromString(valueElement.value, leaveValue);
|
@@ -952,7 +950,7 @@ var jscolor = {
|
|
952 |
valueElement.setAttribute('autocomplete', 'off');
|
953 |
}
|
954 |
|
955 |
-
|
956 |
if (styleElement) {
|
957 |
styleElement.jscStyle = {
|
958 |
backgroundColor : styleElement.style.backgroundColor,
|
@@ -960,7 +958,7 @@ var jscolor = {
|
|
960 |
};
|
961 |
}
|
962 |
|
963 |
-
|
964 |
switch (modeID) {
|
965 |
case 0:
|
966 |
jscolor.requireImage('hs.png');
|
9 |
* @link http://jscolor.com
|
10 |
*/
|
11 |
var jscolor = {
|
12 |
+
/* location of jscolor directory (leave empty to autodetect). */
|
13 |
dir : '',
|
14 |
+
/* class name. */
|
15 |
bindClass : 'color',
|
16 |
+
/* automatic binding via <input class="...">. */
|
17 |
binding : true,
|
18 |
+
/* use image preloading?. */
|
19 |
preloading : true,
|
20 |
|
21 |
install : function() {
|
136 |
var ev = document.createEventObject();
|
137 |
el.fireEvent('on' + evnt, ev);
|
138 |
} else if (el['on' + evnt]) {
|
139 |
+
/* model (IE5). */
|
140 |
el['on' + evnt]();
|
141 |
}
|
142 |
},
|
285 |
t.path = removeDotSegments(r.path);
|
286 |
} else {
|
287 |
if (base.authority !== null && base.path === '') {
|
|
|
288 |
t.path = '/' + r.path;
|
289 |
} else {
|
290 |
t.path = base.path.replace(/[^\/]+$/, '') + r.path;
|
356 |
this.pickerFaceColor = 'ThreeDFace';
|
357 |
this.pickerBorder = 1;
|
358 |
this.pickerBorderColor = 'ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight';
|
359 |
+
/* color */
|
360 |
this.pickerInset = 1;
|
361 |
this.pickerInsetColor = 'ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow';
|
362 |
+
/* color */
|
363 |
this.pickerZIndex = 10000;
|
364 |
|
365 |
for (var p in prop) {
|
439 |
this.exportColor(leaveValue | leaveStyle);
|
440 |
|
441 |
} else if (this.fromString(valueElement.value)) {
|
442 |
+
/* OK */
|
443 |
} else {
|
444 |
this.exportColor();
|
445 |
}
|
596 |
jscolor.picker.box.appendChild(jscolor.picker.btn);
|
597 |
jscolor.picker.boxB.appendChild(jscolor.picker.box);
|
598 |
}
|
|
|
599 |
var p = jscolor.picker;
|
600 |
|
601 |
+
/* controls interaction */
|
602 |
p.box.onmouseup = p.box.onmouseout = function() {
|
603 |
target.focus();
|
604 |
};
|
637 |
setSld(e);
|
638 |
};
|
639 |
|
640 |
+
/* picker */
|
641 |
var dims = getPickerDims(THIS);
|
642 |
p.box.style.width = dims[0] + 'px';
|
643 |
p.box.style.height = dims[1] + 'px';
|
644 |
|
645 |
+
/* picker border */
|
646 |
p.boxB.style.position = 'absolute';
|
647 |
p.boxB.style.clear = 'both';
|
648 |
p.boxB.style.left = x + 'px';
|
652 |
p.boxB.style.borderColor = THIS.pickerBorderColor;
|
653 |
p.boxB.style.background = THIS.pickerFaceColor;
|
654 |
|
655 |
+
/* pad image */
|
656 |
p.pad.style.width = jscolor.images.pad[0] + 'px';
|
657 |
p.pad.style.height = jscolor.images.pad[1] + 'px';
|
658 |
|
659 |
+
/* pad border */
|
660 |
p.padB.style.position = 'absolute';
|
661 |
p.padB.style.left = THIS.pickerFace + 'px';
|
662 |
p.padB.style.top = THIS.pickerFace + 'px';
|
663 |
p.padB.style.border = THIS.pickerInset + 'px solid';
|
664 |
p.padB.style.borderColor = THIS.pickerInsetColor;
|
665 |
|
666 |
+
/* pad mouse area */
|
667 |
p.padM.style.position = 'absolute';
|
668 |
p.padM.style.left = '0';
|
669 |
p.padM.style.top = '0';
|
672 |
p.padM.style.height = p.box.style.height;
|
673 |
p.padM.style.cursor = 'crosshair';
|
674 |
|
675 |
+
/* slider image */
|
676 |
p.sld.style.overflow = 'hidden';
|
677 |
p.sld.style.width = jscolor.images.sld[0] + 'px';
|
678 |
p.sld.style.height = jscolor.images.sld[1] + 'px';
|
679 |
|
680 |
+
/* slider border */
|
681 |
p.sldB.style.display = THIS.slider ? 'block' : 'none';
|
682 |
p.sldB.style.position = 'absolute';
|
683 |
p.sldB.style.right = THIS.pickerFace + 'px';
|
685 |
p.sldB.style.border = THIS.pickerInset + 'px solid';
|
686 |
p.sldB.style.borderColor = THIS.pickerInsetColor;
|
687 |
|
688 |
+
/* slider mouse area */
|
689 |
p.sldM.style.display = THIS.slider ? 'block' : 'none';
|
690 |
p.sldM.style.position = 'absolute';
|
691 |
p.sldM.style.right = '0';
|
699 |
p.sldM.style.cursor = 'hand';
|
700 |
}
|
701 |
|
702 |
+
/* "close" button */
|
703 |
function setBtnBorder() {
|
704 |
var insetColors = THIS.pickerInsetColor.split(/\s+/);
|
705 |
var pickerOutsetColor = insetColors.length < 2 ? insetColors[0]
|
728 |
};
|
729 |
p.btnS.style.lineHeight = p.btn.style.height;
|
730 |
|
731 |
+
/* load images in optimal order */
|
732 |
switch (modeID) {
|
733 |
case 0:
|
734 |
var padImg = 'hs.png';
|
746 |
p.pad.style.backgroundRepeat = "no-repeat";
|
747 |
p.pad.style.backgroundPosition = "0 0";
|
748 |
|
749 |
+
/* place pointers */
|
750 |
redrawPad();
|
751 |
redrawSld();
|
752 |
|
770 |
}
|
771 |
|
772 |
function redrawPad() {
|
773 |
+
/* redraw the pad pointer */
|
774 |
switch (modeID) {
|
775 |
case 0:
|
776 |
var yComponent = 1;
|
789 |
+ (THIS.pickerFace + THIS.pickerInset + y - Math
|
790 |
.floor(jscolor.images.cross[1] / 2)) + 'px';
|
791 |
|
792 |
+
/* redraw the slider image */
|
793 |
var seg = jscolor.picker.sld.childNodes;
|
794 |
|
795 |
switch (modeID) {
|
846 |
}
|
847 |
|
848 |
function redrawSld() {
|
849 |
+
/* redraw the slider pointer */
|
850 |
switch (modeID) {
|
851 |
case 0:
|
852 |
var yComponent = 2;
|
919 |
var valueElement = jscolor.fetchElement(this.valueElement), styleElement = jscolor
|
920 |
.fetchElement(this.styleElement);
|
921 |
var holdPad = false, holdSld = false;
|
922 |
+
/* var leaveValue = 1 << 0, leaveStyle = 1 << 1, leavePad = 1 << 2, leaveSld = 1 << 3; */
|
923 |
var leaveValue = 1, leaveStyle = 2, leavePad = 4, leaveSld = 8;
|
924 |
|
925 |
+
/* target */
|
926 |
jscolor.addEvent(target, 'focus', function() {
|
927 |
if (THIS.pickerOnfocus) {
|
928 |
THIS.showPicker();
|
939 |
}
|
940 |
});
|
941 |
|
942 |
+
/* valueElement */
|
943 |
if (valueElement) {
|
944 |
var updateField = function() {
|
945 |
THIS.fromString(valueElement.value, leaveValue);
|
950 |
valueElement.setAttribute('autocomplete', 'off');
|
951 |
}
|
952 |
|
953 |
+
/* styleElement */
|
954 |
if (styleElement) {
|
955 |
styleElement.jscStyle = {
|
956 |
backgroundColor : styleElement.style.backgroundColor,
|
958 |
};
|
959 |
}
|
960 |
|
961 |
+
/* require images */
|
962 |
switch (modeID) {
|
963 |
case 0:
|
964 |
jscolor.requireImage('hs.png');
|
js/tw-gb/block.js
CHANGED
@@ -82,7 +82,7 @@
|
|
82 |
|
83 |
function showPopup( shortcode, shortcode_id ) {
|
84 |
var shortcodeCbName = generateUniqueCbName( pluginId );
|
85 |
-
|
86 |
window[shortcodeCbName + '_shortcode'] = shortcode ? shortcode : '';
|
87 |
window[shortcodeCbName] = function ( shortcode, shortcode_id ) {
|
88 |
delete window[shortcodeCbName];
|
@@ -182,4 +182,4 @@
|
|
182 |
} )(
|
183 |
window.wp.blocks,
|
184 |
window.wp.element
|
185 |
-
);
|
82 |
|
83 |
function showPopup( shortcode, shortcode_id ) {
|
84 |
var shortcodeCbName = generateUniqueCbName( pluginId );
|
85 |
+
/* Store shortcode attribute into a global variable to get it from an iframe. */
|
86 |
window[shortcodeCbName + '_shortcode'] = shortcode ? shortcode : '';
|
87 |
window[shortcodeCbName] = function ( shortcode, shortcode_id ) {
|
88 |
delete window[shortcodeCbName];
|
182 |
} )(
|
183 |
window.wp.blocks,
|
184 |
window.wp.element
|
185 |
+
);
|
photo-gallery.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Photo Gallery
|
4 |
* Plugin URI: https://10web.io/plugins/wordpress-photo-gallery/
|
5 |
* Description: This plugin is a fully responsive gallery plugin with advanced functionality. It allows having different image galleries for your posts and pages. You can create unlimited number of galleries, combine them into albums, and provide descriptions and tags.
|
6 |
-
* Version: 1.4.
|
7 |
* Author: Photo Gallery Team
|
8 |
* Author URI: https://10web.io/pricing/
|
9 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
@@ -47,6 +47,7 @@ final class BWG {
|
|
47 |
public $is_demo = FALSE;
|
48 |
public $options = array();
|
49 |
public $upload_dir = '';
|
|
|
50 |
public $free_msg = '';
|
51 |
|
52 |
/**
|
@@ -80,8 +81,8 @@ final class BWG {
|
|
80 |
$this->plugin_dir = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
|
81 |
$this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
|
82 |
$this->main_file = plugin_basename(__FILE__);
|
83 |
-
$this->plugin_version = '1.4.
|
84 |
-
$this->db_version = '1.4.
|
85 |
$this->prefix = 'bwg';
|
86 |
$this->nicename = __('Photo Gallery', $this->prefix);
|
87 |
|
@@ -90,7 +91,8 @@ final class BWG {
|
|
90 |
require_once($this->plugin_dir . '/framework/BWGOptions.php');
|
91 |
$this->options = new WD_BWG_Options();
|
92 |
|
93 |
-
$this->upload_dir = $this->options->
|
|
|
94 |
|
95 |
$this->free_msg = __('This option is disabled in free version.', $this->prefix);
|
96 |
$this->is_demo = get_site_option('tenweb_admin_demo');
|
@@ -125,6 +127,7 @@ final class BWG {
|
|
125 |
add_action('wp_ajax_addEmbed', array($this, 'bwg_add_embed_ajax'));
|
126 |
add_action('wp_ajax_editimage_' . $this->prefix, array($this, 'admin_ajax'));
|
127 |
add_action('wp_ajax_addTags_' . $this->prefix, array($this, 'admin_ajax'));
|
|
|
128 |
if( $this->is_pro ) {
|
129 |
add_action('wp_ajax_addInstagramGallery', array( $this, 'bwg_add_embed_ajax' ));
|
130 |
add_action('wp_ajax_addFacebookGallery', array( $this, 'bwg_add_embed_ajax' ));
|
@@ -133,6 +136,9 @@ final class BWG {
|
|
133 |
if ( !is_admin() ) {
|
134 |
add_shortcode('Best_Wordpress_Gallery', array($this, 'shortcode'));
|
135 |
}
|
|
|
|
|
|
|
136 |
|
137 |
// Add media button to WP editor.
|
138 |
add_action('wp_ajax_shortcode_' . $this->prefix, array($this, 'admin_ajax'));
|
@@ -193,7 +199,12 @@ final class BWG {
|
|
193 |
|
194 |
// Enqueue block editor assets for Gutenberg.
|
195 |
add_filter('tw_get_block_editor_assets', array($this, 'register_block_editor_assets'));
|
196 |
-
add_action(
|
|
|
|
|
|
|
|
|
|
|
197 |
|
198 |
// Privacy policy.
|
199 |
add_action( 'admin_init', array($this, 'add_privacy_policy_content') );
|
@@ -282,6 +293,67 @@ final class BWG {
|
|
282 |
add_action('init', array($this, 'create_post_types'));
|
283 |
}
|
284 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
285 |
private function use_home_url() {
|
286 |
$home_url = str_replace(array("http://", "https://"), "", home_url());
|
287 |
$pos = strpos($home_url, "/");
|
@@ -461,8 +533,8 @@ final class BWG {
|
|
461 |
'bwg_error' => __('Error', $this->prefix),
|
462 |
'bwg_show_order' => __('Show order column', $this->prefix),
|
463 |
'bwg_hide_order' => __('Hide order column', $this->prefix),
|
464 |
-
'
|
465 |
-
'
|
466 |
'saved' => __('Items Succesfully Saved.', $this->prefix),
|
467 |
'recovered' => __('Item Succesfully Recovered.', $this->prefix),
|
468 |
'published' => __('Item Succesfully Published.', $this->prefix),
|
@@ -479,9 +551,12 @@ final class BWG {
|
|
479 |
'other_warning' => __('This action will reset gallery type to mixed and will save that choice. You cannot undo it.', $this->prefix),
|
480 |
'insert' => __('Insert', $this->prefix),
|
481 |
'import_failed' => __('Failed to import images from media library', $this->prefix),
|
|
|
482 |
'wp_upload_dir' => wp_upload_dir(),
|
483 |
'ajax_url' => wp_nonce_url( admin_url('admin-ajax.php'), 'bwg_UploadHandler', 'bwg_nonce' ),
|
484 |
-
'uploads_url' =>
|
|
|
|
|
485 |
));
|
486 |
wp_localize_script($this->prefix . '_admin', 'bwg_objectGGF', WDWLibrary::get_google_fonts());
|
487 |
wp_enqueue_script('jquery-ui-sortable');
|
@@ -533,11 +608,11 @@ final class BWG {
|
|
533 |
}
|
534 |
}
|
535 |
|
536 |
-
public function shortcode($params) {
|
537 |
if ( is_admin() && defined('DOING_AJAX') && !DOING_AJAX) {
|
538 |
return;
|
539 |
}
|
540 |
-
if (isset($params['id'])) {
|
541 |
global $wpdb;
|
542 |
$shortcode = $wpdb->get_var($wpdb->prepare("SELECT tagtext FROM " . $wpdb->prefix . "bwg_shortcode WHERE id='%d'", $params['id']));
|
543 |
if ($shortcode) {
|
@@ -554,7 +629,7 @@ final class BWG {
|
|
554 |
}
|
555 |
// 'gallery_type' is the only parameter not being checked.
|
556 |
// Checking for incomplete shortcodes.
|
557 |
-
if (isset($params['gallery_type'])) {
|
558 |
$pairs = WDWLibrary::get_shortcode_option_params( $params );
|
559 |
ob_start();
|
560 |
$this->front_end( $pairs );
|
@@ -569,7 +644,7 @@ final class BWG {
|
|
569 |
* @param $params
|
570 |
*/
|
571 |
public function front_end($params) {
|
572 |
-
|
573 |
if ($params['gallery_type'] == 'thumbnails' || $params['gallery_type'] == 'slideshow') {
|
574 |
require_once(BWG()->plugin_dir . '/frontend/controllers/controller.php');
|
575 |
$controller = new BWGControllerSite( ucfirst( $params[ 'gallery_type' ] ) );
|
@@ -618,27 +693,29 @@ final class BWG {
|
|
618 |
$code = code_generic($l, $cap_digital, $cap_latin_char);
|
619 |
WDWLibrary::bwg_session_start();
|
620 |
$_SESSION['bwg_captcha_code'] = $code;
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
$
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
$
|
632 |
-
|
633 |
-
|
634 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
635 |
}
|
636 |
-
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
637 |
-
header('Cache-Control: no-store, no-cache, must-revalidate');
|
638 |
-
header('Cache-Control: post-check=0, pre-check=0', FALSE);
|
639 |
-
header('Pragma: no-cache');
|
640 |
-
header('Content-Type: image/jpeg');
|
641 |
-
imagejpeg($canvas, NULL, BWG()->options->jpeg_quality);
|
642 |
die('');
|
643 |
}
|
644 |
}
|
@@ -715,6 +792,7 @@ final class BWG {
|
|
715 |
'albumsgalleries_' . $this->prefix,
|
716 |
'shortcode_' . $this->prefix,
|
717 |
'editimage_' . $this->prefix,
|
|
|
718 |
);
|
719 |
if ( !empty($page) && in_array($page, $allowed_pages) ) {
|
720 |
$page = WDWLibrary::clean_page_prefix($page);
|
@@ -788,8 +866,11 @@ final class BWG {
|
|
788 |
function media_button($context) {
|
789 |
ob_start();
|
790 |
$url = add_query_arg(array('action' => 'shortcode_bwg', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
|
791 |
-
|
792 |
-
<a onclick="
|
|
|
|
|
|
|
793 |
<span class="wp-media-buttons-icon" style="background: url('<?php echo $this->plugin_url; ?>/images/icons/bwg_edit_but.png') no-repeat scroll left top rgba(0, 0, 0, 0);"></span>
|
794 |
<?php _e('Add Photo Gallery', $this->prefix); ?>
|
795 |
</a>
|
@@ -816,12 +897,21 @@ final class BWG {
|
|
816 |
* Add script to header.
|
817 |
*/
|
818 |
public function global_script() {
|
819 |
-
|
820 |
<script>
|
821 |
var bwg_admin_ajax = '<?php echo add_query_arg(array('action' => 'shortcode_' . $this->prefix), admin_url('admin-ajax.php')); ?>';
|
822 |
var bwg_ajax_url = '<?php echo add_query_arg(array('action' => ''), admin_url('admin-ajax.php')); ?>';
|
823 |
var bwg_plugin_url = '<?php echo BWG()->plugin_url; ?>';
|
824 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
825 |
// Set shortcode popup dimensions.
|
826 |
function bwg_set_shortcode_popup_dimensions() {
|
827 |
var H = jQuery(window).height(), W = jQuery(window).width();
|
@@ -830,7 +920,7 @@ final class BWG {
|
|
830 |
if (tbWindow.size()) {
|
831 |
tbWindow.width(W).height(H);
|
832 |
jQuery('#TB_iframeContent').width(W).height(H);
|
833 |
-
tbWindow.css({'top': 0, 'left': 0, 'margin-left': '0'});
|
834 |
}
|
835 |
// Edit
|
836 |
var tbWindow = jQuery('.mce-window[aria-label="Photo Gallery"]');
|
@@ -845,14 +935,14 @@ final class BWG {
|
|
845 |
}
|
846 |
// Create loading block.
|
847 |
function bwg_create_loading_block() {
|
848 |
-
|
849 |
}
|
850 |
// Remove loading block.
|
851 |
function bwg_remove_loading_block() {
|
852 |
-
|
853 |
-
|
854 |
}
|
855 |
-
|
856 |
<?php
|
857 |
}
|
858 |
|
@@ -1084,24 +1174,27 @@ final class BWG {
|
|
1084 |
*/
|
1085 |
public function register_frontend_scripts() {
|
1086 |
$version = BWG()->plugin_version;
|
1087 |
-
wp_register_script('bwg_frontend', BWG()->front_url . '/js/bwg_frontend.js', array('jquery'), $version);
|
1088 |
wp_register_style('bwg_frontend', BWG()->front_url . '/css/bwg_frontend.css', array(), $version);
|
1089 |
-
|
1090 |
-
|
|
|
|
|
1091 |
// Styles/Scripts for popup.
|
1092 |
wp_register_style('bwg_font-awesome', BWG()->front_url . '/css/font-awesome/font-awesome.css', array(), '4.6.3');
|
1093 |
-
wp_register_script('bwg_jquery_mobile', BWG()->front_url . '/js/jquery.mobile.js', array('jquery'), $version);
|
1094 |
-
wp_register_script('bwg_mCustomScrollbar', BWG()->front_url . '/js/jquery.mCustomScrollbar.concat.min.js', array('jquery'), $version);
|
1095 |
wp_register_style('bwg_mCustomScrollbar', BWG()->front_url . '/css/jquery.mCustomScrollbar.css', array(), $version);
|
1096 |
-
|
1097 |
-
wp_register_script('
|
1098 |
-
wp_register_script('
|
|
|
1099 |
if ( $this->is_pro ) {
|
1100 |
-
wp_register_script('bwg_raty', BWG()->front_url . '/js/jquery.raty.js', array( 'jquery' ), '2.5.2');
|
1101 |
-
wp_register_script('bwg_featureCarousel', BWG()->plugin_url . '/js/jquery.featureCarousel.js', array( 'jquery' ), $version);
|
1102 |
// 3D Tag Cloud.
|
1103 |
-
wp_register_script('bwg_3DEngine', BWG()->front_url . '/js/3DEngine/3DEngine.js', array('jquery'), '1.0.0');
|
1104 |
-
wp_register_script('bwg_Sphere', BWG()->front_url . '/js/3DEngine/Sphere.js', array('jquery'), '1.0.0');
|
1105 |
}
|
1106 |
wp_localize_script('bwg_gallery_box', 'bwg_objectL10n', array(
|
1107 |
'bwg_field_required' => __('field is required.', $this->prefix),
|
@@ -1110,6 +1203,7 @@ final class BWG {
|
|
1110 |
));
|
1111 |
wp_localize_script('bwg_frontend', 'bwg_objectsL10n', array(
|
1112 |
'bwg_select_tag' => __('Select Tag', $this->prefix),
|
|
|
1113 |
'bwg_search' => __('Search', $this->prefix),
|
1114 |
'bwg_show_ecommerce' => __('Show Ecommerce', $this->prefix),
|
1115 |
'bwg_hide_ecommerce' => __('Hide Ecommerce', $this->prefix),
|
@@ -1119,12 +1213,16 @@ final class BWG {
|
|
1119 |
'bwg_restore' => __('Restore', $this->prefix),
|
1120 |
'bwg_maximize' => __('Maximize', $this->prefix),
|
1121 |
'bwg_fullscreen' => __('Fullscreen', $this->prefix),
|
|
|
|
|
|
|
|
|
1122 |
));
|
1123 |
|
1124 |
// Google fonts.
|
1125 |
require_once(BWG()->plugin_dir . '/framework/WDWLibrary.php');
|
1126 |
$google_fonts = WDWLibrary::get_used_google_fonts();
|
1127 |
-
if (!empty($google_fonts)) {
|
1128 |
$query = implode("|", str_replace(' ', '+', $google_fonts));
|
1129 |
$url = 'https://fonts.googleapis.com/css?family=' . $query . '&subset=greek,latin,greek-ext,vietnamese,cyrillic-ext,latin-ext,cyrillic';
|
1130 |
wp_register_style('bwg_googlefonts', $url, null, null);
|
@@ -1636,6 +1734,18 @@ final class BWG {
|
|
1636 |
}
|
1637 |
return $mimes;
|
1638 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1639 |
}
|
1640 |
|
1641 |
/**
|
@@ -1654,7 +1764,7 @@ BWG();
|
|
1654 |
*
|
1655 |
* @param $id Shortcode id.
|
1656 |
*/
|
1657 |
-
function photo_gallery($id) {
|
1658 |
echo BWG()->shortcode(array('id' => $id));
|
1659 |
}
|
1660 |
|
@@ -1803,8 +1913,6 @@ function wdpg_io_install_notice() {
|
|
1803 |
jQuery("#activate_now").on("click",function(){
|
1804 |
activate_io_plugin()
|
1805 |
})
|
1806 |
-
|
1807 |
-
|
1808 |
</script>
|
1809 |
<style>
|
1810 |
@media only screen and (max-width: 500px) {
|
3 |
* Plugin Name: Photo Gallery
|
4 |
* Plugin URI: https://10web.io/plugins/wordpress-photo-gallery/
|
5 |
* Description: This plugin is a fully responsive gallery plugin with advanced functionality. It allows having different image galleries for your posts and pages. You can create unlimited number of galleries, combine them into albums, and provide descriptions and tags.
|
6 |
+
* Version: 1.4.13
|
7 |
* Author: Photo Gallery Team
|
8 |
* Author URI: https://10web.io/pricing/
|
9 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
47 |
public $is_demo = FALSE;
|
48 |
public $options = array();
|
49 |
public $upload_dir = '';
|
50 |
+
public $upload_url = '';
|
51 |
public $free_msg = '';
|
52 |
|
53 |
/**
|
81 |
$this->plugin_dir = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
|
82 |
$this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
|
83 |
$this->main_file = plugin_basename(__FILE__);
|
84 |
+
$this->plugin_version = '1.4.13';
|
85 |
+
$this->db_version = '1.4.13';
|
86 |
$this->prefix = 'bwg';
|
87 |
$this->nicename = __('Photo Gallery', $this->prefix);
|
88 |
|
91 |
require_once($this->plugin_dir . '/framework/BWGOptions.php');
|
92 |
$this->options = new WD_BWG_Options();
|
93 |
|
94 |
+
$this->upload_dir = $this->options->upload_dir;
|
95 |
+
$this->upload_url = $this->options->upload_url;
|
96 |
|
97 |
$this->free_msg = __('This option is disabled in free version.', $this->prefix);
|
98 |
$this->is_demo = get_site_option('tenweb_admin_demo');
|
127 |
add_action('wp_ajax_addEmbed', array($this, 'bwg_add_embed_ajax'));
|
128 |
add_action('wp_ajax_editimage_' . $this->prefix, array($this, 'admin_ajax'));
|
129 |
add_action('wp_ajax_addTags_' . $this->prefix, array($this, 'admin_ajax'));
|
130 |
+
add_action('wp_ajax_options_' . $this->prefix, array($this, 'admin_ajax'));
|
131 |
if( $this->is_pro ) {
|
132 |
add_action('wp_ajax_addInstagramGallery', array( $this, 'bwg_add_embed_ajax' ));
|
133 |
add_action('wp_ajax_addFacebookGallery', array( $this, 'bwg_add_embed_ajax' ));
|
136 |
if ( !is_admin() ) {
|
137 |
add_shortcode('Best_Wordpress_Gallery', array($this, 'shortcode'));
|
138 |
}
|
139 |
+
// Editor message dismiss.
|
140 |
+
add_action('wp_ajax_bwg_editor_missing_dismissed', array($this, 'dismiss_notice'));
|
141 |
+
add_action('wp_ajax_bwg_recreate_dismissed', array($this, 'dismiss_notice'));
|
142 |
|
143 |
// Add media button to WP editor.
|
144 |
add_action('wp_ajax_shortcode_' . $this->prefix, array($this, 'admin_ajax'));
|
199 |
|
200 |
// Enqueue block editor assets for Gutenberg.
|
201 |
add_filter('tw_get_block_editor_assets', array($this, 'register_block_editor_assets'));
|
202 |
+
add_action('enqueue_block_editor_assets', array($this, 'enqueue_block_editor_assets'));
|
203 |
+
|
204 |
+
add_action('admin_notices', array($this, 'admin_notices'));
|
205 |
+
|
206 |
+
// Prevent adding shortcode conflict with some builders.
|
207 |
+
$this->before_shortcode_add_builder_editor();
|
208 |
|
209 |
// Privacy policy.
|
210 |
add_action( 'admin_init', array($this, 'add_privacy_policy_content') );
|
293 |
add_action('init', array($this, 'create_post_types'));
|
294 |
}
|
295 |
|
296 |
+
/**
|
297 |
+
* Wordpress admin notice actions.
|
298 |
+
*/
|
299 |
+
public function admin_notices() {
|
300 |
+
// Show this notice only on Photo Gallery pages.
|
301 |
+
if ( isset( $_GET[ 'page' ] ) && strpos( esc_html( $_GET[ 'page' ] ), '_bwg' ) !== FALSE ) {
|
302 |
+
/**
|
303 |
+
* possible values are 'editor_missing', 'editor_missing_dismissed', 'recreate_dismissed', false
|
304 |
+
*/
|
305 |
+
$wp_editor_state = get_option( 'bwg_wp_editor_state' );
|
306 |
+
// Check if host is ready to edit images.
|
307 |
+
$this->wp_editor_exists = wp_image_editor_supports( array( 'methods' => array( 'resize' ) ) );
|
308 |
+
$wp_editor_message = false;
|
309 |
+
$wp_editor_new_state = false;
|
310 |
+
if ( !$this->wp_editor_exists ) {
|
311 |
+
// Editor missing and error notification is not dismissed.
|
312 |
+
if ( false === $wp_editor_state || 'editor_missing' === $wp_editor_state ) {
|
313 |
+
$wp_editor_message_action = 'bwg_editor_missing_dismissed';
|
314 |
+
$wp_editor_message = '<p>' . sprintf(__('Image edit functionality is not supported by your web host. We highly recommend you to contact your hosting provider and ask them to enable %s library.', $this->prefix), '<b>' . __("PHP GD", $this->prefix) . '</b>') . '</p>';
|
315 |
+
$wp_editor_message .= '<p>' . sprintf(__('Without image editing functions, image thumbnails will not be created, thus causing load time issues on published galleries. Furthermore, some of Photo Gallery\'s features, e.g. %s, %s, and %s, will not be available.', $this->prefix), '<b>' . __("crop", $this->prefix) . '</b>', '<b>' . __("edit", $this->prefix) . '</b>', '<b>' . __("rotate", $this->prefix) . '</b>') . '</p>';
|
316 |
+
$wp_editor_new_state = 'editor_missing';
|
317 |
+
}
|
318 |
+
}
|
319 |
+
else {
|
320 |
+
// Editor exists, some error state was detected before and recreate thumbnails message is not dismissed.
|
321 |
+
if ( false !== $wp_editor_state && 'recreate_dismissed' != $wp_editor_state ) {
|
322 |
+
$options_url = admin_url('admin.php?page=options_bwg');
|
323 |
+
$wp_editor_message_action = 'bwg_recreate_dismissed';
|
324 |
+
$wp_editor_message = '<p>' . sprintf(__('Image edit functionality was just activated on your web host. Please go to %s, navigate to %s tab and press %s button.', $this->prefix), '<b><a href="' . $options_url . '" title="' . __("Options", $this->prefix) . '">' . __("Options page", $this->prefix) . '</a></b>', '<b>' . __("General", $this->prefix) . '</b>', '<b>' . __("Recreate", $this->prefix) . '</b>') . '</p>';
|
325 |
+
$wp_editor_new_state = 'recreate';
|
326 |
+
}
|
327 |
+
}
|
328 |
+
if ( $wp_editor_new_state ) {
|
329 |
+
update_option( 'bwg_wp_editor_state', $wp_editor_new_state );
|
330 |
+
}
|
331 |
+
if ( $wp_editor_message ) {
|
332 |
+
?>
|
333 |
+
<div id="bwg_image_editor_notice" class="notice error is-dismissible" data-action="<?php echo $wp_editor_message_action; ?>">
|
334 |
+
<?php echo $wp_editor_message; ?>
|
335 |
+
</div>
|
336 |
+
<?php
|
337 |
+
}
|
338 |
+
}
|
339 |
+
}
|
340 |
+
|
341 |
+
/**
|
342 |
+
* Dismiss Image editor messages.
|
343 |
+
*/
|
344 |
+
public function dismiss_notice() {
|
345 |
+
$action = WDWLibrary::get('action');
|
346 |
+
$allowed_pages = array(
|
347 |
+
'bwg_editor_missing_dismissed',
|
348 |
+
'bwg_recreate_dismissed',
|
349 |
+
);
|
350 |
+
if ( !empty($action) && in_array($action, $allowed_pages) ) {
|
351 |
+
$action = str_replace(BWG()->prefix . '_', '', $action);
|
352 |
+
update_option( 'bwg_wp_editor_state', $action );
|
353 |
+
}
|
354 |
+
die();
|
355 |
+
}
|
356 |
+
|
357 |
private function use_home_url() {
|
358 |
$home_url = str_replace(array("http://", "https://"), "", home_url());
|
359 |
$pos = strpos($home_url, "/");
|
533 |
'bwg_error' => __('Error', $this->prefix),
|
534 |
'bwg_show_order' => __('Show order column', $this->prefix),
|
535 |
'bwg_hide_order' => __('Hide order column', $this->prefix),
|
536 |
+
'selected_item' => __('Selected %d item.', $this->prefix),
|
537 |
+
'selected_items' => __('Selected %d items.', $this->prefix),
|
538 |
'saved' => __('Items Succesfully Saved.', $this->prefix),
|
539 |
'recovered' => __('Item Succesfully Recovered.', $this->prefix),
|
540 |
'published' => __('Item Succesfully Published.', $this->prefix),
|
551 |
'other_warning' => __('This action will reset gallery type to mixed and will save that choice. You cannot undo it.', $this->prefix),
|
552 |
'insert' => __('Insert', $this->prefix),
|
553 |
'import_failed' => __('Failed to import images from media library', $this->prefix),
|
554 |
+
'only_the_following_types_are_allowed' => __('Sorry, only jpg, jpeg, gif, png types are allowed.', $this->prefix),
|
555 |
'wp_upload_dir' => wp_upload_dir(),
|
556 |
'ajax_url' => wp_nonce_url( admin_url('admin-ajax.php'), 'bwg_UploadHandler', 'bwg_nonce' ),
|
557 |
+
'uploads_url' => BWG()->options->upload_url,
|
558 |
+
'recreate_success' => __('Thumbnails successfully recreated.', $this->prefix),
|
559 |
+
'watermark_option_reset' => __('All images are successfully reset.', $this->prefix),
|
560 |
));
|
561 |
wp_localize_script($this->prefix . '_admin', 'bwg_objectGGF', WDWLibrary::get_google_fonts());
|
562 |
wp_enqueue_script('jquery-ui-sortable');
|
608 |
}
|
609 |
}
|
610 |
|
611 |
+
public function shortcode( $params =array() ) {
|
612 |
if ( is_admin() && defined('DOING_AJAX') && !DOING_AJAX) {
|
613 |
return;
|
614 |
}
|
615 |
+
if ( isset($params['id']) ) {
|
616 |
global $wpdb;
|
617 |
$shortcode = $wpdb->get_var($wpdb->prepare("SELECT tagtext FROM " . $wpdb->prefix . "bwg_shortcode WHERE id='%d'", $params['id']));
|
618 |
if ($shortcode) {
|
629 |
}
|
630 |
// 'gallery_type' is the only parameter not being checked.
|
631 |
// Checking for incomplete shortcodes.
|
632 |
+
if ( isset($params['gallery_type']) ) {
|
633 |
$pairs = WDWLibrary::get_shortcode_option_params( $params );
|
634 |
ob_start();
|
635 |
$this->front_end( $pairs );
|
644 |
* @param $params
|
645 |
*/
|
646 |
public function front_end($params) {
|
647 |
+
require_once(BWG()->plugin_dir . '/framework/WDWLibraryEmbed.php');
|
648 |
if ($params['gallery_type'] == 'thumbnails' || $params['gallery_type'] == 'slideshow') {
|
649 |
require_once(BWG()->plugin_dir . '/frontend/controllers/controller.php');
|
650 |
$controller = new BWGControllerSite( ucfirst( $params[ 'gallery_type' ] ) );
|
693 |
$code = code_generic($l, $cap_digital, $cap_latin_char);
|
694 |
WDWLibrary::bwg_session_start();
|
695 |
$_SESSION['bwg_captcha_code'] = $code;
|
696 |
+
if (function_exists('imagecreatetruecolor')) {
|
697 |
+
$canvas = imagecreatetruecolor( $cap_width, $cap_height );
|
698 |
+
$c = imagecolorallocate( $canvas, rand( 150, 255 ), rand( 150, 255 ), rand( 150, 255 ) );
|
699 |
+
imagefilledrectangle( $canvas, 0, 0, $cap_width, $cap_height, $c );
|
700 |
+
$count = strlen( $code );
|
701 |
+
$color_text = imagecolorallocate( $canvas, 0, 0, 0 );
|
702 |
+
for ( $it = 0; $it < $count; $it++ ) {
|
703 |
+
$letter = $code[ $it ];
|
704 |
+
imagestring( $canvas, 6, (10 * $it + 10), $cap_height / 4, $letter, $color_text );
|
705 |
+
}
|
706 |
+
for ( $c = 0; $c < 150; $c++ ) {
|
707 |
+
$x = rand( 0, $cap_width - 1 );
|
708 |
+
$y = rand( 0, 29 );
|
709 |
+
$col = '0x' . rand( 0, 9 ) . '0' . rand( 0, 9 ) . '0' . rand( 0, 9 ) . '0';
|
710 |
+
imagesetpixel( $canvas, $x, $y, $col );
|
711 |
+
}
|
712 |
+
header( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' );
|
713 |
+
header( 'Cache-Control: no-store, no-cache, must-revalidate' );
|
714 |
+
header( 'Cache-Control: post-check=0, pre-check=0', FALSE );
|
715 |
+
header( 'Pragma: no-cache' );
|
716 |
+
header( 'Content-Type: image/jpeg' );
|
717 |
+
imagejpeg( $canvas, NULL, BWG()->options->jpeg_quality );
|
718 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
719 |
die('');
|
720 |
}
|
721 |
}
|
792 |
'albumsgalleries_' . $this->prefix,
|
793 |
'shortcode_' . $this->prefix,
|
794 |
'editimage_' . $this->prefix,
|
795 |
+
'options_' . $this->prefix,
|
796 |
);
|
797 |
if ( !empty($page) && in_array($page, $allowed_pages) ) {
|
798 |
$page = WDWLibrary::clean_page_prefix($page);
|
866 |
function media_button($context) {
|
867 |
ob_start();
|
868 |
$url = add_query_arg(array('action' => 'shortcode_bwg', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
|
869 |
+
?>
|
870 |
+
<a onclick="if ( typeof tb_click == 'function' ) {
|
871 |
+
tb_click.call(this);
|
872 |
+
bwg_create_loading_block();
|
873 |
+
bwg_set_shortcode_popup_dimensions(); } return false;" href="<?php echo $url; ?>" class="bwg-shortcode-btn button" title="<?php _e('Insert Photo Gallery', $this->prefix); ?>">
|
874 |
<span class="wp-media-buttons-icon" style="background: url('<?php echo $this->plugin_url; ?>/images/icons/bwg_edit_but.png') no-repeat scroll left top rgba(0, 0, 0, 0);"></span>
|
875 |
<?php _e('Add Photo Gallery', $this->prefix); ?>
|
876 |
</a>
|
897 |
* Add script to header.
|
898 |
*/
|
899 |
public function global_script() {
|
900 |
+
?>
|
901 |
<script>
|
902 |
var bwg_admin_ajax = '<?php echo add_query_arg(array('action' => 'shortcode_' . $this->prefix), admin_url('admin-ajax.php')); ?>';
|
903 |
var bwg_ajax_url = '<?php echo add_query_arg(array('action' => ''), admin_url('admin-ajax.php')); ?>';
|
904 |
var bwg_plugin_url = '<?php echo BWG()->plugin_url; ?>';
|
905 |
|
906 |
+
/* TODO: jira 484
|
907 |
+
jQuery(document).ready(function () {
|
908 |
+
jQuery("a.bwg-shortcode-btn").on("click", function() {
|
909 |
+
if ( typeof tb_click == 'function' ) {
|
910 |
+
tb_click.call(this);
|
911 |
+
bwg_create_loading_block();
|
912 |
+
bwg_set_shortcode_popup_dimensions(); } return false;
|
913 |
+
});
|
914 |
+
});*/
|
915 |
// Set shortcode popup dimensions.
|
916 |
function bwg_set_shortcode_popup_dimensions() {
|
917 |
var H = jQuery(window).height(), W = jQuery(window).width();
|
920 |
if (tbWindow.size()) {
|
921 |
tbWindow.width(W).height(H);
|
922 |
jQuery('#TB_iframeContent').width(W).height(H);
|
923 |
+
tbWindow.css({'top': 0, 'left': 0, 'margin-left': '0', 'z-index': '1000000'});
|
924 |
}
|
925 |
// Edit
|
926 |
var tbWindow = jQuery('.mce-window[aria-label="Photo Gallery"]');
|
935 |
}
|
936 |
// Create loading block.
|
937 |
function bwg_create_loading_block() {
|
938 |
+
jQuery('body').append('<div class="loading_div" style="display:block; width: 100%; height: 100%; opacity: 0.6; position: fixed; background-color: #000000; background-image: url('+ bwg_plugin_url +'/images/spinner.gif); background-position: center; background-repeat: no-repeat; background-size: 50px; z-index: 1001000; top: 0; left: 0;"></div>');
|
939 |
}
|
940 |
// Remove loading block.
|
941 |
function bwg_remove_loading_block() {
|
942 |
+
jQuery(".loading_div", window.parent.document).remove();
|
943 |
+
jQuery('.loading_div').remove();
|
944 |
}
|
945 |
+
</script>
|
946 |
<?php
|
947 |
}
|
948 |
|
1174 |
*/
|
1175 |
public function register_frontend_scripts() {
|
1176 |
$version = BWG()->plugin_version;
|
1177 |
+
wp_register_script('bwg_frontend', BWG()->front_url . '/js/bwg_frontend.js', array('jquery'), $version, true);
|
1178 |
wp_register_style('bwg_frontend', BWG()->front_url . '/css/bwg_frontend.css', array(), $version);
|
1179 |
+
|
1180 |
+
wp_register_script('bwg_sumoselect', BWG()->front_url . '/js/jquery.sumoselect.min.js', array('jquery'), '3.0.3', true);
|
1181 |
+
wp_register_style('bwg_sumoselect', BWG()->front_url . '/css/sumoselect.css', array(), '3.0.3');
|
1182 |
+
|
1183 |
// Styles/Scripts for popup.
|
1184 |
wp_register_style('bwg_font-awesome', BWG()->front_url . '/css/font-awesome/font-awesome.css', array(), '4.6.3');
|
1185 |
+
wp_register_script('bwg_jquery_mobile', BWG()->front_url . '/js/jquery.mobile.js', array('jquery'), $version, true);
|
1186 |
+
wp_register_script('bwg_mCustomScrollbar', BWG()->front_url . '/js/jquery.mCustomScrollbar.concat.min.js', array('jquery'), $version, true);
|
1187 |
wp_register_style('bwg_mCustomScrollbar', BWG()->front_url . '/css/jquery.mCustomScrollbar.css', array(), $version);
|
1188 |
+
|
1189 |
+
wp_register_script('jquery-fullscreen', BWG()->front_url . '/js/jquery.fullscreen-0.4.1.js', array('jquery'), '0.4.1', true);
|
1190 |
+
wp_register_script('bwg_gallery_box', BWG()->front_url . '/js/bwg_gallery_box.js', array('jquery'), $version, true);
|
1191 |
+
wp_register_script('bwg_embed', BWG()->front_url . '/js/bwg_embed.js', array('jquery'), $version, true);
|
1192 |
if ( $this->is_pro ) {
|
1193 |
+
wp_register_script('bwg_raty', BWG()->front_url . '/js/jquery.raty.js', array( 'jquery' ), '2.5.2', true);
|
1194 |
+
wp_register_script('bwg_featureCarousel', BWG()->plugin_url . '/js/jquery.featureCarousel.js', array( 'jquery' ), $version, true);
|
1195 |
// 3D Tag Cloud.
|
1196 |
+
wp_register_script('bwg_3DEngine', BWG()->front_url . '/js/3DEngine/3DEngine.js', array('jquery'), '1.0.0', true);
|
1197 |
+
wp_register_script('bwg_Sphere', BWG()->front_url . '/js/3DEngine/Sphere.js', array('jquery'), '1.0.0', true);
|
1198 |
}
|
1199 |
wp_localize_script('bwg_gallery_box', 'bwg_objectL10n', array(
|
1200 |
'bwg_field_required' => __('field is required.', $this->prefix),
|
1203 |
));
|
1204 |
wp_localize_script('bwg_frontend', 'bwg_objectsL10n', array(
|
1205 |
'bwg_select_tag' => __('Select Tag', $this->prefix),
|
1206 |
+
'bwg_order_by' => __('Order By', $this->prefix),
|
1207 |
'bwg_search' => __('Search', $this->prefix),
|
1208 |
'bwg_show_ecommerce' => __('Show Ecommerce', $this->prefix),
|
1209 |
'bwg_hide_ecommerce' => __('Hide Ecommerce', $this->prefix),
|
1213 |
'bwg_restore' => __('Restore', $this->prefix),
|
1214 |
'bwg_maximize' => __('Maximize', $this->prefix),
|
1215 |
'bwg_fullscreen' => __('Fullscreen', $this->prefix),
|
1216 |
+
'bwg_search_tag' => __('SEARCH...', $this->prefix),
|
1217 |
+
'bwg_tag_no_match' => __('No tags found', $this->prefix),
|
1218 |
+
'bwg_all_tags_selected' => __('All tags selected', $this->prefix),
|
1219 |
+
'bwg_tags_selected' => __('tags selected', $this->prefix),
|
1220 |
));
|
1221 |
|
1222 |
// Google fonts.
|
1223 |
require_once(BWG()->plugin_dir . '/framework/WDWLibrary.php');
|
1224 |
$google_fonts = WDWLibrary::get_used_google_fonts();
|
1225 |
+
if ( !empty($google_fonts) ) {
|
1226 |
$query = implode("|", str_replace(' ', '+', $google_fonts));
|
1227 |
$url = 'https://fonts.googleapis.com/css?family=' . $query . '&subset=greek,latin,greek-ext,vietnamese,cyrillic-ext,latin-ext,cyrillic';
|
1228 |
wp_register_style('bwg_googlefonts', $url, null, null);
|
1734 |
}
|
1735 |
return $mimes;
|
1736 |
}
|
1737 |
+
|
1738 |
+
/**
|
1739 |
+
* Prevent adding shortcode conflict with some builders.
|
1740 |
+
*/
|
1741 |
+
private function before_shortcode_add_builder_editor() {
|
1742 |
+
if ( defined('ELEMENTOR_VERSION') ) {
|
1743 |
+
add_action('elementor/editor/before_enqueue_scripts', array( $this, 'global_script' ));
|
1744 |
+
}
|
1745 |
+
if ( class_exists('FLBuilder') ) {
|
1746 |
+
add_action('wp_enqueue_scripts', array( $this, 'global_script' ));
|
1747 |
+
}
|
1748 |
+
}
|
1749 |
}
|
1750 |
|
1751 |
/**
|
1764 |
*
|
1765 |
* @param $id Shortcode id.
|
1766 |
*/
|
1767 |
+
function photo_gallery( $id ) {
|
1768 |
echo BWG()->shortcode(array('id' => $id));
|
1769 |
}
|
1770 |
|
1913 |
jQuery("#activate_now").on("click",function(){
|
1914 |
activate_io_plugin()
|
1915 |
})
|
|
|
|
|
1916 |
</script>
|
1917 |
<style>
|
1918 |
@media only screen and (max-width: 500px) {
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: webdorado,wdsupport,photogallerysupport,10web
|
|
3 |
Tags: gallery, photo gallery, image gallery, responsive gallery, wordpress gallery plugin, photo albums, gallery slider, gallery lightbox, wordpress photo gallery plugin, fullscreen gallery, watermarking, video gallery
|
4 |
Requires at least: 3.4
|
5 |
Tested up to: 4.9
|
6 |
-
Stable tag: 1.4.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -279,6 +279,32 @@ Choose whether to display random or the first/last specific number of images.
|
|
279 |
|
280 |
== Changelog ==
|
281 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
= 1.4.12 =
|
283 |
* Added: GDPR compliance.
|
284 |
|
3 |
Tags: gallery, photo gallery, image gallery, responsive gallery, wordpress gallery plugin, photo albums, gallery slider, gallery lightbox, wordpress photo gallery plugin, fullscreen gallery, watermarking, video gallery
|
4 |
Requires at least: 3.4
|
5 |
Tested up to: 4.9
|
6 |
+
Stable tag: 1.4.13
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
279 |
|
280 |
== Changelog ==
|
281 |
|
282 |
+
|
283 |
+
= 1.4.13 =
|
284 |
+
* Added: Download button functionality related to the filters.
|
285 |
+
* Added: Gutenberg integration.
|
286 |
+
* Added: Recreate thumbnails, set and reset watermark functions actions by Ajax ( part to part by limit 50 ) in options.
|
287 |
+
* Added: Images sorting functionality in gallery edit page.
|
288 |
+
* Changed: Moved Slideshow view inline javascript to js file.
|
289 |
+
* Changed: Remove static css from Slideshow view.
|
290 |
+
* Changed: Check GD2 library availability.
|
291 |
+
* Changed: Thumbnail titles styles in thumbnail view.
|
292 |
+
* Changed: Design of filters in thumbnail view.
|
293 |
+
* Improved: Open lightbox faster.
|
294 |
+
* Improved: How to use.
|
295 |
+
* Fixed: Add shortcode functionality on Beaver, Elementor, SiteOrigin and Visual Composer builders.
|
296 |
+
* Fixed: Bug on setting watermark.
|
297 |
+
* Fixed: Conflict with "Fast Velocity Minify".
|
298 |
+
* Fixed: Filmstrip image ordering
|
299 |
+
* Fixed: Bug on searched images delete in admin.
|
300 |
+
* Fixed: Conflict Wordpress.com hosting.
|
301 |
+
* Fixed: Search logic when the image title contains several words and when you add space before searched word.
|
302 |
+
* Fixed: Bug on scroll load.
|
303 |
+
* Fixed: Add items to gallery group in IE.
|
304 |
+
* Fixed: Slideshow widget bug.
|
305 |
+
* Fixed: Importing to many images from Media library.
|
306 |
+
|
307 |
+
|
308 |
= 1.4.12 =
|
309 |
* Added: GDPR compliance.
|
310 |
|
update.php
CHANGED
@@ -63,7 +63,7 @@ class BWGUpdate {
|
|
63 |
// Add search box option.
|
64 |
$wpdb->query("ALTER TABLE " . $wpdb->prefix . "bwg_option ADD `show_search_box` tinyint(1) NOT NULL DEFAULT 0");
|
65 |
// Add search box width option.
|
66 |
-
$wpdb->query("ALTER TABLE " . $wpdb->prefix . "bwg_option ADD `search_box_width` int(4) NOT NULL DEFAULT
|
67 |
// Add info enable/disable option.
|
68 |
$wpdb->query("ALTER TABLE " . $wpdb->prefix . "bwg_option ADD `popup_enable_info` tinyint(1) NOT NULL DEFAULT 1");
|
69 |
}
|
63 |
// Add search box option.
|
64 |
$wpdb->query("ALTER TABLE " . $wpdb->prefix . "bwg_option ADD `show_search_box` tinyint(1) NOT NULL DEFAULT 0");
|
65 |
// Add search box width option.
|
66 |
+
$wpdb->query("ALTER TABLE " . $wpdb->prefix . "bwg_option ADD `search_box_width` int(4) NOT NULL DEFAULT 330");
|
67 |
// Add info enable/disable option.
|
68 |
$wpdb->query("ALTER TABLE " . $wpdb->prefix . "bwg_option ADD `popup_enable_info` tinyint(1) NOT NULL DEFAULT 1");
|
69 |
}
|