Version Description
- Turn SliderWD Media Upload
- Ajax save
- Images Bulk Add
- Timer bar bug fixed
- change shortcode button
- fullwidth slider margin bug fixed
Download this release
Release Info
Developer | webdorado |
Plugin | Slider by WD – Responsive Slider |
Version | 1.0.2 |
Comparing to | |
See all releases |
Code changes from version 1.0.1 to 1.0.2
- admin/controllers/WDSControllerSliders_wds.php +128 -117
- admin/models/WDSModelSliders_wds.php +8 -6
- admin/models/WDSModelUninstall_wds.php +1 -0
- admin/views/WDSViewSliders_wds.php +245 -112
- admin/views/WDSViewUninstall_wds.php +1 -1
- admin/views/WDSViewWDSShortcode.php +48 -62
- css/wds_tables.css +36 -8
- demo/1-150x150.jpg +0 -0
- demo/1.jpg +0 -0
- demo/2-150x150.jpg +0 -0
- demo/2.jpg +0 -0
- demo/3-150x150.jpg +0 -0
- demo/3.jpg +0 -0
- featured/featured.php +6 -0
- featured/images/fm.import.jpg +0 -0
- featured/style.css +1 -0
- filemanager/UploadHandler.php +966 -0
- filemanager/controller.php +309 -0
- filemanager/css/default.css +530 -0
- filemanager/css/default_view_list.css +126 -0
- filemanager/css/default_view_thumbs.css +97 -0
- filemanager/css/index.html +1 -0
- filemanager/images/btn_icons/back.png +0 -0
- filemanager/images/btn_icons/copy.png +0 -0
- filemanager/images/btn_icons/create_dir.png +0 -0
- filemanager/images/btn_icons/cut.png +0 -0
- filemanager/images/btn_icons/delete.png +0 -0
- filemanager/images/btn_icons/divider.png +0 -0
- filemanager/images/btn_icons/import.png +0 -0
- filemanager/images/btn_icons/index.html +1 -0
- filemanager/images/btn_icons/paste.png +0 -0
- filemanager/images/btn_icons/rename.png +0 -0
- filemanager/images/btn_icons/sort_asc.png +0 -0
- filemanager/images/btn_icons/sort_desc.png +0 -0
- filemanager/images/btn_icons/up.png +0 -0
- filemanager/images/btn_icons/upload.png +0 -0
- filemanager/images/btn_icons/view_list.png +0 -0
- filemanager/images/btn_icons/view_thumbs.png +0 -0
- filemanager/images/btn_row_move_down.png +0 -0
- filemanager/images/btn_row_move_up.png +0 -0
- filemanager/images/btn_row_remove.png +0 -0
- filemanager/images/file_icons/_blank.png +0 -0
- filemanager/images/file_icons/_page.png +0 -0
- filemanager/images/file_icons/aac.png +0 -0
- filemanager/images/file_icons/ai.png +0 -0
- filemanager/images/file_icons/aiff.png +0 -0
- filemanager/images/file_icons/avi.png +0 -0
- filemanager/images/file_icons/bmp.png +0 -0
- filemanager/images/file_icons/c.png +0 -0
- filemanager/images/file_icons/cpp.png +0 -0
- filemanager/images/file_icons/css.png +0 -0
- filemanager/images/file_icons/dat.png +0 -0
- filemanager/images/file_icons/dir.png +0 -0
- filemanager/images/file_icons/dmg.png +0 -0
- filemanager/images/file_icons/doc.png +0 -0
- filemanager/images/file_icons/dotx.png +0 -0
- filemanager/images/file_icons/dwg.png +0 -0
- filemanager/images/file_icons/dxf.png +0 -0
- filemanager/images/file_icons/eps.png +0 -0
- filemanager/images/file_icons/exe.png +0 -0
- filemanager/images/file_icons/flv.png +0 -0
- filemanager/images/file_icons/gif.png +0 -0
- filemanager/images/file_icons/h.png +0 -0
- filemanager/images/file_icons/hpp.png +0 -0
- filemanager/images/file_icons/html.png +0 -0
- filemanager/images/file_icons/ics.png +0 -0
- filemanager/images/file_icons/index.html +9 -0
- filemanager/images/file_icons/iso.png +0 -0
- filemanager/images/file_icons/java.png +0 -0
- filemanager/images/file_icons/jpeg.png +0 -0
- filemanager/images/file_icons/jpg.png +0 -0
- filemanager/images/file_icons/key.png +0 -0
- filemanager/images/file_icons/mid.png +0 -0
- filemanager/images/file_icons/mp3.png +0 -0
- filemanager/images/file_icons/mp4.png +0 -0
- filemanager/images/file_icons/mpg.png +0 -0
- filemanager/images/file_icons/odf.png +0 -0
- filemanager/images/file_icons/ods.png +0 -0
- filemanager/images/file_icons/odt.png +0 -0
- filemanager/images/file_icons/otp.png +0 -0
- filemanager/images/file_icons/ots.png +0 -0
- filemanager/images/file_icons/ott.png +0 -0
- filemanager/images/file_icons/pdf.png +0 -0
- filemanager/images/file_icons/php.png +0 -0
- filemanager/images/file_icons/png.png +0 -0
- filemanager/images/file_icons/ppt.png +0 -0
- filemanager/images/file_icons/psd.png +0 -0
- filemanager/images/file_icons/py.png +0 -0
- filemanager/images/file_icons/qt.png +0 -0
- filemanager/images/file_icons/rar.png +0 -0
- filemanager/images/file_icons/rb.png +0 -0
- filemanager/images/file_icons/rtf.png +0 -0
- filemanager/images/file_icons/sql.png +0 -0
- filemanager/images/file_icons/tga.png +0 -0
- filemanager/images/file_icons/tgz.png +0 -0
- filemanager/images/file_icons/tiff.png +0 -0
- filemanager/images/file_icons/txt.png +0 -0
- filemanager/images/file_icons/wav.png +0 -0
- filemanager/images/file_icons/xls.png +0 -0
- filemanager/images/file_icons/xlsx.png +0 -0
- filemanager/images/file_icons/xml.png +0 -0
- filemanager/images/file_icons/yml.png +0 -0
- filemanager/images/file_icons/zip.png +0 -0
- filemanager/images/index.html +9 -0
- filemanager/images/progressbar.gif +0 -0
- filemanager/js/default.js +555 -0
- filemanager/js/jq_uploader/index.html +9 -0
- filemanager/js/jq_uploader/jquery.fileupload.js +1243 -0
- filemanager/js/jq_uploader/jquery.iframe-transport.js +185 -0
- filemanager/js/jq_uploader/jquery.upload-1.0.2.js +133 -0
- filemanager/model.php +282 -0
- filemanager/view.php +449 -0
- framework/WDW_S_Library.php +82 -8
- frontend/views/WDSViewSlider.php +155 -136
- images/wd_slider.png +0 -0
- js/images/wds_edit_but.png +0 -0
- js/wds.js +492 -40
- js/wds_edit_button.js +0 -22
- js/wds_shortcode.js +0 -446
- licensing/images/Plus.png +0 -0
- licensing/licensing.php +140 -0
- licensing/style.css +54 -0
- readme.txt +23 -13
- slider-wd.php +95 -23
- sliders-insert.php +1 -0
- sliders-update.php +4 -0
admin/controllers/WDSControllerSliders_wds.php
CHANGED
@@ -55,36 +55,43 @@ class WDSControllerSliders_wds {
|
|
55 |
|
56 |
require_once WD_S_DIR . "/admin/views/WDSViewSliders_wds.php";
|
57 |
$view = new WDSViewSliders_wds($model);
|
58 |
-
$id =
|
59 |
$view->edit($id);
|
60 |
}
|
61 |
|
62 |
public function save() {
|
63 |
-
$message = $this->save_slider_db();
|
64 |
-
$this->save_slide_db();
|
65 |
$page = WDW_S_Library::get('page');
|
66 |
-
WDW_S_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' =>
|
67 |
}
|
68 |
|
69 |
public function apply() {
|
70 |
-
$
|
71 |
$this->save_slide_db();
|
72 |
-
|
73 |
-
$id = (int) $wpdb->get_var('SELECT MAX(`id`) FROM ' . $wpdb->prefix . 'wdsslider');
|
74 |
-
$current_id = WDW_S_Library::get('current_id', $id);
|
75 |
-
$nav_tab = WDW_S_Library::get('nav_tab', 'global');
|
76 |
-
$tab = WDW_S_Library::get('tab', 'settings');
|
77 |
-
$sub_tab = WDW_S_Library::get('sub_tab', '');
|
78 |
-
$page = WDW_S_Library::get('page');
|
79 |
-
WDW_S_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'nav_tab' => $nav_tab, 'tab' => $tab, 'sub_tab' => $sub_tab, 'message' => $message), admin_url('admin.php')));
|
80 |
}
|
|
|
|
|
|
|
|
|
|
|
81 |
|
82 |
public function save_slider_db() {
|
83 |
global $wpdb;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
$slider_id = (isset($_POST['current_id']) ? (int) $_POST['current_id'] : 0);
|
85 |
$name = ((isset($_POST['name'])) ? esc_html(stripslashes($_POST['name'])) : '');
|
86 |
$published = ((isset($_POST['published'])) ? (int) esc_html(stripslashes($_POST['published'])) : 1);
|
87 |
$full_width = ((isset($_POST['full_width'])) ? (int) esc_html(stripslashes($_POST['full_width'])) : 0);
|
|
|
88 |
$width = ((isset($_POST['width'])) ? (int) esc_html(stripslashes($_POST['width'])) : 800);
|
89 |
$height = ((isset($_POST['height'])) ? (int) esc_html((stripslashes($_POST['height']))) : 300);
|
90 |
$bg_fit = ((isset($_POST['bg_fit'])) ? esc_html(stripslashes($_POST['bg_fit'])) : 'cover');
|
@@ -100,7 +107,7 @@ class WDSControllerSliders_wds {
|
|
100 |
$background_transparent = ((isset($_POST['background_transparent'])) ? esc_html(stripslashes($_POST['background_transparent'])) : 100);
|
101 |
$glb_border_width = ((isset($_POST['glb_border_width'])) ? (int) esc_html(stripslashes($_POST['glb_border_width'])) : 0);
|
102 |
$glb_border_style = ((isset($_POST['glb_border_style'])) ? esc_html(stripslashes($_POST['glb_border_style'])) : 'none');
|
103 |
-
$glb_border_color = ((isset($_POST['glb_border_color'])) ? esc_html(stripslashes($_POST['glb_border_color'])) : '
|
104 |
$glb_border_radius = ((isset($_POST['glb_border_radius'])) ? esc_html(stripslashes($_POST['glb_border_radius'])) : '');
|
105 |
$glb_margin = ((isset($_POST['glb_margin'])) ? (int) esc_html(stripslashes($_POST['glb_margin'])) : 0);
|
106 |
$glb_box_shadow = ((isset($_POST['glb_box_shadow'])) ? esc_html(stripslashes($_POST['glb_box_shadow'])) : '');
|
@@ -109,26 +116,26 @@ class WDSControllerSliders_wds {
|
|
109 |
$prev_next_butt = ((isset($_POST['prev_next_butt'])) ? (int) esc_html(stripslashes($_POST['prev_next_butt'])) : 1);
|
110 |
$play_paus_butt = ((isset($_POST['play_paus_butt'])) ? (int) esc_html(stripslashes($_POST['play_paus_butt'])) : 0);
|
111 |
$navigation = ((isset($_POST['navigation'])) ? esc_html(stripslashes($_POST['navigation'])) : 'hover');
|
112 |
-
$rl_butt_style = ((isset($_POST['rl_butt_style'])) ? esc_html(stripslashes($_POST['rl_butt_style'])) : 'fa-angle-double');
|
113 |
-
$rl_butt_size = ((isset($_POST['rl_butt_size'])) ? (int) esc_html(stripslashes($_POST['rl_butt_size'])) : 40);
|
114 |
-
$pp_butt_size = ((isset($_POST['pp_butt_size'])) ? (int) esc_html(stripslashes($_POST['pp_butt_size'])) : 40);
|
115 |
-
$butts_color = ((isset($_POST['butts_color'])) ? esc_html(stripslashes($_POST['butts_color'])) : '000000');
|
116 |
-
$butts_transparent = ((isset($_POST['butts_transparent'])) ? (int) esc_html(stripslashes($_POST['butts_transparent'])) : 50);
|
117 |
-
$hover_color = ((isset($_POST['hover_color'])) ? esc_html(stripslashes($_POST['hover_color'])) : '000000');
|
118 |
-
$nav_border_width = ((isset($_POST['nav_border_width'])) ? (int) esc_html(stripslashes($_POST['nav_border_width'])) : 0);
|
119 |
-
$nav_border_style = ((isset($_POST['nav_border_style'])) ? esc_html(stripslashes($_POST['nav_border_style'])) : 'none');
|
120 |
$nav_border_color = ((isset($_POST['nav_border_color'])) ? esc_html(stripslashes($_POST['nav_border_color'])) : 'FFFFFF');
|
121 |
-
$nav_border_radius = ((isset($_POST['nav_border_radius'])) ? esc_html(stripslashes($_POST['nav_border_radius'])) : '20px');
|
122 |
-
$nav_bg_color = ((isset($_POST['nav_bg_color'])) ? esc_html(stripslashes($_POST['nav_bg_color'])) : 'FFFFFF');
|
123 |
$bull_position = ((isset($_POST['bull_position'])) ? esc_html(stripslashes($_POST['bull_position'])) : 'bottom');
|
124 |
if (isset($_POST['enable_bullets']) && (esc_html(stripslashes($_POST['enable_bullets'])) == 0)) {
|
125 |
$bull_position = 'none';
|
126 |
}
|
127 |
-
$bull_style = ((isset($_POST['bull_style'])) ? esc_html(stripslashes($_POST['bull_style'])) : 'fa-circle-o');
|
128 |
-
$bull_size = ((isset($_POST['bull_size'])) ? (int) esc_html(stripslashes($_POST['bull_size'])) : 25);
|
129 |
-
$bull_color = ((isset($_POST['bull_color'])) ? esc_html(stripslashes($_POST['bull_color'])) : 'FFFFFF');
|
130 |
-
$bull_act_color = ((isset($_POST['bull_act_color'])) ? esc_html(stripslashes($_POST['bull_act_color'])) : 'FFFFFF');
|
131 |
-
$bull_margin = ((isset($_POST['bull_margin'])) ? (int) esc_html(stripslashes($_POST['bull_margin'])) : 3);
|
132 |
$film_pos = ((isset($_POST['film_pos'])) ? esc_html(stripslashes($_POST['film_pos'])) : 'none');
|
133 |
if (isset($_POST['enable_filmstrip']) && (esc_html(stripslashes($_POST['enable_filmstrip'])) == 0)) {
|
134 |
$film_pos = 'none';
|
@@ -227,6 +234,7 @@ class WDSControllerSliders_wds {
|
|
227 |
'timer_bar_color' => $timer_bar_color,
|
228 |
'timer_bar_transparent' => $timer_bar_transparent,
|
229 |
'layer_out_next' => $layer_out_next,
|
|
|
230 |
), array(
|
231 |
'%s',
|
232 |
'%d',
|
@@ -295,7 +303,9 @@ class WDSControllerSliders_wds {
|
|
295 |
'%s',
|
296 |
'%d',
|
297 |
'%d',
|
|
|
298 |
));
|
|
|
299 |
}
|
300 |
else {
|
301 |
$save = $wpdb->update($wpdb->prefix . 'wdsslider', array(
|
@@ -366,6 +376,7 @@ class WDSControllerSliders_wds {
|
|
366 |
'timer_bar_color' => $timer_bar_color,
|
367 |
'timer_bar_transparent' => $timer_bar_transparent,
|
368 |
'layer_out_next' => $layer_out_next,
|
|
|
369 |
), array('id' => $slider_id));
|
370 |
}
|
371 |
if ($save !== FALSE) {
|
@@ -382,17 +393,20 @@ class WDSControllerSliders_wds {
|
|
382 |
if (!$slider_id) {
|
383 |
$slider_id = $wpdb->get_var('SELECT MAX(id) FROM ' . $wpdb->prefix . 'wdsslider');
|
384 |
}
|
385 |
-
$del_slide_ids_string = (isset($_POST['del_slide_ids_string']) ? esc_html(stripslashes($_POST['del_slide_ids_string'])) : '');
|
386 |
-
$del_slide_id_array = explode(',', $del_slide_ids_string);
|
387 |
-
foreach ($del_slide_id_array as $del_slide_id) {
|
388 |
-
if ($del_slide_id) {
|
389 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'wdsslide WHERE id="%d"', $del_slide_id));
|
390 |
-
}
|
391 |
-
}
|
392 |
$slide_ids_string = (isset($_POST['slide_ids_string']) ? esc_html(stripslashes($_POST['slide_ids_string'])) : '');
|
393 |
$slide_id_array = explode(',', $slide_ids_string);
|
|
|
|
|
|
|
|
|
|
|
|
|
394 |
foreach ($slide_id_array as $slide_id) {
|
395 |
if ($slide_id) {
|
|
|
|
|
|
|
|
|
396 |
$title = ((isset($_POST['title' . $slide_id])) ? esc_html(stripslashes($_POST['title' . $slide_id])) : '');
|
397 |
$type = ((isset($_POST['type' . $slide_id])) ? esc_html(stripslashes($_POST['type' . $slide_id])) : '');
|
398 |
$order = ((isset($_POST['order' . $slide_id])) ? esc_html(stripslashes($_POST['order' . $slide_id])) : '');
|
@@ -420,8 +434,10 @@ class WDSControllerSliders_wds {
|
|
420 |
'%s',
|
421 |
'%s',
|
422 |
));
|
423 |
-
|
424 |
-
|
|
|
|
|
425 |
}
|
426 |
else {
|
427 |
$save = $wpdb->update($wpdb->prefix . 'wdsslide', array(
|
@@ -434,7 +450,9 @@ class WDSControllerSliders_wds {
|
|
434 |
'image_url' => $image_url,
|
435 |
'thumb_url' => $thumb_url,
|
436 |
), array('id' => $slide_id));
|
437 |
-
|
|
|
|
|
438 |
}
|
439 |
}
|
440 |
}
|
@@ -442,54 +460,47 @@ class WDSControllerSliders_wds {
|
|
442 |
|
443 |
public function save_layer_db($slide_id, $slide_id_pr) {
|
444 |
global $wpdb;
|
445 |
-
$del_layer_ids_string = (isset($_POST['slide' . $slide_id . '_del_layer_ids_string']) ? esc_html(stripslashes($_POST['slide' . $slide_id . '_del_layer_ids_string'])) : '');
|
446 |
-
$del_layer_id_array = explode(',', $del_layer_ids_string);
|
447 |
-
foreach ($del_layer_id_array as $del_layer_id) {
|
448 |
-
if ($del_layer_id) {
|
449 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'wdslayer WHERE id="%d"', $del_layer_id));
|
450 |
-
}
|
451 |
-
}
|
452 |
$layer_ids_string = (isset($_POST['slide' . $slide_id . '_layer_ids_string']) ? esc_html(stripslashes($_POST['slide' . $slide_id . '_layer_ids_string'])) : '');
|
453 |
$layer_id_array = explode(',', $layer_ids_string);
|
454 |
foreach ($layer_id_array as $layer_id) {
|
455 |
if ($layer_id) {
|
456 |
$prefix = 'slide' . $slide_id . '_layer' . $layer_id;
|
457 |
-
$
|
458 |
-
$
|
459 |
-
$
|
460 |
-
$
|
461 |
-
$
|
462 |
-
$
|
463 |
-
$
|
464 |
-
$left = ((isset($
|
465 |
-
$top = ((isset($
|
466 |
-
$start = ((isset($
|
467 |
-
$end = ((isset($
|
468 |
-
$published = ((isset($
|
469 |
-
$color = ((isset($
|
470 |
-
$size = ((isset($
|
471 |
-
$ffamily = ((isset($
|
472 |
-
$fweight = ((isset($
|
473 |
-
$padding = ((isset($
|
474 |
-
$fbgcolor = ((isset($
|
475 |
-
$transparent = ((isset($
|
476 |
-
$border_width = ((isset($
|
477 |
-
$border_style = ((isset($
|
478 |
-
$border_color = ((isset($
|
479 |
-
$border_radius = ((isset($
|
480 |
-
$shadow = ((isset($
|
481 |
-
$image_url = ((isset($
|
482 |
-
$image_width = ((isset($
|
483 |
-
$image_height = ((isset($
|
484 |
-
$image_scale = ((isset($
|
485 |
-
$alt = ((isset($
|
486 |
-
$imgtransparent = ((isset($
|
487 |
-
$social_button = ((isset($
|
488 |
-
$hover_color = ((isset($
|
489 |
-
$layer_effect_in = ((isset($
|
490 |
-
$layer_effect_out = ((isset($
|
491 |
-
$duration_eff_in = ((isset($
|
492 |
-
$duration_eff_out = ((isset($
|
493 |
if ($title) {
|
494 |
if (strpos($layer_id, 'pr_') !== FALSE) {
|
495 |
$save = $wpdb->insert($wpdb->prefix . 'wdslayer', array(
|
@@ -611,8 +622,6 @@ class WDSControllerSliders_wds {
|
|
611 |
}
|
612 |
|
613 |
public function set_watermark() {
|
614 |
-
$message = $this->save_slider_db();
|
615 |
-
$this->save_slide_db();
|
616 |
global $wpdb;
|
617 |
$slider_id = WDW_S_Library::get('current_id', 0);
|
618 |
if (!$slider_id) {
|
@@ -623,14 +632,17 @@ class WDSControllerSliders_wds {
|
|
623 |
$slider = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'wdsslider WHERE `id`="%d"', $slider_id));
|
624 |
|
625 |
switch ($slider->built_in_watermark_type) {
|
626 |
-
case 'text':
|
627 |
foreach ($slider_images as $slider_image) {
|
628 |
if ($slider_image) {
|
629 |
$slider_image_dir = str_replace(site_url() . '/', ABSPATH, $slider_image);
|
630 |
-
$
|
631 |
-
$
|
632 |
-
$
|
633 |
-
$new_image = $
|
|
|
|
|
|
|
634 |
if (!file_exists($new_image)) {
|
635 |
copy($slider_image_dir, $new_image);
|
636 |
}
|
@@ -638,14 +650,18 @@ class WDSControllerSliders_wds {
|
|
638 |
}
|
639 |
}
|
640 |
break;
|
641 |
-
|
|
|
642 |
foreach ($slider_images as $slider_image) {
|
643 |
if ($slider_image) {
|
644 |
$slider_image_dir = str_replace(site_url() . '/', ABSPATH, $slider_image);
|
645 |
-
$
|
646 |
-
$
|
647 |
-
$
|
648 |
-
$new_image = $
|
|
|
|
|
|
|
649 |
if (!file_exists($new_image)) {
|
650 |
copy($slider_image_dir, $new_image);
|
651 |
}
|
@@ -654,50 +670,45 @@ class WDSControllerSliders_wds {
|
|
654 |
}
|
655 |
}
|
656 |
break;
|
|
|
|
|
|
|
|
|
657 |
}
|
658 |
-
|
659 |
-
$nav_tab = WDW_S_Library::get('nav_tab', 'global');
|
660 |
-
$tab = WDW_S_Library::get('tab', 'settings');
|
661 |
-
$sub_tab = WDW_S_Library::get('sub_tab', '');
|
662 |
-
$page = WDW_S_Library::get('page');
|
663 |
-
WDW_S_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $slider_id, 'nav_tab' => $nav_tab, 'tab' => $tab, 'sub_tab' => $sub_tab, 'message' => $message), admin_url('admin.php')));
|
664 |
}
|
665 |
|
666 |
public function reset_watermark() {
|
667 |
-
$this->save_slider_db();
|
668 |
-
$this->save_slide_db();
|
669 |
global $wpdb;
|
670 |
$slider_id = WDW_S_Library::get('current_id', 0);
|
671 |
if (!$slider_id) {
|
672 |
$slider_id = $wpdb->get_var('SELECT MAX(id) FROM ' . $wpdb->prefix . 'wdsslider');
|
673 |
}
|
674 |
-
|
675 |
$slider_images = $wpdb->get_col($wpdb->prepare('SELECT image_url FROM ' . $wpdb->prefix . 'wdsslide WHERE `slider_id`="%d"', $slider_id));
|
676 |
foreach ($slider_images as $slider_image) {
|
677 |
if ($slider_image) {
|
678 |
$slider_image_dir = str_replace(site_url() . '/', ABSPATH, $slider_image);
|
679 |
-
$
|
680 |
-
$
|
681 |
-
$
|
682 |
-
$new_image = $
|
683 |
if (file_exists($new_image)) {
|
684 |
copy($new_image, $slider_image_dir);
|
685 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
686 |
}
|
687 |
}
|
688 |
-
|
689 |
-
require_once WD_S_DIR . "/admin/models/WDSModelSliders_wds.php";
|
690 |
-
$model = new WDSModelSliders_wds();
|
691 |
-
|
692 |
-
require_once WD_S_DIR . "/admin/views/WDSViewSliders_wds.php";
|
693 |
-
$view = new WDSViewSliders_wds($model);
|
694 |
-
echo WDW_S_Library::message('Watermark Succesfully Removed.', 'updated');
|
695 |
-
$view->edit($slider_id);
|
696 |
}
|
697 |
|
698 |
public function reset() {
|
699 |
-
$this->save_slider_db();
|
700 |
-
$this->save_slide_db();
|
701 |
global $wpdb;
|
702 |
$slider_id = WDW_S_Library::get('current_id', 0);
|
703 |
if (!$slider_id) {
|
55 |
|
56 |
require_once WD_S_DIR . "/admin/views/WDSViewSliders_wds.php";
|
57 |
$view = new WDSViewSliders_wds($model);
|
58 |
+
$id = ((isset($_POST['current_id']) && esc_html(stripslashes($_POST['current_id'])) != '') ? esc_html(stripslashes($_POST['current_id'])) : 0);
|
59 |
$view->edit($id);
|
60 |
}
|
61 |
|
62 |
public function save() {
|
|
|
|
|
63 |
$page = WDW_S_Library::get('page');
|
64 |
+
WDW_S_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => 1), admin_url('admin.php')));
|
65 |
}
|
66 |
|
67 |
public function apply() {
|
68 |
+
$this->save_slider_db();
|
69 |
$this->save_slide_db();
|
70 |
+
$this->edit();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
}
|
72 |
+
|
73 |
+
// public function save_slide() {
|
74 |
+
// $this->save_slide_db();
|
75 |
+
// $this->edit();
|
76 |
+
// }
|
77 |
|
78 |
public function save_slider_db() {
|
79 |
global $wpdb;
|
80 |
+
$del_slide_ids_string = (isset($_POST['del_slide_ids_string']) ? substr(esc_html(stripslashes($_POST['del_slide_ids_string'])), 0, -1) : '');
|
81 |
+
if ($del_slide_ids_string) {
|
82 |
+
$wpdb->query('DELETE FROM ' . $wpdb->prefix . 'wdsslide WHERE id IN (' . $del_slide_ids_string . ')');
|
83 |
+
}
|
84 |
+
if (get_option("wds_theme_version")) {
|
85 |
+
$allow = FALSE;
|
86 |
+
}
|
87 |
+
else {
|
88 |
+
$allow = TRUE;
|
89 |
+
}
|
90 |
$slider_id = (isset($_POST['current_id']) ? (int) $_POST['current_id'] : 0);
|
91 |
$name = ((isset($_POST['name'])) ? esc_html(stripslashes($_POST['name'])) : '');
|
92 |
$published = ((isset($_POST['published'])) ? (int) esc_html(stripslashes($_POST['published'])) : 1);
|
93 |
$full_width = ((isset($_POST['full_width'])) ? (int) esc_html(stripslashes($_POST['full_width'])) : 0);
|
94 |
+
$spider_uploader = ((isset($_POST['spider_uploader'])) ? (int) esc_html(stripslashes($_POST['spider_uploader'])) : 1);
|
95 |
$width = ((isset($_POST['width'])) ? (int) esc_html(stripslashes($_POST['width'])) : 800);
|
96 |
$height = ((isset($_POST['height'])) ? (int) esc_html((stripslashes($_POST['height']))) : 300);
|
97 |
$bg_fit = ((isset($_POST['bg_fit'])) ? esc_html(stripslashes($_POST['bg_fit'])) : 'cover');
|
107 |
$background_transparent = ((isset($_POST['background_transparent'])) ? esc_html(stripslashes($_POST['background_transparent'])) : 100);
|
108 |
$glb_border_width = ((isset($_POST['glb_border_width'])) ? (int) esc_html(stripslashes($_POST['glb_border_width'])) : 0);
|
109 |
$glb_border_style = ((isset($_POST['glb_border_style'])) ? esc_html(stripslashes($_POST['glb_border_style'])) : 'none');
|
110 |
+
$glb_border_color = ((isset($_POST['glb_border_color'])) ? esc_html(stripslashes($_POST['glb_border_color'])) : '000000');
|
111 |
$glb_border_radius = ((isset($_POST['glb_border_radius'])) ? esc_html(stripslashes($_POST['glb_border_radius'])) : '');
|
112 |
$glb_margin = ((isset($_POST['glb_margin'])) ? (int) esc_html(stripslashes($_POST['glb_margin'])) : 0);
|
113 |
$glb_box_shadow = ((isset($_POST['glb_box_shadow'])) ? esc_html(stripslashes($_POST['glb_box_shadow'])) : '');
|
116 |
$prev_next_butt = ((isset($_POST['prev_next_butt'])) ? (int) esc_html(stripslashes($_POST['prev_next_butt'])) : 1);
|
117 |
$play_paus_butt = ((isset($_POST['play_paus_butt'])) ? (int) esc_html(stripslashes($_POST['play_paus_butt'])) : 0);
|
118 |
$navigation = ((isset($_POST['navigation'])) ? esc_html(stripslashes($_POST['navigation'])) : 'hover');
|
119 |
+
$rl_butt_style = ((isset($_POST['rl_butt_style']) && $allow) ? esc_html(stripslashes($_POST['rl_butt_style'])) : 'fa-angle-double');
|
120 |
+
$rl_butt_size = ((isset($_POST['rl_butt_size']) && $allow) ? (int) esc_html(stripslashes($_POST['rl_butt_size'])) : 40);
|
121 |
+
$pp_butt_size = ((isset($_POST['pp_butt_size']) && $allow) ? (int) esc_html(stripslashes($_POST['pp_butt_size'])) : 40);
|
122 |
+
$butts_color = ((isset($_POST['butts_color']) && $allow) ? esc_html(stripslashes($_POST['butts_color'])) : '000000');
|
123 |
+
$butts_transparent = ((isset($_POST['butts_transparent']) && $allow) ? (int) esc_html(stripslashes($_POST['butts_transparent'])) : 50);
|
124 |
+
$hover_color = ((isset($_POST['hover_color']) && $allow) ? esc_html(stripslashes($_POST['hover_color'])) : '000000');
|
125 |
+
$nav_border_width = ((isset($_POST['nav_border_width']) && $allow) ? (int) esc_html(stripslashes($_POST['nav_border_width'])) : 0);
|
126 |
+
$nav_border_style = ((isset($_POST['nav_border_style']) && $allow) ? esc_html(stripslashes($_POST['nav_border_style'])) : 'none');
|
127 |
$nav_border_color = ((isset($_POST['nav_border_color'])) ? esc_html(stripslashes($_POST['nav_border_color'])) : 'FFFFFF');
|
128 |
+
$nav_border_radius = ((isset($_POST['nav_border_radius']) && $allow) ? esc_html(stripslashes($_POST['nav_border_radius'])) : '20px');
|
129 |
+
$nav_bg_color = ((isset($_POST['nav_bg_color']) && $allow) ? esc_html(stripslashes($_POST['nav_bg_color'])) : 'FFFFFF');
|
130 |
$bull_position = ((isset($_POST['bull_position'])) ? esc_html(stripslashes($_POST['bull_position'])) : 'bottom');
|
131 |
if (isset($_POST['enable_bullets']) && (esc_html(stripslashes($_POST['enable_bullets'])) == 0)) {
|
132 |
$bull_position = 'none';
|
133 |
}
|
134 |
+
$bull_style = ((isset($_POST['bull_style']) && $allow) ? esc_html(stripslashes($_POST['bull_style'])) : 'fa-circle-o');
|
135 |
+
$bull_size = ((isset($_POST['bull_size']) && $allow) ? (int) esc_html(stripslashes($_POST['bull_size'])) : 25);
|
136 |
+
$bull_color = ((isset($_POST['bull_color']) && $allow) ? esc_html(stripslashes($_POST['bull_color'])) : 'FFFFFF');
|
137 |
+
$bull_act_color = ((isset($_POST['bull_act_color']) && $allow) ? esc_html(stripslashes($_POST['bull_act_color'])) : 'FFFFFF');
|
138 |
+
$bull_margin = ((isset($_POST['bull_margin']) && $allow) ? (int) esc_html(stripslashes($_POST['bull_margin'])) : 3);
|
139 |
$film_pos = ((isset($_POST['film_pos'])) ? esc_html(stripslashes($_POST['film_pos'])) : 'none');
|
140 |
if (isset($_POST['enable_filmstrip']) && (esc_html(stripslashes($_POST['enable_filmstrip'])) == 0)) {
|
141 |
$film_pos = 'none';
|
234 |
'timer_bar_color' => $timer_bar_color,
|
235 |
'timer_bar_transparent' => $timer_bar_transparent,
|
236 |
'layer_out_next' => $layer_out_next,
|
237 |
+
'spider_uploader' => $spider_uploader,
|
238 |
), array(
|
239 |
'%s',
|
240 |
'%d',
|
303 |
'%s',
|
304 |
'%d',
|
305 |
'%d',
|
306 |
+
'%d',
|
307 |
));
|
308 |
+
$_POST['current_id'] = (int) $wpdb->get_var('SELECT MAX(`id`) FROM ' . $wpdb->prefix . 'wdsslider');
|
309 |
}
|
310 |
else {
|
311 |
$save = $wpdb->update($wpdb->prefix . 'wdsslider', array(
|
376 |
'timer_bar_color' => $timer_bar_color,
|
377 |
'timer_bar_transparent' => $timer_bar_transparent,
|
378 |
'layer_out_next' => $layer_out_next,
|
379 |
+
'spider_uploader' => $spider_uploader,
|
380 |
), array('id' => $slider_id));
|
381 |
}
|
382 |
if ($save !== FALSE) {
|
393 |
if (!$slider_id) {
|
394 |
$slider_id = $wpdb->get_var('SELECT MAX(id) FROM ' . $wpdb->prefix . 'wdsslider');
|
395 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
396 |
$slide_ids_string = (isset($_POST['slide_ids_string']) ? esc_html(stripslashes($_POST['slide_ids_string'])) : '');
|
397 |
$slide_id_array = explode(',', $slide_ids_string);
|
398 |
+
if (get_option("wds_theme_version")) {
|
399 |
+
$allow = FALSE;
|
400 |
+
}
|
401 |
+
else {
|
402 |
+
$allow = TRUE;
|
403 |
+
}
|
404 |
foreach ($slide_id_array as $slide_id) {
|
405 |
if ($slide_id) {
|
406 |
+
$del_layer_ids_string = (isset($_POST['slide' . $slide_id . '_del_layer_ids_string']) ? substr(esc_html(stripslashes($_POST['slide' . $slide_id . '_del_layer_ids_string'])), 0, -1) : '');
|
407 |
+
if ($del_layer_ids_string) {
|
408 |
+
$wpdb->query('DELETE FROM ' . $wpdb->prefix . 'wdslayer WHERE id IN (' . $del_layer_ids_string . ')');
|
409 |
+
}
|
410 |
$title = ((isset($_POST['title' . $slide_id])) ? esc_html(stripslashes($_POST['title' . $slide_id])) : '');
|
411 |
$type = ((isset($_POST['type' . $slide_id])) ? esc_html(stripslashes($_POST['type' . $slide_id])) : '');
|
412 |
$order = ((isset($_POST['order' . $slide_id])) ? esc_html(stripslashes($_POST['order' . $slide_id])) : '');
|
434 |
'%s',
|
435 |
'%s',
|
436 |
));
|
437 |
+
if ($allow) {
|
438 |
+
$slide_id_pr = $wpdb->get_var('SELECT MAX(id) FROM ' . $wpdb->prefix . 'wdsslide');
|
439 |
+
$this->save_layer_db($slide_id, $slide_id_pr);
|
440 |
+
}
|
441 |
}
|
442 |
else {
|
443 |
$save = $wpdb->update($wpdb->prefix . 'wdsslide', array(
|
450 |
'image_url' => $image_url,
|
451 |
'thumb_url' => $thumb_url,
|
452 |
), array('id' => $slide_id));
|
453 |
+
if ($allow) {
|
454 |
+
$this->save_layer_db($slide_id, $slide_id);
|
455 |
+
}
|
456 |
}
|
457 |
}
|
458 |
}
|
460 |
|
461 |
public function save_layer_db($slide_id, $slide_id_pr) {
|
462 |
global $wpdb;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
463 |
$layer_ids_string = (isset($_POST['slide' . $slide_id . '_layer_ids_string']) ? esc_html(stripslashes($_POST['slide' . $slide_id . '_layer_ids_string'])) : '');
|
464 |
$layer_id_array = explode(',', $layer_ids_string);
|
465 |
foreach ($layer_id_array as $layer_id) {
|
466 |
if ($layer_id) {
|
467 |
$prefix = 'slide' . $slide_id . '_layer' . $layer_id;
|
468 |
+
$json_string = (isset($_POST[$prefix . '_json']) ? stripslashes($_POST[$prefix . '_json']) : '');
|
469 |
+
$params_array = json_decode($json_string, TRUE);
|
470 |
+
$title = ((isset($params_array['title'])) ? esc_html(stripslashes($params_array['title'])) : '');
|
471 |
+
$type = ((isset($params_array['type'])) ? esc_html(stripslashes($params_array['type'])) : '');
|
472 |
+
$depth = ((isset($params_array['depth'])) ? esc_html(stripslashes($params_array['depth'])) : '');
|
473 |
+
$text = ((isset($params_array['text'])) ? stripslashes($params_array['text']) : '');
|
474 |
+
$link = ((isset($params_array['link'])) ? esc_html(stripslashes($params_array['link'])) : '');
|
475 |
+
$left = ((isset($params_array['left'])) ? esc_html(stripslashes($params_array['left'])) : '');
|
476 |
+
$top = ((isset($params_array['top'])) ? esc_html(stripslashes($params_array['top'])) : '');
|
477 |
+
$start = ((isset($params_array['start'])) ? esc_html(stripslashes($params_array['start'])) : '');
|
478 |
+
$end = ((isset($params_array['end'])) ? esc_html(stripslashes($params_array['end'])) : '');
|
479 |
+
$published = ((isset($params_array['published'])) ? esc_html(stripslashes($params_array['published'])) : '');
|
480 |
+
$color = ((isset($params_array['color'])) ? esc_html(stripslashes($params_array['color'])) : '');
|
481 |
+
$size = ((isset($params_array['size'])) ? esc_html(stripslashes($params_array['size'])) : '');
|
482 |
+
$ffamily = ((isset($params_array['ffamily'])) ? esc_html(stripslashes($params_array['ffamily'])) : '');
|
483 |
+
$fweight = ((isset($params_array['fweight'])) ? esc_html(stripslashes($params_array['fweight'])) : '');
|
484 |
+
$padding = ((isset($params_array['padding'])) ? esc_html(stripslashes($params_array['padding'])) : '');
|
485 |
+
$fbgcolor = ((isset($params_array['fbgcolor'])) ? esc_html(stripslashes($params_array['fbgcolor'])) : '');
|
486 |
+
$transparent = ((isset($params_array['transparent'])) ? esc_html(stripslashes($params_array['transparent'])) : '');
|
487 |
+
$border_width = ((isset($params_array['border_width'])) ? esc_html(stripslashes($params_array['border_width'])) : '');
|
488 |
+
$border_style = ((isset($params_array['border_style'])) ? esc_html(stripslashes($params_array['border_style'])) : '');
|
489 |
+
$border_color = ((isset($params_array['border_color'])) ? esc_html(stripslashes($params_array['border_color'])) : '');
|
490 |
+
$border_radius = ((isset($params_array['border_radius'])) ? esc_html(stripslashes($params_array['border_radius'])) : '');
|
491 |
+
$shadow = ((isset($params_array['shadow'])) ? esc_html(stripslashes($params_array['shadow'])) : '');
|
492 |
+
$image_url = ((isset($params_array['image_url'])) ? esc_html(stripslashes($params_array['image_url'])) : '');
|
493 |
+
$image_width = ((isset($params_array['image_width'])) ? esc_html(stripslashes($params_array['image_width'])) : '');
|
494 |
+
$image_height = ((isset($params_array['image_height'])) ? esc_html(stripslashes($params_array['image_height'])) : '');
|
495 |
+
$image_scale = ((isset($params_array['image_scale'])) ? esc_html(stripslashes($params_array['image_scale'])) : '');
|
496 |
+
$alt = ((isset($params_array['alt'])) ? esc_html(stripslashes($params_array['alt'])) : '');
|
497 |
+
$imgtransparent = ((isset($params_array['imgtransparent'])) ? esc_html(stripslashes($params_array['imgtransparent'])) : '');
|
498 |
+
$social_button = ((isset($params_array['social_button'])) ? esc_html(stripslashes($params_array['social_button'])) : '');
|
499 |
+
$hover_color = ((isset($params_array['hover_color'])) ? esc_html(stripslashes($params_array['hover_color'])) : '');
|
500 |
+
$layer_effect_in = ((isset($params_array['layer_effect_in'])) ? esc_html(stripslashes($params_array['layer_effect_in'])) : '');
|
501 |
+
$layer_effect_out = ((isset($params_array['layer_effect_out'])) ? esc_html(stripslashes($params_array['layer_effect_out'])) : '');
|
502 |
+
$duration_eff_in = ((isset($params_array['duration_eff_in'])) ? esc_html(stripslashes($params_array['duration_eff_in'])) : 3);
|
503 |
+
$duration_eff_out = ((isset($params_array['duration_eff_out'])) ? esc_html(stripslashes($params_array['duration_eff_out'])) : 3);
|
504 |
if ($title) {
|
505 |
if (strpos($layer_id, 'pr_') !== FALSE) {
|
506 |
$save = $wpdb->insert($wpdb->prefix . 'wdslayer', array(
|
622 |
}
|
623 |
|
624 |
public function set_watermark() {
|
|
|
|
|
625 |
global $wpdb;
|
626 |
$slider_id = WDW_S_Library::get('current_id', 0);
|
627 |
if (!$slider_id) {
|
632 |
$slider = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'wdsslider WHERE `id`="%d"', $slider_id));
|
633 |
|
634 |
switch ($slider->built_in_watermark_type) {
|
635 |
+
case 'text': {
|
636 |
foreach ($slider_images as $slider_image) {
|
637 |
if ($slider_image) {
|
638 |
$slider_image_dir = str_replace(site_url() . '/', ABSPATH, $slider_image);
|
639 |
+
$last_slash_pos = strrpos($slider_image_dir, '/') + 1;
|
640 |
+
$dest_dir = substr($slider_image_dir, 0, $last_slash_pos);
|
641 |
+
$image_name = substr($slider_image_dir, $last_slash_pos);
|
642 |
+
$new_image = $dest_dir . '.original/' . $image_name;
|
643 |
+
if (!is_dir($dest_dir . '.original')) {
|
644 |
+
mkdir($dest_dir . '.original', 0777);
|
645 |
+
}
|
646 |
if (!file_exists($new_image)) {
|
647 |
copy($slider_image_dir, $new_image);
|
648 |
}
|
650 |
}
|
651 |
}
|
652 |
break;
|
653 |
+
}
|
654 |
+
case 'image': {
|
655 |
foreach ($slider_images as $slider_image) {
|
656 |
if ($slider_image) {
|
657 |
$slider_image_dir = str_replace(site_url() . '/', ABSPATH, $slider_image);
|
658 |
+
$last_slash_pos = strrpos($slider_image_dir, '/') + 1;
|
659 |
+
$dest_dir = substr($slider_image_dir, 0, $last_slash_pos);
|
660 |
+
$image_name = substr($slider_image_dir, $last_slash_pos);
|
661 |
+
$new_image = $dest_dir . '.original/' . $image_name;
|
662 |
+
if (!is_dir($dest_dir . '.original')) {
|
663 |
+
mkdir($dest_dir . '.original', 0777);
|
664 |
+
}
|
665 |
if (!file_exists($new_image)) {
|
666 |
copy($slider_image_dir, $new_image);
|
667 |
}
|
670 |
}
|
671 |
}
|
672 |
break;
|
673 |
+
}
|
674 |
+
default: {
|
675 |
+
break;
|
676 |
+
}
|
677 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
678 |
}
|
679 |
|
680 |
public function reset_watermark() {
|
|
|
|
|
681 |
global $wpdb;
|
682 |
$slider_id = WDW_S_Library::get('current_id', 0);
|
683 |
if (!$slider_id) {
|
684 |
$slider_id = $wpdb->get_var('SELECT MAX(id) FROM ' . $wpdb->prefix . 'wdsslider');
|
685 |
}
|
|
|
686 |
$slider_images = $wpdb->get_col($wpdb->prepare('SELECT image_url FROM ' . $wpdb->prefix . 'wdsslide WHERE `slider_id`="%d"', $slider_id));
|
687 |
foreach ($slider_images as $slider_image) {
|
688 |
if ($slider_image) {
|
689 |
$slider_image_dir = str_replace(site_url() . '/', ABSPATH, $slider_image);
|
690 |
+
$last_slash_pos = strrpos($slider_image_dir, '/') + 1;
|
691 |
+
$dest_dir = substr($slider_image_dir, 0, $last_slash_pos);
|
692 |
+
$image_name = substr($slider_image_dir, $last_slash_pos);
|
693 |
+
$new_image = $dest_dir . '.original/' . $image_name;
|
694 |
if (file_exists($new_image)) {
|
695 |
copy($new_image, $slider_image_dir);
|
696 |
}
|
697 |
+
else {
|
698 |
+
// For 1.0.1 version.
|
699 |
+
$last_dot_pos = strrpos($slider_image_dir, '.');
|
700 |
+
$base_name = substr($slider_image_dir, 0, $last_dot_pos);
|
701 |
+
$ext = substr($slider_image_dir, strlen($base_name));
|
702 |
+
$new_image = $base_name . '-original' . $ext;
|
703 |
+
if (file_exists($new_image)) {
|
704 |
+
copy($new_image, $slider_image_dir);
|
705 |
+
}
|
706 |
+
}
|
707 |
}
|
708 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
709 |
}
|
710 |
|
711 |
public function reset() {
|
|
|
|
|
712 |
global $wpdb;
|
713 |
$slider_id = WDW_S_Library::get('current_id', 0);
|
714 |
if (!$slider_id) {
|
admin/models/WDSModelSliders_wds.php
CHANGED
@@ -32,7 +32,7 @@ class WDSModelSliders_wds {
|
|
32 |
$rows = array();
|
33 |
$rows[0] = new stdClass();
|
34 |
$rows[0]->id = 'pr1';
|
35 |
-
$rows[0]->title = 'Slide';
|
36 |
$rows[0]->type = 'image';
|
37 |
$rows[0]->image_url = '';
|
38 |
$rows[0]->thumb_url = '';
|
@@ -60,7 +60,7 @@ class WDSModelSliders_wds {
|
|
60 |
global $wpdb;
|
61 |
$where = ((isset($_POST['search_value'])) ? 'WHERE name LIKE "%' . esc_html(stripslashes($_POST['search_value'])) . '%"' : '');
|
62 |
$asc_or_desc = ((isset($_POST['asc_or_desc'])) ? esc_html(stripslashes($_POST['asc_or_desc'])) : 'asc');
|
63 |
-
$order_by = ' ORDER BY `' . ((isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) != '') ? esc_html(stripslashes($_POST['order_by'])) : 'id') . '` ' . $asc_or_desc;
|
64 |
if (isset($_POST['page_number']) && $_POST['page_number']) {
|
65 |
$limit = ((int) $_POST['page_number'] - 1) * 20;
|
66 |
}
|
@@ -85,15 +85,17 @@ class WDSModelSliders_wds {
|
|
85 |
else {
|
86 |
$row = new stdClass();
|
87 |
if ($reset && $id) {
|
88 |
-
$row = $wpdb->get_row($wpdb->prepare('SELECT name
|
89 |
}
|
90 |
else {
|
91 |
$row->name = '';
|
92 |
-
|
93 |
-
$row->height = 300;
|
94 |
}
|
95 |
$row->id = $id;
|
|
|
|
|
96 |
$row->full_width = 0;
|
|
|
97 |
$row->bg_fit = 'cover';
|
98 |
$row->align = 'center';
|
99 |
$row->effect = 'fade';
|
@@ -108,7 +110,7 @@ class WDSModelSliders_wds {
|
|
108 |
$row->background_transparent = 100;
|
109 |
$row->glb_border_width = 0;
|
110 |
$row->glb_border_style = 'none';
|
111 |
-
$row->glb_border_color = '
|
112 |
$row->glb_border_radius = '';
|
113 |
$row->glb_margin = 0;
|
114 |
$row->glb_box_shadow = '';
|
32 |
$rows = array();
|
33 |
$rows[0] = new stdClass();
|
34 |
$rows[0]->id = 'pr1';
|
35 |
+
$rows[0]->title = 'Slide 1';
|
36 |
$rows[0]->type = 'image';
|
37 |
$rows[0]->image_url = '';
|
38 |
$rows[0]->thumb_url = '';
|
60 |
global $wpdb;
|
61 |
$where = ((isset($_POST['search_value'])) ? 'WHERE name LIKE "%' . esc_html(stripslashes($_POST['search_value'])) . '%"' : '');
|
62 |
$asc_or_desc = ((isset($_POST['asc_or_desc'])) ? esc_html(stripslashes($_POST['asc_or_desc'])) : 'asc');
|
63 |
+
$order_by = ' ORDER BY `' . ((isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) != '' && esc_html(stripslashes($_POST['order_by'])) != 'order') ? esc_html(stripslashes($_POST['order_by'])) : 'id') . '` ' . $asc_or_desc;
|
64 |
if (isset($_POST['page_number']) && $_POST['page_number']) {
|
65 |
$limit = ((int) $_POST['page_number'] - 1) * 20;
|
66 |
}
|
85 |
else {
|
86 |
$row = new stdClass();
|
87 |
if ($reset && $id) {
|
88 |
+
$row = $wpdb->get_row($wpdb->prepare('SELECT name FROM ' . $wpdb->prefix . 'wdsslider WHERE id="%d"', $id));
|
89 |
}
|
90 |
else {
|
91 |
$row->name = '';
|
92 |
+
|
|
|
93 |
}
|
94 |
$row->id = $id;
|
95 |
+
$row->width = 800;
|
96 |
+
$row->height = 300;
|
97 |
$row->full_width = 0;
|
98 |
+
$row->spider_uploader = 1;
|
99 |
$row->bg_fit = 'cover';
|
100 |
$row->align = 'center';
|
101 |
$row->effect = 'fade';
|
110 |
$row->background_transparent = 100;
|
111 |
$row->glb_border_width = 0;
|
112 |
$row->glb_border_style = 'none';
|
113 |
+
$row->glb_border_color = '000000';
|
114 |
$row->glb_border_radius = '';
|
115 |
$row->glb_margin = 0;
|
116 |
$row->glb_box_shadow = '';
|
admin/models/WDSModelUninstall_wds.php
CHANGED
@@ -25,6 +25,7 @@ class WDSModelUninstall_wds {
|
|
25 |
$wpdb->query("DROP TABLE " . $wpdb->prefix . "wdslayer");
|
26 |
|
27 |
delete_option("wds_version");
|
|
|
28 |
}
|
29 |
////////////////////////////////////////////////////////////////////////////////////////
|
30 |
// Getters & Setters //
|
25 |
$wpdb->query("DROP TABLE " . $wpdb->prefix . "wdslayer");
|
26 |
|
27 |
delete_option("wds_version");
|
28 |
+
delete_option("wds_theme_version");
|
29 |
}
|
30 |
////////////////////////////////////////////////////////////////////////////////////////
|
31 |
// Getters & Setters //
|
admin/views/WDSViewSliders_wds.php
CHANGED
@@ -360,7 +360,26 @@ class WDSViewSliders_wds {
|
|
360 |
$built_in_watermark_fonts[] = $filename;
|
361 |
}
|
362 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
363 |
?>
|
|
|
|
|
|
|
|
|
|
|
364 |
<div style="clear: both; float: left; width: 99%;">
|
365 |
<div style="float: left; font-size: 14px; font-weight: bold;">
|
366 |
This section allows you to add/edit slider.
|
@@ -375,17 +394,31 @@ class WDSViewSliders_wds {
|
|
375 |
<form class="wrap" method="post" id="sliders_form" action="admin.php?page=sliders_wds" style="float: left; width: 99%;">
|
376 |
<span class="slider-icon"></span>
|
377 |
<h2><?php echo $page_title; ?></h2>
|
378 |
-
<div style="float: right; position: absolute; right: 11px; z-index: 50;">
|
379 |
-
<input class="button-secondary" type="
|
380 |
-
spider_set_input_value('task', 'save')
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
389 |
<input class="button-secondary" type="submit" onclick="spider_set_input_value('task', 'cancel')" value="Cancel" />
|
390 |
</div>
|
391 |
<div class="wds_tabs">
|
@@ -428,9 +461,9 @@ class WDSViewSliders_wds {
|
|
428 |
<tr>
|
429 |
<td class="spider_label"><label>Dimensions: </label></td>
|
430 |
<td>
|
431 |
-
<input type="text" name="width" id="width" value="<?php echo $row->width; ?>" class="spider_int_input" onchange="
|
432 |
-
<input type="text" name="height" id="height" value="<?php echo $row->height; ?>" class="spider_int_input" onchange="
|
433 |
-
<div class="spider_description">Maximum
|
434 |
</td>
|
435 |
</tr>
|
436 |
<tr>
|
@@ -438,6 +471,8 @@ class WDSViewSliders_wds {
|
|
438 |
<td>
|
439 |
<input type="radio" id="full_width1" name="full_width" <?php echo (($row->full_width) ? 'checked="checked"' : ''); ?> value="1" /><label for="full_width1">Yes</label>
|
440 |
<input type="radio" id="full_width0" name="full_width" <?php echo (($row->full_width) ? '' : 'checked="checked"'); ?> value="0" /><label for="full_width0">No</label>
|
|
|
|
|
441 |
</td>
|
442 |
</tr>
|
443 |
<tr>
|
@@ -460,6 +495,7 @@ class WDSViewSliders_wds {
|
|
460 |
}
|
461 |
?>
|
462 |
</select>
|
|
|
463 |
</td>
|
464 |
</tr>
|
465 |
<tr>
|
@@ -481,13 +517,17 @@ class WDSViewSliders_wds {
|
|
481 |
</tr>
|
482 |
<tr>
|
483 |
<td class="spider_label"><label for="time_intervval">Time Interval: </label></td>
|
484 |
-
<td
|
|
|
|
|
|
|
485 |
</tr>
|
486 |
<tr>
|
487 |
<td class="spider_label"><label>Autoplay: </label></td>
|
488 |
<td>
|
489 |
<input type="radio" id="autoplay1" name="autoplay" <?php echo (($row->autoplay) ? 'checked="checked"' : ''); ?> value="1" /><label for="autoplay1">Yes</label>
|
490 |
<input type="radio" id="autoplay0" name="autoplay" <?php echo (($row->autoplay) ? '' : 'checked="checked"'); ?> value="0" /><label for="autoplay0">No</label>
|
|
|
491 |
</td>
|
492 |
</tr>
|
493 |
<tr>
|
@@ -495,6 +535,7 @@ class WDSViewSliders_wds {
|
|
495 |
<td>
|
496 |
<input type="radio" id="shuffle1" name="shuffle" <?php echo (($row->shuffle) ? 'checked="checked"' : ''); ?> value="1" /><label for="shuffle1">Yes</label>
|
497 |
<input type="radio" id="shuffle0" name="shuffle" <?php echo (($row->shuffle) ? '' : 'checked="checked"'); ?> value="0" /><label for="shuffle0">No</label>
|
|
|
498 |
</td>
|
499 |
</tr>
|
500 |
<tr>
|
@@ -502,6 +543,7 @@ class WDSViewSliders_wds {
|
|
502 |
<td>
|
503 |
<input type="radio" id="music1" name="music" <?php echo (($row->music) ? 'checked="checked"' : ''); ?> value="1" onClick="bwg_enable_disable('', 'tr_music_url', 'music1')" /><label for="music1">Yes</label>
|
504 |
<input type="radio" id="music0" name="music" <?php echo (($row->music) ? '' : 'checked="checked"'); ?> value="0" onClick="bwg_enable_disable('none', 'tr_music_url', 'music0')" /><label for="music0">No</label>
|
|
|
505 |
</td>
|
506 |
</tr>
|
507 |
<tr id="tr_music_url">
|
@@ -519,6 +561,7 @@ class WDSViewSliders_wds {
|
|
519 |
<td>
|
520 |
<input type="radio" id="preload_images1" name="preload_images" <?php echo (($row->preload_images) ? 'checked="checked"' : ''); ?> value="1" /><label for="preload_images1">Yes</label>
|
521 |
<input type="radio" id="preload_images0" name="preload_images" <?php echo (($row->preload_images) ? '' : 'checked="checked"'); ?> value="0" /><label for="preload_images0">No</label>
|
|
|
522 |
</td>
|
523 |
</tr>
|
524 |
<tr>
|
@@ -543,6 +586,7 @@ class WDSViewSliders_wds {
|
|
543 |
?>
|
544 |
</select>
|
545 |
<input type="text" name="glb_border_color" id="glb_border_color" value="<?php echo $row->glb_border_color; ?>" class="color" />
|
|
|
546 |
</td>
|
547 |
</tr>
|
548 |
<tr>
|
@@ -556,6 +600,7 @@ class WDSViewSliders_wds {
|
|
556 |
<td class="spider_label"><label for="glb_margin">Margin: </label></td>
|
557 |
<td>
|
558 |
<input type="text" name="glb_margin" id="glb_margin" value="<?php echo $row->glb_margin; ?>" class="spider_int_input" onkeypress="return spider_check_isnum(event)" /> px
|
|
|
559 |
</td>
|
560 |
</tr>
|
561 |
<tr>
|
@@ -582,7 +627,15 @@ class WDSViewSliders_wds {
|
|
582 |
<td>
|
583 |
<input type="radio" name="layer_out_next" id="layer_out_next_1" value="1" <?php if ($row->layer_out_next) echo 'checked="checked"'; ?> /><label for="layer_out_next_1">Yes</label>
|
584 |
<input type="radio" name="layer_out_next" id="layer_out_next_0" value="0" <?php if (!$row->layer_out_next) echo 'checked="checked"'; ?> /><label for="layer_out_next_0">No</label>
|
585 |
-
<div class="spider_description"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
586 |
</td>
|
587 |
</tr>
|
588 |
<tr>
|
@@ -590,6 +643,7 @@ class WDSViewSliders_wds {
|
|
590 |
<td>
|
591 |
<input type="radio" id="published1" name="published" <?php echo (($row->published) ? 'checked="checked"' : ''); ?> value="1" /><label for="published1">Yes</label>
|
592 |
<input type="radio" id="published0" name="published" <?php echo (($row->published) ? '' : 'checked="checked"'); ?> value="0" /><label for="published0">No</label>
|
|
|
593 |
</td>
|
594 |
</tr>
|
595 |
</tbody>
|
@@ -605,7 +659,7 @@ class WDSViewSliders_wds {
|
|
605 |
<td>
|
606 |
<input type="radio" name="prev_next_butt" id="prev_next_butt_1" value="1" <?php if ($row->prev_next_butt) echo 'checked="checked"'; ?> /><label for="prev_next_butt_1">Yes</label>
|
607 |
<input type="radio" name="prev_next_butt" id="prev_next_butt_0" value="0" <?php if (!$row->prev_next_butt) echo 'checked="checked"'; ?> /><label for="prev_next_butt_0">No</label>
|
608 |
-
<div class="spider_description"
|
609 |
</td>
|
610 |
</tr>
|
611 |
<tr>
|
@@ -615,7 +669,7 @@ class WDSViewSliders_wds {
|
|
615 |
<td>
|
616 |
<input type="radio" name="play_paus_butt" id="play_paus_butt_1" value="1" <?php if ($row->play_paus_butt) echo 'checked="checked"'; ?> /><label for="play_paus_butt_1">Yes</label>
|
617 |
<input type="radio" name="play_paus_butt" id="play_paus_butt_0" value="0" <?php if (!$row->play_paus_butt) echo 'checked="checked"'; ?> /><label for="play_paus_butt_0">No</label>
|
618 |
-
<div class="spider_description"
|
619 |
</td>
|
620 |
</tr>
|
621 |
<tr>
|
@@ -625,13 +679,16 @@ class WDSViewSliders_wds {
|
|
625 |
<td>
|
626 |
<input type="radio" name="navigation" id="navigation_1" value="hover" <?php if ($row->navigation == 'hover') echo 'checked="checked"'; ?> /><label for="navigation_1">On hover</label>
|
627 |
<input type="radio" name="navigation" id="navigation_0" value="always" <?php if ($row->navigation == 'always' ) echo 'checked="checked"'; ?> /><label for="navigation_0">Always</label>
|
628 |
-
<div class="spider_description"
|
629 |
</td>
|
630 |
</tr>
|
|
|
|
|
|
|
631 |
<tr id="right_left_butt_style">
|
632 |
-
<td class="spider_label"><label for="rl_butt_style">Next / Previous buttons style: </label></td>
|
633 |
<td>
|
634 |
-
<select name="rl_butt_style" id="rl_butt_style"
|
635 |
<?php
|
636 |
foreach ($button_styles as $key => $button_style) {
|
637 |
?>
|
@@ -640,37 +697,42 @@ class WDSViewSliders_wds {
|
|
640 |
}
|
641 |
?>
|
642 |
</select>
|
|
|
643 |
</td>
|
644 |
</tr>
|
645 |
<tr id="right_left_butt_size">
|
646 |
-
<td class="spider_label"><label for="rl_butt_size">Next / Previous buttons size: </label></td>
|
647 |
<td>
|
648 |
-
<input type="text" name="rl_butt_size" id="rl_butt_size" value="<?php echo $row->rl_butt_size; ?>" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
|
|
|
649 |
</td>
|
650 |
</tr>
|
651 |
<tr id="play_pause_butt_size">
|
652 |
-
<td class="spider_label"><label for="pp_butt_size">Play / Pause button size: </label></td>
|
653 |
<td>
|
654 |
-
<input type="text" name="pp_butt_size" id="pp_butt_size" value="<?php echo $row->pp_butt_size; ?>" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
|
|
|
655 |
</td>
|
656 |
</tr>
|
657 |
<tr id="buttons_color">
|
658 |
-
<td class="spider_label"><label for="butts_color">Buttons color: </label></td>
|
659 |
<td>
|
660 |
-
<input type="text" name="butts_color" id="butts_color" value="<?php echo $row->butts_color; ?>" class="color"/>
|
|
|
661 |
</td>
|
662 |
</tr>
|
663 |
<tr>
|
664 |
-
<td class="spider_label"><label for="hover_color">Hover color: </label></td>
|
665 |
<td>
|
666 |
-
<input type="text" name="hover_color" id="hover_color" value="<?php echo $row->hover_color; ?>" class="color"/>
|
|
|
667 |
</td>
|
668 |
</tr>
|
669 |
<tr>
|
670 |
-
<td class="spider_label"><label for="nav_border_width">Border: </label></td>
|
671 |
<td>
|
672 |
-
<input type="text" name="nav_border_width" id="nav_border_width" value="<?php echo $row->nav_border_width; ?>" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
|
673 |
-
<select name="nav_border_style" id="nav_border_style"
|
674 |
<?php
|
675 |
foreach ($border_styles as $key => $border_style) {
|
676 |
?>
|
@@ -679,20 +741,21 @@ class WDSViewSliders_wds {
|
|
679 |
}
|
680 |
?>
|
681 |
</select>
|
682 |
-
<input type="text" name="nav_border_color" id="nav_border_color" value="<?php echo $row->nav_border_color; ?>" class="color"/>
|
|
|
683 |
</td>
|
684 |
</tr>
|
685 |
-
<td class="spider_label"><label for="nav_border_radius">Border radius: </label></td>
|
686 |
<td>
|
687 |
-
<input type="text" name="nav_border_radius" id="nav_border_radius" value="<?php echo $row->nav_border_radius; ?>" class="spider_char_input" />
|
688 |
<div class="spider_description">Use CSS type values.</div>
|
689 |
</td>
|
690 |
</tr>
|
691 |
<tr>
|
692 |
-
<td class="spider_label"><label for="nav_bg_color">Background color: </label></td>
|
693 |
<td>
|
694 |
-
<input type="text" name="nav_bg_color" id="nav_bg_color" value="<?php echo $row->nav_bg_color; ?>" class="color" />
|
695 |
-
<input type="text" name="butts_transparent" id="butts_transparent" value="<?php echo $row->butts_transparent; ?>" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
|
696 |
<div class="spider_description">Transparency value must be between 0 to 100.</div>
|
697 |
</td>
|
698 |
</tr>
|
@@ -707,6 +770,7 @@ class WDSViewSliders_wds {
|
|
707 |
<td>
|
708 |
<input type="radio" id="enable_bullets1" name="enable_bullets" <?php echo (($row->enable_bullets) ? 'checked="checked"' : ''); ?> value="1" /><label for="enable_bullets1">Yes</label>
|
709 |
<input type="radio" id="enable_bullets0" name="enable_bullets" <?php echo (($row->enable_bullets) ? '' : 'checked="checked"'); ?> value="0" /><label for="enable_bullets0">No</label>
|
|
|
710 |
</td>
|
711 |
</tr>
|
712 |
<tr>
|
@@ -716,12 +780,16 @@ class WDSViewSliders_wds {
|
|
716 |
<option value="top" <?php echo (($row->bull_position == "top") ? 'selected="selected"' : ''); ?>>Top</option>
|
717 |
<option value="bottom" <?php echo (($row->bull_position == "bottom") ? 'selected="selected"' : ''); ?>>Bottom</option>
|
718 |
</select>
|
|
|
719 |
</td>
|
720 |
</tr>
|
|
|
|
|
|
|
721 |
<tr>
|
722 |
-
<td class="spider_label"><label for="bull_style">Bullet style: </label></td>
|
723 |
<td>
|
724 |
-
<select name="bull_style" id="bull_style"
|
725 |
<?php
|
726 |
foreach ($bull_styles as $key => $bull_style) {
|
727 |
?>
|
@@ -730,30 +798,35 @@ class WDSViewSliders_wds {
|
|
730 |
}
|
731 |
?>
|
732 |
</select>
|
|
|
733 |
</td>
|
734 |
</tr>
|
735 |
<tr id="bullet_size">
|
736 |
-
<td class="spider_label"><label for="bull_size">Size: </label></td>
|
737 |
<td>
|
738 |
-
<input type="text" name="bull_size" id="bull_size" value="<?php echo $row->bull_size; ?>" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
|
|
|
739 |
</td>
|
740 |
</tr>
|
741 |
<tr id="bullets_color">
|
742 |
-
<td class="spider_label"><label for="bull_color">Color: </label></td>
|
743 |
<td>
|
744 |
-
<input type="text" name="bull_color" id="bull_color" value="<?php echo $row->bull_color; ?>" class="color"/>
|
|
|
745 |
</td>
|
746 |
</tr>
|
747 |
<tr id="bullets_act_color">
|
748 |
-
<td class="spider_label"><label for="bull_act_color">Active color: </label></td>
|
749 |
<td>
|
750 |
-
<input type="text" name="bull_act_color" id="bull_act_color" value="<?php echo $row->bull_act_color; ?>" class="color"/>
|
|
|
751 |
</td>
|
752 |
</tr>
|
753 |
<tr id="bullet_margin">
|
754 |
-
<td class="spider_label"><label for="bull_margin">Margin: </label></td>
|
755 |
<td>
|
756 |
-
<input type="text" name="bull_margin" id="bull_margin" value="<?php echo $row->bull_margin; ?>" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
|
|
|
757 |
</td>
|
758 |
</tr>
|
759 |
</tbody>
|
@@ -772,6 +845,7 @@ class WDSViewSliders_wds {
|
|
772 |
<td>
|
773 |
<input disabled="disabled" type="radio" id="enable_filmstrip1" name="enable_filmstrip" <?php echo (($row->enable_filmstrip) ? 'checked="checked"' : ''); ?> value="1" /><label for="filmstrip1">Yes</label>
|
774 |
<input disabled="disabled" type="radio" id="enable_filmstrip0" name="enable_filmstrip" <?php echo (($row->enable_filmstrip) ? '' : 'checked="checked"'); ?> value="0" /><label for="filmstrip0">No</label>
|
|
|
775 |
</td>
|
776 |
</tr>
|
777 |
<tr id="filmstrip_position">
|
@@ -783,6 +857,7 @@ class WDSViewSliders_wds {
|
|
783 |
<option value="bottom" <?php echo (($row->film_pos == "bottom") ? 'selected="selected"' : ''); ?>>Bottom</option>
|
784 |
<option value="left" <?php echo (($row->film_pos == "left") ? 'selected="selected"' : ''); ?>>Left</option>
|
785 |
</select>
|
|
|
786 |
</td>
|
787 |
</tr>
|
788 |
<tr id="filmstrip_size">
|
@@ -790,18 +865,21 @@ class WDSViewSliders_wds {
|
|
790 |
<td>
|
791 |
<input disabled="disabled" type="text" name="film_thumb_width" id="film_thumb_width" value="<?php echo $row->film_thumb_width; ?>" class="spider_int_input" onkeypress="return spider_check_isnum(event)" /> x
|
792 |
<input disabled="disabled" type="text" name="film_thumb_height" id="film_thumb_height" value="<?php echo $row->film_thumb_height; ?>" class="spider_int_input" onkeypress="return spider_check_isnum(event)" /> px
|
|
|
793 |
</td>
|
794 |
</tr>
|
795 |
<tr>
|
796 |
<td class="spider_label"><label for="film_bg_color">Background color: </label></td>
|
797 |
<td>
|
798 |
<input disabled="disabled" type="text" name="film_bg_color" id="film_bg_color" value="<?php echo $row->film_bg_color; ?>" class="color" />
|
|
|
799 |
</td>
|
800 |
</tr>
|
801 |
<tr id="filmstrip_thumb_margin">
|
802 |
<td class="spider_label"><label for="film_tmb_margin">Thumbnail margin: </label></td>
|
803 |
<td>
|
804 |
<input disabled="disabled" type="text" name="film_tmb_margin" id="film_tmb_margin" value="<?php echo $row->film_tmb_margin; ?>" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
|
|
|
805 |
</td>
|
806 |
</tr>
|
807 |
<tr>
|
@@ -818,12 +896,14 @@ class WDSViewSliders_wds {
|
|
818 |
?>
|
819 |
</select>
|
820 |
<input disabled="disabled" type="text" name="film_act_border_color" id="film_act_border_color" value="<?php echo $row->film_act_border_color; ?>" class="color"/>
|
|
|
821 |
</td>
|
822 |
</tr>
|
823 |
<tr>
|
824 |
<td class="spider_label"><label for="film_dac_transparent">Deactive transparency: </label></td>
|
825 |
<td>
|
826 |
<input disabled="disabled" type="text" name="film_dac_transparent" id="film_dac_transparent" value="<?php echo $row->film_dac_transparent; ?>" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
|
|
|
827 |
</td>
|
828 |
</tr>
|
829 |
</tbody>
|
@@ -837,6 +917,7 @@ class WDSViewSliders_wds {
|
|
837 |
<td>
|
838 |
<input type="radio" id="enable_time_bar1" name="enable_time_bar" <?php echo (($row->enable_time_bar) ? 'checked="checked"' : ''); ?> value="1" /><label for="time_bar1">Yes</label>
|
839 |
<input type="radio" id="enable_time_bar0" name="enable_time_bar" <?php echo (($row->enable_time_bar) ? '' : 'checked="checked"'); ?> value="0" /><label for="time_bar0">No</label>
|
|
|
840 |
</td>
|
841 |
</tr>
|
842 |
<tr>
|
@@ -846,12 +927,14 @@ class WDSViewSliders_wds {
|
|
846 |
<option value="top" <?php echo (($row->timer_bar_type == "top") ? 'selected="selected"' : ''); ?>>Line top</option>
|
847 |
<option value="bottom" <?php echo (($row->timer_bar_type == "bottom") ? 'selected="selected"' : ''); ?>>Line Bottom</option>
|
848 |
</select>
|
|
|
849 |
</td>
|
850 |
</tr>
|
851 |
<tr>
|
852 |
<td class="spider_label"><label for="timer_bar_size">Size: </label></td>
|
853 |
<td>
|
854 |
<input type="text" name="timer_bar_size" id="timer_bar_size" value="<?php echo $row->timer_bar_size; ?>" class="spider_int_input" onkeypress="return spider_check_isnum(event)" /> px
|
|
|
855 |
</td>
|
856 |
</tr>
|
857 |
<tr>
|
@@ -890,7 +973,7 @@ class WDSViewSliders_wds {
|
|
890 |
<label for="built_in_watermark_type_text">Text</label>
|
891 |
<input type="radio" name="built_in_watermark_type" id="built_in_watermark_type_image" value="image" <?php if ($row->built_in_watermark_type == 'image') echo 'checked="checked"'; ?> onClick="bwg_built_in_watermark('watermark_type_image')" onchange="preview_built_in_watermark()" />
|
892 |
<label for="built_in_watermark_type_image">Image</label>
|
893 |
-
<div class="spider_description"
|
894 |
</td>
|
895 |
</tr>
|
896 |
<tr id="tr_built_in_watermark_url">
|
@@ -899,7 +982,20 @@ class WDSViewSliders_wds {
|
|
899 |
</td>
|
900 |
<td>
|
901 |
<input type="text" id="built_in_watermark_url" name="built_in_watermark_url" style="width: 68%;" value="<?php echo $row->built_in_watermark_url; ?>" style="display:inline-block;" onchange="preview_built_in_watermark()" />
|
|
|
|
|
|
|
902 |
<input id="wat_img_add_butt" class="button-primary" type="button" onclick="spider_media_uploader('watermark', event); return false;" value="Add Image" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
903 |
<div class="spider_description">Only .png format is supported.</div>
|
904 |
</td>
|
905 |
</tr>
|
@@ -909,7 +1005,7 @@ class WDSViewSliders_wds {
|
|
909 |
</td>
|
910 |
<td>
|
911 |
<input type="text" name="built_in_watermark_text" id="built_in_watermark_text" style="width: 100%;" value="<?php echo $row->built_in_watermark_text; ?>" onchange="preview_built_in_watermark()" onkeypress="preview_built_in_watermark()" />
|
912 |
-
<div class="spider_description"
|
913 |
</td>
|
914 |
</tr>
|
915 |
<tr id="tr_built_in_watermark_size">
|
@@ -927,7 +1023,7 @@ class WDSViewSliders_wds {
|
|
927 |
</td>
|
928 |
<td>
|
929 |
<input type="text" name="built_in_watermark_font_size" id="built_in_watermark_font_size" value="<?php echo $row->built_in_watermark_font_size; ?>" class="spider_int_input" onchange="preview_built_in_watermark()" onkeypress="return spider_check_isnum(event)" /> px
|
930 |
-
<div class="spider_description"
|
931 |
</td>
|
932 |
</tr>
|
933 |
<tr id="tr_built_in_watermark_font">
|
@@ -956,7 +1052,7 @@ class WDSViewSliders_wds {
|
|
956 |
<?php
|
957 |
}
|
958 |
?>
|
959 |
-
<div class="spider_description"
|
960 |
</td>
|
961 |
</tr>
|
962 |
<tr id="tr_built_in_watermark_color">
|
@@ -993,14 +1089,14 @@ class WDSViewSliders_wds {
|
|
993 |
</tr>
|
994 |
</tbody>
|
995 |
</table>
|
996 |
-
<div class="spider_description"
|
997 |
</td>
|
998 |
</tr>
|
999 |
</tbody>
|
1000 |
</table>
|
1001 |
</td>
|
1002 |
<td style="width: 50%; vertical-align: top;height: 100%; display: table-cell;">
|
1003 |
-
<span id="preview_built_in_watermark" style=
|
1004 |
</td>
|
1005 |
</tr>
|
1006 |
</tbody>
|
@@ -1013,7 +1109,10 @@ class WDSViewSliders_wds {
|
|
1013 |
<td class="spider_label"><label for="css">Css: </label></td>
|
1014 |
</tr>
|
1015 |
<tr>
|
1016 |
-
<td style="width: 90%;"
|
|
|
|
|
|
|
1017 |
</tr>
|
1018 |
</tbody>
|
1019 |
</table>
|
@@ -1035,7 +1134,8 @@ class WDSViewSliders_wds {
|
|
1035 |
<?php
|
1036 |
foreach ($slides_row as $key => $slide_row) {
|
1037 |
?>
|
1038 |
-
<a id="wbs_subtab<?php echo $slide_row->id; ?>" class="connectedSortable <?php echo ((($id == 0 || !$sub_tab_type) && $key == 0) || ('slide' . $slide_row->id == $sub_tab_type)) ? 'wds_sub_active' : ''; ?>" href="#">
|
|
|
1039 |
<input type="text" id="title<?php echo $slide_row->id; ?>" name="title<?php echo $slide_row->id; ?>" value="<?php echo $slide_row->title; ?>" class="wds_tab_title" tab_type="slide<?php echo $slide_row->id; ?>" onclick="wds_change_sub_tab(this, 'wds_slide<?php echo $slide_row->id; ?>')"/>
|
1040 |
<span class="wds_tab_remove" title="Delete slide" onclick="wds_remove_slide('<?php echo $slide_row->id; ?>')"></span>
|
1041 |
<input type="hidden" name="order<?php echo $slide_row->id; ?>" id="order<?php echo $slide_row->id; ?>" value="<?php echo $slide_row->order; ?>" />
|
@@ -1049,31 +1149,28 @@ class WDSViewSliders_wds {
|
|
1049 |
<?php
|
1050 |
foreach ($slides_row as $key => $slide_row) {
|
1051 |
?>
|
1052 |
-
<div class="wds_box <?php echo ((($id == 0 || !$sub_tab_type) && $key == 0) || ('slide' . $slide_row->id == $sub_tab_type)) ? 'wds_sub_active' : ''; ?> wds_slide<?php echo $slide_row->id; ?>">
|
1053 |
<table class="ui-sortable<?php echo $slide_row->id; ?>">
|
1054 |
<thead><tr><td colspan="4"> </td></tr></thead>
|
1055 |
<tbody>
|
1056 |
<input type="hidden" name="type<?php echo $slide_row->id; ?>" id="type<?php echo $slide_row->id; ?>" value="<?php echo $slide_row->type; ?>" />
|
1057 |
-
<tr>
|
1058 |
-
<td class="spider_label"><label>Published: </label></td>
|
1059 |
-
<td>
|
1060 |
-
<input type="radio" id="published<?php echo $slide_row->id; ?>1" name="published<?php echo $slide_row->id; ?>" <?php echo (($slide_row->published) ? 'checked="checked"' : ''); ?> value="1" /><label for="published<?php echo $slide_row->id; ?>1">Yes</label>
|
1061 |
-
<input type="radio" id="published<?php echo $slide_row->id; ?>0" name="published<?php echo $slide_row->id; ?>" <?php echo (($slide_row->published) ? '' : 'checked="checked"'); ?> value="0" /><label for="published<?php echo $slide_row->id; ?>0">No</label>
|
1062 |
-
</td>
|
1063 |
-
</tr>
|
1064 |
-
<tr id="trlink<?php echo $slide_row->id; ?>" <?php echo $slide_row->type == 'image' ? '' : 'style="display: none;"'; ?>>
|
1065 |
-
<td class="spider_label">
|
1066 |
-
<label for="link<?php echo $slide_row->id; ?>">Link the slide: </label>
|
1067 |
-
</td>
|
1068 |
-
<td>
|
1069 |
-
<input id="link<?php echo $slide_row->id; ?>" type="text" size="39" value="<?php echo $slide_row->link; ?>" name="link<?php echo $slide_row->id; ?>" />
|
1070 |
-
<div class="spider_description">Use http:// and https:// for external links.</div>
|
1071 |
-
</td>
|
1072 |
-
</tr>
|
1073 |
<tr>
|
1074 |
<td colspan="4">
|
|
|
|
|
|
|
1075 |
<input type="button" class="button-primary" id="button_image_url<?php echo $slide_row->id; ?>" onclick="spider_media_uploader('<?php echo $slide_row->id; ?>', event); return false;" value="Add Image from Media Library" />
|
1076 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1077 |
<input type="button" class="button-secondary wds_free_button" onclick="alert('This functionality is disabled in free version.')" value="Add Video" />
|
1078 |
<input type="button" class="button-secondary" id="delete_image_url<?php echo $slide_row->id; ?>" onclick="spider_remove_url('button_image_url<?php echo $slide_row->id; ?>', 'image_url<?php echo $slide_row->id; ?>', 'delete_image_url<?php echo $slide_row->id; ?>', 'wds_preview_image<?php echo $slide_row->id; ?>')" value="Remove" />
|
1079 |
<input type="hidden" id="image_url<?php echo $slide_row->id; ?>" name="image_url<?php echo $slide_row->id; ?>" value="<?php echo $slide_row->image_url; ?>" style="display: inline-block;" />
|
@@ -1085,14 +1182,14 @@ class WDSViewSliders_wds {
|
|
1085 |
<div id="wds_preview_wrapper_<?php echo $slide_row->id; ?>" class="wds_preview_wrapper" style="width: <?php echo $row->width; ?>px; height: <?php echo $row->height; ?>px;">
|
1086 |
<div class="wds_preview" style="overflow: hidden; position: absolute; width: inherit; height: inherit; background-color: transparent; background-image: none; display: block;">
|
1087 |
<div id="wds_preview_image<?php echo $slide_row->id; ?>" class="wds_preview_image<?php echo $slide_row->id; ?>"
|
1088 |
-
style=
|
1089 |
-
background-image: url(
|
1090 |
background-position: center center;
|
1091 |
background-repeat: no-repeat;
|
1092 |
background-size: <?php echo $row->bg_fit; ?>;
|
1093 |
width: inherit;
|
1094 |
height: inherit;
|
1095 |
-
/*position: relative;*/
|
1096 |
<?php
|
1097 |
$layers_row = $this->model->get_layers_row_data($slide_row->id);
|
1098 |
if ($layers_row) {
|
@@ -1102,14 +1199,14 @@ class WDSViewSliders_wds {
|
|
1102 |
case 'text': {
|
1103 |
?>
|
1104 |
<span id="<?php echo $prefix; ?>" class="wds_draggable_<?php echo $slide_row->id; ?> wds_draggable ui-draggable" onclick="wds_showhide_layer('<?php echo $prefix; ?>_tbody', 1)"
|
1105 |
-
style="<?php echo $layer->image_width ? 'width: ' . $layer->image_width . '%; ' : ''; ?><?php echo $layer->image_height ? 'height: ' . $layer->image_height . '%; ' : ''; ?>word-break: <?php echo ($layer->image_scale ? 'keep-all' : 'break-all'); ?>; display: inline-block; position: absolute; left: <?php echo $layer->left; ?>px; top: <?php echo $layer->top; ?>px; z-index: <?php echo $layer->depth; ?>; color: #<?php echo $layer->color; ?>; font-size: <?php echo $layer->size; ?>px; line-height:
|
1106 |
<?php
|
1107 |
break;
|
1108 |
}
|
1109 |
case 'image': {
|
1110 |
?>
|
1111 |
<img id="<?php echo $prefix; ?>" class="wds_draggable_<?php echo $slide_row->id; ?> wds_draggable ui-draggable" onclick="wds_showhide_layer('<?php echo $prefix; ?>_tbody', 1)" src="<?php echo $layer->image_url; ?>"
|
1112 |
-
style="opacity: <?php echo (100 - $layer->imgtransparent) / 100; ?>; filter: Alpha(opacity=<?php echo 100 - $layer->imgtransparent; ?>); position: absolute; left: <?php echo $layer->left; ?>px; top: <?php echo $layer->top; ?>px; z-index: <?php echo $layer->depth; ?>; border: <?php echo $layer->border_width; ?>px <?php echo $layer->border_style; ?> #<?php echo $layer->border_color; ?>; border-radius: <?php echo $layer->border_radius; ?>; box-shadow: <?php echo $layer->shadow; ?>;
|
1113 |
<?php
|
1114 |
break;
|
1115 |
}
|
@@ -1132,10 +1229,39 @@ class WDSViewSliders_wds {
|
|
1132 |
</div>
|
1133 |
</td>
|
1134 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1135 |
<tr>
|
1136 |
<td colspan="4">
|
1137 |
-
<input type="button" class="button
|
1138 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1139 |
<input type="button" class="button-secondary button button-small wds_free_button" onclick="alert('This functionality is disabled in free version.'); return false;" value="Add Social Button Layer" />
|
1140 |
</td>
|
1141 |
</tr>
|
@@ -1150,7 +1276,7 @@ class WDSViewSliders_wds {
|
|
1150 |
<tr class="wds_layer_head_tr">
|
1151 |
<td class="wds_layer_head" colspan="4">
|
1152 |
<div class="handle connectedSortable" title="Drag to re-order"></div>
|
1153 |
-
<span class="wds_layer_label" onclick="wds_showhide_layer('<?php echo $prefix; ?>_tbody', 0)"><input id="<?php echo $prefix; ?>_title" name="<?php echo $prefix; ?>_title" type="text" class="wds_layer_title" style="width: 80px;" value="<?php echo $layer->title; ?>" /></span>
|
1154 |
<span class="wds_layer_remove" onclick="wds_delete_layer('<?php echo $slide_row->id; ?>', '<?php echo $layer->id; ?>')" title="Delete layer"></span>
|
1155 |
<span class="wds_layer_dublicate" onclick="wds_add_layer('<?php echo $layer->type; ?>', '<?php echo $slide_row->id; ?>', '', event, 1); wds_duplicate_layer('<?php echo $layer->type; ?>', '<?php echo $slide_row->id; ?>', '<?php echo $layer->id; ?>');" title="Duplicate layer"></span>
|
1156 |
<input id="<?php echo $prefix; ?>_depth" class="wds_layer_depth spider_int_input" type="text" onchange="jQuery('#<?php echo $prefix; ?>').css({zIndex: jQuery(this).val()})" onkeypress="return spider_check_isnum(event)" value="<?php echo $layer->depth; ?>" prefix="<?php echo $prefix; ?>" name="<?php echo $prefix; ?>_depth" title="z-index" />
|
@@ -1198,13 +1324,13 @@ class WDSViewSliders_wds {
|
|
1198 |
</tr>
|
1199 |
<tr class="wds_layer_tr" style="display: none;">
|
1200 |
<td class="spider_label">
|
1201 |
-
<label for="<?php echo $prefix; ?>
|
1202 |
</td>
|
1203 |
<td>
|
1204 |
<input id="<?php echo $prefix; ?>_image_width" class="spider_int_input" type="text" onchange="wds_text_width(this,'<?php echo $prefix; ?>')" value="<?php echo $layer->image_width; ?>" name="<?php echo $prefix; ?>_image_width" /> x
|
1205 |
<input id="<?php echo $prefix; ?>_image_height" class="spider_int_input" type="text" onchange="wds_text_height(this,'<?php echo $prefix; ?>')" value="<?php echo $layer->image_height; ?>" name="<?php echo $prefix; ?>_image_height" /> %
|
1206 |
-
<input id="<?php echo $prefix; ?>_image_scale" type="checkbox" onchange="wds_break_word(this, '<?php echo $prefix; ?>')" name="<?php echo $prefix; ?>_image_scale" <?php echo (($layer->image_scale) ? 'checked="checked"' : ''); ?>
|
1207 |
-
<div class="spider_description">Leave blank to keep the initial
|
1208 |
</td>
|
1209 |
<td class="spider_label">
|
1210 |
<label for="<?php echo $prefix; ?>_layer_effect_out">Effect Out:</label>
|
@@ -1240,7 +1366,7 @@ class WDSViewSliders_wds {
|
|
1240 |
<td>
|
1241 |
X <input id="<?php echo $prefix; ?>_left" class="spider_int_input" type="text" onchange="jQuery('#<?php echo $prefix; ?>').css({left: jQuery(this).val() + 'px'})" onkeypress="return spider_check_isnum(event)" value="<?php echo $layer->left; ?>" name="<?php echo $prefix; ?>_left" />
|
1242 |
Y <input id="<?php echo $prefix; ?>_top" class="spider_int_input" type="text" onchange="jQuery('#<?php echo $prefix; ?>').css({top: jQuery(this).val() + 'px'})" onkeypress="return spider_check_isnum(event)" value="<?php echo $layer->top; ?>" name="<?php echo $prefix; ?>_top" />
|
1243 |
-
<div class="spider_description"
|
1244 |
</td>
|
1245 |
<td class="spider_label">
|
1246 |
<label for="<?php echo $prefix; ?>_padding">Padding: </label>
|
@@ -1382,8 +1508,8 @@ class WDSViewSliders_wds {
|
|
1382 |
<input type="hidden" name="<?php echo $prefix; ?>_image_url" id="<?php echo $prefix; ?>_image_url" value="<?php echo $layer->image_url; ?>" />
|
1383 |
<input id="<?php echo $prefix; ?>_image_width" class="spider_int_input" type="text" onkeyup="wds_scale('#<?php echo $prefix; ?>_image_scale', '<?php echo $prefix; ?>')" value="<?php echo $layer->image_width; ?>" name="<?php echo $prefix; ?>_image_width" /> x
|
1384 |
<input id="<?php echo $prefix; ?>_image_height" class="spider_int_input" type="text" onkeyup="wds_scale('#<?php echo $prefix; ?>_image_scale', '<?php echo $prefix; ?>')" value="<?php echo $layer->image_height; ?>" name="<?php echo $prefix; ?>_image_height" /> px
|
1385 |
-
<input id="<?php echo $prefix; ?>_image_scale" type="checkbox" onchange="wds_scale(this, '<?php echo $prefix; ?>')" name="<?php echo $prefix; ?>_image_scale" <?php echo (($layer->image_scale) ? 'checked="checked"' : ''); ?>
|
1386 |
-
<div class="spider_description"
|
1387 |
</td>
|
1388 |
<td class="spider_label">
|
1389 |
<label for="<?php echo $prefix; ?>_layer_effect_in">Effect In:</label>
|
@@ -1418,7 +1544,7 @@ class WDSViewSliders_wds {
|
|
1418 |
</td>
|
1419 |
<td>
|
1420 |
<input id="<?php echo $prefix; ?>_alt" type="text" size="39" value="<?php echo $layer->alt; ?>" name="<?php echo $prefix; ?>_alt" />
|
1421 |
-
<div class="spider_description"
|
1422 |
</td>
|
1423 |
<td class="spider_label">
|
1424 |
<label for="<?php echo $prefix; ?>_layer_effect_out">Effect Out:</label>
|
@@ -1480,7 +1606,7 @@ class WDSViewSliders_wds {
|
|
1480 |
<td>
|
1481 |
X <input id="<?php echo $prefix; ?>_left" class="spider_int_input" type="text" onchange="jQuery('#<?php echo $prefix; ?>').css({left: jQuery(this).val() + 'px'})" onkeypress="return spider_check_isnum(event)" value="<?php echo $layer->left; ?>" name="<?php echo $prefix; ?>_left" />
|
1482 |
Y <input id="<?php echo $prefix; ?>_top" class="spider_int_input" type="text" onchange="jQuery('#<?php echo $prefix; ?>').css({top: jQuery(this).val() + 'px'})" onkeypress="return spider_check_isnum(event)" value="<?php echo $layer->top; ?>" name="<?php echo $prefix; ?>_top" />
|
1483 |
-
<div class="spider_description"
|
1484 |
</td>
|
1485 |
<td class="spider_label">
|
1486 |
<label for="<?php echo $prefix; ?>_border_radius">Radius: </label>
|
@@ -1531,7 +1657,7 @@ class WDSViewSliders_wds {
|
|
1531 |
<td>
|
1532 |
X <input id="<?php echo $prefix; ?>_left" class="spider_int_input" type="text" onchange="jQuery('#<?php echo $prefix; ?>').css({left: jQuery(this).val() + 'px'})" onkeypress="return spider_check_isnum(event)" value="<?php echo $layer->left; ?>" name="<?php echo $prefix; ?>_left" />
|
1533 |
Y <input id="<?php echo $prefix; ?>_top" class="spider_int_input" type="text" onchange="jQuery('#<?php echo $prefix; ?>').css({top: jQuery(this).val() + 'px'})" onkeypress="return spider_check_isnum(event)" value="<?php echo $layer->top; ?>" name="<?php echo $prefix; ?>_top" />
|
1534 |
-
<div class="spider_description"
|
1535 |
</td>
|
1536 |
<td class="spider_label">
|
1537 |
<label for="<?php echo $prefix; ?>_layer_effect_in">Effect In:</label>
|
@@ -1666,9 +1792,22 @@ class WDSViewSliders_wds {
|
|
1666 |
<input id="slide<?php echo $slide_row->id; ?>_del_layer_ids_string" name="slide<?php echo $slide_row->id; ?>_del_layer_ids_string" type="hidden" value="" />
|
1667 |
</div>
|
1668 |
<script>
|
1669 |
-
jQuery(
|
|
|
1670 |
wds_drag_layer('<?php echo $slide_row->id; ?>');
|
1671 |
wds_layer_weights('<?php echo $slide_row->id; ?>');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1672 |
});
|
1673 |
</script>
|
1674 |
<?php
|
@@ -1681,29 +1820,23 @@ class WDSViewSliders_wds {
|
|
1681 |
</table>
|
1682 |
</div>
|
1683 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1684 |
<input id="task" name="task" type="hidden" value="" />
|
1685 |
-
<input id="current_id" name="current_id" type="hidden" value="<?php echo $row->id; ?>" />
|
1686 |
-
<input id="slide_ids_string" name="slide_ids_string" type="hidden" value="<?php echo $slide_ids_string; ?>" />
|
1687 |
-
<input id="del_slide_ids_string" name="del_slide_ids_string" type="hidden" value="" />
|
1688 |
-
<input id="nav_tab" name="nav_tab" type="hidden" value="<?php echo WDW_S_Library::get('nav_tab', 'global'); ?>" />
|
1689 |
-
<input id="tab" name="tab" type="hidden" value="<?php echo WDW_S_Library::get('tab', 'slides'); ?>" />
|
1690 |
-
<input id="sub_tab" name="sub_tab" type="hidden" value="<?php echo $sub_tab_type; ?>" />
|
1691 |
<script>
|
|
|
|
|
1692 |
jQuery(window).load(function() {
|
1693 |
-
|
1694 |
-
var nav_tab = jQuery("#nav_tab").val();
|
1695 |
-
wds_change_nav(jQuery(".wds_nav_tabs li[tab_type='" + nav_tab + "']"), 'wds_nav_' + nav_tab + '_box');
|
1696 |
-
var tab = jQuery("#tab").val();
|
1697 |
-
wds_change_tab(jQuery(".wds_tab_label[tab_type='" + tab + "']"), 'wds_' + tab + '_box');
|
1698 |
-
bwg_built_in_watermark('watermark_type_<?php echo $row->built_in_watermark_type ?>');
|
1699 |
-
preview_built_in_watermark();
|
1700 |
-
wds_slide_weights();
|
1701 |
-
if (jQuery("#music1").is(":checked")) {
|
1702 |
-
bwg_enable_disable('', 'tr_music_url', 'music1');
|
1703 |
-
}
|
1704 |
-
else {
|
1705 |
-
bwg_enable_disable('none', 'tr_music_url', 'music0');
|
1706 |
-
}
|
1707 |
});
|
1708 |
</script>
|
1709 |
<div class="opacity_add_image_url opacity_add_video wds_opacity_video" onclick="jQuery('.opacity_add_video').hide();jQuery('.opacity_add_image_url').hide();"></div>
|
360 |
$built_in_watermark_fonts[] = $filename;
|
361 |
}
|
362 |
}
|
363 |
+
if (get_option("wds_theme_version")) {
|
364 |
+
$fv = TRUE;
|
365 |
+
$fv_class = 'spider_free_version_label';
|
366 |
+
$fv_disabled = 'disabled="disabled"';
|
367 |
+
$fv_message = '<tr><td colspan="2"><div class="error" style="padding: 5px; font-size: 14px; color: #000000 !important;">Some options are disabled in free version.</div></td></tr>';
|
368 |
+
$fv_title = ' title="This option is disabled in free version."';
|
369 |
+
}
|
370 |
+
else {
|
371 |
+
$fv = FALSE;
|
372 |
+
$fv_class = '';
|
373 |
+
$fv_disabled = '';
|
374 |
+
$fv_message = '';
|
375 |
+
$fv_title = '';
|
376 |
+
}
|
377 |
?>
|
378 |
+
<div class="spider_message_cont"></div>
|
379 |
+
<div class="spider_load">
|
380 |
+
<div class="spider_load_cont"></div>
|
381 |
+
<div class="spider_load_icon"><img class="spider_ajax_loading" src="<?php echo WD_S_URL . '/images/ajax_loader.png'; ?>"></div>
|
382 |
+
</div>
|
383 |
<div style="clear: both; float: left; width: 99%;">
|
384 |
<div style="float: left; font-size: 14px; font-weight: bold;">
|
385 |
This section allows you to add/edit slider.
|
394 |
<form class="wrap" method="post" id="sliders_form" action="admin.php?page=sliders_wds" style="float: left; width: 99%;">
|
395 |
<span class="slider-icon"></span>
|
396 |
<h2><?php echo $page_title; ?></h2>
|
397 |
+
<div class="wds_buttons" style="float: right; position: absolute; right: 11px; z-index: 50;">
|
398 |
+
<input class="button-secondary" type="button" onclick="if (wds_check_required('name', 'Name')) {return false;};
|
399 |
+
spider_set_input_value('task', 'save');
|
400 |
+
spider_ajax_save('sliders_form', event);" value="Save" />
|
401 |
+
<input class="button-secondary" type="button" onclick="if (wds_check_required('name', 'Name')) {return false;};
|
402 |
+
spider_set_input_value('task', 'apply');
|
403 |
+
spider_ajax_save('sliders_form', event);" value="Apply" />
|
404 |
+
<?php
|
405 |
+
if ($row->spider_uploader) {
|
406 |
+
?>
|
407 |
+
<a href="<?php echo add_query_arg(array('action' => 'addImage', 'width' => '700', 'height' => '550', 'extensions' => 'jpg,jpeg,png,gif', 'callback' => 'wds_add_image', 'image_for' => 'add_slides', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" class="button-primary thickbox thickbox-preview" id="content-add_media" title="Add Images" onclick="return false;">
|
408 |
+
Add Images
|
409 |
+
</a>
|
410 |
+
<?php
|
411 |
+
}
|
412 |
+
?>
|
413 |
+
<input class="button-primary" type="button" onclick="if (wds_check_required('name', 'Name')) {return false;};
|
414 |
+
spider_set_input_value('task', 'set_watermark');
|
415 |
+
spider_ajax_save('sliders_form', event);" value="Set Watermark" />
|
416 |
+
<input class="button-secondary" type="button" onclick="if (wds_check_required('name', 'Name')) {return false;};
|
417 |
+
spider_set_input_value('task', 'reset_watermark');
|
418 |
+
spider_ajax_save('sliders_form', event);" value="Reset Watermark" />
|
419 |
+
<input class="button-secondary" type="button" onclick="if (wds_check_required('name', 'Name')) {return false;};
|
420 |
+
spider_set_input_value('task', 'reset');
|
421 |
+
spider_ajax_save('sliders_form', event);" value="Reset Settings" />
|
422 |
<input class="button-secondary" type="submit" onclick="spider_set_input_value('task', 'cancel')" value="Cancel" />
|
423 |
</div>
|
424 |
<div class="wds_tabs">
|
461 |
<tr>
|
462 |
<td class="spider_label"><label>Dimensions: </label></td>
|
463 |
<td>
|
464 |
+
<input type="text" name="width" id="width" value="<?php echo $row->width; ?>" class="spider_int_input" onchange="wds_whr('width')" onkeypress="return spider_check_isnum(event)" /> x
|
465 |
+
<input type="text" name="height" id="height" value="<?php echo $row->height; ?>" class="spider_int_input" onchange="wds_whr('height')" onkeypress="return spider_check_isnum(event)" /> px
|
466 |
+
<div class="spider_description">Maximum width and height for slider.</div>
|
467 |
</td>
|
468 |
</tr>
|
469 |
<tr>
|
471 |
<td>
|
472 |
<input type="radio" id="full_width1" name="full_width" <?php echo (($row->full_width) ? 'checked="checked"' : ''); ?> value="1" /><label for="full_width1">Yes</label>
|
473 |
<input type="radio" id="full_width0" name="full_width" <?php echo (($row->full_width) ? '' : 'checked="checked"'); ?> value="0" /><label for="full_width0">No</label>
|
474 |
+
<input type="text" name="ratio" id="ratio" value="" class="spider_int_input" onchange="wds_whr('ratio')" onkeypress="return spider_check_isnum(event)" /><label for="ratio">Ratio</label>
|
475 |
+
<div class="spider_description">The image will stretch to the page width, taking the height based on dimensions ratio.</div>
|
476 |
</td>
|
477 |
</tr>
|
478 |
<tr>
|
495 |
}
|
496 |
?>
|
497 |
</select>
|
498 |
+
<div class="spider_description">Set the alignment of the slider.</div>
|
499 |
</td>
|
500 |
</tr>
|
501 |
<tr>
|
517 |
</tr>
|
518 |
<tr>
|
519 |
<td class="spider_label"><label for="time_intervval">Time Interval: </label></td>
|
520 |
+
<td>
|
521 |
+
<input type="text" id="time_intervval" name="time_intervval" value="<?php echo $row->time_intervval; ?>" class="spider_int_input" onkeypress="return spider_check_isnum(event)" /> sec.
|
522 |
+
<div class="spider_description">Set the time interval for the change of the sliders when autoplay is on.</div>
|
523 |
+
</td>
|
524 |
</tr>
|
525 |
<tr>
|
526 |
<td class="spider_label"><label>Autoplay: </label></td>
|
527 |
<td>
|
528 |
<input type="radio" id="autoplay1" name="autoplay" <?php echo (($row->autoplay) ? 'checked="checked"' : ''); ?> value="1" /><label for="autoplay1">Yes</label>
|
529 |
<input type="radio" id="autoplay0" name="autoplay" <?php echo (($row->autoplay) ? '' : 'checked="checked"'); ?> value="0" /><label for="autoplay0">No</label>
|
530 |
+
<div class="spider_description">Choose whether to autoplay the sliders or not.</div>
|
531 |
</td>
|
532 |
</tr>
|
533 |
<tr>
|
535 |
<td>
|
536 |
<input type="radio" id="shuffle1" name="shuffle" <?php echo (($row->shuffle) ? 'checked="checked"' : ''); ?> value="1" /><label for="shuffle1">Yes</label>
|
537 |
<input type="radio" id="shuffle0" name="shuffle" <?php echo (($row->shuffle) ? '' : 'checked="checked"'); ?> value="0" /><label for="shuffle0">No</label>
|
538 |
+
<div class="spider_description">Choose whether to have the slides change in a random manner or to keep the original sequence.</div>
|
539 |
</td>
|
540 |
</tr>
|
541 |
<tr>
|
543 |
<td>
|
544 |
<input type="radio" id="music1" name="music" <?php echo (($row->music) ? 'checked="checked"' : ''); ?> value="1" onClick="bwg_enable_disable('', 'tr_music_url', 'music1')" /><label for="music1">Yes</label>
|
545 |
<input type="radio" id="music0" name="music" <?php echo (($row->music) ? '' : 'checked="checked"'); ?> value="0" onClick="bwg_enable_disable('none', 'tr_music_url', 'music0')" /><label for="music0">No</label>
|
546 |
+
<div class="spider_description">Choose whether to have music/audio track playback with the slider or not.</div>
|
547 |
</td>
|
548 |
</tr>
|
549 |
<tr id="tr_music_url">
|
561 |
<td>
|
562 |
<input type="radio" id="preload_images1" name="preload_images" <?php echo (($row->preload_images) ? 'checked="checked"' : ''); ?> value="1" /><label for="preload_images1">Yes</label>
|
563 |
<input type="radio" id="preload_images0" name="preload_images" <?php echo (($row->preload_images) ? '' : 'checked="checked"'); ?> value="0" /><label for="preload_images0">No</label>
|
564 |
+
<div class="spider_description">Choose to have faster load for the first few images and process the rest meanwhile.</div>
|
565 |
</td>
|
566 |
</tr>
|
567 |
<tr>
|
586 |
?>
|
587 |
</select>
|
588 |
<input type="text" name="glb_border_color" id="glb_border_color" value="<?php echo $row->glb_border_color; ?>" class="color" />
|
589 |
+
<div class="spider_description">Set the border width, type and the color.</div>
|
590 |
</td>
|
591 |
</tr>
|
592 |
<tr>
|
600 |
<td class="spider_label"><label for="glb_margin">Margin: </label></td>
|
601 |
<td>
|
602 |
<input type="text" name="glb_margin" id="glb_margin" value="<?php echo $row->glb_margin; ?>" class="spider_int_input" onkeypress="return spider_check_isnum(event)" /> px
|
603 |
+
<div class="spider_description">Set a margin for the slider.</div>
|
604 |
</td>
|
605 |
</tr>
|
606 |
<tr>
|
627 |
<td>
|
628 |
<input type="radio" name="layer_out_next" id="layer_out_next_1" value="1" <?php if ($row->layer_out_next) echo 'checked="checked"'; ?> /><label for="layer_out_next_1">Yes</label>
|
629 |
<input type="radio" name="layer_out_next" id="layer_out_next_0" value="0" <?php if (!$row->layer_out_next) echo 'checked="checked"'; ?> /><label for="layer_out_next_0">No</label>
|
630 |
+
<div class="spider_description">Choose whether to have the layer effect out regardless of the timing between the hit to the next slider or skip the effect out and get to the next image.</div>
|
631 |
+
</td>
|
632 |
+
</tr>
|
633 |
+
<tr>
|
634 |
+
<td class="spider_label"><label>Turn SliderWD Media Upload: </label></td>
|
635 |
+
<td>
|
636 |
+
<input type="radio" id="spider_uploader1" name="spider_uploader" <?php echo (($row->spider_uploader) ? 'checked="checked"' : ''); ?> value="1" /><label for="spider_uploader1">Yes</label>
|
637 |
+
<input type="radio" id="spider_uploader0" name="spider_uploader" <?php echo (($row->spider_uploader) ? '' : 'checked="checked"'); ?> value="0" /><label for="spider_uploader0">No</label>
|
638 |
+
<div class="spider_description">Choose the option to use the custom media upload instead of the WordPress default for adding images.</div>
|
639 |
</td>
|
640 |
</tr>
|
641 |
<tr>
|
643 |
<td>
|
644 |
<input type="radio" id="published1" name="published" <?php echo (($row->published) ? 'checked="checked"' : ''); ?> value="1" /><label for="published1">Yes</label>
|
645 |
<input type="radio" id="published0" name="published" <?php echo (($row->published) ? '' : 'checked="checked"'); ?> value="0" /><label for="published0">No</label>
|
646 |
+
<div class="spider_description">Choose whether to publish the mentioned slider or not.</div>
|
647 |
</td>
|
648 |
</tr>
|
649 |
</tbody>
|
659 |
<td>
|
660 |
<input type="radio" name="prev_next_butt" id="prev_next_butt_1" value="1" <?php if ($row->prev_next_butt) echo 'checked="checked"'; ?> /><label for="prev_next_butt_1">Yes</label>
|
661 |
<input type="radio" name="prev_next_butt" id="prev_next_butt_0" value="0" <?php if (!$row->prev_next_butt) echo 'checked="checked"'; ?> /><label for="prev_next_butt_0">No</label>
|
662 |
+
<div class="spider_description">Choose whether to display Previous and Next buttons or not.</div>
|
663 |
</td>
|
664 |
</tr>
|
665 |
<tr>
|
669 |
<td>
|
670 |
<input type="radio" name="play_paus_butt" id="play_paus_butt_1" value="1" <?php if ($row->play_paus_butt) echo 'checked="checked"'; ?> /><label for="play_paus_butt_1">Yes</label>
|
671 |
<input type="radio" name="play_paus_butt" id="play_paus_butt_0" value="0" <?php if (!$row->play_paus_butt) echo 'checked="checked"'; ?> /><label for="play_paus_butt_0">No</label>
|
672 |
+
<div class="spider_description">Choose whether to display Play and Pause buttons or not.</div>
|
673 |
</td>
|
674 |
</tr>
|
675 |
<tr>
|
679 |
<td>
|
680 |
<input type="radio" name="navigation" id="navigation_1" value="hover" <?php if ($row->navigation == 'hover') echo 'checked="checked"'; ?> /><label for="navigation_1">On hover</label>
|
681 |
<input type="radio" name="navigation" id="navigation_0" value="always" <?php if ($row->navigation == 'always' ) echo 'checked="checked"'; ?> /><label for="navigation_0">Always</label>
|
682 |
+
<div class="spider_description">Select between the option of always displaying the navigation buttons or only when hovered.</div>
|
683 |
</td>
|
684 |
</tr>
|
685 |
+
</tbody>
|
686 |
+
<tbody class="<?php echo $fv_class; ?>"<?php echo $fv_title; ?>>
|
687 |
+
<?php echo $fv_message; ?>
|
688 |
<tr id="right_left_butt_style">
|
689 |
+
<td class="spider_label <?php echo $fv_class; ?>"><label for="rl_butt_style">Next / Previous buttons style: </label></td>
|
690 |
<td>
|
691 |
+
<select name="rl_butt_style" id="rl_butt_style" <?php echo $fv_disabled; ?>>
|
692 |
<?php
|
693 |
foreach ($button_styles as $key => $button_style) {
|
694 |
?>
|
697 |
}
|
698 |
?>
|
699 |
</select>
|
700 |
+
<div class="spider_description">Choose the style of the button you prefer to have as navigation buttons.</div>
|
701 |
</td>
|
702 |
</tr>
|
703 |
<tr id="right_left_butt_size">
|
704 |
+
<td class="spider_label <?php echo $fv_class; ?>"><label for="rl_butt_size">Next / Previous buttons size: </label></td>
|
705 |
<td>
|
706 |
+
<input type="text" name="rl_butt_size" id="rl_butt_size" value="<?php echo $row->rl_butt_size; ?>" class="spider_int_input" onkeypress="return spider_check_isnum(event)" <?php echo $fv_disabled; ?> /> px
|
707 |
+
<div class="spider_description">Set the size for the next / previous buttons.</div>
|
708 |
</td>
|
709 |
</tr>
|
710 |
<tr id="play_pause_butt_size">
|
711 |
+
<td class="spider_label <?php echo $fv_class; ?>"><label for="pp_butt_size">Play / Pause button size: </label></td>
|
712 |
<td>
|
713 |
+
<input type="text" name="pp_butt_size" id="pp_butt_size" value="<?php echo $row->pp_butt_size; ?>" class="spider_int_input" onkeypress="return spider_check_isnum(event)" <?php echo $fv_disabled; ?> /> px
|
714 |
+
<div class="spider_description">Set the size for the play / pause buttons.</div>
|
715 |
</td>
|
716 |
</tr>
|
717 |
<tr id="buttons_color">
|
718 |
+
<td class="spider_label <?php echo $fv_class; ?>"><label for="butts_color">Buttons color: </label></td>
|
719 |
<td>
|
720 |
+
<input type="text" name="butts_color" id="butts_color" value="<?php echo $row->butts_color; ?>" class="color" <?php echo $fv_disabled; ?> />
|
721 |
+
<div class="spider_description">Select a color for the navigation buttons.</div>
|
722 |
</td>
|
723 |
</tr>
|
724 |
<tr>
|
725 |
+
<td class="spider_label <?php echo $fv_class; ?>"><label for="hover_color">Hover color: </label></td>
|
726 |
<td>
|
727 |
+
<input type="text" name="hover_color" id="hover_color" value="<?php echo $row->hover_color; ?>" class="color" <?php echo $fv_disabled; ?> />
|
728 |
+
<div class="spider_description">Select a hover color for the navigation buttons.</div>
|
729 |
</td>
|
730 |
</tr>
|
731 |
<tr>
|
732 |
+
<td class="spider_label <?php echo $fv_class; ?>"><label for="nav_border_width">Border: </label></td>
|
733 |
<td>
|
734 |
+
<input type="text" name="nav_border_width" id="nav_border_width" value="<?php echo $row->nav_border_width; ?>" class="spider_int_input" onkeypress="return spider_check_isnum(event)" <?php echo $fv_disabled; ?> /> px
|
735 |
+
<select name="nav_border_style" id="nav_border_style" <?php echo $fv_disabled; ?>>
|
736 |
<?php
|
737 |
foreach ($border_styles as $key => $border_style) {
|
738 |
?>
|
741 |
}
|
742 |
?>
|
743 |
</select>
|
744 |
+
<input type="text" name="nav_border_color" id="nav_border_color" value="<?php echo $row->nav_border_color; ?>" class="color" <?php echo $fv_disabled; ?> />
|
745 |
+
<div class="spider_description">Select the type, size and the color of border for the navigation buttons.</div>
|
746 |
</td>
|
747 |
</tr>
|
748 |
+
<td class="spider_label <?php echo $fv_class; ?>"><label for="nav_border_radius">Border radius: </label></td>
|
749 |
<td>
|
750 |
+
<input type="text" name="nav_border_radius" id="nav_border_radius" value="<?php echo $row->nav_border_radius; ?>" class="spider_char_input" <?php echo $fv_disabled; ?> />
|
751 |
<div class="spider_description">Use CSS type values.</div>
|
752 |
</td>
|
753 |
</tr>
|
754 |
<tr>
|
755 |
+
<td class="spider_label <?php echo $fv_class; ?>"><label for="nav_bg_color">Background color: </label></td>
|
756 |
<td>
|
757 |
+
<input type="text" name="nav_bg_color" id="nav_bg_color" value="<?php echo $row->nav_bg_color; ?>" class="color" <?php echo $fv_disabled; ?> />
|
758 |
+
<input type="text" name="butts_transparent" id="butts_transparent" value="<?php echo $row->butts_transparent; ?>" class="spider_int_input" onkeypress="return spider_check_isnum(event)" <?php echo $fv_disabled; ?> /> %
|
759 |
<div class="spider_description">Transparency value must be between 0 to 100.</div>
|
760 |
</td>
|
761 |
</tr>
|
770 |
<td>
|
771 |
<input type="radio" id="enable_bullets1" name="enable_bullets" <?php echo (($row->enable_bullets) ? 'checked="checked"' : ''); ?> value="1" /><label for="enable_bullets1">Yes</label>
|
772 |
<input type="radio" id="enable_bullets0" name="enable_bullets" <?php echo (($row->enable_bullets) ? '' : 'checked="checked"'); ?> value="0" /><label for="enable_bullets0">No</label>
|
773 |
+
<div class="spider_description">Choose whether to have navigation bullets or not.</div>
|
774 |
</td>
|
775 |
</tr>
|
776 |
<tr>
|
780 |
<option value="top" <?php echo (($row->bull_position == "top") ? 'selected="selected"' : ''); ?>>Top</option>
|
781 |
<option value="bottom" <?php echo (($row->bull_position == "bottom") ? 'selected="selected"' : ''); ?>>Bottom</option>
|
782 |
</select>
|
783 |
+
<div class="spider_description">Select the position for the navigation bullets.</div>
|
784 |
</td>
|
785 |
</tr>
|
786 |
+
</tbody>
|
787 |
+
<tbody class="<?php echo $fv_class; ?>"<?php echo $fv_title; ?>>
|
788 |
+
<?php echo $fv_message; ?>
|
789 |
<tr>
|
790 |
+
<td class="spider_label <?php echo $fv_class; ?>"><label for="bull_style">Bullet style: </label></td>
|
791 |
<td>
|
792 |
+
<select name="bull_style" id="bull_style" <?php echo $fv_disabled; ?>>
|
793 |
<?php
|
794 |
foreach ($bull_styles as $key => $bull_style) {
|
795 |
?>
|
798 |
}
|
799 |
?>
|
800 |
</select>
|
801 |
+
<div class="spider_description">Choose the style for the bullets.</div>
|
802 |
</td>
|
803 |
</tr>
|
804 |
<tr id="bullet_size">
|
805 |
+
<td class="spider_label <?php echo $fv_class; ?>"><label for="bull_size">Size: </label></td>
|
806 |
<td>
|
807 |
+
<input type="text" name="bull_size" id="bull_size" value="<?php echo $row->bull_size; ?>" class="spider_int_input" onkeypress="return spider_check_isnum(event)" <?php echo $fv_disabled; ?> /> px
|
808 |
+
<div class="spider_description">Define the size of the navigation bullets.</div>
|
809 |
</td>
|
810 |
</tr>
|
811 |
<tr id="bullets_color">
|
812 |
+
<td class="spider_label <?php echo $fv_class; ?>"><label for="bull_color">Color: </label></td>
|
813 |
<td>
|
814 |
+
<input type="text" name="bull_color" id="bull_color" value="<?php echo $row->bull_color; ?>" class="color" <?php echo $fv_disabled; ?> />
|
815 |
+
<div class="spider_description">Select the color for the navigation bullets.</div>
|
816 |
</td>
|
817 |
</tr>
|
818 |
<tr id="bullets_act_color">
|
819 |
+
<td class="spider_label <?php echo $fv_class; ?>"><label for="bull_act_color">Active color: </label></td>
|
820 |
<td>
|
821 |
+
<input type="text" name="bull_act_color" id="bull_act_color" value="<?php echo $row->bull_act_color; ?>" class="color" <?php echo $fv_disabled; ?> />
|
822 |
+
<div class="spider_description">Select the color for the bullet, which is currently displaying a corresponding image.</div>
|
823 |
</td>
|
824 |
</tr>
|
825 |
<tr id="bullet_margin">
|
826 |
+
<td class="spider_label <?php echo $fv_class; ?>"><label for="bull_margin">Margin: </label></td>
|
827 |
<td>
|
828 |
+
<input type="text" name="bull_margin" id="bull_margin" value="<?php echo $row->bull_margin; ?>" class="spider_int_input" onkeypress="return spider_check_isnum(event)" <?php echo $fv_disabled; ?> /> px
|
829 |
+
<div class="spider_description">Set the margin for the navigation bullets in pixels.</div>
|
830 |
</td>
|
831 |
</tr>
|
832 |
</tbody>
|
845 |
<td>
|
846 |
<input disabled="disabled" type="radio" id="enable_filmstrip1" name="enable_filmstrip" <?php echo (($row->enable_filmstrip) ? 'checked="checked"' : ''); ?> value="1" /><label for="filmstrip1">Yes</label>
|
847 |
<input disabled="disabled" type="radio" id="enable_filmstrip0" name="enable_filmstrip" <?php echo (($row->enable_filmstrip) ? '' : 'checked="checked"'); ?> value="0" /><label for="filmstrip0">No</label>
|
848 |
+
<div class="spider_description">Choose whether to have thumbnails of the slides displayed as a filmstrip or not.</div>
|
849 |
</td>
|
850 |
</tr>
|
851 |
<tr id="filmstrip_position">
|
857 |
<option value="bottom" <?php echo (($row->film_pos == "bottom") ? 'selected="selected"' : ''); ?>>Bottom</option>
|
858 |
<option value="left" <?php echo (($row->film_pos == "left") ? 'selected="selected"' : ''); ?>>Left</option>
|
859 |
</select>
|
860 |
+
<div class="spider_description">Set the position of the filmstrip.</div>
|
861 |
</td>
|
862 |
</tr>
|
863 |
<tr id="filmstrip_size">
|
865 |
<td>
|
866 |
<input disabled="disabled" type="text" name="film_thumb_width" id="film_thumb_width" value="<?php echo $row->film_thumb_width; ?>" class="spider_int_input" onkeypress="return spider_check_isnum(event)" /> x
|
867 |
<input disabled="disabled" type="text" name="film_thumb_height" id="film_thumb_height" value="<?php echo $row->film_thumb_height; ?>" class="spider_int_input" onkeypress="return spider_check_isnum(event)" /> px
|
868 |
+
<div class="spider_description">Define the maximum width and heigth of the filmstrip thumbnails.</div>
|
869 |
</td>
|
870 |
</tr>
|
871 |
<tr>
|
872 |
<td class="spider_label"><label for="film_bg_color">Background color: </label></td>
|
873 |
<td>
|
874 |
<input disabled="disabled" type="text" name="film_bg_color" id="film_bg_color" value="<?php echo $row->film_bg_color; ?>" class="color" />
|
875 |
+
<div class="spider_description">Select the background color for the filmstrip.</div>
|
876 |
</td>
|
877 |
</tr>
|
878 |
<tr id="filmstrip_thumb_margin">
|
879 |
<td class="spider_label"><label for="film_tmb_margin">Thumbnail margin: </label></td>
|
880 |
<td>
|
881 |
<input disabled="disabled" type="text" name="film_tmb_margin" id="film_tmb_margin" value="<?php echo $row->film_tmb_margin; ?>" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> px
|
882 |
+
<div class="spider_description">Set the margin for the thumbnails.</div>
|
883 |
</td>
|
884 |
</tr>
|
885 |
<tr>
|
896 |
?>
|
897 |
</select>
|
898 |
<input disabled="disabled" type="text" name="film_act_border_color" id="film_act_border_color" value="<?php echo $row->film_act_border_color; ?>" class="color"/>
|
899 |
+
<div class="spider_description">The thumbnail for the currently displayed image will have a border. You can set its size, type and color.</div>
|
900 |
</td>
|
901 |
</tr>
|
902 |
<tr>
|
903 |
<td class="spider_label"><label for="film_dac_transparent">Deactive transparency: </label></td>
|
904 |
<td>
|
905 |
<input disabled="disabled" type="text" name="film_dac_transparent" id="film_dac_transparent" value="<?php echo $row->film_dac_transparent; ?>" class="spider_int_input" onkeypress="return spider_check_isnum(event)"/> %
|
906 |
+
<div class="spider_description">You can set a transparency level for the inactive filmstrip items which must be between 0 to 100..</div>
|
907 |
</td>
|
908 |
</tr>
|
909 |
</tbody>
|
917 |
<td>
|
918 |
<input type="radio" id="enable_time_bar1" name="enable_time_bar" <?php echo (($row->enable_time_bar) ? 'checked="checked"' : ''); ?> value="1" /><label for="time_bar1">Yes</label>
|
919 |
<input type="radio" id="enable_time_bar0" name="enable_time_bar" <?php echo (($row->enable_time_bar) ? '' : 'checked="checked"'); ?> value="0" /><label for="time_bar0">No</label>
|
920 |
+
<div class="spider_description">You can add a bar displaying the timing left to switching to the next slide on autoplay.</div>
|
921 |
</td>
|
922 |
</tr>
|
923 |
<tr>
|
927 |
<option value="top" <?php echo (($row->timer_bar_type == "top") ? 'selected="selected"' : ''); ?>>Line top</option>
|
928 |
<option value="bottom" <?php echo (($row->timer_bar_type == "bottom") ? 'selected="selected"' : ''); ?>>Line Bottom</option>
|
929 |
</select>
|
930 |
+
<div class="spider_description">Choose the type of the timer bar to be used within the slider.</div>
|
931 |
</td>
|
932 |
</tr>
|
933 |
<tr>
|
934 |
<td class="spider_label"><label for="timer_bar_size">Size: </label></td>
|
935 |
<td>
|
936 |
<input type="text" name="timer_bar_size" id="timer_bar_size" value="<?php echo $row->timer_bar_size; ?>" class="spider_int_input" onkeypress="return spider_check_isnum(event)" /> px
|
937 |
+
<div class="spider_description">Define the height of the timer bar.</div>
|
938 |
</td>
|
939 |
</tr>
|
940 |
<tr>
|
973 |
<label for="built_in_watermark_type_text">Text</label>
|
974 |
<input type="radio" name="built_in_watermark_type" id="built_in_watermark_type_image" value="image" <?php if ($row->built_in_watermark_type == 'image') echo 'checked="checked"'; ?> onClick="bwg_built_in_watermark('watermark_type_image')" onchange="preview_built_in_watermark()" />
|
975 |
<label for="built_in_watermark_type_image">Image</label>
|
976 |
+
<div class="spider_description">Choose what kind of watermark you want to use.</div>
|
977 |
</td>
|
978 |
</tr>
|
979 |
<tr id="tr_built_in_watermark_url">
|
982 |
</td>
|
983 |
<td>
|
984 |
<input type="text" id="built_in_watermark_url" name="built_in_watermark_url" style="width: 68%;" value="<?php echo $row->built_in_watermark_url; ?>" style="display:inline-block;" onchange="preview_built_in_watermark()" />
|
985 |
+
<?php
|
986 |
+
if (!$row->spider_uploader) {
|
987 |
+
?>
|
988 |
<input id="wat_img_add_butt" class="button-primary" type="button" onclick="spider_media_uploader('watermark', event); return false;" value="Add Image" />
|
989 |
+
<?php
|
990 |
+
}
|
991 |
+
else {
|
992 |
+
?>
|
993 |
+
<a href="<?php echo add_query_arg(array('action' => 'addImage', 'width' => '700', 'height' => '550', 'extensions' => 'jpg,jpeg,png,gif', 'callback' => 'wds_add_image', 'image_for' => 'watermark', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" class="button-primary thickbox thickbox-preview" id="content-add_media" title="Add Image" onclick="return false;">
|
994 |
+
Add Image
|
995 |
+
</a>
|
996 |
+
<?php
|
997 |
+
}
|
998 |
+
?>
|
999 |
<div class="spider_description">Only .png format is supported.</div>
|
1000 |
</td>
|
1001 |
</tr>
|
1005 |
</td>
|
1006 |
<td>
|
1007 |
<input type="text" name="built_in_watermark_text" id="built_in_watermark_text" style="width: 100%;" value="<?php echo $row->built_in_watermark_text; ?>" onchange="preview_built_in_watermark()" onkeypress="preview_built_in_watermark()" />
|
1008 |
+
<div class="spider_description">Provide the text which will be displayed over the slides.</div>
|
1009 |
</td>
|
1010 |
</tr>
|
1011 |
<tr id="tr_built_in_watermark_size">
|
1023 |
</td>
|
1024 |
<td>
|
1025 |
<input type="text" name="built_in_watermark_font_size" id="built_in_watermark_font_size" value="<?php echo $row->built_in_watermark_font_size; ?>" class="spider_int_input" onchange="preview_built_in_watermark()" onkeypress="return spider_check_isnum(event)" /> px
|
1026 |
+
<div class="spider_description">Specify the font size of the watermark.</div>
|
1027 |
</td>
|
1028 |
</tr>
|
1029 |
<tr id="tr_built_in_watermark_font">
|
1052 |
<?php
|
1053 |
}
|
1054 |
?>
|
1055 |
+
<div class="spider_description">Specify the font family for the watermark text.</div>
|
1056 |
</td>
|
1057 |
</tr>
|
1058 |
<tr id="tr_built_in_watermark_color">
|
1089 |
</tr>
|
1090 |
</tbody>
|
1091 |
</table>
|
1092 |
+
<div class="spider_description">Choose the positioning of the watermark.</div>
|
1093 |
</td>
|
1094 |
</tr>
|
1095 |
</tbody>
|
1096 |
</table>
|
1097 |
</td>
|
1098 |
<td style="width: 50%; vertical-align: top;height: 100%; display: table-cell;">
|
1099 |
+
<span id="preview_built_in_watermark" style='display:table-cell; background-image:url("<?php echo WD_S_URL . '/images/watermark_preview.jpg'?>"); background-size:100% 100%;width:400px;height:400px;padding-top: 4px; position:relative;'></span>
|
1100 |
</td>
|
1101 |
</tr>
|
1102 |
</tbody>
|
1109 |
<td class="spider_label"><label for="css">Css: </label></td>
|
1110 |
</tr>
|
1111 |
<tr>
|
1112 |
+
<td style="width: 90%;">
|
1113 |
+
<div class="spider_description">Add custom CSS to apply custom changes to the slider.</div>
|
1114 |
+
<textarea id="css" name="css" rows="30" style="width: 100%;"><?php echo htmlspecialchars($row->css); ?></textarea>
|
1115 |
+
</td>
|
1116 |
</tr>
|
1117 |
</tbody>
|
1118 |
</table>
|
1134 |
<?php
|
1135 |
foreach ($slides_row as $key => $slide_row) {
|
1136 |
?>
|
1137 |
+
<a id="wbs_subtab<?php echo $slide_row->id; ?>" class="connectedSortable <?php echo (((($id == 0 || !$sub_tab_type) || (strpos($sub_tab_type, 'pr') !== FALSE)) && $key == 0) || ('slide' . $slide_row->id == $sub_tab_type)) ? 'wds_sub_active' : ''; ?>" href="#">
|
1138 |
+
<div class="handle" title="Drag to re-order"></div>
|
1139 |
<input type="text" id="title<?php echo $slide_row->id; ?>" name="title<?php echo $slide_row->id; ?>" value="<?php echo $slide_row->title; ?>" class="wds_tab_title" tab_type="slide<?php echo $slide_row->id; ?>" onclick="wds_change_sub_tab(this, 'wds_slide<?php echo $slide_row->id; ?>')"/>
|
1140 |
<span class="wds_tab_remove" title="Delete slide" onclick="wds_remove_slide('<?php echo $slide_row->id; ?>')"></span>
|
1141 |
<input type="hidden" name="order<?php echo $slide_row->id; ?>" id="order<?php echo $slide_row->id; ?>" value="<?php echo $slide_row->order; ?>" />
|
1149 |
<?php
|
1150 |
foreach ($slides_row as $key => $slide_row) {
|
1151 |
?>
|
1152 |
+
<div class="wds_box <?php echo (((($id == 0 || !$sub_tab_type) || (strpos($sub_tab_type, 'pr') !== FALSE)) && $key == 0) || ('slide' . $slide_row->id == $sub_tab_type)) ? 'wds_sub_active' : ''; ?> wds_slide<?php echo $slide_row->id; ?>">
|
1153 |
<table class="ui-sortable<?php echo $slide_row->id; ?>">
|
1154 |
<thead><tr><td colspan="4"> </td></tr></thead>
|
1155 |
<tbody>
|
1156 |
<input type="hidden" name="type<?php echo $slide_row->id; ?>" id="type<?php echo $slide_row->id; ?>" value="<?php echo $slide_row->type; ?>" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1157 |
<tr>
|
1158 |
<td colspan="4">
|
1159 |
+
<?php
|
1160 |
+
if (!$row->spider_uploader) {
|
1161 |
+
?>
|
1162 |
<input type="button" class="button-primary" id="button_image_url<?php echo $slide_row->id; ?>" onclick="spider_media_uploader('<?php echo $slide_row->id; ?>', event); return false;" value="Add Image from Media Library" />
|
1163 |
+
<?php
|
1164 |
+
}
|
1165 |
+
else {
|
1166 |
+
?>
|
1167 |
+
<a href="<?php echo add_query_arg(array('action' => 'addImage', 'width' => '700', 'height' => '550', 'extensions' => 'jpg,jpeg,png,gif', 'callback' => 'wds_add_image', 'image_for' => 'add_update_slide', 'slide_id' => $slide_row->id, 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" class="button-primary thickbox thickbox-preview" id="content-add_media" title="Add Image" onclick="return false;">
|
1168 |
+
Add Image
|
1169 |
+
</a>
|
1170 |
+
<?php
|
1171 |
+
}
|
1172 |
+
?>
|
1173 |
+
<input type="button" class="button-primary" onclick="wds_add_image_url('<?php echo $slide_row->id; ?>')" value="Add Image by URL" />
|
1174 |
<input type="button" class="button-secondary wds_free_button" onclick="alert('This functionality is disabled in free version.')" value="Add Video" />
|
1175 |
<input type="button" class="button-secondary" id="delete_image_url<?php echo $slide_row->id; ?>" onclick="spider_remove_url('button_image_url<?php echo $slide_row->id; ?>', 'image_url<?php echo $slide_row->id; ?>', 'delete_image_url<?php echo $slide_row->id; ?>', 'wds_preview_image<?php echo $slide_row->id; ?>')" value="Remove" />
|
1176 |
<input type="hidden" id="image_url<?php echo $slide_row->id; ?>" name="image_url<?php echo $slide_row->id; ?>" value="<?php echo $slide_row->image_url; ?>" style="display: inline-block;" />
|
1182 |
<div id="wds_preview_wrapper_<?php echo $slide_row->id; ?>" class="wds_preview_wrapper" style="width: <?php echo $row->width; ?>px; height: <?php echo $row->height; ?>px;">
|
1183 |
<div class="wds_preview" style="overflow: hidden; position: absolute; width: inherit; height: inherit; background-color: transparent; background-image: none; display: block;">
|
1184 |
<div id="wds_preview_image<?php echo $slide_row->id; ?>" class="wds_preview_image<?php echo $slide_row->id; ?>"
|
1185 |
+
style='background-color: <?php echo WDW_S_Library::spider_hex2rgba($row->background_color, (100 - $row->background_transparent) / 100); ?>;
|
1186 |
+
background-image: url("<?php echo $slide_row->type != 'image' ? $slide_row->thumb_url : $slide_row->image_url . '?date=' . date('Y-m-d H:i:s'); ?>");
|
1187 |
background-position: center center;
|
1188 |
background-repeat: no-repeat;
|
1189 |
background-size: <?php echo $row->bg_fit; ?>;
|
1190 |
width: inherit;
|
1191 |
height: inherit;
|
1192 |
+
/*position: relative;*/'>
|
1193 |
<?php
|
1194 |
$layers_row = $this->model->get_layers_row_data($slide_row->id);
|
1195 |
if ($layers_row) {
|
1199 |
case 'text': {
|
1200 |
?>
|
1201 |
<span id="<?php echo $prefix; ?>" class="wds_draggable_<?php echo $slide_row->id; ?> wds_draggable ui-draggable" onclick="wds_showhide_layer('<?php echo $prefix; ?>_tbody', 1)"
|
1202 |
+
style="<?php echo $layer->image_width ? 'width: ' . $layer->image_width . '%; ' : ''; ?><?php echo $layer->image_height ? 'height: ' . $layer->image_height . '%; ' : ''; ?>word-break: <?php echo ($layer->image_scale ? 'keep-all' : 'break-all'); ?>; display: inline-block; position: absolute; left: <?php echo $layer->left; ?>px; top: <?php echo $layer->top; ?>px; z-index: <?php echo $layer->depth; ?>; color: #<?php echo $layer->color; ?>; font-size: <?php echo $layer->size; ?>px; line-height: 1.25em; font-family: <?php echo $layer->ffamily; ?>; font-weight: <?php echo $layer->fweight; ?>; padding: <?php echo $layer->padding; ?>; background-color: <?php echo WDW_S_Library::spider_hex2rgba($layer->fbgcolor, (100 - $layer->transparent) / 100); ?>; border: <?php echo $layer->border_width; ?>px <?php echo $layer->border_style; ?> #<?php echo $layer->border_color; ?>; border-radius: <?php echo $layer->border_radius; ?>; box-shadow: <?php echo $layer->shadow; ?>"><?php echo str_replace(array("\r\n", "\r", "\n"), "<br>", $layer->text); ?></span>
|
1203 |
<?php
|
1204 |
break;
|
1205 |
}
|
1206 |
case 'image': {
|
1207 |
?>
|
1208 |
<img id="<?php echo $prefix; ?>" class="wds_draggable_<?php echo $slide_row->id; ?> wds_draggable ui-draggable" onclick="wds_showhide_layer('<?php echo $prefix; ?>_tbody', 1)" src="<?php echo $layer->image_url; ?>"
|
1209 |
+
style="opacity: <?php echo (100 - $layer->imgtransparent) / 100; ?>; filter: Alpha(opacity=<?php echo 100 - $layer->imgtransparent; ?>); position: absolute; left: <?php echo $layer->left; ?>px; top: <?php echo $layer->top; ?>px; z-index: <?php echo $layer->depth; ?>; border: <?php echo $layer->border_width; ?>px <?php echo $layer->border_style; ?> #<?php echo $layer->border_color; ?>; border-radius: <?php echo $layer->border_radius; ?>; box-shadow: <?php echo $layer->shadow; ?>; " />
|
1210 |
<?php
|
1211 |
break;
|
1212 |
}
|
1229 |
</div>
|
1230 |
</td>
|
1231 |
</tr>
|
1232 |
+
<tr>
|
1233 |
+
<td class="spider_label"><label>Published: </label></td>
|
1234 |
+
<td>
|
1235 |
+
<input type="radio" id="published<?php echo $slide_row->id; ?>1" name="published<?php echo $slide_row->id; ?>" <?php echo (($slide_row->published) ? 'checked="checked"' : ''); ?> value="1" /><label for="published<?php echo $slide_row->id; ?>1">Yes</label>
|
1236 |
+
<input type="radio" id="published<?php echo $slide_row->id; ?>0" name="published<?php echo $slide_row->id; ?>" <?php echo (($slide_row->published) ? '' : 'checked="checked"'); ?> value="0" /><label for="published<?php echo $slide_row->id; ?>0">No</label>
|
1237 |
+
</td>
|
1238 |
+
</tr>
|
1239 |
+
<tr id="trlink<?php echo $slide_row->id; ?>" <?php echo $slide_row->type == 'image' ? '' : 'style="display: none;"'; ?>>
|
1240 |
+
<td class="spider_label">
|
1241 |
+
<label for="link<?php echo $slide_row->id; ?>">Link the slide to: </label>
|
1242 |
+
</td>
|
1243 |
+
<td>
|
1244 |
+
<input id="link<?php echo $slide_row->id; ?>" type="text" size="39" value="<?php echo $slide_row->link; ?>" name="link<?php echo $slide_row->id; ?>" />
|
1245 |
+
<div class="spider_description">You can set a redirection link, so that the user will get to the mentioned location upon hitting the slide.<br />Use http:// and https:// for external links.</div>
|
1246 |
+
</td>
|
1247 |
+
</tr>
|
1248 |
<tr>
|
1249 |
<td colspan="4">
|
1250 |
+
<input type="button" class="button-<?php echo !$fv ? "primary" : "secondary wds_free_button"; ?> button button-small" onclick="<?php echo !$fv ? "wds_add_layer('text', '" . $slide_row->id . "')" : "alert('This functionality is disabled in free version.')"; ?>; return false;" value="Add Text Layer" />
|
1251 |
+
<?php
|
1252 |
+
if (!$row->spider_uploader) {
|
1253 |
+
?>
|
1254 |
+
<input type="button" class="button-<?php echo !$fv ? "primary" : "secondary wds_free_button"; ?> button button-small" onclick="<?php echo !$fv ? "wds_add_layer('image', '" . $slide_row->id . "', '', event)" : "alert('This functionality is disabled in free version.')"; ?>; return false;" value="Add Image Layer" />
|
1255 |
+
<?php
|
1256 |
+
}
|
1257 |
+
else {
|
1258 |
+
?>
|
1259 |
+
<a href="<?php echo !$fv ? add_query_arg(array('action' => 'addImage', 'width' => '700', 'height' => '550', 'extensions' => 'jpg,jpeg,png,gif', 'callback' => 'wds_add_image', 'image_for' => 'add_layer', 'slide_id' => $slide_row->id, 'TB_iframe' => '1'), admin_url('admin-ajax.php')) : ''; ?>" onclick="<?php echo !$fv ? '' : "alert('This functionality is disabled in free version.')"; ?>; return false;" class="button-<?php echo !$fv ? "primary thickbox thickbox-preview" : "secondary wds_free_button"; ?> button button-small" id="content-add_media" title="Add Image Layer">
|
1260 |
+
Add Image layer
|
1261 |
+
</a>
|
1262 |
+
<?php
|
1263 |
+
}
|
1264 |
+
?>
|
1265 |
<input type="button" class="button-secondary button button-small wds_free_button" onclick="alert('This functionality is disabled in free version.'); return false;" value="Add Social Button Layer" />
|
1266 |
</td>
|
1267 |
</tr>
|
1276 |
<tr class="wds_layer_head_tr">
|
1277 |
<td class="wds_layer_head" colspan="4">
|
1278 |
<div class="handle connectedSortable" title="Drag to re-order"></div>
|
1279 |
+
<span class="wds_layer_label" onclick="wds_showhide_layer('<?php echo $prefix; ?>_tbody', 0)"><input id="<?php echo $prefix; ?>_title" name="<?php echo $prefix; ?>_title" type="text" class="wds_layer_title" style="width: 80px;" value="<?php echo $layer->title; ?>" title="Layer title" /></span>
|
1280 |
<span class="wds_layer_remove" onclick="wds_delete_layer('<?php echo $slide_row->id; ?>', '<?php echo $layer->id; ?>')" title="Delete layer"></span>
|
1281 |
<span class="wds_layer_dublicate" onclick="wds_add_layer('<?php echo $layer->type; ?>', '<?php echo $slide_row->id; ?>', '', event, 1); wds_duplicate_layer('<?php echo $layer->type; ?>', '<?php echo $slide_row->id; ?>', '<?php echo $layer->id; ?>');" title="Duplicate layer"></span>
|
1282 |
<input id="<?php echo $prefix; ?>_depth" class="wds_layer_depth spider_int_input" type="text" onchange="jQuery('#<?php echo $prefix; ?>').css({zIndex: jQuery(this).val()})" onkeypress="return spider_check_isnum(event)" value="<?php echo $layer->depth; ?>" prefix="<?php echo $prefix; ?>" name="<?php echo $prefix; ?>_depth" title="z-index" />
|
1324 |
</tr>
|
1325 |
<tr class="wds_layer_tr" style="display: none;">
|
1326 |
<td class="spider_label">
|
1327 |
+
<label for="<?php echo $prefix; ?>_image_width">Dimensions: </label>
|
1328 |
</td>
|
1329 |
<td>
|
1330 |
<input id="<?php echo $prefix; ?>_image_width" class="spider_int_input" type="text" onchange="wds_text_width(this,'<?php echo $prefix; ?>')" value="<?php echo $layer->image_width; ?>" name="<?php echo $prefix; ?>_image_width" /> x
|
1331 |
<input id="<?php echo $prefix; ?>_image_height" class="spider_int_input" type="text" onchange="wds_text_height(this,'<?php echo $prefix; ?>')" value="<?php echo $layer->image_height; ?>" name="<?php echo $prefix; ?>_image_height" /> %
|
1332 |
+
<input id="<?php echo $prefix; ?>_image_scale" type="checkbox" onchange="wds_break_word(this, '<?php echo $prefix; ?>')" name="<?php echo $prefix; ?>_image_scale" <?php echo (($layer->image_scale) ? 'checked="checked"' : ''); ?> /><label for="<?php echo $prefix; ?>_image_scale">Break-word</label>
|
1333 |
+
<div class="spider_description">Leave blank to keep the initial width and height.</div>
|
1334 |
</td>
|
1335 |
<td class="spider_label">
|
1336 |
<label for="<?php echo $prefix; ?>_layer_effect_out">Effect Out:</label>
|
1366 |
<td>
|
1367 |
X <input id="<?php echo $prefix; ?>_left" class="spider_int_input" type="text" onchange="jQuery('#<?php echo $prefix; ?>').css({left: jQuery(this).val() + 'px'})" onkeypress="return spider_check_isnum(event)" value="<?php echo $layer->left; ?>" name="<?php echo $prefix; ?>_left" />
|
1368 |
Y <input id="<?php echo $prefix; ?>_top" class="spider_int_input" type="text" onchange="jQuery('#<?php echo $prefix; ?>').css({top: jQuery(this).val() + 'px'})" onkeypress="return spider_check_isnum(event)" value="<?php echo $layer->top; ?>" name="<?php echo $prefix; ?>_top" />
|
1369 |
+
<div class="spider_description">In addition you can drag and drop the layer to a desired position.</div>
|
1370 |
</td>
|
1371 |
<td class="spider_label">
|
1372 |
<label for="<?php echo $prefix; ?>_padding">Padding: </label>
|
1508 |
<input type="hidden" name="<?php echo $prefix; ?>_image_url" id="<?php echo $prefix; ?>_image_url" value="<?php echo $layer->image_url; ?>" />
|
1509 |
<input id="<?php echo $prefix; ?>_image_width" class="spider_int_input" type="text" onkeyup="wds_scale('#<?php echo $prefix; ?>_image_scale', '<?php echo $prefix; ?>')" value="<?php echo $layer->image_width; ?>" name="<?php echo $prefix; ?>_image_width" /> x
|
1510 |
<input id="<?php echo $prefix; ?>_image_height" class="spider_int_input" type="text" onkeyup="wds_scale('#<?php echo $prefix; ?>_image_scale', '<?php echo $prefix; ?>')" value="<?php echo $layer->image_height; ?>" name="<?php echo $prefix; ?>_image_height" /> px
|
1511 |
+
<input id="<?php echo $prefix; ?>_image_scale" type="checkbox" onchange="wds_scale(this, '<?php echo $prefix; ?>')" name="<?php echo $prefix; ?>_image_scale" <?php echo (($layer->image_scale) ? 'checked="checked"' : ''); ?> /><label for="<?php echo $prefix; ?>_image_scale">Scale</label>
|
1512 |
+
<div class="spider_description">Set width and height of the image.</div>
|
1513 |
</td>
|
1514 |
<td class="spider_label">
|
1515 |
<label for="<?php echo $prefix; ?>_layer_effect_in">Effect In:</label>
|
1544 |
</td>
|
1545 |
<td>
|
1546 |
<input id="<?php echo $prefix; ?>_alt" type="text" size="39" value="<?php echo $layer->alt; ?>" name="<?php echo $prefix; ?>_alt" />
|
1547 |
+
<div class="spider_description">Set the HTML attribute specified in the IMG tag.</div>
|
1548 |
</td>
|
1549 |
<td class="spider_label">
|
1550 |
<label for="<?php echo $prefix; ?>_layer_effect_out">Effect Out:</label>
|
1606 |
<td>
|
1607 |
X <input id="<?php echo $prefix; ?>_left" class="spider_int_input" type="text" onchange="jQuery('#<?php echo $prefix; ?>').css({left: jQuery(this).val() + 'px'})" onkeypress="return spider_check_isnum(event)" value="<?php echo $layer->left; ?>" name="<?php echo $prefix; ?>_left" />
|
1608 |
Y <input id="<?php echo $prefix; ?>_top" class="spider_int_input" type="text" onchange="jQuery('#<?php echo $prefix; ?>').css({top: jQuery(this).val() + 'px'})" onkeypress="return spider_check_isnum(event)" value="<?php echo $layer->top; ?>" name="<?php echo $prefix; ?>_top" />
|
1609 |
+
<div class="spider_description">In addition you can drag and drop the layer to a desired position.</div>
|
1610 |
</td>
|
1611 |
<td class="spider_label">
|
1612 |
<label for="<?php echo $prefix; ?>_border_radius">Radius: </label>
|
1657 |
<td>
|
1658 |
X <input id="<?php echo $prefix; ?>_left" class="spider_int_input" type="text" onchange="jQuery('#<?php echo $prefix; ?>').css({left: jQuery(this).val() + 'px'})" onkeypress="return spider_check_isnum(event)" value="<?php echo $layer->left; ?>" name="<?php echo $prefix; ?>_left" />
|
1659 |
Y <input id="<?php echo $prefix; ?>_top" class="spider_int_input" type="text" onchange="jQuery('#<?php echo $prefix; ?>').css({top: jQuery(this).val() + 'px'})" onkeypress="return spider_check_isnum(event)" value="<?php echo $layer->top; ?>" name="<?php echo $prefix; ?>_top" />
|
1660 |
+
<div class="spider_description">In addition you can drag and drop the layer to a desired position.</div>
|
1661 |
</td>
|
1662 |
<td class="spider_label">
|
1663 |
<label for="<?php echo $prefix; ?>_layer_effect_in">Effect In:</label>
|
1792 |
<input id="slide<?php echo $slide_row->id; ?>_del_layer_ids_string" name="slide<?php echo $slide_row->id; ?>_del_layer_ids_string" type="hidden" value="" />
|
1793 |
</div>
|
1794 |
<script>
|
1795 |
+
jQuery(document).ready(function() {
|
1796 |
+
wds_whr('width');
|
1797 |
wds_drag_layer('<?php echo $slide_row->id; ?>');
|
1798 |
wds_layer_weights('<?php echo $slide_row->id; ?>');
|
1799 |
+
<?php
|
1800 |
+
if ($layers_row) {
|
1801 |
+
foreach ($layers_row as $key => $layer) {
|
1802 |
+
if ($layer->type == 'image') {
|
1803 |
+
$prefix = 'slide' . $slide_row->id . '_layer' . $layer->id;
|
1804 |
+
?>
|
1805 |
+
wds_scale('#<?php echo $prefix; ?>_image_scale', '<?php echo $prefix; ?>');
|
1806 |
+
<?php
|
1807 |
+
}
|
1808 |
+
}
|
1809 |
+
}
|
1810 |
+
?>
|
1811 |
});
|
1812 |
</script>
|
1813 |
<?php
|
1820 |
</table>
|
1821 |
</div>
|
1822 |
</div>
|
1823 |
+
<div class="wds_task_cont">
|
1824 |
+
<input id="current_id" name="current_id" type="hidden" value="<?php echo $row->id; ?>" />
|
1825 |
+
<input id="slide_ids_string" name="slide_ids_string" type="hidden" value="<?php echo $slide_ids_string; ?>" />
|
1826 |
+
<input id="del_slide_ids_string" name="del_slide_ids_string" type="hidden" value="" />
|
1827 |
+
<input id="nav_tab" name="nav_tab" type="hidden" value="<?php echo WDW_S_Library::get('nav_tab', 'global'); ?>" />
|
1828 |
+
<input id="tab" name="tab" type="hidden" value="<?php echo WDW_S_Library::get('tab', 'slides'); ?>" />
|
1829 |
+
<input id="sub_tab" name="sub_tab" type="hidden" value="<?php echo $sub_tab_type; ?>" />
|
1830 |
+
<script>
|
1831 |
+
var spider_uploader = <?php echo $row->spider_uploader; ?>;
|
1832 |
+
</script>
|
1833 |
+
</div>
|
1834 |
<input id="task" name="task" type="hidden" value="" />
|
|
|
|
|
|
|
|
|
|
|
|
|
1835 |
<script>
|
1836 |
+
var uploader_href = '<?php echo add_query_arg(array('action' => 'addImage', 'width' => '700', 'height' => '550', 'extensions' => 'jpg,jpeg,png,gif', 'callback' => 'wds_add_image', 'image_for' => 'add_update_slide', 'slide_id' => 'slideID', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>';
|
1837 |
+
var fv = '<?php echo $fv; ?>';
|
1838 |
jQuery(window).load(function() {
|
1839 |
+
wds_onload();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1840 |
});
|
1841 |
</script>
|
1842 |
<div class="opacity_add_image_url opacity_add_video wds_opacity_video" onclick="jQuery('.opacity_add_video').hide();jQuery('.opacity_add_image_url').hide();"></div>
|
admin/views/WDSViewUninstall_wds.php
CHANGED
@@ -92,7 +92,7 @@ class WDSViewUninstall_wds {
|
|
92 |
<p>The following Database Tables successfully deleted:</p>
|
93 |
<p><?php echo $prefix; ?>wdsslider,</p>
|
94 |
<p><?php echo $prefix; ?>wdsslide,</p>
|
95 |
-
<p><?php echo $prefix; ?>wdslayer
|
96 |
</div>
|
97 |
<?php
|
98 |
if (isset($_POST['bwg_delete_files'])) {
|
92 |
<p>The following Database Tables successfully deleted:</p>
|
93 |
<p><?php echo $prefix; ?>wdsslider,</p>
|
94 |
<p><?php echo $prefix; ?>wdsslide,</p>
|
95 |
+
<p><?php echo $prefix; ?>wdslayer.</p>
|
96 |
</div>
|
97 |
<?php
|
98 |
if (isset($_POST['bwg_delete_files'])) {
|
admin/views/WDSViewWDSShortcode.php
CHANGED
@@ -24,69 +24,55 @@ class WDSViewWDSShortcode {
|
|
24 |
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
public function display() {
|
26 |
$rows = $this->model->get_row_data();
|
|
|
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 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
<div style="float: right;">
|
76 |
-
<input type="submit" id="insert" name="insert" value="Insert" onClick="wds_insert_shortcode();"/>
|
77 |
-
</div>
|
78 |
-
</div>
|
79 |
-
<script type="text/javascript">
|
80 |
-
function wds_insert_shortcode() {
|
81 |
-
if (document.getElementById("wds_id").value) {
|
82 |
-
var tagtext = '[wds id="' + document.getElementById('wds_id').value + '"]';
|
83 |
-
window.tinyMCE.execCommand('mceInsertContent', false, tagtext);
|
84 |
-
}
|
85 |
-
tinyMCEPopup.close();
|
86 |
-
}
|
87 |
-
</script>
|
88 |
-
</body>
|
89 |
-
</html>
|
90 |
<?php
|
91 |
die();
|
92 |
}
|
24 |
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
public function display() {
|
26 |
$rows = $this->model->get_row_data();
|
27 |
+
wp_print_scripts('jquery');
|
28 |
?>
|
29 |
+
<link rel="stylesheet" href="<?php echo site_url(); ?>/wp-includes/js/tinymce/<?php echo ((get_bloginfo('version') < '3.8') ? 'themes/advanced/skins/wp_theme' : 'plugins/compat3x/css'); ?>/dialog.css" />
|
30 |
+
<div class="tabs" role="tablist" tabindex="-1">
|
31 |
+
<ul>
|
32 |
+
<li id="display_tab" class="current" role="tab" tabindex="0">
|
33 |
+
<span>
|
34 |
+
<a href="javascript:mcTabs.displayTab('display_tab','display_panel');" onMouseDown="return false;" tabindex="-1">Slider WD</a>
|
35 |
+
</span>
|
36 |
+
</li>
|
37 |
+
</ul>
|
38 |
+
</div>
|
39 |
+
<div class="panel_wrapper">
|
40 |
+
<div id="display_panel" class="panel current" style="height: 90px !important;">
|
41 |
+
<table>
|
42 |
+
<tr>
|
43 |
+
<td style="vertical-align: middle; text-align: left;">Select a Slider</td>
|
44 |
+
<td style="vertical-align: middle; text-align: left;">
|
45 |
+
<select name="wds_id" id="wds_id" style="width: 230px; text-align: left;">
|
46 |
+
<option value="0" selected="selected">- Select a Slider -</option>
|
47 |
+
<?php
|
48 |
+
foreach ($rows as $row) {
|
49 |
+
?>
|
50 |
+
<option value="<?php echo $row->id; ?>"><?php echo $row->name; ?></option>
|
51 |
+
<?php
|
52 |
+
}
|
53 |
+
?>
|
54 |
+
</select>
|
55 |
+
</td>
|
56 |
+
</tr>
|
57 |
+
</table>
|
58 |
+
</div>
|
59 |
+
</div>
|
60 |
+
<div class="mceActionPanel">
|
61 |
+
<div style="float: left;">
|
62 |
+
<input type="button" id="cancel" name="cancel" value="Cancel" onClick="window.parent.tb_remove();" />
|
63 |
+
</div>
|
64 |
+
<div style="float: right;">
|
65 |
+
<input type="submit" id="insert" name="insert" value="Insert" onClick="wds_insert_shortcode();" />
|
66 |
+
</div>
|
67 |
+
</div>
|
68 |
+
<script type="text/javascript">
|
69 |
+
function wds_insert_shortcode() {
|
70 |
+
if (document.getElementById("wds_id").value) {
|
71 |
+
window.parent.send_to_editor('[wds id="' + document.getElementById('wds_id').value + '"]');
|
72 |
+
}
|
73 |
+
window.parent.tb_remove();
|
74 |
+
}
|
75 |
+
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
<?php
|
77 |
die();
|
78 |
}
|
css/wds_tables.css
CHANGED
@@ -23,8 +23,39 @@
|
|
23 |
text-shadow: none !important;
|
24 |
}
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
.spider_ajax_loading {
|
27 |
border: none !important;
|
|
|
|
|
28 |
-webkit-animation: spin 2.5s infinite linear;
|
29 |
-moz-animation: spin 2.5s infinite linear;
|
30 |
-o-animation: spin 2.5s infinite linear;
|
@@ -201,6 +232,8 @@
|
|
201 |
.handle {
|
202 |
background: url("../images/draggable.png") no-repeat transparent;
|
203 |
border: none;
|
|
|
|
|
204 |
height: 15px;
|
205 |
margin: 0 auto;
|
206 |
vertical-align: middle;
|
@@ -217,10 +250,6 @@
|
|
217 |
width: 32px;
|
218 |
}
|
219 |
|
220 |
-
.connectedSortable {
|
221 |
-
cursor: move;
|
222 |
-
}
|
223 |
-
|
224 |
.spider_label {
|
225 |
font-weight: bold;
|
226 |
width: 100px;
|
@@ -516,7 +545,7 @@
|
|
516 |
font: bold 14px/26px Arial,serif;
|
517 |
height: 26px;
|
518 |
padding: 0 5px;
|
519 |
-
width:
|
520 |
}
|
521 |
|
522 |
.wds_add_layer {
|
@@ -533,7 +562,7 @@
|
|
533 |
filter: Alpha(opacity=50);
|
534 |
padding: 1px;
|
535 |
vertical-align: middle;
|
536 |
-
width:
|
537 |
}
|
538 |
|
539 |
.wds_sub_active .wds_tab_title,
|
@@ -593,7 +622,6 @@
|
|
593 |
.wds_layer_label {
|
594 |
display: inline-block;
|
595 |
font-size: 13px;
|
596 |
-
margin: 5px;
|
597 |
width: 80%;
|
598 |
}
|
599 |
|
@@ -753,7 +781,7 @@
|
|
753 |
}
|
754 |
|
755 |
.wds_box td {
|
756 |
-
padding:
|
757 |
}
|
758 |
|
759 |
.wds_active_layer {
|
23 |
text-shadow: none !important;
|
24 |
}
|
25 |
|
26 |
+
.spider_message_cont {
|
27 |
+
display: none;
|
28 |
+
width: 99%;
|
29 |
+
}
|
30 |
+
|
31 |
+
.spider_load {
|
32 |
+
display: none;
|
33 |
+
}
|
34 |
+
|
35 |
+
.spider_load_cont {
|
36 |
+
background-color: rgba(0, 0, 0, 0.2);
|
37 |
+
left: 0;
|
38 |
+
height: 100%;
|
39 |
+
position: fixed;
|
40 |
+
top: 0;
|
41 |
+
width: 100%;
|
42 |
+
z-index: 99998;
|
43 |
+
}
|
44 |
+
|
45 |
+
.spider_load_icon {
|
46 |
+
left: 0;
|
47 |
+
height: 100%;
|
48 |
+
position: fixed;
|
49 |
+
text-align: center;
|
50 |
+
top: 0;
|
51 |
+
width: 100%;
|
52 |
+
z-index: 99999;
|
53 |
+
}
|
54 |
+
|
55 |
.spider_ajax_loading {
|
56 |
border: none !important;
|
57 |
+
margin-top: 200px;
|
58 |
+
width: 50px;
|
59 |
-webkit-animation: spin 2.5s infinite linear;
|
60 |
-moz-animation: spin 2.5s infinite linear;
|
61 |
-o-animation: spin 2.5s infinite linear;
|
232 |
.handle {
|
233 |
background: url("../images/draggable.png") no-repeat transparent;
|
234 |
border: none;
|
235 |
+
cursor: move;
|
236 |
+
display: inline-block;
|
237 |
height: 15px;
|
238 |
margin: 0 auto;
|
239 |
vertical-align: middle;
|
250 |
width: 32px;
|
251 |
}
|
252 |
|
|
|
|
|
|
|
|
|
253 |
.spider_label {
|
254 |
font-weight: bold;
|
255 |
width: 100px;
|
545 |
font: bold 14px/26px Arial,serif;
|
546 |
height: 26px;
|
547 |
padding: 0 5px;
|
548 |
+
width: 87px;
|
549 |
}
|
550 |
|
551 |
.wds_add_layer {
|
562 |
filter: Alpha(opacity=50);
|
563 |
padding: 1px;
|
564 |
vertical-align: middle;
|
565 |
+
width: 50px;
|
566 |
}
|
567 |
|
568 |
.wds_sub_active .wds_tab_title,
|
622 |
.wds_layer_label {
|
623 |
display: inline-block;
|
624 |
font-size: 13px;
|
|
|
625 |
width: 80%;
|
626 |
}
|
627 |
|
781 |
}
|
782 |
|
783 |
.wds_box td {
|
784 |
+
padding: 6px 0;
|
785 |
}
|
786 |
|
787 |
.wds_active_layer {
|
demo/1-150x150.jpg
ADDED
Binary file
|
demo/1.jpg
ADDED
Binary file
|
demo/2-150x150.jpg
ADDED
Binary file
|
demo/2.jpg
ADDED
Binary file
|
demo/3-150x150.jpg
ADDED
Binary file
|
demo/3.jpg
ADDED
Binary file
|
featured/featured.php
CHANGED
@@ -31,6 +31,12 @@ function spider_featured($current_plugin = '') {
|
|
31 |
'content' => 'WordPress Contact Form Maker is an advanced and easy-to-use tool for creating forms.',
|
32 |
'href' => 'http://web-dorado.com/products/wordpress-contact-form-maker-plugin.html'
|
33 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
"spider-calendar" => array(
|
35 |
'title' => 'Spider Calendar',
|
36 |
'text' => 'WordPress event calendar plugin',
|
31 |
'content' => 'WordPress Contact Form Maker is an advanced and easy-to-use tool for creating forms.',
|
32 |
'href' => 'http://web-dorado.com/products/wordpress-contact-form-maker-plugin.html'
|
33 |
),
|
34 |
+
"fm-import" => array(
|
35 |
+
'title' => 'Form Maker Export/Import',
|
36 |
+
'text' => 'WordPress Form Maker export/import plugin',
|
37 |
+
'content' => 'Form Maker Export/Import is a Form Maker capacity enhancing plugin.',
|
38 |
+
'href' => 'http://web-dorado.com/products/wordpress-form/export-import.html'
|
39 |
+
),
|
40 |
"spider-calendar" => array(
|
41 |
'title' => 'Spider Calendar',
|
42 |
'text' => 'WordPress event calendar plugin',
|
featured/images/fm.import.jpg
ADDED
Binary file
|
featured/style.css
CHANGED
@@ -13,6 +13,7 @@
|
|
13 |
#main_featured_plugins_page #featured-plugins-list li.player .product {background: url("images/player.jpg") left center no-repeat;}
|
14 |
#main_featured_plugins_page #featured-plugins-list li.spider-calendar .product {background: url("images/spider-calendar.jpg") left center no-repeat;}
|
15 |
#main_featured_plugins_page #featured-plugins-list li.zoom .product {background: url("images/zoom.jpg") left center no-repeat;}
|
|
|
16 |
|
17 |
#main_featured_plugins_page * {
|
18 |
color: #444;
|
13 |
#main_featured_plugins_page #featured-plugins-list li.player .product {background: url("images/player.jpg") left center no-repeat;}
|
14 |
#main_featured_plugins_page #featured-plugins-list li.spider-calendar .product {background: url("images/spider-calendar.jpg") left center no-repeat;}
|
15 |
#main_featured_plugins_page #featured-plugins-list li.zoom .product {background: url("images/zoom.jpg") left center no-repeat;}
|
16 |
+
#main_featured_plugins_page #featured-plugins-list li.fm-import .product {background: url("images/fm.import.jpg") left center no-repeat;}
|
17 |
|
18 |
#main_featured_plugins_page * {
|
19 |
color: #444;
|
filemanager/UploadHandler.php
ADDED
@@ -0,0 +1,966 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* jQuery File Upload Plugin PHP Class 6.4.1
|
4 |
+
*
|
5 |
+
*
|
6 |
+
* Copyright 2010, Sebastian Tschan
|
7 |
+
* https://blueimp.net
|
8 |
+
*
|
9 |
+
* Licensed under the MIT license:
|
10 |
+
* http://www.opensource.org/licenses/MIT
|
11 |
+
*/
|
12 |
+
|
13 |
+
if (function_exists('current_user_can')) {
|
14 |
+
if (!current_user_can('read')) {
|
15 |
+
die('Access Denied');
|
16 |
+
}
|
17 |
+
}
|
18 |
+
else {
|
19 |
+
die('Access Denied');
|
20 |
+
}
|
21 |
+
|
22 |
+
$upload_handler = new UploadHandler(array(
|
23 |
+
'upload_dir' => $_GET['dir'],
|
24 |
+
'accept_file_types' => '/\.(gif|jpe?g|png|bmp|mp4|flv|webm|ogg|mp3|wav|pdf|zip)$/i'
|
25 |
+
));
|
26 |
+
|
27 |
+
class UploadHandler {
|
28 |
+
protected $options;
|
29 |
+
// PHP File Upload error message codes:
|
30 |
+
// http://php.net/manual/en/features.file-upload.errors.php
|
31 |
+
protected $error_messages = array(
|
32 |
+
1 => 'The uploaded file exceeds the upload_max_filesize directive in php.ini',
|
33 |
+
2 => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form',
|
34 |
+
3 => 'The uploaded file was only partially uploaded',
|
35 |
+
4 => 'No file was uploaded',
|
36 |
+
6 => 'Missing a temporary folder',
|
37 |
+
7 => 'Failed to write file to disk',
|
38 |
+
8 => 'A PHP extension stopped the file upload',
|
39 |
+
'post_max_size' => 'The uploaded file exceeds the post_max_size directive in php.ini',
|
40 |
+
'max_file_size' => 'File is too big',
|
41 |
+
'min_file_size' => 'File is too small',
|
42 |
+
'accept_file_types' => 'Filetype not allowed',
|
43 |
+
'max_number_of_files' => 'Maximum number of files exceeded',
|
44 |
+
'max_width' => 'Image exceeds maximum width',
|
45 |
+
'min_width' => 'Image requires a minimum width',
|
46 |
+
'max_height' => 'Image exceeds maximum height',
|
47 |
+
'min_height' => 'Image requires a minimum height'
|
48 |
+
);
|
49 |
+
|
50 |
+
function __construct($options = null, $initialize = true, $error_messages = null) {
|
51 |
+
$this->options = array(
|
52 |
+
'script_url' => $this->get_full_url().'/',
|
53 |
+
'upload_dir' => dirname($_SERVER['SCRIPT_FILENAME']).'/files/',
|
54 |
+
'upload_url' => $this->get_full_url().'/files/',
|
55 |
+
'user_dirs' => false,
|
56 |
+
'mkdir_mode' => 0755,
|
57 |
+
'param_name' => 'files',
|
58 |
+
// Set the following option to 'POST', if your server does not support
|
59 |
+
// DELETE requests. This is a parameter sent to the client:
|
60 |
+
'delete_type' => 'DELETE',
|
61 |
+
'access_control_allow_origin' => '*',
|
62 |
+
'access_control_allow_credentials' => false,
|
63 |
+
'access_control_allow_methods' => array(
|
64 |
+
'OPTIONS',
|
65 |
+
'HEAD',
|
66 |
+
'GET',
|
67 |
+
'POST',
|
68 |
+
'PUT',
|
69 |
+
'PATCH',
|
70 |
+
'DELETE'
|
71 |
+
),
|
72 |
+
'access_control_allow_headers' => array(
|
73 |
+
'Content-Type',
|
74 |
+
'Content-Range',
|
75 |
+
'Content-Disposition'
|
76 |
+
),
|
77 |
+
// Enable to provide file downloads via GET requests to the PHP script:
|
78 |
+
'download_via_php' => false,
|
79 |
+
// Defines which files can be displayed inline when downloaded:
|
80 |
+
'inline_file_types' => '/\.(gif|jpe?g|png)$/i',
|
81 |
+
// Defines which files (based on their names) are accepted for upload:
|
82 |
+
'accept_file_types' => '/.+$/i',
|
83 |
+
// The php.ini settings upload_max_filesize and post_max_size
|
84 |
+
// take precedence over the following max_file_size setting:
|
85 |
+
'max_file_size' => null,
|
86 |
+
'min_file_size' => 1,
|
87 |
+
// The maximum number of files for the upload directory:
|
88 |
+
'max_number_of_files' => null,
|
89 |
+
// Image resolution restrictions:
|
90 |
+
'max_width' => ((isset($_REQUEST['file_namesML']) && esc_html($_REQUEST['file_namesML'])) ? (isset($_REQUEST['importer_img_width']) ? (int) $_REQUEST['importer_img_width'] : 1200) : (isset($_POST['upload_img_width']) ? (int) $_POST['upload_img_width'] : 1200)),
|
91 |
+
'max_height' => ((isset($_REQUEST['file_namesML']) && esc_html($_REQUEST['file_namesML'])) ? (isset($_REQUEST['importer_img_height']) ? (int) $_REQUEST['importer_img_height'] : 1200) : (isset($_POST['upload_img_height']) ? (int) $_POST['upload_img_height'] : 1200)),
|
92 |
+
'min_width' => 1,
|
93 |
+
'min_height' => 1,
|
94 |
+
// Set the following option to false to enable resumable uploads:
|
95 |
+
'discard_aborted_uploads' => true,
|
96 |
+
// Set to true to rotate images based on EXIF meta data, if available:
|
97 |
+
'orient_image' => false,
|
98 |
+
);
|
99 |
+
if (!$this->options['max_width'] || !$this->options['max_height']) {
|
100 |
+
$this->options['max_width'] = NULL;
|
101 |
+
$this->options['max_height'] = NULL;
|
102 |
+
}
|
103 |
+
$this->options += array(
|
104 |
+
'image_versions' => array(
|
105 |
+
// Uncomment the following version to restrict the size of
|
106 |
+
// uploaded images:
|
107 |
+
/*
|
108 |
+
'' => array(
|
109 |
+
'max_width' => 1920,
|
110 |
+
'max_height' => 1200,
|
111 |
+
'jpeg_quality' => 95
|
112 |
+
),
|
113 |
+
*/
|
114 |
+
// Uncomment the following to create medium sized images:
|
115 |
+
/*
|
116 |
+
'medium' => array(
|
117 |
+
'max_width' => 800,
|
118 |
+
'max_height' => 600,
|
119 |
+
'jpeg_quality' => 80
|
120 |
+
),
|
121 |
+
*/
|
122 |
+
'.original' => array(
|
123 |
+
'max_width' => $this->options['max_width'],
|
124 |
+
'max_height' => $this->options['max_height'],
|
125 |
+
'jpeg_quality' => 100
|
126 |
+
),
|
127 |
+
'thumb' => array(
|
128 |
+
'max_width' => ((isset($_REQUEST['file_namesML']) && esc_html($_REQUEST['file_namesML'])) ? (isset($_REQUEST['importer_thumb_width']) ? (int) $_REQUEST['importer_thumb_width'] : 300) : ((isset($_POST['upload_thumb_width']) && (int) $_POST['upload_thumb_width']) ? (int) $_POST['upload_thumb_width'] : 300)),
|
129 |
+
'max_height' => ((isset($_REQUEST['file_namesML']) && esc_html($_REQUEST['file_namesML'])) ? (isset($_REQUEST['importer_thumb_height']) ? (int) $_REQUEST['importer_thumb_height'] : 300) : ((isset($_POST['upload_thumb_height']) && (int) $_POST['upload_thumb_height']) ? (int) $_POST['upload_thumb_height'] : 300)),
|
130 |
+
'jpeg_quality' => 90
|
131 |
+
),
|
132 |
+
)
|
133 |
+
);
|
134 |
+
if ($options) {
|
135 |
+
$this->options = array_merge($this->options, $options);
|
136 |
+
}
|
137 |
+
if ($error_messages) {
|
138 |
+
$this->error_messages = array_merge($this->error_messages, $error_messages);
|
139 |
+
}
|
140 |
+
if ($initialize) {
|
141 |
+
$this->initialize();
|
142 |
+
}
|
143 |
+
}
|
144 |
+
|
145 |
+
protected function initialize() {
|
146 |
+
switch ($_SERVER['REQUEST_METHOD']) {
|
147 |
+
case 'OPTIONS':
|
148 |
+
case 'HEAD':
|
149 |
+
$this->head();
|
150 |
+
break;
|
151 |
+
case 'GET':
|
152 |
+
$this->get();
|
153 |
+
break;
|
154 |
+
case 'PATCH':
|
155 |
+
case 'PUT':
|
156 |
+
case 'POST':
|
157 |
+
$this->post();
|
158 |
+
break;
|
159 |
+
case 'DELETE':
|
160 |
+
$this->delete();
|
161 |
+
break;
|
162 |
+
default:
|
163 |
+
$this->header('HTTP/1.1 405 Method Not Allowed');
|
164 |
+
}
|
165 |
+
}
|
166 |
+
|
167 |
+
protected function get_full_url() {
|
168 |
+
$https = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off';
|
169 |
+
return
|
170 |
+
($https ? 'https://' : 'http://').
|
171 |
+
(!empty($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'].'@' : '').
|
172 |
+
(isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ($_SERVER['SERVER_NAME'].
|
173 |
+
($https && $_SERVER['SERVER_PORT'] === 443 ||
|
174 |
+
$_SERVER['SERVER_PORT'] === 80 ? '' : ':'.$_SERVER['SERVER_PORT']))).
|
175 |
+
substr($_SERVER['SCRIPT_NAME'],0, strrpos($_SERVER['SCRIPT_NAME'], '/'));
|
176 |
+
}
|
177 |
+
|
178 |
+
protected function get_user_id() {
|
179 |
+
@session_start();
|
180 |
+
return session_id();
|
181 |
+
}
|
182 |
+
|
183 |
+
protected function get_user_path() {
|
184 |
+
if ($this->options['user_dirs']) {
|
185 |
+
return $this->get_user_id().'/';
|
186 |
+
}
|
187 |
+
return '';
|
188 |
+
}
|
189 |
+
|
190 |
+
protected function get_upload_path($file_name = null, $version = null) {
|
191 |
+
$file_name = $file_name ? $file_name : '';
|
192 |
+
$version_path = empty($version) ? '' : $version.'/';
|
193 |
+
return $this->options['upload_dir'].$this->get_user_path()
|
194 |
+
.$version_path.$file_name;
|
195 |
+
}
|
196 |
+
|
197 |
+
protected function get_query_separator($url) {
|
198 |
+
return strpos($url, '?') === false ? '?' : '&';
|
199 |
+
}
|
200 |
+
|
201 |
+
protected function get_download_url($file_name, $version = null) {
|
202 |
+
if ($this->options['download_via_php']) {
|
203 |
+
$url = $this->options['script_url']
|
204 |
+
.$this->get_query_separator($this->options['script_url'])
|
205 |
+
.'file='.rawurlencode($file_name);
|
206 |
+
if ($version) {
|
207 |
+
$url .= '&version='.rawurlencode($version);
|
208 |
+
}
|
209 |
+
return $url.'&download=1';
|
210 |
+
}
|
211 |
+
$version_path = empty($version) ? '' : rawurlencode($version).'/';
|
212 |
+
return $this->options['upload_url'].$this->get_user_path()
|
213 |
+
.$version_path.rawurlencode($file_name);
|
214 |
+
}
|
215 |
+
|
216 |
+
protected function set_file_delete_properties($file) {
|
217 |
+
$file->delete_url = $this->options['script_url']
|
218 |
+
.$this->get_query_separator($this->options['script_url'])
|
219 |
+
.'file='.rawurlencode($file->name);
|
220 |
+
$file->delete_type = $this->options['delete_type'];
|
221 |
+
if ($file->delete_type !== 'DELETE') {
|
222 |
+
$file->delete_url .= '&_method=DELETE';
|
223 |
+
}
|
224 |
+
if ($this->options['access_control_allow_credentials']) {
|
225 |
+
$file->delete_with_credentials = true;
|
226 |
+
}
|
227 |
+
}
|
228 |
+
|
229 |
+
// Fix for overflowing signed 32 bit integers,
|
230 |
+
// works for sizes up to 2^32-1 bytes (4 GiB - 1):
|
231 |
+
protected function fix_integer_overflow($size) {
|
232 |
+
if ($size < 0) {
|
233 |
+
$size += 2.0 * (PHP_INT_MAX + 1);
|
234 |
+
}
|
235 |
+
return $size;
|
236 |
+
}
|
237 |
+
|
238 |
+
protected function get_file_size($file_path, $clear_stat_cache = false) {
|
239 |
+
if ($clear_stat_cache) {
|
240 |
+
clearstatcache(true, $file_path);
|
241 |
+
}
|
242 |
+
return $this->fix_integer_overflow(filesize($file_path));
|
243 |
+
|
244 |
+
}
|
245 |
+
|
246 |
+
protected function is_valid_file_object($file_name) {
|
247 |
+
$file_path = $this->get_upload_path($file_name);
|
248 |
+
if (is_file($file_path) && $file_name[0] !== '.') {
|
249 |
+
return true;
|
250 |
+
}
|
251 |
+
return false;
|
252 |
+
}
|
253 |
+
|
254 |
+
protected function get_file_object($file_name) {
|
255 |
+
if ($this->is_valid_file_object($file_name)) {
|
256 |
+
$file = new stdClass();
|
257 |
+
$file->name = $file_name;
|
258 |
+
$file->size = $this->get_file_size(
|
259 |
+
$this->get_upload_path($file_name)
|
260 |
+
);
|
261 |
+
$file->url = $this->get_download_url($file->name);
|
262 |
+
foreach($this->options['image_versions'] as $version => $options) {
|
263 |
+
if (!empty($version)) {
|
264 |
+
if (is_file($this->get_upload_path($file_name, $version))) {
|
265 |
+
$file->{$version.'_url'} = $this->get_download_url(
|
266 |
+
$file->name,
|
267 |
+
$version
|
268 |
+
);
|
269 |
+
}
|
270 |
+
}
|
271 |
+
}
|
272 |
+
$this->set_file_delete_properties($file);
|
273 |
+
return $file;
|
274 |
+
}
|
275 |
+
return null;
|
276 |
+
}
|
277 |
+
|
278 |
+
protected function get_file_objects($iteration_method = 'get_file_object') {
|
279 |
+
$upload_dir = $this->get_upload_path();
|
280 |
+
if (!is_dir($upload_dir)) {
|
281 |
+
return array();
|
282 |
+
}
|
283 |
+
return array_values(array_filter(array_map(
|
284 |
+
array($this, $iteration_method),
|
285 |
+
scandir($upload_dir)
|
286 |
+
)));
|
287 |
+
}
|
288 |
+
|
289 |
+
protected function count_file_objects() {
|
290 |
+
return count($this->get_file_objects('is_valid_file_object'));
|
291 |
+
}
|
292 |
+
|
293 |
+
protected function create_scaled_image($file_name, $version, $options) {
|
294 |
+
$file_path = $this->get_upload_path($file_name);
|
295 |
+
if (!empty($version) && ($version != 'main')) {
|
296 |
+
$version_dir = $this->get_upload_path(null, $version);
|
297 |
+
if (!is_dir($version_dir)) {
|
298 |
+
mkdir($version_dir, $this->options['mkdir_mode'], true);
|
299 |
+
}
|
300 |
+
$new_file_path = $version_dir.'/'.$file_name;
|
301 |
+
} else {
|
302 |
+
$new_file_path = $file_path;
|
303 |
+
}
|
304 |
+
if (!function_exists('getimagesize')) {
|
305 |
+
error_log('Function not found: getimagesize');
|
306 |
+
return false;
|
307 |
+
}
|
308 |
+
list($img_width, $img_height) = @getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));
|
309 |
+
if (!$img_width || !$img_height) {
|
310 |
+
return false;
|
311 |
+
}
|
312 |
+
$max_width = $options['max_width'];
|
313 |
+
$max_height = $options['max_height'];
|
314 |
+
$scale = min(
|
315 |
+
$max_width / $img_width,
|
316 |
+
$max_height / $img_height
|
317 |
+
);
|
318 |
+
ini_set('memory_limit', '-1');
|
319 |
+
if (($scale >= 1) || (($max_width == NULL) && ($max_height == NULL))) {
|
320 |
+
if ($file_path !== $new_file_path) {
|
321 |
+
return copy($file_path, $new_file_path);
|
322 |
+
}
|
323 |
+
return true;
|
324 |
+
}
|
325 |
+
if (!function_exists('imagecreatetruecolor')) {
|
326 |
+
error_log('Function not found: imagecreatetruecolor');
|
327 |
+
return false;
|
328 |
+
}
|
329 |
+
|
330 |
+
if (empty($options['crop'])) {
|
331 |
+
$new_width = $img_width * $scale;
|
332 |
+
$new_height = $img_height * $scale;
|
333 |
+
$dst_x = 0;
|
334 |
+
$dst_y = 0;
|
335 |
+
$new_img = @imagecreatetruecolor($new_width, $new_height);
|
336 |
+
} else {
|
337 |
+
if (($img_width / $img_height) >= ($max_width / $max_height)) {
|
338 |
+
$new_width = $img_width / ($img_height / $max_height);
|
339 |
+
$new_height = $max_height;
|
340 |
+
} else {
|
341 |
+
$new_width = $max_width;
|
342 |
+
$new_height = $img_height / ($img_width / $max_width);
|
343 |
+
}
|
344 |
+
$dst_x = 0 - ($new_width - $max_width) / 2;
|
345 |
+
$dst_y = 0 - ($new_height - $max_height) / 2;
|
346 |
+
$new_img = @imagecreatetruecolor($max_width, $max_height);
|
347 |
+
}
|
348 |
+
list($width, $height, $type) = getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));
|
349 |
+
// switch (strtolower(substr(strrchr($file_name, '.'), 1))) {
|
350 |
+
switch ($type) {
|
351 |
+
case 2:
|
352 |
+
$src_img = @imagecreatefromjpeg($file_path);
|
353 |
+
$write_image = 'imagejpeg';
|
354 |
+
$image_quality = isset($options['jpeg_quality']) ? $options['jpeg_quality'] : 75;
|
355 |
+
break;
|
356 |
+
case 1:
|
357 |
+
@imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0));
|
358 |
+
$src_img = @imagecreatefromgif($file_path);
|
359 |
+
$write_image = 'imagegif';
|
360 |
+
$image_quality = null;
|
361 |
+
break;
|
362 |
+
case 3:
|
363 |
+
@imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0));
|
364 |
+
@imagealphablending($new_img, false);
|
365 |
+
@imagesavealpha($new_img, true);
|
366 |
+
$src_img = @imagecreatefrompng($file_path);
|
367 |
+
$write_image = 'imagepng';
|
368 |
+
$image_quality = isset($options['png_quality']) ? $options['png_quality'] : 9;
|
369 |
+
break;
|
370 |
+
default:
|
371 |
+
$src_img = null;
|
372 |
+
}
|
373 |
+
$success = $src_img && @imagecopyresampled(
|
374 |
+
$new_img,
|
375 |
+
$src_img,
|
376 |
+
$dst_x,
|
377 |
+
$dst_y,
|
378 |
+
0,
|
379 |
+
0,
|
380 |
+
$new_width,
|
381 |
+
$new_height,
|
382 |
+
$img_width,
|
383 |
+
$img_height
|
384 |
+
) && $write_image($new_img, $new_file_path, $image_quality);
|
385 |
+
// Free up memory (imagedestroy does not delete files):
|
386 |
+
@imagedestroy($src_img);
|
387 |
+
@imagedestroy($new_img);
|
388 |
+
ini_restore('memory_limit');
|
389 |
+
return $success;
|
390 |
+
}
|
391 |
+
|
392 |
+
protected function get_error_message($error) {
|
393 |
+
return array_key_exists($error, $this->error_messages) ? $this->error_messages[$error] : $error;
|
394 |
+
}
|
395 |
+
|
396 |
+
function get_config_bytes($val) {
|
397 |
+
$val = trim($val);
|
398 |
+
$last = strtolower($val[strlen($val)-1]);
|
399 |
+
switch($last) {
|
400 |
+
case 'g':
|
401 |
+
$val *= 1024;
|
402 |
+
case 'm':
|
403 |
+
$val *= 1024;
|
404 |
+
case 'k':
|
405 |
+
$val *= 1024;
|
406 |
+
}
|
407 |
+
return $this->fix_integer_overflow($val);
|
408 |
+
}
|
409 |
+
|
410 |
+
protected function validate($uploaded_file, $file, $error, $index) {
|
411 |
+
if ($error) {
|
412 |
+
$file->error = $this->get_error_message($error);
|
413 |
+
return false;
|
414 |
+
}
|
415 |
+
$content_length = $this->fix_integer_overflow(intval($_SERVER['CONTENT_LENGTH']));
|
416 |
+
$post_max_size = $this->get_config_bytes(ini_get('post_max_size'));
|
417 |
+
if ($post_max_size && ($content_length > $post_max_size)) {
|
418 |
+
$file->error = $this->get_error_message('post_max_size');
|
419 |
+
return false;
|
420 |
+
}
|
421 |
+
if (!preg_match($this->options['accept_file_types'], $file->name)) {
|
422 |
+
$file->error = $this->get_error_message('accept_file_types');
|
423 |
+
return false;
|
424 |
+
}
|
425 |
+
if ($uploaded_file && is_uploaded_file($uploaded_file)) {
|
426 |
+
$file_size = $this->get_file_size($uploaded_file);
|
427 |
+
}
|
428 |
+
else {
|
429 |
+
$file_size = $content_length;
|
430 |
+
}
|
431 |
+
if ($this->options['max_file_size'] && (
|
432 |
+
$file_size > $this->options['max_file_size'] ||
|
433 |
+
$file->size > $this->options['max_file_size'])
|
434 |
+
) {
|
435 |
+
$file->error = $this->get_error_message('max_file_size');
|
436 |
+
return false;
|
437 |
+
}
|
438 |
+
if ($this->options['min_file_size'] &&
|
439 |
+
$file_size < $this->options['min_file_size']) {
|
440 |
+
$file->error = $this->get_error_message('min_file_size');
|
441 |
+
return false;
|
442 |
+
}
|
443 |
+
if (is_int($this->options['max_number_of_files']) && (
|
444 |
+
$this->count_file_objects() >= $this->options['max_number_of_files'])
|
445 |
+
) {
|
446 |
+
$file->error = $this->get_error_message('max_number_of_files');
|
447 |
+
return false;
|
448 |
+
}
|
449 |
+
list($img_width, $img_height) = @getimagesize(htmlspecialchars_decode($uploaded_file, ENT_COMPAT | ENT_QUOTES));
|
450 |
+
if (is_int($img_width)) {
|
451 |
+
// if ($this->options['max_width'] && $img_width > $this->options['max_width']) {
|
452 |
+
// $file->error = $this->get_error_message('max_width');
|
453 |
+
// return false;
|
454 |
+
// }
|
455 |
+
// if ($this->options['max_height'] && $img_height > $this->options['max_height']) {
|
456 |
+
// $file->error = $this->get_error_message('max_height');
|
457 |
+
// return false;
|
458 |
+
// }
|
459 |
+
if ($this->options['min_width'] && $img_width < $this->options['min_width']) {
|
460 |
+
$file->error = $this->get_error_message('min_width');
|
461 |
+
return false;
|
462 |
+
}
|
463 |
+
if ($this->options['min_height'] && $img_height < $this->options['min_height']) {
|
464 |
+
$file->error = $this->get_error_message('min_height');
|
465 |
+
return false;
|
466 |
+
}
|
467 |
+
}
|
468 |
+
return true;
|
469 |
+
}
|
470 |
+
|
471 |
+
protected function upcount_name_callback($matches) {
|
472 |
+
$index = isset($matches[1]) ? intval($matches[1]) + 1 : 1;
|
473 |
+
$ext = isset($matches[2]) ? $matches[2] : '';
|
474 |
+
return ' ('.$index.')'.$ext;
|
475 |
+
}
|
476 |
+
|
477 |
+
protected function upcount_name($name) {
|
478 |
+
return preg_replace_callback(
|
479 |
+
'/(?:(?: \(([\d]+)\))?(\.[^.]+))?$/',
|
480 |
+
array($this, 'upcount_name_callback'),
|
481 |
+
$name,
|
482 |
+
1
|
483 |
+
);
|
484 |
+
}
|
485 |
+
|
486 |
+
protected function get_unique_filename($name, $type, $index, $content_range) {
|
487 |
+
while(is_dir($this->get_upload_path($name))) {
|
488 |
+
$name = $this->upcount_name($name);
|
489 |
+
}
|
490 |
+
// Keep an existing filename if this is part of a chunked upload:
|
491 |
+
$uploaded_bytes = $this->fix_integer_overflow(intval(isset($content_range[1]) ? $content_range[1] : 0));
|
492 |
+
while(is_file($this->get_upload_path($name))) {
|
493 |
+
if ($uploaded_bytes === $this->get_file_size(
|
494 |
+
$this->get_upload_path($name))) {
|
495 |
+
break;
|
496 |
+
}
|
497 |
+
$name = $this->upcount_name($name);
|
498 |
+
}
|
499 |
+
return $name;
|
500 |
+
}
|
501 |
+
|
502 |
+
protected function trim_file_name($name, $type, $index, $content_range) {
|
503 |
+
// Remove path information and dots around the filename, to prevent uploading
|
504 |
+
// into different directories or replacing hidden system files.
|
505 |
+
// Also remove control characters and spaces (\x00..\x20) around the filename:
|
506 |
+
$name = trim(stripslashes($name), ".\x00..\x20");
|
507 |
+
// Use a timestamp for empty filenames:
|
508 |
+
if (!$name) {
|
509 |
+
$name = str_replace('.', '-', microtime(true));
|
510 |
+
}
|
511 |
+
// Add missing file extension for known image types:
|
512 |
+
if (strpos($name, '.') === false &&
|
513 |
+
preg_match('/^image\/(gif|jpe?g|png)/', $type, $matches)) {
|
514 |
+
$name .= '.'.$matches[1];
|
515 |
+
}
|
516 |
+
return $name;
|
517 |
+
}
|
518 |
+
|
519 |
+
protected function get_file_name($name, $type, $index, $content_range) {
|
520 |
+
return $this->get_unique_filename(
|
521 |
+
$this->trim_file_name($name, $type, $index, $content_range),
|
522 |
+
$type,
|
523 |
+
$index,
|
524 |
+
$content_range
|
525 |
+
);
|
526 |
+
}
|
527 |
+
|
528 |
+
protected function handle_form_data($file, $index) {
|
529 |
+
// Handle form data, e.g. $_REQUEST['description'][$index]
|
530 |
+
}
|
531 |
+
|
532 |
+
protected function orient_image($file_path) {
|
533 |
+
if (!function_exists('exif_read_data')) {
|
534 |
+
return false;
|
535 |
+
}
|
536 |
+
$exif = @exif_read_data($file_path);
|
537 |
+
if ($exif === false) {
|
538 |
+
return false;
|
539 |
+
}
|
540 |
+
$orientation = intval(@$exif['Orientation']);
|
541 |
+
if (!in_array($orientation, array(3, 6, 8))) {
|
542 |
+
return false;
|
543 |
+
}
|
544 |
+
ini_set('memory_limit', '-1');
|
545 |
+
$image = @imagecreatefromjpeg($file_path);
|
546 |
+
switch ($orientation) {
|
547 |
+
case 3:
|
548 |
+
$image = @imagerotate($image, 180, 0);
|
549 |
+
break;
|
550 |
+
case 6:
|
551 |
+
$image = @imagerotate($image, 270, 0);
|
552 |
+
break;
|
553 |
+
case 8:
|
554 |
+
$image = @imagerotate($image, 90, 0);
|
555 |
+
break;
|
556 |
+
default:
|
557 |
+
return false;
|
558 |
+
}
|
559 |
+
$success = imagejpeg($image, $file_path);
|
560 |
+
// Free up memory (imagedestroy does not delete files):
|
561 |
+
@imagedestroy($image);
|
562 |
+
ini_restore('memory_limit');
|
563 |
+
return $success;
|
564 |
+
}
|
565 |
+
|
566 |
+
protected function handle_image_file($file_path, $file) {
|
567 |
+
if ($this->options['orient_image']) {
|
568 |
+
$this->orient_image($file_path);
|
569 |
+
}
|
570 |
+
$failed_versions = array();
|
571 |
+
foreach($this->options['image_versions'] as $version => $options) {
|
572 |
+
if ($this->create_scaled_image($file->name, $version, $options)) {
|
573 |
+
if (!empty($version)) {
|
574 |
+
$file->{$version.'_url'} = $this->get_download_url(
|
575 |
+
$file->name,
|
576 |
+
$version
|
577 |
+
);
|
578 |
+
}
|
579 |
+
else {
|
580 |
+
$file->size = $this->get_file_size($file_path, true);
|
581 |
+
}
|
582 |
+
}
|
583 |
+
else {
|
584 |
+
$failed_versions[] = $version;
|
585 |
+
}
|
586 |
+
}
|
587 |
+
switch (count($failed_versions)) {
|
588 |
+
case 0:
|
589 |
+
break;
|
590 |
+
case 1:
|
591 |
+
$file->error = 'Failed to create scaled version: '
|
592 |
+
.$failed_versions[0];
|
593 |
+
break;
|
594 |
+
default:
|
595 |
+
$file->error = 'Failed to create scaled versions: '
|
596 |
+
.implode($failed_versions,', ');
|
597 |
+
}
|
598 |
+
}
|
599 |
+
|
600 |
+
protected function handle_zip_file($file_path, $file) {
|
601 |
+
$zip = new ZipArchive;
|
602 |
+
$res = $zip->open($file_path);
|
603 |
+
if ($res === TRUE) {
|
604 |
+
$target_dir = substr($file_path, 0, strlen($file_path) - 4);
|
605 |
+
if (!is_dir($target_dir)) {
|
606 |
+
mkdir($target_dir, 0777);
|
607 |
+
}
|
608 |
+
$zip->extractTo($target_dir);
|
609 |
+
$zip->close();
|
610 |
+
$this->handle_directory($target_dir);
|
611 |
+
}
|
612 |
+
}
|
613 |
+
|
614 |
+
protected function handle_directory($target_dir) {
|
615 |
+
$extracted_files = scandir($target_dir);
|
616 |
+
if ($extracted_files) {
|
617 |
+
$temp_upload_dir = $this->options['upload_dir'];
|
618 |
+
$this->options['upload_dir'] = $target_dir . '/';
|
619 |
+
foreach ($extracted_files as $ex_file) {
|
620 |
+
if ($ex_file != '.' && $ex_file != '..') {
|
621 |
+
$ex_file = $target_dir . '/' . $ex_file;
|
622 |
+
if (is_file($ex_file)) {
|
623 |
+
$type = filetype($ex_file);
|
624 |
+
$name = basename($ex_file);
|
625 |
+
$index = null;
|
626 |
+
$content_range = null;
|
627 |
+
$size = $this->get_file_size($ex_file);
|
628 |
+
$file = new stdClass();
|
629 |
+
$file->name = $name;
|
630 |
+
$file->size = $this->fix_integer_overflow(intval($size));
|
631 |
+
$file->type = $type;
|
632 |
+
$file->url = $this->get_download_url($file->name);
|
633 |
+
list($img_width, $img_height) = @getimagesize(htmlspecialchars_decode($ex_file, ENT_COMPAT | ENT_QUOTES));
|
634 |
+
|
635 |
+
if ($this->options['max_width'] && $this->options['max_height']) {
|
636 |
+
// Zip Upload.
|
637 |
+
$this->create_scaled_image($file->name, 'main', $this->options);
|
638 |
+
}
|
639 |
+
|
640 |
+
if (is_int($img_width)) {
|
641 |
+
$this->handle_image_file($ex_file, $file);
|
642 |
+
}
|
643 |
+
}
|
644 |
+
elseif (is_dir($ex_file)) {
|
645 |
+
$this->handle_directory($ex_file);
|
646 |
+
}
|
647 |
+
}
|
648 |
+
}
|
649 |
+
$this->options['upload_dir'] = $temp_upload_dir;
|
650 |
+
}
|
651 |
+
}
|
652 |
+
|
653 |
+
protected function handle_file_import($uploaded_file, $name, $index = null, $content_range = null) {
|
654 |
+
$parent_dir = wp_upload_dir();
|
655 |
+
$parent_dir = $parent_dir['basedir'];
|
656 |
+
$file_type_array = explode('.', $name);
|
657 |
+
$type = strtolower(end($file_type_array));
|
658 |
+
|
659 |
+
$file = new stdClass();
|
660 |
+
$file->name = $this->get_file_name($name, $type, $index, $content_range);
|
661 |
+
$file->type = $type;
|
662 |
+
$this->handle_form_data($file, $index);
|
663 |
+
$upload_dir = $this->get_upload_path();
|
664 |
+
if (!is_dir($upload_dir)) {
|
665 |
+
mkdir($upload_dir, $this->options['mkdir_mode'], true);
|
666 |
+
}
|
667 |
+
$file_path = $this->get_upload_path($file->name);
|
668 |
+
|
669 |
+
copy($parent_dir . '/' . $uploaded_file, $file_path);
|
670 |
+
list($img_width, $img_height) = @getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));
|
671 |
+
|
672 |
+
if ($this->options['max_width'] && $this->options['max_height']) {
|
673 |
+
// Media libruary Upload.
|
674 |
+
$this->create_scaled_image($file->name, 'main', $this->options);
|
675 |
+
}
|
676 |
+
|
677 |
+
if (is_int($img_width)) {
|
678 |
+
$this->handle_image_file($file_path, $file);
|
679 |
+
}
|
680 |
+
$this->set_file_delete_properties($file);
|
681 |
+
|
682 |
+
return $file;
|
683 |
+
}
|
684 |
+
|
685 |
+
protected function handle_file_upload($uploaded_file, $name, $size, $type, $error, $index = null, $content_range = null) {
|
686 |
+
$file = new stdClass();
|
687 |
+
$file->name = $this->get_file_name($name, $type, $index, $content_range);
|
688 |
+
$file->size = $this->fix_integer_overflow(intval($size));
|
689 |
+
$file->type = $type;
|
690 |
+
if ($this->validate($uploaded_file, $file, $error, $index)) {
|
691 |
+
$this->handle_form_data($file, $index);
|
692 |
+
$upload_dir = $this->get_upload_path();
|
693 |
+
if (!is_dir($upload_dir)) {
|
694 |
+
mkdir($upload_dir, $this->options['mkdir_mode'], true);
|
695 |
+
}
|
696 |
+
$file_path = $this->get_upload_path($file->name);
|
697 |
+
$append_file = $content_range && is_file($file_path) &&
|
698 |
+
$file->size > $this->get_file_size($file_path);
|
699 |
+
if ($uploaded_file && is_uploaded_file($uploaded_file)) {
|
700 |
+
// multipart/formdata uploads (POST method uploads)
|
701 |
+
if ($append_file) {
|
702 |
+
file_put_contents(
|
703 |
+
$file_path,
|
704 |
+
fopen($uploaded_file, 'r'),
|
705 |
+
FILE_APPEND
|
706 |
+
);
|
707 |
+
}
|
708 |
+
else {
|
709 |
+
move_uploaded_file($uploaded_file, $file_path);
|
710 |
+
}
|
711 |
+
}
|
712 |
+
else {
|
713 |
+
// Non-multipart uploads (PUT method support)
|
714 |
+
file_put_contents(
|
715 |
+
$file_path,
|
716 |
+
fopen('php://input', 'r'),
|
717 |
+
$append_file ? FILE_APPEND : 0
|
718 |
+
);
|
719 |
+
}
|
720 |
+
$file_size = $this->get_file_size($file_path, $append_file);
|
721 |
+
if ($file_size === $file->size) {
|
722 |
+
if ($this->options['max_width'] && $this->options['max_height']) {
|
723 |
+
// Upload.
|
724 |
+
$this->create_scaled_image($file->name, 'main', $this->options);
|
725 |
+
}
|
726 |
+
$file->url = $this->get_download_url($file->name);
|
727 |
+
list($img_width, $img_height) = @getimagesize(htmlspecialchars_decode($file_path, ENT_COMPAT | ENT_QUOTES));
|
728 |
+
if (is_int($img_width)) {
|
729 |
+
$this->handle_image_file($file_path, $file);
|
730 |
+
}
|
731 |
+
else {
|
732 |
+
$this->handle_zip_file($file_path, $file);
|
733 |
+
}
|
734 |
+
}
|
735 |
+
else {
|
736 |
+
$file->size = $file_size;
|
737 |
+
if (!$content_range && $this->options['discard_aborted_uploads']) {
|
738 |
+
unlink($file_path);
|
739 |
+
$file->error = 'abort';
|
740 |
+
}
|
741 |
+
}
|
742 |
+
$this->set_file_delete_properties($file);
|
743 |
+
}
|
744 |
+
return $file;
|
745 |
+
}
|
746 |
+
|
747 |
+
protected function readfile($file_path) {
|
748 |
+
return readfile($file_path);
|
749 |
+
}
|
750 |
+
|
751 |
+
protected function body($str) {
|
752 |
+
echo $str;
|
753 |
+
}
|
754 |
+
|
755 |
+
protected function header($str) {
|
756 |
+
header($str);
|
757 |
+
}
|
758 |
+
|
759 |
+
protected function generate_response($content, $print_response = true) {
|
760 |
+
if ($print_response) {
|
761 |
+
$json = json_encode($content);
|
762 |
+
$redirect = isset($_REQUEST['redirect']) ? stripslashes($_REQUEST['redirect']) : null;
|
763 |
+
if ($redirect) {
|
764 |
+
$this->header('Location: '.sprintf($redirect, rawurlencode($json)));
|
765 |
+
return;
|
766 |
+
}
|
767 |
+
$this->head();
|
768 |
+
if (isset($_SERVER['HTTP_CONTENT_RANGE'])) {
|
769 |
+
$files = isset($content[$this->options['param_name']]) ? $content[$this->options['param_name']] : null;
|
770 |
+
if ($files && is_array($files) && is_object($files[0]) && $files[0]->size) {
|
771 |
+
$this->header('Range: 0-'.($this->fix_integer_overflow(intval($files[0]->size)) - 1));
|
772 |
+
}
|
773 |
+
}
|
774 |
+
$this->body($json);
|
775 |
+
}
|
776 |
+
return $content;
|
777 |
+
}
|
778 |
+
|
779 |
+
protected function get_version_param() {
|
780 |
+
return isset($_GET['version']) ? basename(stripslashes($_GET['version'])) : null;
|
781 |
+
}
|
782 |
+
|
783 |
+
protected function get_file_name_param() {
|
784 |
+
return isset($_GET['file']) ? basename(stripslashes($_GET['file'])) : null;
|
785 |
+
}
|
786 |
+
|
787 |
+
protected function get_file_type($file_path) {
|
788 |
+
switch (strtolower(pathinfo($file_path, PATHINFO_EXTENSION))) {
|
789 |
+
case 'jpeg':
|
790 |
+
case 'jpg':
|
791 |
+
return 'image/jpeg';
|
792 |
+
case 'png':
|
793 |
+
return 'image/png';
|
794 |
+
case 'gif':
|
795 |
+
return 'image/gif';
|
796 |
+
default:
|
797 |
+
return '';
|
798 |
+
}
|
799 |
+
}
|
800 |
+
|
801 |
+
protected function download() {
|
802 |
+
if (!$this->options['download_via_php']) {
|
803 |
+
$this->header('HTTP/1.1 403 Forbidden');
|
804 |
+
return;
|
805 |
+
}
|
806 |
+
$file_name = $this->get_file_name_param();
|
807 |
+
if ($this->is_valid_file_object($file_name)) {
|
808 |
+
$file_path = $this->get_upload_path($file_name, $this->get_version_param());
|
809 |
+
if (is_file($file_path)) {
|
810 |
+
if (!preg_match($this->options['inline_file_types'], $file_name)) {
|
811 |
+
$this->header('Content-Description: File Transfer');
|
812 |
+
$this->header('Content-Type: application/octet-stream');
|
813 |
+
$this->header('Content-Disposition: attachment; filename="'.$file_name.'"');
|
814 |
+
$this->header('Content-Transfer-Encoding: binary');
|
815 |
+
}
|
816 |
+
else {
|
817 |
+
// Prevent Internet Explorer from MIME-sniffing the content-type:
|
818 |
+
$this->header('X-Content-Type-Options: nosniff');
|
819 |
+
$this->header('Content-Type: '.$this->get_file_type($file_path));
|
820 |
+
$this->header('Content-Disposition: inline; filename="'.$file_name.'"');
|
821 |
+
}
|
822 |
+
$this->header('Content-Length: '.$this->get_file_size($file_path));
|
823 |
+
$this->header('Last-Modified: '.gmdate('D, d M Y H:i:s T', filemtime($file_path)));
|
824 |
+
$this->readfile($file_path);
|
825 |
+
}
|
826 |
+
}
|
827 |
+
}
|
828 |
+
|
829 |
+
protected function send_content_type_header() {
|
830 |
+
$this->header('Vary: Accept');
|
831 |
+
if (isset($_SERVER['HTTP_ACCEPT']) &&
|
832 |
+
(strpos($_SERVER['HTTP_ACCEPT'], 'application/json') !== false)) {
|
833 |
+
$this->header('Content-type: application/json');
|
834 |
+
}
|
835 |
+
else {
|
836 |
+
$this->header('Content-type: text/plain');
|
837 |
+
}
|
838 |
+
}
|
839 |
+
|
840 |
+
protected function send_access_control_headers() {
|
841 |
+
$this->header('Access-Control-Allow-Origin: '.$this->options['access_control_allow_origin']);
|
842 |
+
$this->header('Access-Control-Allow-Credentials: '
|
843 |
+
.($this->options['access_control_allow_credentials'] ? 'true' : 'false'));
|
844 |
+
$this->header('Access-Control-Allow-Methods: '
|
845 |
+
.implode(', ', $this->options['access_control_allow_methods']));
|
846 |
+
$this->header('Access-Control-Allow-Headers: '
|
847 |
+
.implode(', ', $this->options['access_control_allow_headers']));
|
848 |
+
}
|
849 |
+
|
850 |
+
public function head() {
|
851 |
+
$this->header('Pragma: no-cache');
|
852 |
+
$this->header('Cache-Control: no-store, no-cache, must-revalidate');
|
853 |
+
$this->header('Content-Disposition: inline; filename="files.json"');
|
854 |
+
// Prevent Internet Explorer from MIME-sniffing the content-type:
|
855 |
+
$this->header('X-Content-Type-Options: nosniff');
|
856 |
+
if ($this->options['access_control_allow_origin']) {
|
857 |
+
$this->send_access_control_headers();
|
858 |
+
}
|
859 |
+
$this->send_content_type_header();
|
860 |
+
}
|
861 |
+
|
862 |
+
public function get($print_response = true) {
|
863 |
+
/*if (isset($_GET['import']) && $_GET['import'] == 'true') {
|
864 |
+
$file_names = explode('**@**', (isset($_REQUEST['file_namesML']) ? stripslashes($_REQUEST['file_namesML']) : ''));
|
865 |
+
foreach ($file_names as $index => $value) {
|
866 |
+
$file_name_array = explode('/', $value);
|
867 |
+
$files[] = $this->handle_file_import(
|
868 |
+
$value,
|
869 |
+
end($file_name_array),
|
870 |
+
0,
|
871 |
+
""
|
872 |
+
);
|
873 |
+
}
|
874 |
+
header('Location: ' . add_query_arg(array('action' => 'addImage', 'width' => '650', 'height' => '500', 'task' => 'show_file_manager', 'extensions' => 'jpg,jpeg,png,gif', 'callback' => $_REQUEST['callback'], 'image_for' => $_REQUEST['image_for'], 'slide_id' => $_REQUEST['slide_id'], 'dir' => $_REQUEST['redir'], 'TB_iframe' => '1'), admin_url('admin-ajax.php')));
|
875 |
+
exit;
|
876 |
+
}*/
|
877 |
+
if ($print_response && isset($_GET['download'])) {
|
878 |
+
return $this->download();
|
879 |
+
}
|
880 |
+
$file_name = $this->get_file_name_param();
|
881 |
+
if ($file_name) {
|
882 |
+
$response = array(
|
883 |
+
substr($this->options['param_name'], 0, -1) => $this->get_file_object($file_name)
|
884 |
+
);
|
885 |
+
}
|
886 |
+
else {
|
887 |
+
$response = array(
|
888 |
+
$this->options['param_name'] => $this->get_file_objects()
|
889 |
+
);
|
890 |
+
}
|
891 |
+
return $this->generate_response($response, $print_response);
|
892 |
+
}
|
893 |
+
|
894 |
+
public function post($print_response = true) {
|
895 |
+
if (isset($_REQUEST['_method']) && $_REQUEST['_method'] === 'DELETE') {
|
896 |
+
return $this->delete($print_response);
|
897 |
+
}
|
898 |
+
$upload = isset($_FILES[$this->options['param_name']]) ? $_FILES[$this->options['param_name']] : null;
|
899 |
+
$files = array();
|
900 |
+
// Parse the Content-Disposition header, if available:
|
901 |
+
$file_name = isset($_SERVER['HTTP_CONTENT_DISPOSITION']) ? rawurldecode(preg_replace(
|
902 |
+
'/(^[^"]+")|("$)/',
|
903 |
+
'',
|
904 |
+
$_SERVER['HTTP_CONTENT_DISPOSITION']
|
905 |
+
)) : null;
|
906 |
+
// Parse the Content-Range header, which has the following form:
|
907 |
+
// Content-Range: bytes 0-524287/2000000
|
908 |
+
$content_range = isset($_SERVER['HTTP_CONTENT_RANGE']) ? preg_split('/[^0-9]+/', $_SERVER['HTTP_CONTENT_RANGE']) : null;
|
909 |
+
$size = $content_range ? $content_range[3] : null;
|
910 |
+
if ($upload && is_array($upload['tmp_name'])) {
|
911 |
+
// param_name is an array identifier like "files[]",
|
912 |
+
// $_FILES is a multi-dimensional array:
|
913 |
+
foreach ($upload['tmp_name'] as $index => $value) {
|
914 |
+
$files[] = $this->handle_file_upload(
|
915 |
+
$upload['tmp_name'][$index],
|
916 |
+
$file_name ? $file_name : $upload['name'][$index],
|
917 |
+
$size ? $size : $upload['size'][$index],
|
918 |
+
$upload['type'][$index],
|
919 |
+
$upload['error'][$index],
|
920 |
+
$index,
|
921 |
+
$content_range
|
922 |
+
);
|
923 |
+
}
|
924 |
+
}
|
925 |
+
else {
|
926 |
+
// param_name is a single object identifier like "file",
|
927 |
+
// $_FILES is a one-dimensional array:
|
928 |
+
$files[] = $this->handle_file_upload(
|
929 |
+
isset($upload['tmp_name']) ? $upload['tmp_name'] : null,
|
930 |
+
$file_name ? $file_name : (isset($upload['name']) ?
|
931 |
+
$upload['name'] : null),
|
932 |
+
$size ? $size : (isset($upload['size']) ?
|
933 |
+
$upload['size'] : $_SERVER['CONTENT_LENGTH']),
|
934 |
+
isset($upload['type']) ?
|
935 |
+
$upload['type'] : $_SERVER['CONTENT_TYPE'],
|
936 |
+
isset($upload['error']) ? $upload['error'] : null,
|
937 |
+
null,
|
938 |
+
$content_range
|
939 |
+
);
|
940 |
+
}
|
941 |
+
return $this->generate_response(
|
942 |
+
array($this->options['param_name'] => $files),
|
943 |
+
$print_response
|
944 |
+
);
|
945 |
+
}
|
946 |
+
|
947 |
+
public function delete($print_response = true) {
|
948 |
+
$file_name = $this->get_file_name_param();
|
949 |
+
$file_path = $this->get_upload_path($file_name);
|
950 |
+
$success = is_file($file_path) && $file_name[0] !== '.' && unlink($file_path);
|
951 |
+
if ($success) {
|
952 |
+
foreach($this->options['image_versions'] as $version => $options) {
|
953 |
+
if (!empty($version)) {
|
954 |
+
$file = $this->get_upload_path($file_name, $version);
|
955 |
+
if (is_file($file)) {
|
956 |
+
unlink($file);
|
957 |
+
}
|
958 |
+
}
|
959 |
+
}
|
960 |
+
}
|
961 |
+
return $this->generate_response(array('success' => $success), $print_response);
|
962 |
+
}
|
963 |
+
|
964 |
+
}
|
965 |
+
|
966 |
+
die();
|
filemanager/controller.php
ADDED
@@ -0,0 +1,309 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Author: Rob
|
4 |
+
* Date: 6/24/13
|
5 |
+
* Time: 10:57 AM
|
6 |
+
*/
|
7 |
+
|
8 |
+
|
9 |
+
class FilemanagerController {
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Events //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constants //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
17 |
+
// Variables //
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
public $uploads_dir;
|
20 |
+
public $uploads_url;
|
21 |
+
|
22 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
+
// Constructor & Destructor //
|
24 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
+
|
26 |
+
public function __construct() {
|
27 |
+
global $WD_S_UPLOAD_DIR;
|
28 |
+
$upload_dir = wp_upload_dir();
|
29 |
+
//$bwg_options = $this->get_options_data();
|
30 |
+
//$this->uploads_dir = (($bwg_options->images_directory . '/photo-gallery') ? ABSPATH . $bwg_options->images_directory . '/photo-gallery' : WD_S_DIR . '/filemanager/uploads');
|
31 |
+
$this->uploads_dir = ABSPATH . $WD_S_UPLOAD_DIR;
|
32 |
+
//echo $this->uploads_dir;
|
33 |
+
if (file_exists($this->uploads_dir) == FALSE) {
|
34 |
+
mkdir($this->uploads_dir);
|
35 |
+
}
|
36 |
+
//$this->uploads_url = (($bwg_options->images_directory . '/photo-gallery') ? site_url() . '/' . $bwg_options->images_directory . '/photo-gallery' : WD_S_URL . '/filemanager/uploads');
|
37 |
+
$this->uploads_url = site_url() . '/' . $WD_S_UPLOAD_DIR;
|
38 |
+
//exit;
|
39 |
+
}
|
40 |
+
|
41 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
42 |
+
// Public Methods //
|
43 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
44 |
+
|
45 |
+
public function get_options_data() {
|
46 |
+
global $wpdb;
|
47 |
+
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'bwg_option WHERE id="%d"', 1));
|
48 |
+
return $row;
|
49 |
+
}
|
50 |
+
|
51 |
+
public function execute() {
|
52 |
+
$task = isset($_REQUEST['task']) ? stripslashes(esc_html($_REQUEST['task'])) : 'display';
|
53 |
+
if (method_exists($this, $task)) {
|
54 |
+
$this->$task();
|
55 |
+
}
|
56 |
+
else {
|
57 |
+
$this->display();
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
public function get_uploads_dir() {
|
62 |
+
return $this->uploads_dir;
|
63 |
+
}
|
64 |
+
|
65 |
+
public function get_uploads_url() {
|
66 |
+
return $this->uploads_url;
|
67 |
+
}
|
68 |
+
|
69 |
+
public function display() {
|
70 |
+
require_once WD_S_DIR . '/filemanager/model.php';
|
71 |
+
$model = new FilemanagerModel($this);
|
72 |
+
|
73 |
+
require_once WD_S_DIR . '/filemanager/view.php';
|
74 |
+
$view = new FilemanagerView($this, $model);
|
75 |
+
$view->display();
|
76 |
+
}
|
77 |
+
|
78 |
+
public function make_dir() {
|
79 |
+
$input_dir = (isset($_REQUEST['dir']) ? stripslashes(esc_html($_REQUEST['dir'])) : '');
|
80 |
+
$cur_dir_path = $input_dir == '' ? $this->uploads_dir : $this->uploads_dir . '/' . $input_dir;
|
81 |
+
|
82 |
+
$new_dir_path = $cur_dir_path . '/' . (isset($_REQUEST['new_dir_name']) ? stripslashes(esc_html($_REQUEST['new_dir_name'])) : '');
|
83 |
+
|
84 |
+
$msg = '';
|
85 |
+
if (file_exists($new_dir_path) == true) {
|
86 |
+
$msg = "Directory already exists.";
|
87 |
+
}
|
88 |
+
else {
|
89 |
+
mkdir($new_dir_path);
|
90 |
+
}
|
91 |
+
header('Location: ' . add_query_arg(array('action' => 'addImage', 'filemanager_msg' => $msg, 'width' => '650', 'height' => '500', 'task' => 'display', 'extensions' => esc_html($_REQUEST['extensions']), 'callback' => esc_html($_REQUEST['callback']), 'image_for' => esc_html($_REQUEST['image_for']), 'slide_id' => esc_html($_REQUEST['slide_id']), 'dir' => esc_html($_REQUEST['dir']), 'TB_iframe' => '1'), admin_url('admin-ajax.php')));
|
92 |
+
exit;
|
93 |
+
}
|
94 |
+
|
95 |
+
public function rename_item() {
|
96 |
+
$input_dir = (isset($_REQUEST['dir']) ? stripslashes(esc_html($_REQUEST['dir'])) : '');
|
97 |
+
$cur_dir_path = $input_dir == '' ? $this->uploads_dir : $this->uploads_dir . '/' . $input_dir;
|
98 |
+
$cur_dir_path = htmlspecialchars_decode($cur_dir_path, ENT_COMPAT | ENT_QUOTES);
|
99 |
+
|
100 |
+
$file_names = explode('**#**', (isset($_REQUEST['file_names']) ? stripslashes(esc_html($_REQUEST['file_names'])) : ''));
|
101 |
+
$file_name = $file_names[0];
|
102 |
+
$file_name = htmlspecialchars_decode($file_name, ENT_COMPAT | ENT_QUOTES);
|
103 |
+
|
104 |
+
$file_new_name = (isset($_REQUEST['file_new_name']) ? stripslashes(esc_html($_REQUEST['file_new_name'])) : '');
|
105 |
+
|
106 |
+
$file_path = $cur_dir_path . '/' . $file_name;
|
107 |
+
$thumb_file_path = $cur_dir_path . '/thumb/' . $file_name;
|
108 |
+
$original_file_path = $cur_dir_path . '/.original/' . $file_name;
|
109 |
+
|
110 |
+
$msg = '';
|
111 |
+
if (file_exists($file_path) == false) {
|
112 |
+
$msg = "File doesn't exist.";
|
113 |
+
}
|
114 |
+
elseif (is_dir($file_path) == true) {
|
115 |
+
if (rename($file_path, $cur_dir_path . '/' . $file_new_name) == false) {
|
116 |
+
$msg = "Can't rename the file.";
|
117 |
+
}
|
118 |
+
}
|
119 |
+
elseif ((strrpos($file_name, '.') !== false)) {
|
120 |
+
$file_extension = substr($file_name, strrpos($file_name, '.') + 1);
|
121 |
+
if (rename($file_path, $cur_dir_path . '/' . $file_new_name . '.' . $file_extension) == false) {
|
122 |
+
$msg = "Can't rename the file.";
|
123 |
+
}
|
124 |
+
rename($thumb_file_path, $cur_dir_path . '/thumb/' . $file_new_name . '.' . $file_extension);
|
125 |
+
rename($original_file_path, $cur_dir_path . '/.original/' . $file_new_name . '.' . $file_extension);
|
126 |
+
}
|
127 |
+
else {
|
128 |
+
$msg = "Can't rename the file.";
|
129 |
+
}
|
130 |
+
$_REQUEST['file_names'] = '';
|
131 |
+
header('Location: ' . add_query_arg(array('action' => 'addImage', 'filemanager_msg' => $msg, 'width' => '650', 'height' => '500', 'task' => 'display', 'extensions' => esc_html($_REQUEST['extensions']), 'callback' => esc_html($_REQUEST['callback']), 'image_for' => esc_html($_REQUEST['image_for']), 'slide_id' => esc_html($_REQUEST['slide_id']), 'dir' => esc_html($_REQUEST['dir']), 'TB_iframe' => '1'), admin_url('admin-ajax.php')));
|
132 |
+
exit;
|
133 |
+
}
|
134 |
+
|
135 |
+
public function remove_items() {
|
136 |
+
$input_dir = (isset($_REQUEST['dir']) ? stripslashes(esc_html($_REQUEST['dir'])) : '');
|
137 |
+
$cur_dir_path = $input_dir == '' ? $this->uploads_dir : $this->uploads_dir . '/' . $input_dir;
|
138 |
+
$cur_dir_path = htmlspecialchars_decode($cur_dir_path, ENT_COMPAT | ENT_QUOTES);
|
139 |
+
|
140 |
+
$file_names = explode('**#**', (isset($_REQUEST['file_names']) ? stripslashes(esc_html($_REQUEST['file_names'])) : ''));
|
141 |
+
|
142 |
+
$msg = '';
|
143 |
+
foreach ($file_names as $file_name) {
|
144 |
+
$file_name = htmlspecialchars_decode($file_name, ENT_COMPAT | ENT_QUOTES);
|
145 |
+
$file_path = $cur_dir_path . '/' . $file_name;
|
146 |
+
$thumb_file_path = $cur_dir_path . '/thumb/' . $file_name;
|
147 |
+
$original_file_path = $cur_dir_path . '/.original/' . $file_name;
|
148 |
+
if (file_exists($file_path) == false) {
|
149 |
+
$msg = "Some of the files couldn't be removed.";
|
150 |
+
}
|
151 |
+
else {
|
152 |
+
$this->remove_file_dir($file_path);
|
153 |
+
if (file_exists($thumb_file_path)) {
|
154 |
+
$this->remove_file_dir($thumb_file_path);
|
155 |
+
}
|
156 |
+
if (file_exists($original_file_path)) {
|
157 |
+
$this->remove_file_dir($original_file_path);
|
158 |
+
}
|
159 |
+
}
|
160 |
+
}
|
161 |
+
$_REQUEST['file_names'] = '';
|
162 |
+
header('Location: ' . add_query_arg(array('action' => 'addImage', 'filemanager_msg' => $msg, 'width' => '650', 'height' => '500', 'task' => 'show_file_manager', 'extensions' => esc_html($_REQUEST['extensions']), 'callback' => esc_html($_REQUEST['callback']), 'image_for' => esc_html($_REQUEST['image_for']), 'slide_id' => esc_html($_REQUEST['slide_id']), 'dir' => esc_html($_REQUEST['dir']), 'TB_iframe' => '1'), admin_url('admin-ajax.php')));
|
163 |
+
exit;
|
164 |
+
}
|
165 |
+
|
166 |
+
public function paste_items() {
|
167 |
+
$msg = '';
|
168 |
+
|
169 |
+
$file_names = explode('**#**', (isset($_REQUEST['clipboard_files']) ? stripslashes($_REQUEST['clipboard_files']) : ''));
|
170 |
+
// $src_dir = $_SESSION['clipboard_src'];
|
171 |
+
$src_dir = (isset($_REQUEST['clipboard_src']) ? stripslashes($_REQUEST['clipboard_src']) : '');
|
172 |
+
$src_dir = $src_dir == '' ? $this->uploads_dir : $this->uploads_dir . '/' . $src_dir;
|
173 |
+
$src_dir = htmlspecialchars_decode($src_dir, ENT_COMPAT | ENT_QUOTES);
|
174 |
+
// $dest_dir = $_SESSION['clipboard_dest'];
|
175 |
+
$dest_dir = (isset($_REQUEST['clipboard_dest']) ? stripslashes($_REQUEST['clipboard_dest']) : '');
|
176 |
+
$dest_dir = $dest_dir == '' ? $this->uploads_dir : $this->uploads_dir . '/' . $dest_dir;
|
177 |
+
$dest_dir = htmlspecialchars_decode($dest_dir, ENT_COMPAT | ENT_QUOTES);
|
178 |
+
|
179 |
+
switch ((isset($_REQUEST['clipboard_task']) ? stripslashes($_REQUEST['clipboard_task']) : '')) {
|
180 |
+
case 'copy':
|
181 |
+
foreach ($file_names as $file_name) {
|
182 |
+
$file_name = htmlspecialchars_decode($file_name, ENT_COMPAT | ENT_QUOTES);
|
183 |
+
$src = $src_dir . '/' . $file_name;
|
184 |
+
if (file_exists($src) == false) {
|
185 |
+
$msg = "Failed to copy some of the files.";
|
186 |
+
$msg = $file_name;
|
187 |
+
continue;
|
188 |
+
}
|
189 |
+
$dest = $dest_dir . '/' . $file_name;
|
190 |
+
if (!is_dir($src_dir . '/' . $file_name)) {
|
191 |
+
if (!is_dir($dest_dir . '/thumb')) {
|
192 |
+
mkdir($dest_dir . '/thumb', 0777);
|
193 |
+
}
|
194 |
+
$thumb_src = $src_dir . '/thumb/' . $file_name;
|
195 |
+
$thumb_dest = $dest_dir . '/thumb/' . $file_name;
|
196 |
+
if (!is_dir($dest_dir . '/.original')) {
|
197 |
+
mkdir($dest_dir . '/.original', 0777);
|
198 |
+
}
|
199 |
+
$original_src = $src_dir . '/.original/' . $file_name;
|
200 |
+
$original_dest = $dest_dir . '/.original/' . $file_name;
|
201 |
+
}
|
202 |
+
$i = 0;
|
203 |
+
if (file_exists($dest) == true) {
|
204 |
+
$path_parts = pathinfo($dest);
|
205 |
+
while (file_exists($path_parts['dirname'] . '/' . $path_parts['filename'] . '(' . ++$i . ')' . '.' . $path_parts['extension'])) {
|
206 |
+
}
|
207 |
+
$dest = $path_parts['dirname'] . '/' . $path_parts['filename'] . '(' . $i . ')' . '.' . $path_parts['extension'];
|
208 |
+
if (!is_dir($src_dir . '/' . $file_name)) {
|
209 |
+
$thumb_dest = $path_parts['dirname'] . '/thumb/' . $path_parts['filename'] . '(' . $i . ')' . '.' . $path_parts['extension'];
|
210 |
+
$original_dest = $path_parts['dirname'] . '/.original/' . $path_parts['filename'] . '(' . $i . ')' . '.' . $path_parts['extension'];
|
211 |
+
}
|
212 |
+
}
|
213 |
+
|
214 |
+
if (!$this->copy_file_dir($src, $dest)) {
|
215 |
+
$msg = "Failed to copy some of the files.";
|
216 |
+
}
|
217 |
+
if (!is_dir($src_dir . '/' . $file_name)) {
|
218 |
+
$this->copy_file_dir($thumb_src, $thumb_dest);
|
219 |
+
$this->copy_file_dir($original_src, $original_dest);
|
220 |
+
}
|
221 |
+
}
|
222 |
+
break;
|
223 |
+
case 'cut':
|
224 |
+
if ($src_dir != $dest_dir) {
|
225 |
+
foreach ($file_names as $file_name) {
|
226 |
+
$file_name = htmlspecialchars_decode($file_name, ENT_COMPAT | ENT_QUOTES);
|
227 |
+
$src = $src_dir . '/' . $file_name;
|
228 |
+
$dest = $dest_dir . '/' . $file_name;
|
229 |
+
if (!is_dir($src_dir . '/' . $file_name)) {
|
230 |
+
$thumb_src = $src_dir . '/thumb/' . $file_name;
|
231 |
+
$thumb_dest = $dest_dir . '/thumb/' . $file_name;
|
232 |
+
if (!is_dir($dest_dir . '/thumb')) {
|
233 |
+
mkdir($dest_dir . '/thumb', 0777);
|
234 |
+
}
|
235 |
+
$original_src = $src_dir . '/.original/' . $file_name;
|
236 |
+
$original_dest = $dest_dir . '/.original/' . $file_name;
|
237 |
+
if (!is_dir($dest_dir . '/.original')) {
|
238 |
+
mkdir($dest_dir . '/.original', 0777);
|
239 |
+
}
|
240 |
+
}
|
241 |
+
if ((file_exists($src) == false) || (file_exists($dest) == true) || (!rename($src, $dest))) {
|
242 |
+
$msg = "Failed to move some of the files.";
|
243 |
+
}
|
244 |
+
if (!is_dir($src_dir . '/' . $file_name)) {
|
245 |
+
rename($thumb_src, $thumb_dest);
|
246 |
+
rename($original_src, $original_dest);
|
247 |
+
}
|
248 |
+
}
|
249 |
+
}
|
250 |
+
break;
|
251 |
+
}
|
252 |
+
header('Location: ' . add_query_arg(array('action' => 'addImage', 'filemanager_msg' => $msg, 'width' => '650', 'height' => '500', 'task' => 'show_file_manager', 'extensions' => esc_html($_REQUEST['extensions']), 'callback' => esc_html($_REQUEST['callback']), 'image_for' => esc_html($_REQUEST['image_for']), 'slide_id' => esc_html($_REQUEST['slide_id']), 'dir' => esc_html($_REQUEST['dir']), 'TB_iframe' => '1'), admin_url('admin-ajax.php')));
|
253 |
+
exit;
|
254 |
+
}
|
255 |
+
|
256 |
+
public function import_items() {
|
257 |
+
header('Location: ' . add_query_arg(array('action' => 'wds_UploadHandler', 'importer_thumb_width' => esc_html($_REQUEST['importer_thumb_width']), 'importer_thumb_height' => esc_html($_REQUEST['importer_thumb_height']), 'callback' => esc_html($_REQUEST['callback']), 'image_for' => esc_html($_REQUEST['image_for']), 'slide_id' => esc_html($_REQUEST['slide_id']), 'file_namesML' => esc_html($_REQUEST['file_namesML']), 'importer_img_width' => esc_html($_REQUEST['importer_img_width']), 'importer_img_height' => esc_html($_REQUEST['importer_img_height']), 'import' => 'true', 'redir' => esc_html($_REQUEST['dir']), 'dir' => $this->get_uploads_dir() . '/' . esc_html($_REQUEST['dir']) . '/'), admin_url('admin-ajax.php')));
|
258 |
+
exit;
|
259 |
+
}
|
260 |
+
|
261 |
+
|
262 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
263 |
+
// Getters & Setters //
|
264 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
265 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
266 |
+
// Private Methods //
|
267 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
268 |
+
private function remove_file_dir($del_file_dir) {
|
269 |
+
if (is_dir($del_file_dir) == true) {
|
270 |
+
$files_to_remove = scandir($del_file_dir);
|
271 |
+
foreach ($files_to_remove as $file) {
|
272 |
+
if ($file != '.' and $file != '..') {
|
273 |
+
$this->remove_file_dir($del_file_dir . '/' . $file);
|
274 |
+
}
|
275 |
+
}
|
276 |
+
rmdir($del_file_dir);
|
277 |
+
}
|
278 |
+
else {
|
279 |
+
unlink($del_file_dir);
|
280 |
+
}
|
281 |
+
}
|
282 |
+
|
283 |
+
private function copy_file_dir($src, $dest) {
|
284 |
+
if (is_dir($src) == true) {
|
285 |
+
$dir = opendir($src);
|
286 |
+
@mkdir($dest);
|
287 |
+
while (false !== ($file = readdir($dir))) {
|
288 |
+
if (($file != '.') && ($file != '..')) {
|
289 |
+
if (is_dir($src . '/' . $file)) {
|
290 |
+
$this->copy_file_dir($src . '/' . $file, $dest . '/' . $file);
|
291 |
+
}
|
292 |
+
else {
|
293 |
+
copy($src . '/' . $file, $dest . '/' . $file);
|
294 |
+
}
|
295 |
+
}
|
296 |
+
}
|
297 |
+
closedir($dir);
|
298 |
+
return true;
|
299 |
+
}
|
300 |
+
else {
|
301 |
+
return copy($src, $dest);
|
302 |
+
}
|
303 |
+
}
|
304 |
+
|
305 |
+
|
306 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
307 |
+
// Listeners //
|
308 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
309 |
+
}
|
filemanager/css/default.css
ADDED
@@ -0,0 +1,530 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.spider_ajax_loading {
|
2 |
+
border: none !important;
|
3 |
+
-webkit-animation: spin 2.5s infinite linear;
|
4 |
+
-moz-animation: spin 2.5s infinite linear;
|
5 |
+
-o-animation: spin 2.5s infinite linear;
|
6 |
+
animation: spin 2.5s infinite linear;
|
7 |
+
}
|
8 |
+
|
9 |
+
@-moz-keyframes spin {
|
10 |
+
0% {
|
11 |
+
-moz-transform: rotate(0deg);
|
12 |
+
}
|
13 |
+
100% {
|
14 |
+
-moz-transform: rotate(359deg);
|
15 |
+
}
|
16 |
+
}
|
17 |
+
@-webkit-keyframes spin {
|
18 |
+
0% {
|
19 |
+
-webkit-transform: rotate(0deg);
|
20 |
+
}
|
21 |
+
100% {
|
22 |
+
-webkit-transform: rotate(359deg);
|
23 |
+
}
|
24 |
+
}
|
25 |
+
@-o-keyframes spin {
|
26 |
+
0% {
|
27 |
+
-o-transform: rotate(0deg);
|
28 |
+
}
|
29 |
+
100% {
|
30 |
+
-o-transform: rotate(359deg);
|
31 |
+
}
|
32 |
+
}
|
33 |
+
@-ms-keyframes spin {
|
34 |
+
0% {
|
35 |
+
-ms-transform: rotate(0deg);
|
36 |
+
}
|
37 |
+
100% {
|
38 |
+
-ms-transform: rotate(359deg);
|
39 |
+
}
|
40 |
+
}
|
41 |
+
@keyframes spin {
|
42 |
+
0% {
|
43 |
+
transform: rotate(0deg);
|
44 |
+
}
|
45 |
+
100% {
|
46 |
+
transform: rotate(359deg);
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
html {
|
51 |
+
overflow: hidden !important;
|
52 |
+
|
53 |
+
/*deny selecting text*/
|
54 |
+
cursor: default;
|
55 |
+
-webkit-touch-callout: none;
|
56 |
+
-webkit-user-select: none;
|
57 |
+
-khtml-user-select: none;
|
58 |
+
-moz-user-select: none;
|
59 |
+
-ms-user-select: none;
|
60 |
+
user-select: none;
|
61 |
+
}
|
62 |
+
|
63 |
+
/* set joomla messages margin to 0 */
|
64 |
+
body {
|
65 |
+
margin: 0 !important;
|
66 |
+
}
|
67 |
+
|
68 |
+
#system-message, #system-message ul {
|
69 |
+
margin: 0;
|
70 |
+
}
|
71 |
+
|
72 |
+
|
73 |
+
/* font-size */
|
74 |
+
html, body, div, span, th, td, a {
|
75 |
+
font-size: 12px !important;
|
76 |
+
}
|
77 |
+
|
78 |
+
|
79 |
+
/* default tags */
|
80 |
+
.clickable {
|
81 |
+
cursor: pointer !important;
|
82 |
+
}
|
83 |
+
|
84 |
+
|
85 |
+
/* wrapper */
|
86 |
+
#wrapper {
|
87 |
+
position: absolute;
|
88 |
+
top: 0;
|
89 |
+
bottom: 0;
|
90 |
+
left: 0;
|
91 |
+
right: 0;
|
92 |
+
}
|
93 |
+
|
94 |
+
#file_manager,
|
95 |
+
#uploader,
|
96 |
+
#importer {
|
97 |
+
position: absolute;
|
98 |
+
top: 0;
|
99 |
+
bottom: 0;
|
100 |
+
left: 0;
|
101 |
+
right: 0;
|
102 |
+
margin: 0;
|
103 |
+
padding: 0;
|
104 |
+
}
|
105 |
+
|
106 |
+
|
107 |
+
/* file manager */
|
108 |
+
/* ctrls bar */
|
109 |
+
.ctrls_bar {
|
110 |
+
display: table-row;
|
111 |
+
position: absolute;
|
112 |
+
z-index: 1;
|
113 |
+
left: 0;
|
114 |
+
right: 0;
|
115 |
+
margin: 0;
|
116 |
+
border: solid 1px #e8e9ea;
|
117 |
+
background-color: #f5f6f7;
|
118 |
+
padding: 4px;
|
119 |
+
height: 32px;
|
120 |
+
}
|
121 |
+
|
122 |
+
.ctrls_bar_header {
|
123 |
+
top: 0;
|
124 |
+
}
|
125 |
+
|
126 |
+
.ctrls_bar_footer {
|
127 |
+
bottom: 0;
|
128 |
+
}
|
129 |
+
|
130 |
+
.ctrls_bar .ctrls_left {
|
131 |
+
float: left;
|
132 |
+
margin: 0;
|
133 |
+
padding: 0;
|
134 |
+
margin-left: 5px;
|
135 |
+
}
|
136 |
+
|
137 |
+
.ctrls_bar .ctrls_right {
|
138 |
+
float: right;
|
139 |
+
margin: 0;
|
140 |
+
padding: 0;
|
141 |
+
}
|
142 |
+
|
143 |
+
.ctrls_bar .ctrls_right_img {
|
144 |
+
float: right;
|
145 |
+
margin: 0;
|
146 |
+
padding: 0;
|
147 |
+
margin-right: 10px;
|
148 |
+
}
|
149 |
+
|
150 |
+
.ctrl_bar_divider {
|
151 |
+
display: table-cell;
|
152 |
+
margin: 0;
|
153 |
+
background-image: url("../images/btn_icons/divider.png");
|
154 |
+
background-repeat: no-repeat;
|
155 |
+
width: 16px !important;
|
156 |
+
height: 32px !important;
|
157 |
+
padding: 0;
|
158 |
+
vertical-align: middle;
|
159 |
+
cursor: default;
|
160 |
+
}
|
161 |
+
|
162 |
+
.upload_thumb_dim {
|
163 |
+
width: 50px;
|
164 |
+
display: inline-block;
|
165 |
+
margin: 0;
|
166 |
+
background-repeat: no-repeat;
|
167 |
+
min-width: 32px !important;
|
168 |
+
height: 32px !important;
|
169 |
+
padding: 0;
|
170 |
+
vertical-align: middle;
|
171 |
+
color: #808080;
|
172 |
+
cursor: default;
|
173 |
+
}
|
174 |
+
|
175 |
+
.upload_thumb {
|
176 |
+
color: #808080;
|
177 |
+
font-size: 16px !important;
|
178 |
+
}
|
179 |
+
|
180 |
+
.ctrl_bar_btn {
|
181 |
+
display: table-cell;
|
182 |
+
margin: 0;
|
183 |
+
background-repeat: no-repeat;
|
184 |
+
min-width: 32px !important;
|
185 |
+
height: 32px !important;
|
186 |
+
padding: 0;
|
187 |
+
vertical-align: middle;
|
188 |
+
color: #808080;
|
189 |
+
cursor: default;
|
190 |
+
}
|
191 |
+
|
192 |
+
.ctrl_bar_btn:hover {
|
193 |
+
outline: solid 1px #C6C6C6;
|
194 |
+
text-decoration: none;
|
195 |
+
}
|
196 |
+
|
197 |
+
.ctrl_bar_btn.btn_up {
|
198 |
+
background-image: url("../images/btn_icons/up.png");
|
199 |
+
}
|
200 |
+
|
201 |
+
.ctrl_bar_btn.btn_make_dir {
|
202 |
+
background-image: url("../images/btn_icons/create_dir.png");
|
203 |
+
}
|
204 |
+
|
205 |
+
.ctrl_bar_btn.btn_rename_item {
|
206 |
+
background-image: url("../images/btn_icons/rename.png");
|
207 |
+
}
|
208 |
+
|
209 |
+
.ctrl_bar_btn.btn_copy {
|
210 |
+
background-image: url("../images/btn_icons/copy.png");
|
211 |
+
}
|
212 |
+
|
213 |
+
.ctrl_bar_btn.btn_cut {
|
214 |
+
background-image: url("../images/btn_icons/cut.png");
|
215 |
+
}
|
216 |
+
|
217 |
+
.ctrl_bar_btn.btn_paste {
|
218 |
+
background-image: url("../images/btn_icons/paste.png");
|
219 |
+
}
|
220 |
+
|
221 |
+
.ctrl_bar_btn.btn_remove_items {
|
222 |
+
background-image: url("../images/btn_icons/delete.png");
|
223 |
+
}
|
224 |
+
|
225 |
+
.ctrl_bar_btn.btn_upload_files {
|
226 |
+
padding-left: 32px;
|
227 |
+
padding-right: 4px;
|
228 |
+
background-image: url("../images/btn_icons/upload.png");
|
229 |
+
color: #F5F6F7;
|
230 |
+
cursor: pointer;
|
231 |
+
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
|
232 |
+
height: 30px !important;
|
233 |
+
font-size: 14px !important;
|
234 |
+
}
|
235 |
+
|
236 |
+
.ctrl_bar_btn.btn_import_files {
|
237 |
+
padding-left: 32px;
|
238 |
+
padding-right: 4px;
|
239 |
+
background-image: url("../images/btn_icons/import.png");
|
240 |
+
color: #F5F6F7;
|
241 |
+
cursor: pointer;
|
242 |
+
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
|
243 |
+
height: 30px !important;
|
244 |
+
font-size: 14px !important;
|
245 |
+
}
|
246 |
+
|
247 |
+
.ctrl_bar_btn.btn_upload_files, .ctrl_bar_btn.btn_import_files:hover {
|
248 |
+
outline: none;
|
249 |
+
text-decoration: none;
|
250 |
+
}
|
251 |
+
|
252 |
+
.ctrl_bar_btn.btn_primary {
|
253 |
+
background-color: #21759B;
|
254 |
+
background-image: linear-gradient(to bottom, #2A95C5, #21759B);
|
255 |
+
border: 1px solid #21759b;
|
256 |
+
border-bottom-color: #1e6a8d;
|
257 |
+
box-shadow: 0 1px 0 rgba(120, 200, 230, 0.5) inset;
|
258 |
+
text-decoration: none;
|
259 |
+
color: #F5F6F7 !important;
|
260 |
+
-webkit-border-radius: 3px;
|
261 |
+
-webkit-appearance: none;
|
262 |
+
border-radius: 3px;
|
263 |
+
-moz-box-sizing: border-box;
|
264 |
+
box-sizing: border-box;
|
265 |
+
cursor: pointer;
|
266 |
+
white-space: nowrap;
|
267 |
+
padding: 0 10px;
|
268 |
+
font-size: 14px !important;
|
269 |
+
}
|
270 |
+
|
271 |
+
.ctrl_bar_btn.btn_secondary {
|
272 |
+
background: linear-gradient(to bottom, #FEFEFE, #F4F4F4) repeat scroll 0 0 #F3F3F3;
|
273 |
+
border-color: #BBBBBB;
|
274 |
+
color: #333333 !important;
|
275 |
+
text-shadow: 0 1px 0 #FFFFFF;
|
276 |
+
border: 1px solid #BBBBBB;
|
277 |
+
box-shadow: 0 1px 0 rgba(120, 200, 230, 0.5) inset;
|
278 |
+
text-decoration: none;
|
279 |
+
-webkit-border-radius: 3px;
|
280 |
+
-webkit-appearance: none;
|
281 |
+
border-radius: 3px;
|
282 |
+
-moz-box-sizing: border-box;
|
283 |
+
box-sizing: border-box;
|
284 |
+
cursor: pointer;
|
285 |
+
white-space: nowrap;
|
286 |
+
padding: 0 10px;
|
287 |
+
font-size: 14px !important;
|
288 |
+
}
|
289 |
+
.ctrl_bar_empty_devider {
|
290 |
+
display: table-cell;
|
291 |
+
width: 10px;
|
292 |
+
}
|
293 |
+
|
294 |
+
.ctrl_bar_btn.btn_view_thumbs {
|
295 |
+
background-image: url("../images/btn_icons/view_thumbs.png");
|
296 |
+
}
|
297 |
+
|
298 |
+
.ctrl_bar_btn.btn_view_list {
|
299 |
+
background-image: url("../images/btn_icons/view_list.png");
|
300 |
+
}
|
301 |
+
|
302 |
+
.ctrl_bar_btn.btn_back {
|
303 |
+
background-image: url("../images/btn_icons/back.png");
|
304 |
+
}
|
305 |
+
|
306 |
+
|
307 |
+
/* sort icons */
|
308 |
+
.sort_order_asc {
|
309 |
+
display: inline-block !important;
|
310 |
+
margin: 0;
|
311 |
+
background-image: url("../images/btn_icons/sort_asc.png");
|
312 |
+
background-repeat: no-repeat;
|
313 |
+
padding: 0;
|
314 |
+
width: 12px !important;
|
315 |
+
height: 12px !important;
|
316 |
+
vertical-align: middle;
|
317 |
+
color: #808080;
|
318 |
+
cursor: default;
|
319 |
+
text-decoration: none;
|
320 |
+
cursor: pointer;
|
321 |
+
}
|
322 |
+
|
323 |
+
.sort_order_desc {
|
324 |
+
display: inline-block !important;
|
325 |
+
margin: 0;
|
326 |
+
background-image: url("../images/btn_icons/sort_desc.png");
|
327 |
+
background-repeat: no-repeat;
|
328 |
+
padding: 0;
|
329 |
+
width: 12px !important;
|
330 |
+
height: 12px !important;
|
331 |
+
vertical-align: middle;
|
332 |
+
color: #808080;
|
333 |
+
cursor: default;
|
334 |
+
text-decoration: none;
|
335 |
+
cursor: pointer;
|
336 |
+
}
|
337 |
+
|
338 |
+
|
339 |
+
/* path */
|
340 |
+
#path {
|
341 |
+
display: table-row;
|
342 |
+
position: absolute;
|
343 |
+
z-index: 1;
|
344 |
+
top: 40px;
|
345 |
+
left: 0;
|
346 |
+
right: 0;
|
347 |
+
border: solid 1px #e8e9ea;
|
348 |
+
background-color: #f5f6f7;
|
349 |
+
padding: 3px 3px;
|
350 |
+
height: 24px;
|
351 |
+
vertical-align: middle;
|
352 |
+
}
|
353 |
+
|
354 |
+
.path_component {
|
355 |
+
display: table-cell;
|
356 |
+
margin: 0;
|
357 |
+
background-repeat: no-repeat;
|
358 |
+
padding: 0 2px;
|
359 |
+
height: 24px !important;
|
360 |
+
vertical-align: middle;
|
361 |
+
color: #808080;
|
362 |
+
cursor: default;
|
363 |
+
}
|
364 |
+
|
365 |
+
.path_dir:hover {
|
366 |
+
outline: solid 1px #C6C6C6;
|
367 |
+
text-decoration: none;
|
368 |
+
}
|
369 |
+
|
370 |
+
.path_separator:hover {
|
371 |
+
text-decoration: none;
|
372 |
+
}
|
373 |
+
|
374 |
+
|
375 |
+
#file_names_span {
|
376 |
+
display: none;
|
377 |
+
padding: 0 4px;
|
378 |
+
width: 100%;
|
379 |
+
height: 32px !important;
|
380 |
+
vertical-align: middle;
|
381 |
+
}
|
382 |
+
|
383 |
+
#file_names_span span {
|
384 |
+
display: block;
|
385 |
+
height: 18px !important;
|
386 |
+
background-color: #ffffff;
|
387 |
+
vertical-align: middle;
|
388 |
+
cursor: default;
|
389 |
+
outline-style: solid;
|
390 |
+
outline-width: 1px;
|
391 |
+
outline-color: #C6C6C6;
|
392 |
+
overflow: hidden;
|
393 |
+
}
|
394 |
+
|
395 |
+
|
396 |
+
/* uploader */
|
397 |
+
#uploader,
|
398 |
+
#importer {
|
399 |
+
z-index: 10;
|
400 |
+
width: 100%;
|
401 |
+
height: 100%;
|
402 |
+
}
|
403 |
+
|
404 |
+
#uploader_bg,
|
405 |
+
#importer_bg {
|
406 |
+
position: absolute;
|
407 |
+
top: 0;
|
408 |
+
bottom: 0;
|
409 |
+
left: 0;
|
410 |
+
right: 0;
|
411 |
+
background-color: #ffffff;
|
412 |
+
opacity: 0.9;
|
413 |
+
}
|
414 |
+
|
415 |
+
#uploader_hitter {
|
416 |
+
position: absolute;
|
417 |
+
top: 40px;
|
418 |
+
bottom: 160px;
|
419 |
+
left: 0;
|
420 |
+
right: 0;
|
421 |
+
}
|
422 |
+
|
423 |
+
#drag_message {
|
424 |
+
position: absolute;
|
425 |
+
top: 40px;
|
426 |
+
bottom: 60px;
|
427 |
+
left: 40px;
|
428 |
+
right: 40px;
|
429 |
+
outline: #c0c0c0 dashed 5px;
|
430 |
+
text-align: center;
|
431 |
+
}
|
432 |
+
|
433 |
+
#drag_message span {
|
434 |
+
position: absolute;
|
435 |
+
top: 20%;
|
436 |
+
left: 0;
|
437 |
+
right: 0;
|
438 |
+
font-size: 24pt !important;
|
439 |
+
color: #c0c0c0;
|
440 |
+
}
|
441 |
+
|
442 |
+
#btnBrowseContainer {
|
443 |
+
position: absolute;
|
444 |
+
bottom: 0;
|
445 |
+
left: 0;
|
446 |
+
right: 0;
|
447 |
+
height: 40px;
|
448 |
+
vertical-align: middle;
|
449 |
+
text-align: center;
|
450 |
+
}
|
451 |
+
|
452 |
+
#uploaded_files {
|
453 |
+
position: absolute;
|
454 |
+
bottom: 60px;
|
455 |
+
left: 0;
|
456 |
+
right: 0;
|
457 |
+
border: solid 1px #e8e9ea;
|
458 |
+
height: 100px;
|
459 |
+
background-color: #ffffff;
|
460 |
+
overflow-x: auto;
|
461 |
+
overflow-y: scroll;
|
462 |
+
}
|
463 |
+
|
464 |
+
#uploaded_files ul {
|
465 |
+
margin: 0;
|
466 |
+
padding: 5px !important;
|
467 |
+
}
|
468 |
+
|
469 |
+
.uploaded_item {
|
470 |
+
list-style: none;
|
471 |
+
padding: 2px;
|
472 |
+
color: #c0c0c0;
|
473 |
+
}
|
474 |
+
|
475 |
+
.uploaded_item_failed {
|
476 |
+
list-style: none;
|
477 |
+
padding: 2px;
|
478 |
+
color: #ff0000;
|
479 |
+
}
|
480 |
+
|
481 |
+
.uploader_text {
|
482 |
+
background-color: #ffffe0;
|
483 |
+
border-color: #e6db55;
|
484 |
+
padding: 5px 10px;
|
485 |
+
-webkit-border-radius: 3px;
|
486 |
+
border-radius: 3px;
|
487 |
+
border-width: 1px;
|
488 |
+
border-style: solid;
|
489 |
+
font-size: 12px !important;
|
490 |
+
font-family: sans-serif;
|
491 |
+
font-weight: bold;
|
492 |
+
color: #000000;
|
493 |
+
display: inherit;
|
494 |
+
}
|
495 |
+
|
496 |
+
#uploader_progress {
|
497 |
+
position: absolute;
|
498 |
+
z-index: 11;
|
499 |
+
bottom: 0;
|
500 |
+
left: 0;
|
501 |
+
right: 0;
|
502 |
+
border: solid 1px #e8e9ea;
|
503 |
+
background-color: #f5f6f7;
|
504 |
+
padding: 10px 20px;
|
505 |
+
height: 40px;
|
506 |
+
text-align: center;
|
507 |
+
color: #c0c0c0;
|
508 |
+
}
|
509 |
+
|
510 |
+
#uploader_progress div {
|
511 |
+
height: 20px;
|
512 |
+
border: solid 1px #e8e9ea;
|
513 |
+
border-radius: 5px;
|
514 |
+
background-color: #ffffff;
|
515 |
+
}
|
516 |
+
|
517 |
+
#uploader_progress div div {
|
518 |
+
border-width: 0;
|
519 |
+
background-image: url("../images/progressbar.gif");
|
520 |
+
background-repeat: repeat-x;
|
521 |
+
height: 20px;
|
522 |
+
}
|
523 |
+
|
524 |
+
.none_select {
|
525 |
+
-webkit-user-select: none;
|
526 |
+
-khtml-user-select: none;
|
527 |
+
-moz-user-select: none;
|
528 |
+
-ms-user-select: none;
|
529 |
+
user-select: none;
|
530 |
+
}
|
filemanager/css/default_view_list.css
ADDED
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#explorer {
|
2 |
+
position: absolute;
|
3 |
+
top: 70px;
|
4 |
+
bottom: 40px;
|
5 |
+
left: 0;
|
6 |
+
right: 0;
|
7 |
+
background-color: #ffffff;
|
8 |
+
}
|
9 |
+
|
10 |
+
#explorer_header_container {
|
11 |
+
position: absolute;
|
12 |
+
z-index: 1;
|
13 |
+
top: 0;
|
14 |
+
display: table;
|
15 |
+
outline: solid 1px #e8e9ea;
|
16 |
+
background-color: #ffffff;
|
17 |
+
width: 100%;
|
18 |
+
color: #585858;
|
19 |
+
padding: 0 0 0 5px;
|
20 |
+
}
|
21 |
+
|
22 |
+
#explorer_header {
|
23 |
+
display: table-row;
|
24 |
+
}
|
25 |
+
|
26 |
+
#explorer_header span {
|
27 |
+
display: table-cell;
|
28 |
+
height: 30px;
|
29 |
+
vertical-align: middle;
|
30 |
+
}
|
31 |
+
|
32 |
+
#explorer_body_container,
|
33 |
+
#importer_body_container {
|
34 |
+
position: absolute;
|
35 |
+
top: 30px;
|
36 |
+
bottom: 0;
|
37 |
+
left: 0;
|
38 |
+
right: 0;
|
39 |
+
padding: 5px;
|
40 |
+
overflow-y: scroll;
|
41 |
+
|
42 |
+
/*deny selecting text*/
|
43 |
+
cursor: default;
|
44 |
+
-webkit-touch-callout: none;
|
45 |
+
-webkit-user-select: none;
|
46 |
+
-khtml-user-select: none;
|
47 |
+
-moz-user-select: none;
|
48 |
+
-ms-user-select: none;
|
49 |
+
user-select: none;
|
50 |
+
}
|
51 |
+
|
52 |
+
#explorer_body,
|
53 |
+
#importer_body {
|
54 |
+
display: table;
|
55 |
+
margin: 0;
|
56 |
+
padding: 0;
|
57 |
+
width: 100%;
|
58 |
+
}
|
59 |
+
|
60 |
+
|
61 |
+
.explorer_item,
|
62 |
+
.importer_item {
|
63 |
+
display: table-row;
|
64 |
+
height: 40px;
|
65 |
+
}
|
66 |
+
|
67 |
+
.explorer_item_hover,
|
68 |
+
.importer_item_hover {
|
69 |
+
outline-style: solid;
|
70 |
+
outline-width: 1px;
|
71 |
+
outline-color: #70c0e7;
|
72 |
+
background-color: #e5f3fb;
|
73 |
+
}
|
74 |
+
|
75 |
+
.explorer_item_select,
|
76 |
+
.importer_item_select {
|
77 |
+
outline-style: solid;
|
78 |
+
outline-width: 1px;
|
79 |
+
outline-color: #66a7e8;
|
80 |
+
background-color: #d1e8ff;
|
81 |
+
}
|
82 |
+
|
83 |
+
.item_thumb {
|
84 |
+
display: none;
|
85 |
+
}
|
86 |
+
|
87 |
+
.item_numbering {
|
88 |
+
display: table-cell;
|
89 |
+
padding: 0 2px;
|
90 |
+
vertical-align: middle;
|
91 |
+
width: 20px;
|
92 |
+
text-align: right;
|
93 |
+
}
|
94 |
+
|
95 |
+
.item_icon {
|
96 |
+
display: table-cell;
|
97 |
+
width: 40px;
|
98 |
+
padding: 0 2px;
|
99 |
+
vertical-align: middle;
|
100 |
+
}
|
101 |
+
|
102 |
+
.item_icon img {
|
103 |
+
max-width: 32px;
|
104 |
+
max-height: 32px;
|
105 |
+
}
|
106 |
+
|
107 |
+
.item_name {
|
108 |
+
display: table-cell;
|
109 |
+
word-wrap: break-word;
|
110 |
+
word-break: break-all;
|
111 |
+
vertical-align: middle;
|
112 |
+
}
|
113 |
+
|
114 |
+
.item_size {
|
115 |
+
display: table-cell;
|
116 |
+
width: 60px;
|
117 |
+
color: #808080;
|
118 |
+
vertical-align: middle;
|
119 |
+
}
|
120 |
+
|
121 |
+
.item_date_modified {
|
122 |
+
display: table-cell;
|
123 |
+
width: 140px;
|
124 |
+
color: #808080;
|
125 |
+
vertical-align: middle;
|
126 |
+
}
|
filemanager/css/default_view_thumbs.css
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#explorer {
|
2 |
+
position: absolute;
|
3 |
+
top: 70px;
|
4 |
+
bottom: 40px;
|
5 |
+
left: 0;
|
6 |
+
right: 0;
|
7 |
+
background-color: #ffffff;
|
8 |
+
width: 100%;
|
9 |
+
}
|
10 |
+
|
11 |
+
#importer_body_wrapper {
|
12 |
+
position: absolute;
|
13 |
+
top: 40px;
|
14 |
+
bottom: 40px;
|
15 |
+
left: 0;
|
16 |
+
right: 0;
|
17 |
+
background-color: #ffffff;
|
18 |
+
width: 100%;
|
19 |
+
}
|
20 |
+
|
21 |
+
#explorer_header_container {
|
22 |
+
display: none;
|
23 |
+
}
|
24 |
+
|
25 |
+
#explorer_body_container,
|
26 |
+
#importer_body_container {
|
27 |
+
position: absolute;
|
28 |
+
top: 0;
|
29 |
+
bottom: 0;
|
30 |
+
left: 0;
|
31 |
+
right: 0;
|
32 |
+
padding: 5px;
|
33 |
+
overflow-y: scroll;
|
34 |
+
}
|
35 |
+
|
36 |
+
|
37 |
+
.explorer_item,
|
38 |
+
.importer_item {
|
39 |
+
display: table-row;
|
40 |
+
float: left;
|
41 |
+
width: 120px;
|
42 |
+
height: 100px;
|
43 |
+
text-align: center;
|
44 |
+
}
|
45 |
+
|
46 |
+
.explorer_item_hover,
|
47 |
+
.importer_item_hover {
|
48 |
+
outline-style: solid;
|
49 |
+
outline-width: 1px;
|
50 |
+
outline-color: #70c0e7;
|
51 |
+
background-color: #e5f3fb;
|
52 |
+
}
|
53 |
+
|
54 |
+
.explorer_item_select,
|
55 |
+
.importer_item_select {
|
56 |
+
outline-style: solid;
|
57 |
+
outline-width: 1px;
|
58 |
+
outline-color: #66a7e8;
|
59 |
+
background-color: #d1e8ff;
|
60 |
+
}
|
61 |
+
|
62 |
+
|
63 |
+
.item_thumb {
|
64 |
+
display: table-cell;
|
65 |
+
padding: 2px;
|
66 |
+
width: 116px;
|
67 |
+
height: 76px;
|
68 |
+
vertical-align: middle;
|
69 |
+
}
|
70 |
+
|
71 |
+
.item_numbering {
|
72 |
+
display: none;
|
73 |
+
}
|
74 |
+
|
75 |
+
.item_thumb img {
|
76 |
+
max-width: 116px;
|
77 |
+
max-height: 76px;
|
78 |
+
}
|
79 |
+
|
80 |
+
.item_icon {
|
81 |
+
display: none;
|
82 |
+
}
|
83 |
+
|
84 |
+
.item_name {
|
85 |
+
display: block;
|
86 |
+
margin: 0 4px;
|
87 |
+
height: 20px;
|
88 |
+
overflow: hidden;
|
89 |
+
}
|
90 |
+
|
91 |
+
.item_size {
|
92 |
+
display: none;
|
93 |
+
}
|
94 |
+
|
95 |
+
.item_date_modified {
|
96 |
+
display: none;
|
97 |
+
}
|
filemanager/css/index.html
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<!DOCTYPE html><title></title>
|
filemanager/images/btn_icons/back.png
ADDED
Binary file
|
filemanager/images/btn_icons/copy.png
ADDED
Binary file
|
filemanager/images/btn_icons/create_dir.png
ADDED
Binary file
|
filemanager/images/btn_icons/cut.png
ADDED
Binary file
|
filemanager/images/btn_icons/delete.png
ADDED
Binary file
|
filemanager/images/btn_icons/divider.png
ADDED
Binary file
|
filemanager/images/btn_icons/import.png
ADDED
Binary file
|
filemanager/images/btn_icons/index.html
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<!DOCTYPE html><title></title>
|
filemanager/images/btn_icons/paste.png
ADDED
Binary file
|
filemanager/images/btn_icons/rename.png
ADDED
Binary file
|
filemanager/images/btn_icons/sort_asc.png
ADDED
Binary file
|
filemanager/images/btn_icons/sort_desc.png
ADDED
Binary file
|
filemanager/images/btn_icons/up.png
ADDED
Binary file
|
filemanager/images/btn_icons/upload.png
ADDED
Binary file
|
filemanager/images/btn_icons/view_list.png
ADDED
Binary file
|
filemanager/images/btn_icons/view_thumbs.png
ADDED
Binary file
|
filemanager/images/btn_row_move_down.png
ADDED
Binary file
|
filemanager/images/btn_row_move_up.png
ADDED
Binary file
|
filemanager/images/btn_row_remove.png
ADDED
Binary file
|
filemanager/images/file_icons/_blank.png
ADDED
Binary file
|
filemanager/images/file_icons/_page.png
ADDED
Binary file
|
filemanager/images/file_icons/aac.png
ADDED
Binary file
|
filemanager/images/file_icons/ai.png
ADDED
Binary file
|
filemanager/images/file_icons/aiff.png
ADDED
Binary file
|
filemanager/images/file_icons/avi.png
ADDED
Binary file
|
filemanager/images/file_icons/bmp.png
ADDED
Binary file
|
filemanager/images/file_icons/c.png
ADDED
Binary file
|
filemanager/images/file_icons/cpp.png
ADDED
Binary file
|
filemanager/images/file_icons/css.png
ADDED
Binary file
|
filemanager/images/file_icons/dat.png
ADDED
Binary file
|
filemanager/images/file_icons/dir.png
ADDED
Binary file
|
filemanager/images/file_icons/dmg.png
ADDED
Binary file
|
filemanager/images/file_icons/doc.png
ADDED
Binary file
|
filemanager/images/file_icons/dotx.png
ADDED
Binary file
|
filemanager/images/file_icons/dwg.png
ADDED
Binary file
|
filemanager/images/file_icons/dxf.png
ADDED
Binary file
|
filemanager/images/file_icons/eps.png
ADDED
Binary file
|
filemanager/images/file_icons/exe.png
ADDED
Binary file
|
filemanager/images/file_icons/flv.png
ADDED
Binary file
|
filemanager/images/file_icons/gif.png
ADDED
Binary file
|
filemanager/images/file_icons/h.png
ADDED
Binary file
|
filemanager/images/file_icons/hpp.png
ADDED
Binary file
|
filemanager/images/file_icons/html.png
ADDED
Binary file
|
filemanager/images/file_icons/ics.png
ADDED
Binary file
|
filemanager/images/file_icons/index.html
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html>
|
3 |
+
<head>
|
4 |
+
<title></title>
|
5 |
+
</head>
|
6 |
+
<body bgcolor="#ffffff">
|
7 |
+
|
8 |
+
</body>
|
9 |
+
</html>
|
filemanager/images/file_icons/iso.png
ADDED
Binary file
|
filemanager/images/file_icons/java.png
ADDED
Binary file
|
filemanager/images/file_icons/jpeg.png
ADDED
Binary file
|
filemanager/images/file_icons/jpg.png
ADDED
Binary file
|
filemanager/images/file_icons/key.png
ADDED
Binary file
|
filemanager/images/file_icons/mid.png
ADDED
Binary file
|
filemanager/images/file_icons/mp3.png
ADDED
Binary file
|
filemanager/images/file_icons/mp4.png
ADDED
Binary file
|
filemanager/images/file_icons/mpg.png
ADDED
Binary file
|
filemanager/images/file_icons/odf.png
ADDED
Binary file
|
filemanager/images/file_icons/ods.png
ADDED
Binary file
|
filemanager/images/file_icons/odt.png
ADDED
Binary file
|
filemanager/images/file_icons/otp.png
ADDED
Binary file
|
filemanager/images/file_icons/ots.png
ADDED
Binary file
|
filemanager/images/file_icons/ott.png
ADDED
Binary file
|
filemanager/images/file_icons/pdf.png
ADDED
Binary file
|
filemanager/images/file_icons/php.png
ADDED
Binary file
|
filemanager/images/file_icons/png.png
ADDED
Binary file
|
filemanager/images/file_icons/ppt.png
ADDED
Binary file
|
filemanager/images/file_icons/psd.png
ADDED
Binary file
|
filemanager/images/file_icons/py.png
ADDED
Binary file
|
filemanager/images/file_icons/qt.png
ADDED
Binary file
|
filemanager/images/file_icons/rar.png
ADDED
Binary file
|
filemanager/images/file_icons/rb.png
ADDED
Binary file
|
filemanager/images/file_icons/rtf.png
ADDED
Binary file
|
filemanager/images/file_icons/sql.png
ADDED
Binary file
|
filemanager/images/file_icons/tga.png
ADDED
Binary file
|
filemanager/images/file_icons/tgz.png
ADDED
Binary file
|
filemanager/images/file_icons/tiff.png
ADDED
Binary file
|
filemanager/images/file_icons/txt.png
ADDED
Binary file
|
filemanager/images/file_icons/wav.png
ADDED
Binary file
|
filemanager/images/file_icons/xls.png
ADDED
Binary file
|
filemanager/images/file_icons/xlsx.png
ADDED
Binary file
|
filemanager/images/file_icons/xml.png
ADDED
Binary file
|
filemanager/images/file_icons/yml.png
ADDED
Binary file
|
filemanager/images/file_icons/zip.png
ADDED
Binary file
|
filemanager/images/index.html
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html>
|
3 |
+
<head>
|
4 |
+
<title></title>
|
5 |
+
</head>
|
6 |
+
<body bgcolor="#ffffff">
|
7 |
+
|
8 |
+
</body>
|
9 |
+
</html>
|
filemanager/images/progressbar.gif
ADDED
Binary file
|
filemanager/js/default.js
ADDED
@@ -0,0 +1,555 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Author: Rob
|
3 |
+
* Date: 4/18/13
|
4 |
+
* Time: 3:56 PM
|
5 |
+
*/
|
6 |
+
|
7 |
+
|
8 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
9 |
+
// Events //
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
12 |
+
// Constants //
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
15 |
+
// Variables //
|
16 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
17 |
+
var keyFileSelected;
|
18 |
+
var keyFileSelectedML;
|
19 |
+
var filesSelected;
|
20 |
+
var filesSelectedML;
|
21 |
+
var dragFiles;
|
22 |
+
var isUploading;
|
23 |
+
|
24 |
+
|
25 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
26 |
+
// Constructor //
|
27 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
28 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
29 |
+
// Public Methods //
|
30 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
31 |
+
jQuery(document).ready(function () {
|
32 |
+
filesSelected = [];
|
33 |
+
filesSelectedML = [];
|
34 |
+
dragFiles = [];
|
35 |
+
|
36 |
+
//file manager under system messages
|
37 |
+
jQuery("#wrapper").css("top", jQuery("#file_manager_message").css("height"));
|
38 |
+
jQuery(window).resize(function () {
|
39 |
+
jQuery("#container").css("top", jQuery("#file_manager_message").css("height"));
|
40 |
+
});
|
41 |
+
|
42 |
+
isUploading = false;
|
43 |
+
jQuery("#uploader").css("display", "none");
|
44 |
+
jQuery("#uploader_progress_bar").css("display", "none");
|
45 |
+
jQuery("#importer").css("display", "none");
|
46 |
+
|
47 |
+
//decrease explorer header width by scroller width
|
48 |
+
jQuery(".scrollbar_filler").css("width", getScrollBarWidth() + "px");
|
49 |
+
jQuery(document).keydown(function(e) {
|
50 |
+
onKeyDown(e);
|
51 |
+
});
|
52 |
+
});
|
53 |
+
|
54 |
+
|
55 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
56 |
+
// Getters & Setters //
|
57 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
58 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
59 |
+
// Private Methods //
|
60 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
61 |
+
function getClipboardFiles() {
|
62 |
+
return jQuery("form[name=adminForm]").find("input[name=clipboard_file]").val();
|
63 |
+
}
|
64 |
+
|
65 |
+
function submit(task, sortBy, sortOrder, itemsView, destDir, fileNewName, newDirName, clipboardTask, clipboardFiles, clipboardSrc, clipboardDest) {
|
66 |
+
fileNames = filesSelected.join("**#**");
|
67 |
+
fileNamesML = filesSelectedML.join("**@**");
|
68 |
+
switch (task) {
|
69 |
+
case "rename_item":
|
70 |
+
destDir = dir;
|
71 |
+
newDirName = "";
|
72 |
+
clipboardTask = ""
|
73 |
+
clipboardDest = "";
|
74 |
+
break;
|
75 |
+
case "remove_items":
|
76 |
+
destDir = dir;
|
77 |
+
fileNewName = "";
|
78 |
+
newDirName = "";
|
79 |
+
clipboardTask = ""
|
80 |
+
clipboardDest = "";
|
81 |
+
break;
|
82 |
+
case "make_dir":
|
83 |
+
destDir = dir;
|
84 |
+
fileNewName = "";
|
85 |
+
clipboardTask = ""
|
86 |
+
clipboardDest = "";
|
87 |
+
break;
|
88 |
+
case "paste_items":
|
89 |
+
destDir = dir;
|
90 |
+
fileNewName = "";
|
91 |
+
newDirName = "";
|
92 |
+
break;
|
93 |
+
case "import_items":
|
94 |
+
destDir = dir;
|
95 |
+
fileNewName = "";
|
96 |
+
newDirName = "";
|
97 |
+
break;
|
98 |
+
default:
|
99 |
+
task = "";
|
100 |
+
break;
|
101 |
+
|
102 |
+
}
|
103 |
+
|
104 |
+
|
105 |
+
jQuery("form[name=adminForm]").find("input[name=task]").val(task);
|
106 |
+
|
107 |
+
if (sortBy != null) {
|
108 |
+
jQuery("form[name=adminForm]").find("input[name=sort_by]").val(sortBy);
|
109 |
+
}
|
110 |
+
if (sortOrder != null) {
|
111 |
+
jQuery("form[name=adminForm]").find("input[name=sort_order]").val(sortOrder);
|
112 |
+
}
|
113 |
+
if (itemsView != null) {
|
114 |
+
jQuery("form[name=adminForm]").find("input[name=items_view]").val(itemsView);
|
115 |
+
}
|
116 |
+
|
117 |
+
if (destDir != null) {
|
118 |
+
jQuery("form[name=adminForm]").find("input[name=dir]").val(destDir);
|
119 |
+
}
|
120 |
+
if (fileNames != null) {
|
121 |
+
jQuery("form[name=adminForm]").find("input[name=file_names]").val(fileNames);
|
122 |
+
}
|
123 |
+
if (fileNamesML != null) {
|
124 |
+
jQuery("form[name=adminForm]").find("input[name=file_namesML]").val(fileNamesML);
|
125 |
+
}
|
126 |
+
if (fileNewName != null) {
|
127 |
+
jQuery("form[name=adminForm]").find("input[name=file_new_name]").val(fileNewName);
|
128 |
+
}
|
129 |
+
if (newDirName != null) {
|
130 |
+
jQuery("form[name=adminForm]").find("input[name=new_dir_name]").val(newDirName);
|
131 |
+
}
|
132 |
+
|
133 |
+
if (clipboardTask != null) {
|
134 |
+
jQuery("form[name=adminForm]").find("input[name=clipboard_task]").val(clipboardTask);
|
135 |
+
}
|
136 |
+
if (clipboardFiles != null) {
|
137 |
+
jQuery("form[name=adminForm]").find("input[name=clipboard_files]").val(clipboardFiles);
|
138 |
+
}
|
139 |
+
if (clipboardSrc != null) {
|
140 |
+
jQuery("form[name=adminForm]").find("input[name=clipboard_src]").val(clipboardSrc);
|
141 |
+
}
|
142 |
+
if (clipboardDest != null) {
|
143 |
+
jQuery("form[name=adminForm]").find("input[name=clipboard_dest]").val(clipboardDest);
|
144 |
+
}
|
145 |
+
jQuery("form[name=adminForm]").submit();
|
146 |
+
}
|
147 |
+
|
148 |
+
function updateFileNames() {
|
149 |
+
var result = "";
|
150 |
+
if (filesSelected.length > 0) {
|
151 |
+
var fileNames = [];
|
152 |
+
for (var i = 0; i < filesSelected.length; i++) {
|
153 |
+
fileNames[i] = '"' + filesSelected[i] + '"';
|
154 |
+
}
|
155 |
+
result = fileNames.join(" ");
|
156 |
+
}
|
157 |
+
jQuery("#file_names_span span").html(result);
|
158 |
+
}
|
159 |
+
|
160 |
+
|
161 |
+
// submit file
|
162 |
+
function submitFiles() {
|
163 |
+
if (filesSelected.length == 0) {
|
164 |
+
return;
|
165 |
+
}
|
166 |
+
if ((image_for != "add_slides") && (filesSelected.length > 1)) {
|
167 |
+
alert('You cannot add multiple images at once. Please add images one by one or use "Add images" button.');
|
168 |
+
return;
|
169 |
+
}
|
170 |
+
var filesValid = [];
|
171 |
+
for (var i = 0; i < filesSelected.length; i++) {
|
172 |
+
var file_object = jQuery('.explorer_item[name="' + filesSelected[i] + '"]');
|
173 |
+
if (jQuery(file_object).attr("isDir") == "false") {
|
174 |
+
var fileData = [];
|
175 |
+
fileData['name'] = filesSelected[i];
|
176 |
+
fileData['filename'] = jQuery(file_object).attr("filename");
|
177 |
+
/*fileData['url'] = dir + "/" + filesSelected[i]; alert(dirUrl);*/
|
178 |
+
fileData['url'] = dirUrl + "/" + filesSelected[i]; /*alert(dirUrl);*/
|
179 |
+
fileData['reliative_url'] = dirUrl + "/" + filesSelected[i];
|
180 |
+
/*fileData['thumb_url'] = dir + "/thumb/" + filesSelected[i];*/
|
181 |
+
fileData['thumb_url'] = dirUrl + "/thumb/" + filesSelected[i];
|
182 |
+
fileData['thumb'] = jQuery(file_object).attr("filethumb");
|
183 |
+
fileData['size'] = jQuery(file_object).attr("filesize");
|
184 |
+
fileData['filetype'] = jQuery(file_object).attr("filetype");
|
185 |
+
fileData['date_modified'] = jQuery(file_object).attr("date_modified");
|
186 |
+
fileData['resolution'] = jQuery(file_object).attr("fileresolution");
|
187 |
+
filesValid.push(fileData);
|
188 |
+
}
|
189 |
+
}
|
190 |
+
window.parent[callback](filesValid, image_for, slide_id);
|
191 |
+
window.parent.tb_remove();
|
192 |
+
}
|
193 |
+
|
194 |
+
function importFiles() {
|
195 |
+
if (filesSelectedML.length == 0) {
|
196 |
+
alert("Select at least one file to import.");
|
197 |
+
return;
|
198 |
+
}
|
199 |
+
else {
|
200 |
+
submit("import_items", null, null, null, null, null, null, null, null, null, dir);
|
201 |
+
}
|
202 |
+
}
|
203 |
+
|
204 |
+
function getScrollBarWidth() {
|
205 |
+
var inner = document.createElement("p");
|
206 |
+
inner.style.width = "100%";
|
207 |
+
inner.style.height = "200px";
|
208 |
+
|
209 |
+
var outer = document.createElement("div");
|
210 |
+
outer.style.position = "absolute";
|
211 |
+
outer.style.top = "0px";
|
212 |
+
outer.style.left = "0px";
|
213 |
+
outer.style.visibility = "hidden";
|
214 |
+
outer.style.width = "200px";
|
215 |
+
outer.style.height = "150px";
|
216 |
+
outer.style.overflow = "hidden";
|
217 |
+
outer.appendChild(inner);
|
218 |
+
|
219 |
+
document.body.appendChild(outer);
|
220 |
+
var w1 = inner.offsetWidth;
|
221 |
+
outer.style.overflow = "scroll";
|
222 |
+
var w2 = inner.offsetWidth;
|
223 |
+
if (w1 == w2) {
|
224 |
+
w2 = outer.clientWidth;
|
225 |
+
}
|
226 |
+
document.body.removeChild(outer);
|
227 |
+
|
228 |
+
return (w1 - w2);
|
229 |
+
}
|
230 |
+
|
231 |
+
function getFileName(file) {
|
232 |
+
var dotIndex = file.lastIndexOf('.');
|
233 |
+
return file.substring(0, dotIndex < 0 ? file.length : dotIndex);
|
234 |
+
}
|
235 |
+
|
236 |
+
function getFileExtension(file) {
|
237 |
+
return file.substring(file.lastIndexOf('.') + 1);
|
238 |
+
}
|
239 |
+
|
240 |
+
|
241 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
242 |
+
// Listeners //
|
243 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
244 |
+
//ctrls bar handlers
|
245 |
+
function onBtnUpClick(event, obj) {
|
246 |
+
var destDir = dir.substring(0, dir.lastIndexOf(DS));
|
247 |
+
submit("", null, null, null, destDir, null, null, null, null, null, null);
|
248 |
+
}
|
249 |
+
|
250 |
+
function onBtnMakeDirClick(event, obj) {
|
251 |
+
var newDirName = prompt(messageEnterDirName);
|
252 |
+
if ((newDirName) && (newDirName != "")) {
|
253 |
+
submit("make_dir", null, null, null, null, null, newDirName, null, null, null, null);
|
254 |
+
}
|
255 |
+
}
|
256 |
+
|
257 |
+
function onBtnRenameItemClick(event, obj) {
|
258 |
+
if (filesSelected.length != 0) {
|
259 |
+
var newName = prompt(messageEnterNewName, getFileName(filesSelected[0]));
|
260 |
+
if ((newName != null) && (newName != "")) {
|
261 |
+
submit("rename_item", null, null, null, null, newName, null, null, null, null, null);
|
262 |
+
}
|
263 |
+
}
|
264 |
+
}
|
265 |
+
|
266 |
+
function onBtnCopyClick(event, obj) {
|
267 |
+
if (filesSelected.length != 0) {
|
268 |
+
submit("", null, null, null, null, null, null, "copy", filesSelected.join("**#**"), dir, null);
|
269 |
+
}
|
270 |
+
}
|
271 |
+
|
272 |
+
function onBtnCutClick(event, obj) {
|
273 |
+
if (filesSelected.length != 0) {
|
274 |
+
submit("", null, null, null, null, null, null, "cut", filesSelected.join("**#**"), dir, null);
|
275 |
+
}
|
276 |
+
}
|
277 |
+
|
278 |
+
function onBtnPasteClick(event, obj) {
|
279 |
+
if (getClipboardFiles() != "") {
|
280 |
+
submit("paste_items", null, null, null, null, null, null, null, null, null, dir);
|
281 |
+
}
|
282 |
+
}
|
283 |
+
|
284 |
+
function onBtnRemoveItemsClick(event, obj) {
|
285 |
+
if ((filesSelected.length != 0) && (confirm(warningRemoveItems) == true)) {
|
286 |
+
submit("remove_items", null, null, null, null, null, null, null, null, null, null);
|
287 |
+
}
|
288 |
+
}
|
289 |
+
|
290 |
+
function onBtnShowUploaderClick(event, obj) {
|
291 |
+
jQuery("#uploader").fadeIn();
|
292 |
+
}
|
293 |
+
|
294 |
+
function onBtnViewThumbsClick(event, obj) {
|
295 |
+
submit("", null, null, "thumbs", null, null, null, null, null, null, null);
|
296 |
+
}
|
297 |
+
|
298 |
+
function onBtnViewListClick(event, obj) {
|
299 |
+
submit("", null, null, "list", null, null, null, null, null, null, null);
|
300 |
+
}
|
301 |
+
|
302 |
+
function onBtnBackClick(event, obj) {
|
303 |
+
if ((isUploading == false) || (confirm(warningCancelUploads) == true)) {
|
304 |
+
// jQuery("#uploader").fadeOut(function () {
|
305 |
+
submit("", null, null, null, null, null, null, null, null, null, null);
|
306 |
+
// });
|
307 |
+
}
|
308 |
+
}
|
309 |
+
|
310 |
+
|
311 |
+
function onPathComponentClick(event, obj, path) {
|
312 |
+
submit("", null, null, null, path, null, null, null, null, null, null);
|
313 |
+
}
|
314 |
+
|
315 |
+
function onBtnShowImportClick(event, obj) {
|
316 |
+
jQuery("#importer").fadeIn();
|
317 |
+
}
|
318 |
+
|
319 |
+
function onNameHeaderClick(event, obj) {
|
320 |
+
var newSortOrder = ((sortBy == "name") && (sortOrder == "asc")) ? "desc" : "asc";
|
321 |
+
submit("", "name", newSortOrder, null, null, null, null, null, null, null, null);
|
322 |
+
}
|
323 |
+
|
324 |
+
function onSizeHeaderClick(event, obj) {
|
325 |
+
var newSortOrder = ((sortBy == "size") && (sortOrder == "asc")) ? "desc" : "asc";
|
326 |
+
submit("", "size", newSortOrder, null, null, null, null, null, null, null, null);
|
327 |
+
}
|
328 |
+
|
329 |
+
function onDateModifiedHeaderClick(event, obj) {
|
330 |
+
var newSortOrder = ((sortBy == "date_modified") && (sortOrder == "asc")) ? "desc" : "asc";
|
331 |
+
submit("", "date_modified", newSortOrder, null, null, null, null, null, null, null, null);
|
332 |
+
}
|
333 |
+
|
334 |
+
|
335 |
+
//file handlers
|
336 |
+
function onKeyDown(e) {
|
337 |
+
var e = e || window.event;
|
338 |
+
var chCode1 = e.which || e.paramlist_keyCode;
|
339 |
+
if ((e.ctrlKey || e.metaKey) && chCode1 == 65) {
|
340 |
+
jQuery(".explorer_item").addClass("explorer_item_select");
|
341 |
+
jQuery(".importer_item").addClass("importer_item_select");
|
342 |
+
filesSelected = [];
|
343 |
+
filesSelectedML = [];
|
344 |
+
jQuery(".explorer_item").each(function() {
|
345 |
+
var objName = jQuery(this).attr("name");
|
346 |
+
if (filesSelected.indexOf(objName) == -1) {
|
347 |
+
filesSelected.push(objName);
|
348 |
+
keyFileSelected = this;
|
349 |
+
}
|
350 |
+
});
|
351 |
+
jQuery(".importer_item").each(function() {
|
352 |
+
var objName = jQuery(this).attr("path");
|
353 |
+
if (filesSelectedML.indexOf(objName) == -1) {
|
354 |
+
filesSelectedML.push(objName);
|
355 |
+
keyFileSelectedML = this;
|
356 |
+
}
|
357 |
+
});
|
358 |
+
e.preventDefault();
|
359 |
+
}
|
360 |
+
}
|
361 |
+
|
362 |
+
function onFileMOver(event, obj) {
|
363 |
+
jQuery(obj).addClass("explorer_item_hover");
|
364 |
+
}
|
365 |
+
|
366 |
+
function onFileMOverML(event, obj) {
|
367 |
+
jQuery(obj).addClass("importer_item_hover");
|
368 |
+
}
|
369 |
+
|
370 |
+
function onFileMOut(event, obj) {
|
371 |
+
jQuery(obj).removeClass("explorer_item_hover");
|
372 |
+
}
|
373 |
+
|
374 |
+
function onFileMOutML(event, obj) {
|
375 |
+
jQuery(obj).removeClass("importer_item_hover");
|
376 |
+
}
|
377 |
+
|
378 |
+
function onFileClick(event, obj) {
|
379 |
+
jQuery(".explorer_item").removeClass("explorer_item_select");
|
380 |
+
var objName = jQuery(obj).attr("name");
|
381 |
+
if (event.ctrlKey == true || event.metaKey == true) {
|
382 |
+
if (filesSelected.indexOf(objName) == -1) {
|
383 |
+
filesSelected.push(objName);
|
384 |
+
keyFileSelected = obj;
|
385 |
+
}
|
386 |
+
else {
|
387 |
+
filesSelected.splice(filesSelected.indexOf(objName), 1);
|
388 |
+
jQuery(obj).removeClass("explorer_item_select");
|
389 |
+
}
|
390 |
+
}
|
391 |
+
else if (event.shiftKey == true) {
|
392 |
+
filesSelected = [];
|
393 |
+
var explorerItems = jQuery(".explorer_item");
|
394 |
+
var curFileIndex = explorerItems.index(jQuery(obj));
|
395 |
+
var keyFileIndex = explorerItems.index(keyFileSelected);
|
396 |
+
var startIndex = Math.min(keyFileIndex, curFileIndex);
|
397 |
+
var endIndex = startIndex + Math.abs(curFileIndex - keyFileIndex);
|
398 |
+
for (var i = startIndex; i < endIndex + 1; i++) {
|
399 |
+
filesSelected.push(jQuery(explorerItems[i]).attr("name"));
|
400 |
+
}
|
401 |
+
}
|
402 |
+
else {
|
403 |
+
filesSelected = [jQuery(obj).attr("name")];
|
404 |
+
keyFileSelected = obj;
|
405 |
+
}
|
406 |
+
|
407 |
+
for (var i = 0; i < filesSelected.length; i++) {
|
408 |
+
jQuery('.explorer_item[name="' + filesSelected[i] + '"]').addClass("explorer_item_select");
|
409 |
+
}
|
410 |
+
updateFileNames();
|
411 |
+
}
|
412 |
+
|
413 |
+
function onFileClickML(event, obj) {
|
414 |
+
jQuery(".importer_item").removeClass("importer_item_select");
|
415 |
+
var objName = jQuery(obj).attr("path");
|
416 |
+
if (event.ctrlKey == true || event.metaKey == true) {
|
417 |
+
if (filesSelectedML.indexOf(objName) == -1) {
|
418 |
+
filesSelectedML.push(objName);
|
419 |
+
keyFileSelectedML = obj;
|
420 |
+
}
|
421 |
+
else {
|
422 |
+
filesSelectedML.splice(filesSelectedML.indexOf(objName), 1);
|
423 |
+
jQuery(obj).removeClass("importer_item_select");
|
424 |
+
}
|
425 |
+
}
|
426 |
+
else if (event.shiftKey == true) {
|
427 |
+
filesSelectedML = [];
|
428 |
+
var explorerItems = jQuery(".importer_item");
|
429 |
+
var curFileIndex = explorerItems.index(jQuery(obj));
|
430 |
+
var keyFileIndex = explorerItems.index(keyFileSelectedML);
|
431 |
+
var startIndex = Math.min(keyFileIndex, curFileIndex);
|
432 |
+
var endIndex = startIndex + Math.abs(curFileIndex - keyFileIndex);
|
433 |
+
for (var i = startIndex; i < endIndex + 1; i++) {
|
434 |
+
filesSelectedML.push(jQuery(explorerItems[i]).attr("path"));
|
435 |
+
}
|
436 |
+
}
|
437 |
+
else {
|
438 |
+
filesSelectedML = [jQuery(obj).attr("path")];
|
439 |
+
keyFileSelectedML = obj;
|
440 |
+
}
|
441 |
+
|
442 |
+
for (var i = 0; i < filesSelectedML.length; i++) {
|
443 |
+
jQuery('.importer_item[path="' + filesSelectedML[i] + '"]').addClass("importer_item_select");
|
444 |
+
}
|
445 |
+
updateFileNames();
|
446 |
+
}
|
447 |
+
|
448 |
+
function onFileDblClick(event, obj) {
|
449 |
+
if (jQuery(obj).attr("isDir") == "true") {
|
450 |
+
submit("", null, null, null, dir + DS + jQuery(obj).attr("name"), null, null, null, null, null, null);
|
451 |
+
}
|
452 |
+
else {
|
453 |
+
filesSelected = [];
|
454 |
+
filesSelected.push(jQuery(obj).attr("name"));
|
455 |
+
submitFiles();
|
456 |
+
}
|
457 |
+
}
|
458 |
+
|
459 |
+
function onFileDblClickML(event, obj) {
|
460 |
+
filesSelectedML = [];
|
461 |
+
filesSelectedML.push(jQuery(obj).attr("path"));
|
462 |
+
importFiles();
|
463 |
+
}
|
464 |
+
|
465 |
+
function onFileDragStart(event, obj) {
|
466 |
+
var objName = jQuery(obj).attr("name");
|
467 |
+
if (filesSelected.indexOf(objName) < 0) {
|
468 |
+
jQuery(".explorer_item").removeClass("explorer_item_select");
|
469 |
+
if (event.ctrlKey == true || event.metaKey == true) {
|
470 |
+
if (filesSelected.indexOf(objName) == -1) {
|
471 |
+
filesSelected.push(objName);
|
472 |
+
keyFileSelected = obj;
|
473 |
+
}
|
474 |
+
}
|
475 |
+
else if (event.shiftKey == true) {
|
476 |
+
filesSelected = [];
|
477 |
+
var explorerItems = jQuery(".explorer_item");
|
478 |
+
var curFileIndex = explorerItems.index(jQuery(obj));
|
479 |
+
var keyFileIndex = explorerItems.index(keyFileSelected);
|
480 |
+
var startIndex = Math.min(keyFileIndex, curFileIndex);
|
481 |
+
var endIndex = startIndex + Math.abs(curFileIndex - keyFileIndex);
|
482 |
+
for (var i = startIndex; i < endIndex + 1; i++) {
|
483 |
+
filesSelected.push(jQuery(explorerItems[i]).attr("name"));
|
484 |
+
}
|
485 |
+
}
|
486 |
+
else {
|
487 |
+
filesSelected = [jQuery(obj).attr("name")];
|
488 |
+
keyFileSelected = obj;
|
489 |
+
}
|
490 |
+
|
491 |
+
for (var i = 0; i < filesSelected.length; i++) {
|
492 |
+
jQuery('.explorer_item[name="' + filesSelected[i] + '"]').addClass("explorer_item_select");
|
493 |
+
}
|
494 |
+
|
495 |
+
updateFileNames();
|
496 |
+
}
|
497 |
+
dragFiles = filesSelected;
|
498 |
+
}
|
499 |
+
|
500 |
+
function onFileDragOver(event, obj) {
|
501 |
+
event.preventDefault();
|
502 |
+
}
|
503 |
+
|
504 |
+
function onFileDrop(event, obj) {
|
505 |
+
var destDirName = jQuery(obj).attr("name");
|
506 |
+
if ((dragFiles.length == 0) || (dragFiles.indexOf(destDirName) >= 0)) {
|
507 |
+
return false;
|
508 |
+
}
|
509 |
+
var clipboardTask = (event.ctrlKey == true || event.metaKey == true) ? "copy" : "cut";
|
510 |
+
var clipboardDest = dir + DS + destDirName;
|
511 |
+
submit("paste_items", null, null, null, null, null, null, clipboardTask, dragFiles.join("**#**"), dir, clipboardDest);
|
512 |
+
event.preventDefault();
|
513 |
+
}
|
514 |
+
|
515 |
+
function onBtnOpenClick(event, obj) {
|
516 |
+
if (jQuery('.explorer_item[name="' + filesSelected[0] + '"]').attr("isDir") == true) {
|
517 |
+
filesSelected.length = 1;
|
518 |
+
submit("", null, null, null, dir + DS + filesSelected[0], null, null, null, null, null, null);
|
519 |
+
}
|
520 |
+
else {
|
521 |
+
submitFiles();
|
522 |
+
}
|
523 |
+
}
|
524 |
+
|
525 |
+
function onBtnImportClick(event, obj) {
|
526 |
+
importFiles();
|
527 |
+
}
|
528 |
+
|
529 |
+
function onBtnCancelClick(event, obj) {
|
530 |
+
window.parent.tb_remove();
|
531 |
+
}
|
532 |
+
|
533 |
+
function onBtnSelectAllClick() {
|
534 |
+
jQuery(".explorer_item").addClass("explorer_item_select");
|
535 |
+
filesSelected = [];
|
536 |
+
jQuery(".explorer_item").each(function() {
|
537 |
+
var objName = jQuery(this).attr("name");
|
538 |
+
if (filesSelected.indexOf(objName) == -1) {
|
539 |
+
filesSelected.push(objName);
|
540 |
+
keyFileSelected = this;
|
541 |
+
}
|
542 |
+
});
|
543 |
+
}
|
544 |
+
|
545 |
+
function onBtnSelectAllMediLibraryClick() {
|
546 |
+
jQuery(".importer_item").addClass("importer_item_select");
|
547 |
+
filesSelectedML = [];
|
548 |
+
jQuery(".importer_item").each(function() {
|
549 |
+
var objName = jQuery(this).attr("path");
|
550 |
+
if (filesSelectedML.indexOf(objName) == -1) {
|
551 |
+
filesSelectedML.push(objName);
|
552 |
+
keyFileSelectedML = this;
|
553 |
+
}
|
554 |
+
});
|
555 |
+
}
|
filemanager/js/jq_uploader/index.html
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html>
|
3 |
+
<head>
|
4 |
+
<title></title>
|
5 |
+
</head>
|
6 |
+
<body bgcolor="#ffffff">
|
7 |
+
|
8 |
+
</body>
|
9 |
+
</html>
|
filemanager/js/jq_uploader/jquery.fileupload.js
ADDED
@@ -0,0 +1,1243 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* jQuery File Upload Plugin 5.28.8
|
3 |
+
* https://github.com/blueimp/jQuery-File-Upload
|
4 |
+
*
|
5 |
+
* Copyright 2010, Sebastian Tschan
|
6 |
+
* https://blueimp.net
|
7 |
+
*
|
8 |
+
* Licensed under the MIT license:
|
9 |
+
* http://www.opensource.org/licenses/MIT
|
10 |
+
*/
|
11 |
+
|
12 |
+
/*jslint nomen: true, unparam: true, regexp: true */
|
13 |
+
/*global define, window, document, File, Blob, FormData, location */
|
14 |
+
|
15 |
+
(function (factory) {
|
16 |
+
'use strict';
|
17 |
+
if (typeof define === 'function' && define.amd) {
|
18 |
+
// Register as an anonymous AMD module:
|
19 |
+
define([
|
20 |
+
'jquery',
|
21 |
+
'jquery.ui.widget.js'
|
22 |
+
], factory);
|
23 |
+
} else {
|
24 |
+
// Browser globals:
|
25 |
+
factory(window.jQuery);
|
26 |
+
}
|
27 |
+
}(function ($) {
|
28 |
+
'use strict';
|
29 |
+
|
30 |
+
// The FileReader API is not actually used, but works as feature detection,
|
31 |
+
// as e.g. Safari supports XHR file uploads via the FormData API,
|
32 |
+
// but not non-multipart XHR file uploads:
|
33 |
+
$.support.xhrFileUpload = !!(window.XMLHttpRequestUpload && window.FileReader);
|
34 |
+
$.support.xhrFormDataFileUpload = !!window.FormData;
|
35 |
+
|
36 |
+
// The fileupload widget listens for change events on file input fields defined
|
37 |
+
// via fileInput setting and paste or drop events of the given dropZone.
|
38 |
+
// In addition to the default jQuery Widget methods, the fileupload widget
|
39 |
+
// exposes the "add" and "send" methods, to add or directly send files using
|
40 |
+
// the fileupload API.
|
41 |
+
// By default, files added via file input selection, paste, drag & drop or
|
42 |
+
// "add" method are uploaded immediately, but it is possible to override
|
43 |
+
// the "add" callback option to queue file uploads.
|
44 |
+
$.widget('blueimp.fileupload', {
|
45 |
+
|
46 |
+
options: {
|
47 |
+
// The drop target element(s), by the default the complete document.
|
48 |
+
// Set to null to disable drag & drop support:
|
49 |
+
dropZone: $(document),
|
50 |
+
// The paste target element(s), by the default the complete document.
|
51 |
+
// Set to null to disable paste support:
|
52 |
+
pasteZone: $(document),
|
53 |
+
// The file input field(s), that are listened to for change events.
|
54 |
+
// If undefined, it is set to the file input fields inside
|
55 |
+
// of the widget element on plugin initialization.
|
56 |
+
// Set to null to disable the change listener.
|
57 |
+
fileInput: undefined,
|
58 |
+
// By default, the file input field is replaced with a clone after
|
59 |
+
// each input field change event. This is required for iframe transport
|
60 |
+
// queues and allows change events to be fired for the same file
|
61 |
+
// selection, but can be disabled by setting the following option to false:
|
62 |
+
replaceFileInput: true,
|
63 |
+
// The parameter name for the file form data (the request argument name).
|
64 |
+
// If undefined or empty, the name property of the file input field is
|
65 |
+
// used, or "files[]" if the file input name property is also empty,
|
66 |
+
// can be a string or an array of strings:
|
67 |
+
paramName: undefined,
|
68 |
+
// By default, each file of a selection is uploaded using an individual
|
69 |
+
// request for XHR type uploads. Set to false to upload file
|
70 |
+
// selections in one request each:
|
71 |
+
singleFileUploads: true,
|
72 |
+
// To limit the number of files uploaded with one XHR request,
|
73 |
+
// set the following option to an integer greater than 0:
|
74 |
+
limitMultiFileUploads: undefined,
|
75 |
+
// Set the following option to true to issue all file upload requests
|
76 |
+
// in a sequential order:
|
77 |
+
sequentialUploads: false,
|
78 |
+
// To limit the number of concurrent uploads,
|
79 |
+
// set the following option to an integer greater than 0:
|
80 |
+
limitConcurrentUploads: undefined,
|
81 |
+
// Set the following option to true to force iframe transport uploads:
|
82 |
+
forceIframeTransport: false,
|
83 |
+
// Set the following option to the location of a redirect url on the
|
84 |
+
// origin server, for cross-domain iframe transport uploads:
|
85 |
+
redirect: undefined,
|
86 |
+
// The parameter name for the redirect url, sent as part of the form
|
87 |
+
// data and set to 'redirect' if this option is empty:
|
88 |
+
redirectParamName: undefined,
|
89 |
+
// Set the following option to the location of a postMessage window,
|
90 |
+
// to enable postMessage transport uploads:
|
91 |
+
postMessage: undefined,
|
92 |
+
// By default, XHR file uploads are sent as multipart/form-data.
|
93 |
+
// The iframe transport is always using multipart/form-data.
|
94 |
+
// Set to false to enable non-multipart XHR uploads:
|
95 |
+
multipart: true,
|
96 |
+
// To upload large files in smaller chunks, set the following option
|
97 |
+
// to a preferred maximum chunk size. If set to 0, null or undefined,
|
98 |
+
// or the browser does not support the required Blob API, files will
|
99 |
+
// be uploaded as a whole.
|
100 |
+
maxChunkSize: undefined,
|
101 |
+
// When a non-multipart upload or a chunked multipart upload has been
|
102 |
+
// aborted, this option can be used to resume the upload by setting
|
103 |
+
// it to the size of the already uploaded bytes. This option is most
|
104 |
+
// useful when modifying the options object inside of the "add" or
|
105 |
+
// "send" callbacks, as the options are cloned for each file upload.
|
106 |
+
uploadedBytes: undefined,
|
107 |
+
// By default, failed (abort or error) file uploads are removed from the
|
108 |
+
// global progress calculation. Set the following option to false to
|
109 |
+
// prevent recalculating the global progress data:
|
110 |
+
recalculateProgress: true,
|
111 |
+
// Interval in milliseconds to calculate and trigger progress events:
|
112 |
+
progressInterval: 100,
|
113 |
+
// Interval in milliseconds to calculate progress bitrate:
|
114 |
+
bitrateInterval: 500,
|
115 |
+
// By default, uploads are started automatically when adding files:
|
116 |
+
autoUpload: true,
|
117 |
+
|
118 |
+
// Additional form data to be sent along with the file uploads can be set
|
119 |
+
// using this option, which accepts an array of objects with name and
|
120 |
+
// value properties, a function returning such an array, a FormData
|
121 |
+
// object (for XHR file uploads), or a simple object.
|
122 |
+
// The form of the first fileInput is given as parameter to the function:
|
123 |
+
formData: function (form) {
|
124 |
+
return form.serializeArray();
|
125 |
+
},
|
126 |
+
|
127 |
+
// The add callback is invoked as soon as files are added to the fileupload
|
128 |
+
// widget (via file input selection, drag & drop, paste or add API call).
|
129 |
+
// If the singleFileUploads option is enabled, this callback will be
|
130 |
+
// called once for each file in the selection for XHR file uplaods, else
|
131 |
+
// once for each file selection.
|
132 |
+
// The upload starts when the submit method is invoked on the data parameter.
|
133 |
+
// The data object contains a files property holding the added files
|
134 |
+
// and allows to override plugin options as well as define ajax settings.
|
135 |
+
// Listeners for this callback can also be bound the following way:
|
136 |
+
// .bind('fileuploadadd', func);
|
137 |
+
// data.submit() returns a Promise object and allows to attach additional
|
138 |
+
// handlers using jQuery's Deferred callbacks:
|
139 |
+
// data.submit().done(func).fail(func).always(func);
|
140 |
+
add: function (e, data) {
|
141 |
+
if (data.autoUpload || (data.autoUpload !== false &&
|
142 |
+
($(this).data('blueimp-fileupload') ||
|
143 |
+
$(this).data('fileupload')).options.autoUpload)) {
|
144 |
+
data.submit();
|
145 |
+
}
|
146 |
+
},
|
147 |
+
|
148 |
+
// Other callbacks:
|
149 |
+
|
150 |
+
// Callback for the submit event of each file upload:
|
151 |
+
// submit: function (e, data) {}, // .bind('fileuploadsubmit', func);
|
152 |
+
|
153 |
+
// Callback for the start of each file upload request:
|
154 |
+
// send: function (e, data) {}, // .bind('fileuploadsend', func);
|
155 |
+
|
156 |
+
// Callback for successful uploads:
|
157 |
+
// done: function (e, data) {}, // .bind('fileuploaddone', func);
|
158 |
+
|
159 |
+
// Callback for failed (abort or error) uploads:
|
160 |
+
// fail: function (e, data) {}, // .bind('fileuploadfail', func);
|
161 |
+
|
162 |
+
// Callback for completed (success, abort or error) requests:
|
163 |
+
// always: function (e, data) {}, // .bind('fileuploadalways', func);
|
164 |
+
|
165 |
+
// Callback for upload progress events:
|
166 |
+
// progress: function (e, data) {}, // .bind('fileuploadprogress', func);
|
167 |
+
|
168 |
+
// Callback for global upload progress events:
|
169 |
+
// progressall: function (e, data) {}, // .bind('fileuploadprogressall', func);
|
170 |
+
|
171 |
+
// Callback for uploads start, equivalent to the global ajaxStart event:
|
172 |
+
// start: function (e) {}, // .bind('fileuploadstart', func);
|
173 |
+
|
174 |
+
// Callback for uploads stop, equivalent to the global ajaxStop event:
|
175 |
+
// stop: function (e) {}, // .bind('fileuploadstop', func);
|
176 |
+
|
177 |
+
// Callback for change events of the fileInput(s):
|
178 |
+
// change: function (e, data) {}, // .bind('fileuploadchange', func);
|
179 |
+
|
180 |
+
// Callback for paste events to the pasteZone(s):
|
181 |
+
// paste: function (e, data) {}, // .bind('fileuploadpaste', func);
|
182 |
+
|
183 |
+
// Callback for drop events of the dropZone(s):
|
184 |
+
// drop: function (e, data) {}, // .bind('fileuploaddrop', func);
|
185 |
+
|
186 |
+
// Callback for dragover events of the dropZone(s):
|
187 |
+
// dragover: function (e) {}, // .bind('fileuploaddragover', func);
|
188 |
+
|
189 |
+
// Callback for the start of each chunk upload request:
|
190 |
+
// chunksend: function (e, data) {}, // .bind('fileuploadchunksend', func);
|
191 |
+
|
192 |
+
// Callback for successful chunk uploads:
|
193 |
+
// chunkdone: function (e, data) {}, // .bind('fileuploadchunkdone', func);
|
194 |
+
|
195 |
+
// Callback for failed (abort or error) chunk uploads:
|
196 |
+
// chunkfail: function (e, data) {}, // .bind('fileuploadchunkfail', func);
|
197 |
+
|
198 |
+
// Callback for completed (success, abort or error) chunk upload requests:
|
199 |
+
// chunkalways: function (e, data) {}, // .bind('fileuploadchunkalways', func);
|
200 |
+
|
201 |
+
// The plugin options are used as settings object for the ajax calls.
|
202 |
+
// The following are jQuery ajax settings required for the file uploads:
|
203 |
+
processData: false,
|
204 |
+
contentType: false,
|
205 |
+
cache: false
|
206 |
+
},
|
207 |
+
|
208 |
+
// A list of options that require a refresh after assigning a new value:
|
209 |
+
_refreshOptionsList: [
|
210 |
+
'fileInput',
|
211 |
+
'dropZone',
|
212 |
+
'pasteZone',
|
213 |
+
'multipart',
|
214 |
+
'forceIframeTransport'
|
215 |
+
],
|
216 |
+
|
217 |
+
_BitrateTimer: function () {
|
218 |
+
this.timestamp = ((Date.now) ? Date.now() : (new Date()).getTime());
|
219 |
+
this.loaded = 0;
|
220 |
+
this.bitrate = 0;
|
221 |
+
this.getBitrate = function (now, loaded, interval) {
|
222 |
+
var timeDiff = now - this.timestamp;
|
223 |
+
if (!this.bitrate || !interval || timeDiff > interval) {
|
224 |
+
this.bitrate = (loaded - this.loaded) * (1000 / timeDiff) * 8;
|
225 |
+
this.loaded = loaded;
|
226 |
+
this.timestamp = now;
|
227 |
+
}
|
228 |
+
return this.bitrate;
|
229 |
+
};
|
230 |
+
},
|
231 |
+
|
232 |
+
_isXHRUpload: function (options) {
|
233 |
+
return !options.forceIframeTransport &&
|
234 |
+
((!options.multipart && $.support.xhrFileUpload) ||
|
235 |
+
$.support.xhrFormDataFileUpload);
|
236 |
+
},
|
237 |
+
|
238 |
+
_getFormData: function (options) {
|
239 |
+
var formData;
|
240 |
+
if (typeof options.formData === 'function') {
|
241 |
+
return options.formData(options.form);
|
242 |
+
}
|
243 |
+
if ($.isArray(options.formData)) {
|
244 |
+
return options.formData;
|
245 |
+
}
|
246 |
+
if ($.type(options.formData) === 'object') {
|
247 |
+
formData = [];
|
248 |
+
$.each(options.formData, function (name, value) {
|
249 |
+
formData.push({name: name, value: value});
|
250 |
+
});
|
251 |
+
return formData;
|
252 |
+
}
|
253 |
+
return [];
|
254 |
+
},
|
255 |
+
|
256 |
+
_getTotal: function (files) {
|
257 |
+
var total = 0;
|
258 |
+
$.each(files, function (index, file) {
|
259 |
+
total += file.size || 1;
|
260 |
+
});
|
261 |
+
return total;
|
262 |
+
},
|
263 |
+
|
264 |
+
_initProgressObject: function (obj) {
|
265 |
+
var progress = {
|
266 |
+
loaded: 0,
|
267 |
+
total: 0,
|
268 |
+
bitrate: 0
|
269 |
+
};
|
270 |
+
if (obj._progress) {
|
271 |
+
$.extend(obj._progress, progress);
|
272 |
+
} else {
|
273 |
+
obj._progress = progress;
|
274 |
+
}
|
275 |
+
},
|
276 |
+
|
277 |
+
_initResponseObject: function (obj) {
|
278 |
+
var prop;
|
279 |
+
if (obj._response) {
|
280 |
+
for (prop in obj._response) {
|
281 |
+
if (obj._response.hasOwnProperty(prop)) {
|
282 |
+
delete obj._response[prop];
|
283 |
+
}
|
284 |
+
}
|
285 |
+
} else {
|
286 |
+
obj._response = {};
|
287 |
+
}
|
288 |
+
},
|
289 |
+
|
290 |
+
_onProgress: function (e, data) {
|
291 |
+
if (e.lengthComputable) {
|
292 |
+
var now = ((Date.now) ? Date.now() : (new Date()).getTime()),
|
293 |
+
loaded;
|
294 |
+
if (data._time && data.progressInterval &&
|
295 |
+
(now - data._time < data.progressInterval) &&
|
296 |
+
e.loaded !== e.total) {
|
297 |
+
return;
|
298 |
+
}
|
299 |
+
data._time = now;
|
300 |
+
loaded = Math.floor(
|
301 |
+
e.loaded / e.total * (data.chunkSize || data._progress.total)
|
302 |
+
) + (data.uploadedBytes || 0);
|
303 |
+
// Add the difference from the previously loaded state
|
304 |
+
// to the global loaded counter:
|
305 |
+
this._progress.loaded += (loaded - data._progress.loaded);
|
306 |
+
this._progress.bitrate = this._bitrateTimer.getBitrate(
|
307 |
+
now,
|
308 |
+
this._progress.loaded,
|
309 |
+
data.bitrateInterval
|
310 |
+
);
|
311 |
+
data._progress.loaded = data.loaded = loaded;
|
312 |
+
data._progress.bitrate = data.bitrate = data._bitrateTimer.getBitrate(
|
313 |
+
now,
|
314 |
+
loaded,
|
315 |
+
data.bitrateInterval
|
316 |
+
);
|
317 |
+
// Trigger a custom progress event with a total data property set
|
318 |
+
// to the file size(s) of the current upload and a loaded data
|
319 |
+
// property calculated accordingly:
|
320 |
+
this._trigger('progress', e, data);
|
321 |
+
// Trigger a global progress event for all current file uploads,
|
322 |
+
// including ajax calls queued for sequential file uploads:
|
323 |
+
this._trigger('progressall', e, this._progress);
|
324 |
+
}
|
325 |
+
},
|
326 |
+
|
327 |
+
_initProgressListener: function (options) {
|
328 |
+
var that = this,
|
329 |
+
xhr = options.xhr ? options.xhr() : $.ajaxSettings.xhr();
|
330 |
+
// Accesss to the native XHR object is required to add event listeners
|
331 |
+
// for the upload progress event:
|
332 |
+
if (xhr.upload) {
|
333 |
+
$(xhr.upload).bind('progress', function (e) {
|
334 |
+
var oe = e.originalEvent;
|
335 |
+
// Make sure the progress event properties get copied over:
|
336 |
+
e.lengthComputable = oe.lengthComputable;
|
337 |
+
e.loaded = oe.loaded;
|
338 |
+
e.total = oe.total;
|
339 |
+
that._onProgress(e, options);
|
340 |
+
});
|
341 |
+
options.xhr = function () {
|
342 |
+
return xhr;
|
343 |
+
};
|
344 |
+
}
|
345 |
+
},
|
346 |
+
|
347 |
+
_isInstanceOf: function (type, obj) {
|
348 |
+
// Cross-frame instanceof check
|
349 |
+
return Object.prototype.toString.call(obj) === '[object ' + type + ']';
|
350 |
+
},
|
351 |
+
|
352 |
+
_initXHRData: function (options) {
|
353 |
+
var that = this,
|
354 |
+
formData,
|
355 |
+
file = options.files[0],
|
356 |
+
// Ignore non-multipart setting if not supported:
|
357 |
+
multipart = options.multipart || !$.support.xhrFileUpload,
|
358 |
+
paramName = options.paramName[0];
|
359 |
+
options.headers = options.headers || {};
|
360 |
+
if (options.contentRange) {
|
361 |
+
options.headers['Content-Range'] = options.contentRange;
|
362 |
+
}
|
363 |
+
if (!multipart) {
|
364 |
+
options.headers['Content-Disposition'] = 'attachment; filename="' +
|
365 |
+
encodeURI(file.name) + '"';
|
366 |
+
options.contentType = file.type;
|
367 |
+
options.data = options.blob || file;
|
368 |
+
} else if ($.support.xhrFormDataFileUpload) {
|
369 |
+
if (options.postMessage) {
|
370 |
+
// window.postMessage does not allow sending FormData
|
371 |
+
// objects, so we just add the File/Blob objects to
|
372 |
+
// the formData array and let the postMessage window
|
373 |
+
// create the FormData object out of this array:
|
374 |
+
formData = this._getFormData(options);
|
375 |
+
if (options.blob) {
|
376 |
+
formData.push({
|
377 |
+
name: paramName,
|
378 |
+
value: options.blob
|
379 |
+
});
|
380 |
+
} else {
|
381 |
+
$.each(options.files, function (index, file) {
|
382 |
+
formData.push({
|
383 |
+
name: options.paramName[index] || paramName,
|
384 |
+
value: file
|
385 |
+
});
|
386 |
+
});
|
387 |
+
}
|
388 |
+
} else {
|
389 |
+
if (that._isInstanceOf('FormData', options.formData)) {
|
390 |
+
formData = options.formData;
|
391 |
+
} else {
|
392 |
+
formData = new FormData();
|
393 |
+
$.each(this._getFormData(options), function (index, field) {
|
394 |
+
formData.append(field.name, field.value);
|
395 |
+
});
|
396 |
+
}
|
397 |
+
if (options.blob) {
|
398 |
+
options.headers['Content-Disposition'] = 'attachment; filename="' +
|
399 |
+
encodeURI(file.name) + '"';
|
400 |
+
formData.append(paramName, options.blob, file.name);
|
401 |
+
} else {
|
402 |
+
$.each(options.files, function (index, file) {
|
403 |
+
// This check allows the tests to run with
|
404 |
+
// dummy objects:
|
405 |
+
if (that._isInstanceOf('File', file) ||
|
406 |
+
that._isInstanceOf('Blob', file)) {
|
407 |
+
formData.append(
|
408 |
+
options.paramName[index] || paramName,
|
409 |
+
file,
|
410 |
+
file.name
|
411 |
+
);
|
412 |
+
}
|
413 |
+
});
|
414 |
+
}
|
415 |
+
}
|
416 |
+
options.data = formData;
|
417 |
+
}
|
418 |
+
// Blob reference is not needed anymore, free memory:
|
419 |
+
options.blob = null;
|
420 |
+
},
|
421 |
+
|
422 |
+
_initIframeSettings: function (options) {
|
423 |
+
// Setting the dataType to iframe enables the iframe transport:
|
424 |
+
options.dataType = 'iframe ' + (options.dataType || '');
|
425 |
+
// The iframe transport accepts a serialized array as form data:
|
426 |
+
options.formData = this._getFormData(options);
|
427 |
+
// Add redirect url to form data on cross-domain uploads:
|
428 |
+
if (options.redirect && $('<a></a>').prop('href', options.url)
|
429 |
+
.prop('host') !== location.host) {
|
430 |
+
options.formData.push({
|
431 |
+
name: options.redirectParamName || 'redirect',
|
432 |
+
value: options.redirect
|
433 |
+
});
|
434 |
+
}
|
435 |
+
},
|
436 |
+
|
437 |
+
_initDataSettings: function (options) {
|
438 |
+
if (this._isXHRUpload(options)) {
|
439 |
+
if (!this._chunkedUpload(options, true)) {
|
440 |
+
if (!options.data) {
|
441 |
+
this._initXHRData(options);
|
442 |
+
}
|
443 |
+
this._initProgressListener(options);
|
444 |
+
}
|
445 |
+
if (options.postMessage) {
|
446 |
+
// Setting the dataType to postmessage enables the
|
447 |
+
// postMessage transport:
|
448 |
+
options.dataType = 'postmessage ' + (options.dataType || '');
|
449 |
+
}
|
450 |
+
} else {
|
451 |
+
this._initIframeSettings(options);
|
452 |
+
}
|
453 |
+
},
|
454 |
+
|
455 |
+
_getParamName: function (options) {
|
456 |
+
var fileInput = $(options.fileInput),
|
457 |
+
paramName = options.paramName;
|
458 |
+
if (!paramName) {
|
459 |
+
paramName = [];
|
460 |
+
fileInput.each(function () {
|
461 |
+
var input = $(this),
|
462 |
+
name = input.prop('name') || 'files[]',
|
463 |
+
i = (input.prop('files') || [1]).length;
|
464 |
+
while (i) {
|
465 |
+
paramName.push(name);
|
466 |
+
i -= 1;
|
467 |
+
}
|
468 |
+
});
|
469 |
+
if (!paramName.length) {
|
470 |
+
paramName = [fileInput.prop('name') || 'files[]'];
|
471 |
+
}
|
472 |
+
} else if (!$.isArray(paramName)) {
|
473 |
+
paramName = [paramName];
|
474 |
+
}
|
475 |
+
return paramName;
|
476 |
+
},
|
477 |
+
|
478 |
+
_initFormSettings: function (options) {
|
479 |
+
// Retrieve missing options from the input field and the
|
480 |
+
// associated form, if available:
|
481 |
+
if (!options.form || !options.form.length) {
|
482 |
+
options.form = $(options.fileInput.prop('form'));
|
483 |
+
// If the given file input doesn't have an associated form,
|
484 |
+
// use the default widget file input's form:
|
485 |
+
if (!options.form.length) {
|
486 |
+
options.form = $(this.options.fileInput.prop('form'));
|
487 |
+
}
|
488 |
+
}
|
489 |
+
options.paramName = this._getParamName(options);
|
490 |
+
if (!options.url) {
|
491 |
+
options.url = options.form.prop('action') || location.href;
|
492 |
+
}
|
493 |
+
// The HTTP request method must be "POST" or "PUT":
|
494 |
+
options.type = (options.type || options.form.prop('method') || '')
|
495 |
+
.toUpperCase();
|
496 |
+
if (options.type !== 'POST' && options.type !== 'PUT' &&
|
497 |
+
options.type !== 'PATCH') {
|
498 |
+
options.type = 'POST';
|
499 |
+
}
|
500 |
+
if (!options.formAcceptCharset) {
|
501 |
+
options.formAcceptCharset = options.form.attr('accept-charset');
|
502 |
+
}
|
503 |
+
},
|
504 |
+
|
505 |
+
_getAJAXSettings: function (data) {
|
506 |
+
var options = $.extend({}, this.options, data);
|
507 |
+
this._initFormSettings(options);
|
508 |
+
this._initDataSettings(options);
|
509 |
+
return options;
|
510 |
+
},
|
511 |
+
|
512 |
+
// jQuery 1.6 doesn't provide .state(),
|
513 |
+
// while jQuery 1.8+ removed .isRejected() and .isResolved():
|
514 |
+
_getDeferredState: function (deferred) {
|
515 |
+
if (deferred.state) {
|
516 |
+
return deferred.state();
|
517 |
+
}
|
518 |
+
if (deferred.isResolved()) {
|
519 |
+
return 'resolved';
|
520 |
+
}
|
521 |
+
if (deferred.isRejected()) {
|
522 |
+
return 'rejected';
|
523 |
+
}
|
524 |
+
return 'pending';
|
525 |
+
},
|
526 |
+
|
527 |
+
// Maps jqXHR callbacks to the equivalent
|
528 |
+
// methods of the given Promise object:
|
529 |
+
_enhancePromise: function (promise) {
|
530 |
+
promise.success = promise.done;
|
531 |
+
promise.error = promise.fail;
|
532 |
+
promise.complete = promise.always;
|
533 |
+
return promise;
|
534 |
+
},
|
535 |
+
|
536 |
+
// Creates and returns a Promise object enhanced with
|
537 |
+
// the jqXHR methods abort, success, error and complete:
|
538 |
+
_getXHRPromise: function (resolveOrReject, context, args) {
|
539 |
+
var dfd = $.Deferred(),
|
540 |
+
promise = dfd.promise();
|
541 |
+
context = context || this.options.context || promise;
|
542 |
+
if (resolveOrReject === true) {
|
543 |
+
dfd.resolveWith(context, args);
|
544 |
+
} else if (resolveOrReject === false) {
|
545 |
+
dfd.rejectWith(context, args);
|
546 |
+
}
|
547 |
+
promise.abort = dfd.promise;
|
548 |
+
return this._enhancePromise(promise);
|
549 |
+
},
|
550 |
+
|
551 |
+
// Adds convenience methods to the callback arguments:
|
552 |
+
_addConvenienceMethods: function (e, data) {
|
553 |
+
var that = this;
|
554 |
+
data.submit = function () {
|
555 |
+
if (this.state() !== 'pending') {
|
556 |
+
data.jqXHR = this.jqXHR =
|
557 |
+
(that._trigger('submit', e, this) !== false) &&
|
558 |
+
that._onSend(e, this);
|
559 |
+
}
|
560 |
+
return this.jqXHR || that._getXHRPromise();
|
561 |
+
};
|
562 |
+
data.abort = function () {
|
563 |
+
if (this.jqXHR) {
|
564 |
+
return this.jqXHR.abort();
|
565 |
+
}
|
566 |
+
return that._getXHRPromise();
|
567 |
+
};
|
568 |
+
data.state = function () {
|
569 |
+
if (this.jqXHR) {
|
570 |
+
return that._getDeferredState(this.jqXHR);
|
571 |
+
}
|
572 |
+
};
|
573 |
+
data.progress = function () {
|
574 |
+
return this._progress;
|
575 |
+
};
|
576 |
+
data.response = function () {
|
577 |
+
return this._response;
|
578 |
+
};
|
579 |
+
},
|
580 |
+
|
581 |
+
// Parses the Range header from the server response
|
582 |
+
// and returns the uploaded bytes:
|
583 |
+
_getUploadedBytes: function (jqXHR) {
|
584 |
+
var range = jqXHR.getResponseHeader('Range'),
|
585 |
+
parts = range && range.split('-'),
|
586 |
+
upperBytesPos = parts && parts.length > 1 &&
|
587 |
+
parseInt(parts[1], 10);
|
588 |
+
return upperBytesPos && upperBytesPos + 1;
|
589 |
+
},
|
590 |
+
|
591 |
+
// Uploads a file in multiple, sequential requests
|
592 |
+
// by splitting the file up in multiple blob chunks.
|
593 |
+
// If the second parameter is true, only tests if the file
|
594 |
+
// should be uploaded in chunks, but does not invoke any
|
595 |
+
// upload requests:
|
596 |
+
_chunkedUpload: function (options, testOnly) {
|
597 |
+
var that = this,
|
598 |
+
file = options.files[0],
|
599 |
+
fs = file.size,
|
600 |
+
ub = options.uploadedBytes = options.uploadedBytes || 0,
|
601 |
+
mcs = options.maxChunkSize || fs,
|
602 |
+
slice = file.slice || file.webkitSlice || file.mozSlice,
|
603 |
+
dfd = $.Deferred(),
|
604 |
+
promise = dfd.promise(),
|
605 |
+
jqXHR,
|
606 |
+
upload;
|
607 |
+
if (!(this._isXHRUpload(options) && slice && (ub || mcs < fs)) ||
|
608 |
+
options.data) {
|
609 |
+
return false;
|
610 |
+
}
|
611 |
+
if (testOnly) {
|
612 |
+
return true;
|
613 |
+
}
|
614 |
+
if (ub >= fs) {
|
615 |
+
file.error = 'Uploaded bytes exceed file size';
|
616 |
+
return this._getXHRPromise(
|
617 |
+
false,
|
618 |
+
options.context,
|
619 |
+
[null, 'error', file.error]
|
620 |
+
);
|
621 |
+
}
|
622 |
+
// The chunk upload method:
|
623 |
+
upload = function () {
|
624 |
+
// Clone the options object for each chunk upload:
|
625 |
+
var o = $.extend({}, options),
|
626 |
+
currentLoaded = o._progress.loaded;
|
627 |
+
o.blob = slice.call(
|
628 |
+
file,
|
629 |
+
ub,
|
630 |
+
ub + mcs,
|
631 |
+
file.type
|
632 |
+
);
|
633 |
+
// Store the current chunk size, as the blob itself
|
634 |
+
// will be dereferenced after data processing:
|
635 |
+
o.chunkSize = o.blob.size;
|
636 |
+
// Expose the chunk bytes position range:
|
637 |
+
o.contentRange = 'bytes ' + ub + '-' +
|
638 |
+
(ub + o.chunkSize - 1) + '/' + fs;
|
639 |
+
// Process the upload data (the blob and potential form data):
|
640 |
+
that._initXHRData(o);
|
641 |
+
// Add progress listeners for this chunk upload:
|
642 |
+
that._initProgressListener(o);
|
643 |
+
jqXHR = ((that._trigger('chunksend', null, o) !== false && $.ajax(o)) ||
|
644 |
+
that._getXHRPromise(false, o.context))
|
645 |
+
.done(function (result, textStatus, jqXHR) {
|
646 |
+
ub = that._getUploadedBytes(jqXHR) ||
|
647 |
+
(ub + o.chunkSize);
|
648 |
+
// Create a progress event if no final progress event
|
649 |
+
// with loaded equaling total has been triggered
|
650 |
+
// for this chunk:
|
651 |
+
if (o._progress.loaded === currentLoaded) {
|
652 |
+
that._onProgress($.Event('progress', {
|
653 |
+
lengthComputable: true,
|
654 |
+
loaded: ub - o.uploadedBytes,
|
655 |
+
total: ub - o.uploadedBytes
|
656 |
+
}), o);
|
657 |
+
}
|
658 |
+
options.uploadedBytes = o.uploadedBytes = ub;
|
659 |
+
o.result = result;
|
660 |
+
o.textStatus = textStatus;
|
661 |
+
o.jqXHR = jqXHR;
|
662 |
+
that._trigger('chunkdone', null, o);
|
663 |
+
that._trigger('chunkalways', null, o);
|
664 |
+
if (ub < fs) {
|
665 |
+
// File upload not yet complete,
|
666 |
+
// continue with the next chunk:
|
667 |
+
upload();
|
668 |
+
} else {
|
669 |
+
dfd.resolveWith(
|
670 |
+
o.context,
|
671 |
+
[result, textStatus, jqXHR]
|
672 |
+
);
|
673 |
+
}
|
674 |
+
})
|
675 |
+
.fail(function (jqXHR, textStatus, errorThrown) {
|
676 |
+
o.jqXHR = jqXHR;
|
677 |
+
o.textStatus = textStatus;
|
678 |
+
o.errorThrown = errorThrown;
|
679 |
+
that._trigger('chunkfail', null, o);
|
680 |
+
that._trigger('chunkalways', null, o);
|
681 |
+
dfd.rejectWith(
|
682 |
+
o.context,
|
683 |
+
[jqXHR, textStatus, errorThrown]
|
684 |
+
);
|
685 |
+
});
|
686 |
+
};
|
687 |
+
this._enhancePromise(promise);
|
688 |
+
promise.abort = function () {
|
689 |
+
return jqXHR.abort();
|
690 |
+
};
|
691 |
+
upload();
|
692 |
+
return promise;
|
693 |
+
},
|
694 |
+
|
695 |
+
_beforeSend: function (e, data) {
|
696 |
+
if (this._active === 0) {
|
697 |
+
// the start callback is triggered when an upload starts
|
698 |
+
// and no other uploads are currently running,
|
699 |
+
// equivalent to the global ajaxStart event:
|
700 |
+
this._trigger('start');
|
701 |
+
// Set timer for global bitrate progress calculation:
|
702 |
+
this._bitrateTimer = new this._BitrateTimer();
|
703 |
+
// Reset the global progress values:
|
704 |
+
this._progress.loaded = this._progress.total = 0;
|
705 |
+
this._progress.bitrate = 0;
|
706 |
+
}
|
707 |
+
// Make sure the container objects for the .response() and
|
708 |
+
// .progress() methods on the data object are available
|
709 |
+
// and reset to their initial state:
|
710 |
+
this._initResponseObject(data);
|
711 |
+
this._initProgressObject(data);
|
712 |
+
data._progress.loaded = data.loaded = data.uploadedBytes || 0;
|
713 |
+
data._progress.total = data.total = this._getTotal(data.files) || 1;
|
714 |
+
data._progress.bitrate = data.bitrate = 0;
|
715 |
+
this._active += 1;
|
716 |
+
// Initialize the global progress values:
|
717 |
+
this._progress.loaded += data.loaded;
|
718 |
+
this._progress.total += data.total;
|
719 |
+
},
|
720 |
+
|
721 |
+
_onDone: function (result, textStatus, jqXHR, options) {
|
722 |
+
var total = options._progress.total,
|
723 |
+
response = options._response;
|
724 |
+
if (options._progress.loaded < total) {
|
725 |
+
// Create a progress event if no final progress event
|
726 |
+
// with loaded equaling total has been triggered:
|
727 |
+
this._onProgress($.Event('progress', {
|
728 |
+
lengthComputable: true,
|
729 |
+
loaded: total,
|
730 |
+
total: total
|
731 |
+
}), options);
|
732 |
+
}
|
733 |
+
response.result = options.result = result;
|
734 |
+
response.textStatus = options.textStatus = textStatus;
|
735 |
+
response.jqXHR = options.jqXHR = jqXHR;
|
736 |
+
this._trigger('done', null, options);
|
737 |
+
},
|
738 |
+
|
739 |
+
_onFail: function (jqXHR, textStatus, errorThrown, options) {
|
740 |
+
var response = options._response;
|
741 |
+
if (options.recalculateProgress) {
|
742 |
+
// Remove the failed (error or abort) file upload from
|
743 |
+
// the global progress calculation:
|
744 |
+
this._progress.loaded -= options._progress.loaded;
|
745 |
+
this._progress.total -= options._progress.total;
|
746 |
+
}
|
747 |
+
response.jqXHR = options.jqXHR = jqXHR;
|
748 |
+
response.textStatus = options.textStatus = textStatus;
|
749 |
+
response.errorThrown = options.errorThrown = errorThrown;
|
750 |
+
this._trigger('fail', null, options);
|
751 |
+
},
|
752 |
+
|
753 |
+
_onAlways: function (jqXHRorResult, textStatus, jqXHRorError, options) {
|
754 |
+
// jqXHRorResult, textStatus and jqXHRorError are added to the
|
755 |
+
// options object via done and fail callbacks
|
756 |
+
this._trigger('always', null, options);
|
757 |
+
},
|
758 |
+
|
759 |
+
_onSend: function (e, data) {
|
760 |
+
if (!data.submit) {
|
761 |
+
this._addConvenienceMethods(e, data);
|
762 |
+
}
|
763 |
+
var that = this,
|
764 |
+
jqXHR,
|
765 |
+
aborted,
|
766 |
+
slot,
|
767 |
+
pipe,
|
768 |
+
options = that._getAJAXSettings(data),
|
769 |
+
send = function () {
|
770 |
+
that._sending += 1;
|
771 |
+
// Set timer for bitrate progress calculation:
|
772 |
+
options._bitrateTimer = new that._BitrateTimer();
|
773 |
+
jqXHR = jqXHR || (
|
774 |
+
((aborted || that._trigger('send', e, options) === false) &&
|
775 |
+
that._getXHRPromise(false, options.context, aborted)) ||
|
776 |
+
that._chunkedUpload(options) || $.ajax(options)
|
777 |
+
).done(function (result, textStatus, jqXHR) {
|
778 |
+
that._onDone(result, textStatus, jqXHR, options);
|
779 |
+
}).fail(function (jqXHR, textStatus, errorThrown) {
|
780 |
+
that._onFail(jqXHR, textStatus, errorThrown, options);
|
781 |
+
}).always(function (jqXHRorResult, textStatus, jqXHRorError) {
|
782 |
+
that._onAlways(
|
783 |
+
jqXHRorResult,
|
784 |
+
textStatus,
|
785 |
+
jqXHRorError,
|
786 |
+
options
|
787 |
+
);
|
788 |
+
that._sending -= 1;
|
789 |
+
that._active -= 1;
|
790 |
+
if (options.limitConcurrentUploads &&
|
791 |
+
options.limitConcurrentUploads > that._sending) {
|
792 |
+
// Start the next queued upload,
|
793 |
+
// that has not been aborted:
|
794 |
+
var nextSlot = that._slots.shift();
|
795 |
+
while (nextSlot) {
|
796 |
+
if (that._getDeferredState(nextSlot) === 'pending') {
|
797 |
+
nextSlot.resolve();
|
798 |
+
break;
|
799 |
+
}
|
800 |
+
nextSlot = that._slots.shift();
|
801 |
+
}
|
802 |
+
}
|
803 |
+
if (that._active === 0) {
|
804 |
+
// The stop callback is triggered when all uploads have
|
805 |
+
// been completed, equivalent to the global ajaxStop event:
|
806 |
+
that._trigger('stop');
|
807 |
+
}
|
808 |
+
});
|
809 |
+
return jqXHR;
|
810 |
+
};
|
811 |
+
this._beforeSend(e, options);
|
812 |
+
if (this.options.sequentialUploads ||
|
813 |
+
(this.options.limitConcurrentUploads &&
|
814 |
+
this.options.limitConcurrentUploads <= this._sending)) {
|
815 |
+
if (this.options.limitConcurrentUploads > 1) {
|
816 |
+
slot = $.Deferred();
|
817 |
+
this._slots.push(slot);
|
818 |
+
pipe = slot.pipe(send);
|
819 |
+
} else {
|
820 |
+
pipe = (this._sequence = this._sequence.pipe(send, send));
|
821 |
+
}
|
822 |
+
// Return the piped Promise object, enhanced with an abort method,
|
823 |
+
// which is delegated to the jqXHR object of the current upload,
|
824 |
+
// and jqXHR callbacks mapped to the equivalent Promise methods:
|
825 |
+
pipe.abort = function () {
|
826 |
+
aborted = [undefined, 'abort', 'abort'];
|
827 |
+
if (!jqXHR) {
|
828 |
+
if (slot) {
|
829 |
+
slot.rejectWith(options.context, aborted);
|
830 |
+
}
|
831 |
+
return send();
|
832 |
+
}
|
833 |
+
return jqXHR.abort();
|
834 |
+
};
|
835 |
+
return this._enhancePromise(pipe);
|
836 |
+
}
|
837 |
+
return send();
|
838 |
+
},
|
839 |
+
|
840 |
+
_onAdd: function (e, data) {
|
841 |
+
var that = this,
|
842 |
+
result = true,
|
843 |
+
options = $.extend({}, this.options, data),
|
844 |
+
limit = options.limitMultiFileUploads,
|
845 |
+
paramName = this._getParamName(options),
|
846 |
+
paramNameSet,
|
847 |
+
paramNameSlice,
|
848 |
+
fileSet,
|
849 |
+
i;
|
850 |
+
if (!(options.singleFileUploads || limit) ||
|
851 |
+
!this._isXHRUpload(options)) {
|
852 |
+
fileSet = [data.files];
|
853 |
+
paramNameSet = [paramName];
|
854 |
+
} else if (!options.singleFileUploads && limit) {
|
855 |
+
fileSet = [];
|
856 |
+
paramNameSet = [];
|
857 |
+
for (i = 0; i < data.files.length; i += limit) {
|
858 |
+
fileSet.push(data.files.slice(i, i + limit));
|
859 |
+
paramNameSlice = paramName.slice(i, i + limit);
|
860 |
+
if (!paramNameSlice.length) {
|
861 |
+
paramNameSlice = paramName;
|
862 |
+
}
|
863 |
+
paramNameSet.push(paramNameSlice);
|
864 |
+
}
|
865 |
+
} else {
|
866 |
+
paramNameSet = paramName;
|
867 |
+
}
|
868 |
+
data.originalFiles = data.files;
|
869 |
+
$.each(fileSet || data.files, function (index, element) {
|
870 |
+
var newData = $.extend({}, data);
|
871 |
+
newData.files = fileSet ? element : [element];
|
872 |
+
newData.paramName = paramNameSet[index];
|
873 |
+
that._initResponseObject(newData);
|
874 |
+
that._initProgressObject(newData);
|
875 |
+
that._addConvenienceMethods(e, newData);
|
876 |
+
result = that._trigger('add', e, newData);
|
877 |
+
return result;
|
878 |
+
});
|
879 |
+
return result;
|
880 |
+
},
|
881 |
+
|
882 |
+
_replaceFileInput: function (input) {
|
883 |
+
var inputClone = input.clone(true);
|
884 |
+
$('<form></form>').append(inputClone)[0].reset();
|
885 |
+
// Detaching allows to insert the fileInput on another form
|
886 |
+
// without loosing the file input value:
|
887 |
+
input.after(inputClone).detach();
|
888 |
+
// Avoid memory leaks with the detached file input:
|
889 |
+
$.cleanData(input.unbind('remove'));
|
890 |
+
// Replace the original file input element in the fileInput
|
891 |
+
// elements set with the clone, which has been copied including
|
892 |
+
// event handlers:
|
893 |
+
this.options.fileInput = this.options.fileInput.map(function (i, el) {
|
894 |
+
if (el === input[0]) {
|
895 |
+
return inputClone[0];
|
896 |
+
}
|
897 |
+
return el;
|
898 |
+
});
|
899 |
+
// If the widget has been initialized on the file input itself,
|
900 |
+
// override this.element with the file input clone:
|
901 |
+
if (input[0] === this.element[0]) {
|
902 |
+
this.element = inputClone;
|
903 |
+
}
|
904 |
+
},
|
905 |
+
|
906 |
+
_handleFileTreeEntry: function (entry, path) {
|
907 |
+
var that = this,
|
908 |
+
dfd = $.Deferred(),
|
909 |
+
errorHandler = function (e) {
|
910 |
+
if (e && !e.entry) {
|
911 |
+
e.entry = entry;
|
912 |
+
}
|
913 |
+
// Since $.when returns immediately if one
|
914 |
+
// Deferred is rejected, we use resolve instead.
|
915 |
+
// This allows valid files and invalid items
|
916 |
+
// to be returned together in one set:
|
917 |
+
dfd.resolve([e]);
|
918 |
+
},
|
919 |
+
dirReader;
|
920 |
+
path = path || '';
|
921 |
+
if (entry.isFile) {
|
922 |
+
if (entry._file) {
|
923 |
+
// Workaround for Chrome bug #149735
|
924 |
+
entry._file.relativePath = path;
|
925 |
+
dfd.resolve(entry._file);
|
926 |
+
} else {
|
927 |
+
entry.file(function (file) {
|
928 |
+
file.relativePath = path;
|
929 |
+
dfd.resolve(file);
|
930 |
+
}, errorHandler);
|
931 |
+
}
|
932 |
+
} else if (entry.isDirectory) {
|
933 |
+
dirReader = entry.createReader();
|
934 |
+
dirReader.readEntries(function (entries) {
|
935 |
+
that._handleFileTreeEntries(
|
936 |
+
entries,
|
937 |
+
path + entry.name + '/'
|
938 |
+
).done(function (files) {
|
939 |
+
dfd.resolve(files);
|
940 |
+
}).fail(errorHandler);
|
941 |
+
}, errorHandler);
|
942 |
+
} else {
|
943 |
+
// Return an empy list for file system items
|
944 |
+
// other than files or directories:
|
945 |
+
dfd.resolve([]);
|
946 |
+
}
|
947 |
+
return dfd.promise();
|
948 |
+
},
|
949 |
+
|
950 |
+
_handleFileTreeEntries: function (entries, path) {
|
951 |
+
var that = this;
|
952 |
+
return $.when.apply(
|
953 |
+
$,
|
954 |
+
$.map(entries, function (entry) {
|
955 |
+
return that._handleFileTreeEntry(entry, path);
|
956 |
+
})
|
957 |
+
).pipe(function () {
|
958 |
+
return Array.prototype.concat.apply(
|
959 |
+
[],
|
960 |
+
arguments
|
961 |
+
);
|
962 |
+
});
|
963 |
+
},
|
964 |
+
|
965 |
+
_getDroppedFiles: function (dataTransfer) {
|
966 |
+
dataTransfer = dataTransfer || {};
|
967 |
+
var items = dataTransfer.items;
|
968 |
+
if (items && items.length && (items[0].webkitGetAsEntry ||
|
969 |
+
items[0].getAsEntry)) {
|
970 |
+
return this._handleFileTreeEntries(
|
971 |
+
$.map(items, function (item) {
|
972 |
+
var entry;
|
973 |
+
if (item.webkitGetAsEntry) {
|
974 |
+
entry = item.webkitGetAsEntry();
|
975 |
+
if (entry) {
|
976 |
+
// Workaround for Chrome bug #149735:
|
977 |
+
entry._file = item.getAsFile();
|
978 |
+
}
|
979 |
+
return entry;
|
980 |
+
}
|
981 |
+
return item.getAsEntry();
|
982 |
+
})
|
983 |
+
);
|
984 |
+
}
|
985 |
+
return $.Deferred().resolve(
|
986 |
+
$.makeArray(dataTransfer.files)
|
987 |
+
).promise();
|
988 |
+
},
|
989 |
+
|
990 |
+
_getSingleFileInputFiles: function (fileInput) {
|
991 |
+
fileInput = $(fileInput);
|
992 |
+
var entries = fileInput.prop('webkitEntries') ||
|
993 |
+
fileInput.prop('entries'),
|
994 |
+
files,
|
995 |
+
value;
|
996 |
+
if (entries && entries.length) {
|
997 |
+
return this._handleFileTreeEntries(entries);
|
998 |
+
}
|
999 |
+
files = $.makeArray(fileInput.prop('files'));
|
1000 |
+
if (!files.length) {
|
1001 |
+
value = fileInput.prop('value');
|
1002 |
+
if (!value) {
|
1003 |
+
return $.Deferred().resolve([]).promise();
|
1004 |
+
}
|
1005 |
+
// If the files property is not available, the browser does not
|
1006 |
+
// support the File API and we add a pseudo File object with
|
1007 |
+
// the input value as name with path information removed:
|
1008 |
+
files = [{name: value.replace(/^.*\\/, '')}];
|
1009 |
+
} else if (files[0].name === undefined && files[0].fileName) {
|
1010 |
+
// File normalization for Safari 4 and Firefox 3:
|
1011 |
+
$.each(files, function (index, file) {
|
1012 |
+
file.name = file.fileName;
|
1013 |
+
file.size = file.fileSize;
|
1014 |
+
});
|
1015 |
+
}
|
1016 |
+
return $.Deferred().resolve(files).promise();
|
1017 |
+
},
|
1018 |
+
|
1019 |
+
_getFileInputFiles: function (fileInput) {
|
1020 |
+
if (!(fileInput instanceof $) || fileInput.length === 1) {
|
1021 |
+
return this._getSingleFileInputFiles(fileInput);
|
1022 |
+
}
|
1023 |
+
return $.when.apply(
|
1024 |
+
$,
|
1025 |
+
$.map(fileInput, this._getSingleFileInputFiles)
|
1026 |
+
).pipe(function () {
|
1027 |
+
return Array.prototype.concat.apply(
|
1028 |
+
[],
|
1029 |
+
arguments
|
1030 |
+
);
|
1031 |
+
});
|
1032 |
+
},
|
1033 |
+
|
1034 |
+
_onChange: function (e) {
|
1035 |
+
var that = this,
|
1036 |
+
data = {
|
1037 |
+
fileInput: $(e.target),
|
1038 |
+
form: $(e.target.form)
|
1039 |
+
};
|
1040 |
+
this._getFileInputFiles(data.fileInput).always(function (files) {
|
1041 |
+
data.files = files;
|
1042 |
+
if (that.options.replaceFileInput) {
|
1043 |
+
that._replaceFileInput(data.fileInput);
|
1044 |
+
}
|
1045 |
+
if (that._trigger('change', e, data) !== false) {
|
1046 |
+
that._onAdd(e, data);
|
1047 |
+
}
|
1048 |
+
});
|
1049 |
+
},
|
1050 |
+
|
1051 |
+
_onPaste: function (e) {
|
1052 |
+
var items = e.originalEvent && e.originalEvent.clipboardData &&
|
1053 |
+
e.originalEvent.clipboardData.items,
|
1054 |
+
data = {files: []};
|
1055 |
+
if (items && items.length) {
|
1056 |
+
$.each(items, function (index, item) {
|
1057 |
+
var file = item.getAsFile && item.getAsFile();
|
1058 |
+
if (file) {
|
1059 |
+
data.files.push(file);
|
1060 |
+
}
|
1061 |
+
});
|
1062 |
+
if (this._trigger('paste', e, data) === false ||
|
1063 |
+
this._onAdd(e, data) === false) {
|
1064 |
+
return false;
|
1065 |
+
}
|
1066 |
+
}
|
1067 |
+
},
|
1068 |
+
|
1069 |
+
_onDrop: function (e) {
|
1070 |
+
var that = this,
|
1071 |
+
dataTransfer = e.dataTransfer = e.originalEvent &&
|
1072 |
+
e.originalEvent.dataTransfer,
|
1073 |
+
data = {};
|
1074 |
+
if (dataTransfer && dataTransfer.files && dataTransfer.files.length) {
|
1075 |
+
e.preventDefault();
|
1076 |
+
this._getDroppedFiles(dataTransfer).always(function (files) {
|
1077 |
+
data.files = files;
|
1078 |
+
if (that._trigger('drop', e, data) !== false) {
|
1079 |
+
that._onAdd(e, data);
|
1080 |
+
}
|
1081 |
+
});
|
1082 |
+
}
|
1083 |
+
},
|
1084 |
+
|
1085 |
+
_onDragOver: function (e) {
|
1086 |
+
var dataTransfer = e.dataTransfer = e.originalEvent &&
|
1087 |
+
e.originalEvent.dataTransfer;
|
1088 |
+
if (dataTransfer) {
|
1089 |
+
if (this._trigger('dragover', e) === false) {
|
1090 |
+
return false;
|
1091 |
+
}
|
1092 |
+
if ($.inArray('Files', dataTransfer.types) !== -1) {
|
1093 |
+
dataTransfer.dropEffect = 'copy';
|
1094 |
+
e.preventDefault();
|
1095 |
+
}
|
1096 |
+
}
|
1097 |
+
},
|
1098 |
+
|
1099 |
+
_initEventHandlers: function () {
|
1100 |
+
if (this._isXHRUpload(this.options)) {
|
1101 |
+
this._on(this.options.dropZone, {
|
1102 |
+
dragover: this._onDragOver,
|
1103 |
+
drop: this._onDrop
|
1104 |
+
});
|
1105 |
+
this._on(this.options.pasteZone, {
|
1106 |
+
paste: this._onPaste
|
1107 |
+
});
|
1108 |
+
}
|
1109 |
+
this._on(this.options.fileInput, {
|
1110 |
+
change: this._onChange
|
1111 |
+
});
|
1112 |
+
},
|
1113 |
+
|
1114 |
+
_destroyEventHandlers: function () {
|
1115 |
+
this._off(this.options.dropZone, 'dragover drop');
|
1116 |
+
this._off(this.options.pasteZone, 'paste');
|
1117 |
+
this._off(this.options.fileInput, 'change');
|
1118 |
+
},
|
1119 |
+
|
1120 |
+
_setOption: function (key, value) {
|
1121 |
+
var refresh = $.inArray(key, this._refreshOptionsList) !== -1;
|
1122 |
+
if (refresh) {
|
1123 |
+
this._destroyEventHandlers();
|
1124 |
+
}
|
1125 |
+
this._super(key, value);
|
1126 |
+
if (refresh) {
|
1127 |
+
this._initSpecialOptions();
|
1128 |
+
this._initEventHandlers();
|
1129 |
+
}
|
1130 |
+
},
|
1131 |
+
|
1132 |
+
_initSpecialOptions: function () {
|
1133 |
+
var options = this.options;
|
1134 |
+
if (options.fileInput === undefined) {
|
1135 |
+
options.fileInput = this.element.is('input[type="file"]') ?
|
1136 |
+
this.element : this.element.find('input[type="file"]');
|
1137 |
+
} else if (!(options.fileInput instanceof $)) {
|
1138 |
+
options.fileInput = $(options.fileInput);
|
1139 |
+
}
|
1140 |
+
if (!(options.dropZone instanceof $)) {
|
1141 |
+
options.dropZone = $(options.dropZone);
|
1142 |
+
}
|
1143 |
+
if (!(options.pasteZone instanceof $)) {
|
1144 |
+
options.pasteZone = $(options.pasteZone);
|
1145 |
+
}
|
1146 |
+
},
|
1147 |
+
|
1148 |
+
_create: function () {
|
1149 |
+
var options = this.options;
|
1150 |
+
// Initialize options set via HTML5 data-attributes:
|
1151 |
+
$.extend(options, $(this.element[0].cloneNode(false)).data());
|
1152 |
+
this._initSpecialOptions();
|
1153 |
+
this._slots = [];
|
1154 |
+
this._sequence = this._getXHRPromise(true);
|
1155 |
+
this._sending = this._active = 0;
|
1156 |
+
this._initProgressObject(this);
|
1157 |
+
this._initEventHandlers();
|
1158 |
+
},
|
1159 |
+
|
1160 |
+
// This method is exposed to the widget API and allows to query
|
1161 |
+
// the number of active uploads:
|
1162 |
+
active: function () {
|
1163 |
+
return this._active;
|
1164 |
+
},
|
1165 |
+
|
1166 |
+
// This method is exposed to the widget API and allows to query
|
1167 |
+
// the widget upload progress.
|
1168 |
+
// It returns an object with loaded, total and bitrate properties
|
1169 |
+
// for the running uploads:
|
1170 |
+
progress: function () {
|
1171 |
+
return this._progress;
|
1172 |
+
},
|
1173 |
+
|
1174 |
+
// This method is exposed to the widget API and allows adding files
|
1175 |
+
// using the fileupload API. The data parameter accepts an object which
|
1176 |
+
// must have a files property and can contain additional options:
|
1177 |
+
// .fileupload('add', {files: filesList});
|
1178 |
+
add: function (data) {
|
1179 |
+
var that = this;
|
1180 |
+
if (!data || this.options.disabled) {
|
1181 |
+
return;
|
1182 |
+
}
|
1183 |
+
if (data.fileInput && !data.files) {
|
1184 |
+
this._getFileInputFiles(data.fileInput).always(function (files) {
|
1185 |
+
data.files = files;
|
1186 |
+
that._onAdd(null, data);
|
1187 |
+
});
|
1188 |
+
} else {
|
1189 |
+
data.files = $.makeArray(data.files);
|
1190 |
+
this._onAdd(null, data);
|
1191 |
+
}
|
1192 |
+
},
|
1193 |
+
|
1194 |
+
// This method is exposed to the widget API and allows sending files
|
1195 |
+
// using the fileupload API. The data parameter accepts an object which
|
1196 |
+
// must have a files or fileInput property and can contain additional options:
|
1197 |
+
// .fileupload('send', {files: filesList});
|
1198 |
+
// The method returns a Promise object for the file upload call.
|
1199 |
+
send: function (data) {
|
1200 |
+
if (data && !this.options.disabled) {
|
1201 |
+
if (data.fileInput && !data.files) {
|
1202 |
+
var that = this,
|
1203 |
+
dfd = $.Deferred(),
|
1204 |
+
promise = dfd.promise(),
|
1205 |
+
jqXHR,
|
1206 |
+
aborted;
|
1207 |
+
promise.abort = function () {
|
1208 |
+
aborted = true;
|
1209 |
+
if (jqXHR) {
|
1210 |
+
return jqXHR.abort();
|
1211 |
+
}
|
1212 |
+
dfd.reject(null, 'abort', 'abort');
|
1213 |
+
return promise;
|
1214 |
+
};
|
1215 |
+
this._getFileInputFiles(data.fileInput).always(
|
1216 |
+
function (files) {
|
1217 |
+
if (aborted) {
|
1218 |
+
return;
|
1219 |
+
}
|
1220 |
+
data.files = files;
|
1221 |
+
jqXHR = that._onSend(null, data).then(
|
1222 |
+
function (result, textStatus, jqXHR) {
|
1223 |
+
dfd.resolve(result, textStatus, jqXHR);
|
1224 |
+
},
|
1225 |
+
function (jqXHR, textStatus, errorThrown) {
|
1226 |
+
dfd.reject(jqXHR, textStatus, errorThrown);
|
1227 |
+
}
|
1228 |
+
);
|
1229 |
+
}
|
1230 |
+
);
|
1231 |
+
return this._enhancePromise(promise);
|
1232 |
+
}
|
1233 |
+
data.files = $.makeArray(data.files);
|
1234 |
+
if (data.files.length) {
|
1235 |
+
return this._onSend(null, data);
|
1236 |
+
}
|
1237 |
+
}
|
1238 |
+
return this._getXHRPromise(false, data && data.context);
|
1239 |
+
}
|
1240 |
+
|
1241 |
+
});
|
1242 |
+
|
1243 |
+
}));
|
filemanager/js/jq_uploader/jquery.iframe-transport.js
ADDED
@@ -0,0 +1,185 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* jQuery Iframe Transport Plugin 1.6.1
|
3 |
+
* https://github.com/blueimp/jQuery-File-Upload
|
4 |
+
*
|
5 |
+
* Copyright 2011, Sebastian Tschan
|
6 |
+
* https://blueimp.net
|
7 |
+
*
|
8 |
+
* Licensed under the MIT license:
|
9 |
+
* http://www.opensource.org/licenses/MIT
|
10 |
+
*/
|
11 |
+
|
12 |
+
/*jslint unparam: true, nomen: true */
|
13 |
+
/*global define, window, document */
|
14 |
+
|
15 |
+
(function (factory) {
|
16 |
+
'use strict';
|
17 |
+
if (typeof define === 'function' && define.amd) {
|
18 |
+
// Register as an anonymous AMD module:
|
19 |
+
define(['jquery'], factory);
|
20 |
+
} else {
|
21 |
+
// Browser globals:
|
22 |
+
factory(window.jQuery);
|
23 |
+
}
|
24 |
+
}(function ($) {
|
25 |
+
'use strict';
|
26 |
+
|
27 |
+
// Helper variable to create unique names for the transport iframes:
|
28 |
+
var counter = 0;
|
29 |
+
|
30 |
+
// The iframe transport accepts three additional options:
|
31 |
+
// options.fileInput: a jQuery collection of file input fields
|
32 |
+
// options.paramName: the parameter name for the file form data,
|
33 |
+
// overrides the name property of the file input field(s),
|
34 |
+
// can be a string or an array of strings.
|
35 |
+
// options.formData: an array of objects with name and value properties,
|
36 |
+
// equivalent to the return data of .serializeArray(), e.g.:
|
37 |
+
// [{name: 'a', value: 1}, {name: 'b', value: 2}]
|
38 |
+
$.ajaxTransport('iframe', function (options) {
|
39 |
+
if (options.async) {
|
40 |
+
var form,
|
41 |
+
iframe,
|
42 |
+
addParamChar;
|
43 |
+
return {
|
44 |
+
send: function (_, completeCallback) {
|
45 |
+
form = $('<form style="display:none;"></form>');
|
46 |
+
form.attr('accept-charset', options.formAcceptCharset);
|
47 |
+
addParamChar = /\?/.test(options.url) ? '&' : '?';
|
48 |
+
// XDomainRequest only supports GET and POST:
|
49 |
+
if (options.type === 'DELETE') {
|
50 |
+
options.url = options.url + addParamChar + '_method=DELETE';
|
51 |
+
options.type = 'POST';
|
52 |
+
} else if (options.type === 'PUT') {
|
53 |
+
options.url = options.url + addParamChar + '_method=PUT';
|
54 |
+
options.type = 'POST';
|
55 |
+
} else if (options.type === 'PATCH') {
|
56 |
+
options.url = options.url + addParamChar + '_method=PATCH';
|
57 |
+
options.type = 'POST';
|
58 |
+
}
|
59 |
+
// javascript:false as initial iframe src
|
60 |
+
// prevents warning popups on HTTPS in IE6.
|
61 |
+
// IE versions below IE8 cannot set the name property of
|
62 |
+
// elements that have already been added to the DOM,
|
63 |
+
// so we set the name along with the iframe HTML markup:
|
64 |
+
iframe = $(
|
65 |
+
'<iframe src="javascript:false;" name="iframe-transport-' +
|
66 |
+
(counter += 1) + '"></iframe>'
|
67 |
+
).bind('load', function () {
|
68 |
+
var fileInputClones,
|
69 |
+
paramNames = $.isArray(options.paramName) ?
|
70 |
+
options.paramName : [options.paramName];
|
71 |
+
iframe
|
72 |
+
.unbind('load')
|
73 |
+
.bind('load', function () {
|
74 |
+
var response;
|
75 |
+
// Wrap in a try/catch block to catch exceptions thrown
|
76 |
+
// when trying to access cross-domain iframe contents:
|
77 |
+
try {
|
78 |
+
response = iframe.contents();
|
79 |
+
// Google Chrome and Firefox do not throw an
|
80 |
+
// exception when calling iframe.contents() on
|
81 |
+
// cross-domain requests, so we unify the response:
|
82 |
+
if (!response.length || !response[0].firstChild) {
|
83 |
+
throw new Error();
|
84 |
+
}
|
85 |
+
} catch (e) {
|
86 |
+
response = undefined;
|
87 |
+
}
|
88 |
+
// The complete callback returns the
|
89 |
+
// iframe content document as response object:
|
90 |
+
completeCallback(
|
91 |
+
200,
|
92 |
+
'success',
|
93 |
+
{'iframe': response}
|
94 |
+
);
|
95 |
+
// Fix for IE endless progress bar activity bug
|
96 |
+
// (happens on form submits to iframe targets):
|
97 |
+
$('<iframe src="javascript:false;"></iframe>')
|
98 |
+
.appendTo(form);
|
99 |
+
form.remove();
|
100 |
+
});
|
101 |
+
form
|
102 |
+
.prop('target', iframe.prop('name'))
|
103 |
+
.prop('action', options.url)
|
104 |
+
.prop('method', options.type);
|
105 |
+
if (options.formData) {
|
106 |
+
$.each(options.formData, function (index, field) {
|
107 |
+
$('<input type="hidden"/>')
|
108 |
+
.prop('name', field.name)
|
109 |
+
.val(field.value)
|
110 |
+
.appendTo(form);
|
111 |
+
});
|
112 |
+
}
|
113 |
+
if (options.fileInput && options.fileInput.length &&
|
114 |
+
options.type === 'POST') {
|
115 |
+
fileInputClones = options.fileInput.clone();
|
116 |
+
// Insert a clone for each file input field:
|
117 |
+
options.fileInput.after(function (index) {
|
118 |
+
return fileInputClones[index];
|
119 |
+
});
|
120 |
+
if (options.paramName) {
|
121 |
+
options.fileInput.each(function (index) {
|
122 |
+
$(this).prop(
|
123 |
+
'name',
|
124 |
+
paramNames[index] || options.paramName
|
125 |
+
);
|
126 |
+
});
|
127 |
+
}
|
128 |
+
// Appending the file input fields to the hidden form
|
129 |
+
// removes them from their original location:
|
130 |
+
form
|
131 |
+
.append(options.fileInput)
|
132 |
+
.prop('enctype', 'multipart/form-data')
|
133 |
+
// enctype must be set as encoding for IE:
|
134 |
+
.prop('encoding', 'multipart/form-data');
|
135 |
+
}
|
136 |
+
form.submit();
|
137 |
+
// Insert the file input fields at their original location
|
138 |
+
// by replacing the clones with the originals:
|
139 |
+
if (fileInputClones && fileInputClones.length) {
|
140 |
+
options.fileInput.each(function (index, input) {
|
141 |
+
var clone = $(fileInputClones[index]);
|
142 |
+
$(input).prop('name', clone.prop('name'));
|
143 |
+
clone.replaceWith(input);
|
144 |
+
});
|
145 |
+
}
|
146 |
+
});
|
147 |
+
form.append(iframe).appendTo(document.body);
|
148 |
+
},
|
149 |
+
abort: function () {
|
150 |
+
if (iframe) {
|
151 |
+
// javascript:false as iframe src aborts the request
|
152 |
+
// and prevents warning popups on HTTPS in IE6.
|
153 |
+
// concat is used to avoid the "Script URL" JSLint error:
|
154 |
+
iframe
|
155 |
+
.unbind('load')
|
156 |
+
.prop('src', 'javascript'.concat(':false;'));
|
157 |
+
}
|
158 |
+
if (form) {
|
159 |
+
form.remove();
|
160 |
+
}
|
161 |
+
}
|
162 |
+
};
|
163 |
+
}
|
164 |
+
});
|
165 |
+
|
166 |
+
// The iframe transport returns the iframe content document as response.
|
167 |
+
// The following adds converters from iframe to text, json, html, and script:
|
168 |
+
$.ajaxSetup({
|
169 |
+
converters: {
|
170 |
+
'iframe text': function (iframe) {
|
171 |
+
return iframe && $(iframe[0].body).text();
|
172 |
+
},
|
173 |
+
'iframe json': function (iframe) {
|
174 |
+
return iframe && $.parseJSON($(iframe[0].body).text());
|
175 |
+
},
|
176 |
+
'iframe html': function (iframe) {
|
177 |
+
return iframe && $(iframe[0].body).html();
|
178 |
+
},
|
179 |
+
'iframe script': function (iframe) {
|
180 |
+
return iframe && $.globalEval($(iframe[0].body).text());
|
181 |
+
}
|
182 |
+
}
|
183 |
+
});
|
184 |
+
|
185 |
+
}));
|
filemanager/js/jq_uploader/jquery.upload-1.0.2.js
ADDED
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* jQuery.upload v1.0.2
|
3 |
+
*
|
4 |
+
* Copyright (c) 2010 lagos
|
5 |
+
* Dual licensed under the MIT and GPL licenses.
|
6 |
+
*
|
7 |
+
* http://lagoscript.org
|
8 |
+
*/
|
9 |
+
(function($) {
|
10 |
+
|
11 |
+
var uuid = 0;
|
12 |
+
|
13 |
+
$.fn.upload = function(url, data, callback, type) {
|
14 |
+
var self = this, inputs, checkbox, checked,
|
15 |
+
iframeName = 'jquery_upload' + ++uuid,
|
16 |
+
iframe = $('<iframe name="' + iframeName + '" style="position:absolute;top:-9999px" />').appendTo('body'),
|
17 |
+
form = '<form target="' + iframeName + '" method="post" enctype="multipart/form-data" />';
|
18 |
+
|
19 |
+
if ($.isFunction(data)) {
|
20 |
+
type = callback;
|
21 |
+
callback = data;
|
22 |
+
data = {};
|
23 |
+
}
|
24 |
+
|
25 |
+
checkbox = $('input:checkbox', this);
|
26 |
+
checked = $('input:checked', this);
|
27 |
+
form = self.wrapAll(form).parent('form').attr('action', url);
|
28 |
+
|
29 |
+
// Make sure radios and checkboxes keep original values
|
30 |
+
// (IE resets checkd attributes when appending)
|
31 |
+
checkbox.removeAttr('checked');
|
32 |
+
checked.attr('checked', true);
|
33 |
+
|
34 |
+
inputs = createInputs(data);
|
35 |
+
inputs = inputs ? $(inputs).appendTo(form) : null;
|
36 |
+
|
37 |
+
form.submit(function() {
|
38 |
+
iframe.load(function() {
|
39 |
+
var data = handleData(this, type),
|
40 |
+
checked = $('input:checked', self);
|
41 |
+
|
42 |
+
form.after(self).remove();
|
43 |
+
checkbox.removeAttr('checked');
|
44 |
+
checked.attr('checked', true);
|
45 |
+
if (inputs) {
|
46 |
+
inputs.remove();
|
47 |
+
}
|
48 |
+
|
49 |
+
setTimeout(function() {
|
50 |
+
iframe.remove();
|
51 |
+
if (type === 'script') {
|
52 |
+
$.globalEval(data);
|
53 |
+
}
|
54 |
+
if (callback) {
|
55 |
+
callback.call(self, data);
|
56 |
+
}
|
57 |
+
}, 0);
|
58 |
+
});
|
59 |
+
}).submit();
|
60 |
+
|
61 |
+
return this;
|
62 |
+
};
|
63 |
+
|
64 |
+
function createInputs(data) {
|
65 |
+
return $.map(param(data), function(param) {
|
66 |
+
return '<input type="hidden" name="' + param.name + '" value="' + param.value + '"/>';
|
67 |
+
}).join('');
|
68 |
+
}
|
69 |
+
|
70 |
+
function param(data) {
|
71 |
+
if ($.isArray(data)) {
|
72 |
+
return data;
|
73 |
+
}
|
74 |
+
var params = [];
|
75 |
+
|
76 |
+
function add(name, value) {
|
77 |
+
params.push({name:name, value:value});
|
78 |
+
}
|
79 |
+
|
80 |
+
if (typeof data === 'object') {
|
81 |
+
$.each(data, function(name) {
|
82 |
+
if ($.isArray(this)) {
|
83 |
+
$.each(this, function() {
|
84 |
+
add(name, this);
|
85 |
+
});
|
86 |
+
} else {
|
87 |
+
add(name, $.isFunction(this) ? this() : this);
|
88 |
+
}
|
89 |
+
});
|
90 |
+
} else if (typeof data === 'string') {
|
91 |
+
$.each(data.split('&'), function() {
|
92 |
+
var param = $.map(this.split('='), function(v) {
|
93 |
+
return decodeURIComponent(v.replace(/\+/g, ' '));
|
94 |
+
});
|
95 |
+
|
96 |
+
add(param[0], param[1]);
|
97 |
+
});
|
98 |
+
}
|
99 |
+
|
100 |
+
return params;
|
101 |
+
}
|
102 |
+
|
103 |
+
function handleData(iframe, type) {
|
104 |
+
var data, contents = $(iframe).contents().get(0);
|
105 |
+
|
106 |
+
if ($.isXMLDoc(contents) || contents.XMLDocument) {
|
107 |
+
return contents.XMLDocument || contents;
|
108 |
+
}
|
109 |
+
data = $(contents).find('body').html();
|
110 |
+
|
111 |
+
switch (type) {
|
112 |
+
case 'xml':
|
113 |
+
data = parseXml(data);
|
114 |
+
break;
|
115 |
+
case 'json':
|
116 |
+
data = window.eval('(' + data + ')');
|
117 |
+
break;
|
118 |
+
}
|
119 |
+
return data;
|
120 |
+
}
|
121 |
+
|
122 |
+
function parseXml(text) {
|
123 |
+
if (window.DOMParser) {
|
124 |
+
return new DOMParser().parseFromString(text, 'application/xml');
|
125 |
+
} else {
|
126 |
+
var xml = new ActiveXObject('Microsoft.XMLDOM');
|
127 |
+
xml.async = false;
|
128 |
+
xml.loadXML(text);
|
129 |
+
return xml;
|
130 |
+
}
|
131 |
+
}
|
132 |
+
|
133 |
+
})(jQuery);
|
filemanager/model.php
ADDED
@@ -0,0 +1,282 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Author: Rob
|
4 |
+
* Date: 6/24/13
|
5 |
+
* Time: 11:31 AM
|
6 |
+
*/
|
7 |
+
|
8 |
+
$p_dir;
|
9 |
+
$s_order;
|
10 |
+
|
11 |
+
class FilemanagerModel {
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
// Events //
|
14 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
// Constants //
|
17 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Variables //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
private $controller;
|
22 |
+
|
23 |
+
|
24 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
+
// Constructor & Destructor //
|
26 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
27 |
+
public function __construct($controller) {
|
28 |
+
$this->controller = $controller;
|
29 |
+
}
|
30 |
+
|
31 |
+
|
32 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
33 |
+
// Public Methods //
|
34 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
+
public function get_file_manager_data() {
|
36 |
+
$session_data = array();
|
37 |
+
$session_data['sort_by'] = $this->get_from_session('sort_by', 'name');
|
38 |
+
$session_data['sort_order'] = $this->get_from_session('sort_order', 'asc');
|
39 |
+
$session_data['items_view'] = $this->get_from_session('items_view', 'thumbs');
|
40 |
+
$session_data['clipboard_task'] = $this->get_from_session('clipboard_task', '');
|
41 |
+
$session_data['clipboard_files'] = $this->get_from_session('clipboard_files', '');
|
42 |
+
$session_data['clipboard_src'] = $this->get_from_session('clipboard_src', '');
|
43 |
+
$session_data['clipboard_dest'] = $this->get_from_session('clipboard_dest', '');
|
44 |
+
|
45 |
+
$data = array();
|
46 |
+
$data['session_data'] = $session_data;
|
47 |
+
$data['path_components'] = $this->get_path_components();
|
48 |
+
$data['dir'] = (isset($_REQUEST['dir']) ? esc_html($_REQUEST['dir']) : '');
|
49 |
+
$data['files'] = $this->get_files($session_data['sort_by'], $session_data['sort_order']);
|
50 |
+
/*$data['media_library_files'] = ($this->controller->get_options_data()->enable_ML_import ? $this->get_media_library_files($session_data['sort_by'], $session_data['sort_order']) : array());*/
|
51 |
+
$data['extensions'] = (isset($_REQUEST['extensions']) ? esc_html($_REQUEST['extensions']) : '');
|
52 |
+
$data['callback'] = (isset($_REQUEST['callback']) ? esc_html($_REQUEST['callback']) : '');
|
53 |
+
$data['image_for'] = (isset($_REQUEST['image_for']) ? esc_html($_REQUEST['image_for']) : '');
|
54 |
+
$data['slide_id'] = (isset($_REQUEST['slide_id']) ? esc_html($_REQUEST['slide_id']) : '');
|
55 |
+
|
56 |
+
return $data;
|
57 |
+
}
|
58 |
+
|
59 |
+
|
60 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
61 |
+
// Getters & Setters //
|
62 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
63 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
64 |
+
// Private Methods //
|
65 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
66 |
+
private function get_from_session($key, $default) {
|
67 |
+
// if (isset($_SESSION[$key])) {
|
68 |
+
// if (isset($_REQUEST[$key])) {
|
69 |
+
if (isset($_REQUEST[$key])) {
|
70 |
+
// $_SESSION[$key] = $_REQUEST[$key];
|
71 |
+
$_REQUEST[$key] = stripslashes($_REQUEST[$key]);
|
72 |
+
}
|
73 |
+
else {
|
74 |
+
// $_SESSION[$key] = $default;
|
75 |
+
$_REQUEST[$key] = stripslashes($default);
|
76 |
+
}
|
77 |
+
// return $_SESSION[$key];
|
78 |
+
return stripslashes($_REQUEST[$key]);
|
79 |
+
// }
|
80 |
+
// return '';
|
81 |
+
}
|
82 |
+
|
83 |
+
public function get_path_components() {
|
84 |
+
$dir_names = explode('/', (isset($_REQUEST['dir']) ? $_REQUEST['dir'] : ''));
|
85 |
+
$path = '';
|
86 |
+
|
87 |
+
$components = array();
|
88 |
+
$component = array();
|
89 |
+
global $WD_S_UPLOAD_DIR;
|
90 |
+
$component['name'] = $WD_S_UPLOAD_DIR;
|
91 |
+
$component['path'] = $path;
|
92 |
+
$components[] = $component;
|
93 |
+
for ($i = 0; $i < count($dir_names); $i++) {
|
94 |
+
$dir_name = $dir_names[$i];
|
95 |
+
if ($dir_name == '') {
|
96 |
+
continue;
|
97 |
+
}
|
98 |
+
$path .= (($path == '') ? $dir_name : '/' . $dir_name);
|
99 |
+
$component = array();
|
100 |
+
$component['name'] = $dir_name;
|
101 |
+
$component['path'] = $path;
|
102 |
+
$components[] = $component;
|
103 |
+
}
|
104 |
+
return $components;
|
105 |
+
}
|
106 |
+
|
107 |
+
function get_files($sort_by, $sort_order) {
|
108 |
+
$icons_dir_path = WD_S_DIR . '/filemanager/images/file_icons';
|
109 |
+
$icons_dir_url = WD_S_URL . '/filemanager/images/file_icons';
|
110 |
+
$valid_types = explode(',', isset($_REQUEST['extensions']) ? strtolower(esc_html($_REQUEST['extensions'])) : '*');
|
111 |
+
$parent_dir = $this->controller->get_uploads_dir() . (isset($_REQUEST['dir']) ? '/' . esc_html($_REQUEST['dir']) : '');
|
112 |
+
$parent_dir_url = $this->controller->get_uploads_url() . (isset($_REQUEST['dir']) ? '/' . esc_html($_REQUEST['dir']) : '');
|
113 |
+
|
114 |
+
|
115 |
+
$file_names = $this->get_sorted_file_names($parent_dir, $sort_by, $sort_order);
|
116 |
+
|
117 |
+
$dirs = array();
|
118 |
+
$files = array();
|
119 |
+
foreach ($file_names as $file_name) {
|
120 |
+
if (($file_name == '.') || ($file_name == '..') || ($file_name == 'thumb') || ($file_name == '.original')) {
|
121 |
+
continue;
|
122 |
+
}
|
123 |
+
if (is_dir($parent_dir . '/' . $file_name) == TRUE) {
|
124 |
+
$file = array();
|
125 |
+
$file['is_dir'] = TRUE;
|
126 |
+
$file['name'] = $file_name;
|
127 |
+
$file['filename'] = $file_name;
|
128 |
+
$file['type'] = '';
|
129 |
+
$file['thumb'] = $icons_dir_url . '/dir.png';
|
130 |
+
$file['icon'] = $icons_dir_url . '/dir.png';
|
131 |
+
$file['size'] = '';
|
132 |
+
$file['date_modified'] = '';
|
133 |
+
$file['resolution'] = '';
|
134 |
+
$dirs[] = $file;
|
135 |
+
}
|
136 |
+
else {
|
137 |
+
$file = array();
|
138 |
+
$file['is_dir'] = FALSE;
|
139 |
+
$file['name'] = $file_name;
|
140 |
+
$file['filename'] = substr($file_name, 0, strrpos($file_name, '.'));
|
141 |
+
$file_extension = explode('.', $file_name);
|
142 |
+
$file['type'] = strtolower(end($file_extension));
|
143 |
+
$icon = $icons_dir_url . '/' . $file['type'] . '.png';
|
144 |
+
if (file_exists($icons_dir_path . '/' . $file['type'] . '.png') == FALSE) {
|
145 |
+
$icon = $icons_dir_url . '/' . '_blank.png';
|
146 |
+
}
|
147 |
+
$file['thumb'] = $this->is_img($file['type']) ? $parent_dir_url . '/thumb/' . $file_name : $icon;
|
148 |
+
$file['icon'] = $icon;
|
149 |
+
if (($valid_types[0] != '*') && (in_array($file['type'], $valid_types) == FALSE)) {
|
150 |
+
continue;
|
151 |
+
}
|
152 |
+
$file_size_kb = (int)(filesize($parent_dir . '/' . $file_name) / 1024);
|
153 |
+
// $file_size_mb = (int)($file_size_kb / 1024);
|
154 |
+
// $file['size'] = $file_size_kb < 1024 ? (string)$file_size_kb . 'KB' : (string)$file_size_mb . 'MB';
|
155 |
+
$file['size'] = $file_size_kb . ' KB';
|
156 |
+
$file['date_modified'] = date('d F Y, H:i', filemtime($parent_dir . '/' . $file_name));
|
157 |
+
$image_info = getimagesize(htmlspecialchars_decode($parent_dir . '/' . $file_name, ENT_COMPAT | ENT_QUOTES));
|
158 |
+
$file['resolution'] = $this->is_img($file['type']) ? $image_info[0] . ' x ' . $image_info[1] . ' px' : '';
|
159 |
+
$files[] = $file;
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
$result = $sort_order == 'asc' ? array_merge($dirs, $files) : array_merge($files, $dirs);
|
164 |
+
return $result;
|
165 |
+
}
|
166 |
+
|
167 |
+
/*function get_media_library_files($sort_by, $sort_order) {
|
168 |
+
$icons_dir_path = WD_S_DIR . '/filemanager/images/file_icons';
|
169 |
+
$icons_dir_url = WD_S_URL . '/filemanager/images/file_icons';
|
170 |
+
$valid_types = explode(',', isset($_REQUEST['extensions']) ? strtolower(esc_html($_REQUEST['extensions'])) : '*');
|
171 |
+
$upload_dir = wp_upload_dir();
|
172 |
+
$parent_dir = $upload_dir['basedir'];
|
173 |
+
$parent_dir_url = $upload_dir['baseurl'];
|
174 |
+
|
175 |
+
$query_images_args = array(
|
176 |
+
'post_type' => 'attachment', 'post_mime_type' =>'image', 'post_status' => 'inherit', 'posts_per_page' => -1,
|
177 |
+
);
|
178 |
+
|
179 |
+
$query_images = new WP_Query( $query_images_args );
|
180 |
+
|
181 |
+
$files = array();
|
182 |
+
$upload_dir = wp_upload_dir();
|
183 |
+
|
184 |
+
foreach ($query_images->posts as $image) {
|
185 |
+
$file_meta = wp_get_attachment_metadata($image->ID);
|
186 |
+
if (isset($file_meta['file'])) {
|
187 |
+
$file = array();
|
188 |
+
$file['is_dir'] = FALSE;
|
189 |
+
$file_name_array = explode('/', $file_meta['file']);
|
190 |
+
$file_name = end($file_name_array);
|
191 |
+
$file['name'] = $file_name;
|
192 |
+
$file['path'] = $file_meta['file'];
|
193 |
+
$file['filename'] = substr($file_name, 0, strrpos($file_name, '.'));
|
194 |
+
$file_type_array = explode('.', $file_name);
|
195 |
+
$file['type'] = strtolower(end($file_type_array));
|
196 |
+
// $file['thumb'] = wp_get_attachment_thumb_url($image->ID);
|
197 |
+
if (!empty($file_meta['sizes']) && $file_meta['sizes']['thumbnail']['file']) {
|
198 |
+
$file_pos = strrpos($file_meta['file'], '/');
|
199 |
+
$sub_folder = substr($file_meta['file'], 0, $file_pos);
|
200 |
+
$file['thumb'] = $upload_dir['baseurl'] . '/' . $sub_folder . '/' . $file_meta['sizes']['thumbnail']['file'];
|
201 |
+
}
|
202 |
+
else {
|
203 |
+
$file['thumb'] = $upload_dir['baseurl'] . '/' . $file_meta['file'];
|
204 |
+
}
|
205 |
+
$file['icon'] = $file['thumb'];
|
206 |
+
if (($valid_types[0] != '*') && (in_array($file['type'], $valid_types) == FALSE)) {
|
207 |
+
continue;
|
208 |
+
}
|
209 |
+
$file_size_kb = (int)(@filesize($parent_dir . '/' . $file_meta['file']) / 1024);
|
210 |
+
if (!$file_size_kb) continue;
|
211 |
+
$file['size'] = $file_size_kb . ' KB';
|
212 |
+
$file['date_modified'] = date('d F Y, H:i', filemtime($parent_dir . '/' . $file_meta['file']));
|
213 |
+
// $image_info = getimagesize(htmlspecialchars_decode($parent_dir . '/' . $file_meta['file'], ENT_COMPAT | ENT_QUOTES));
|
214 |
+
$file['resolution'] = $this->is_img($file['type']) ? $file_meta['width'] . ' x ' . $file_meta['height'] . ' px' : '';
|
215 |
+
$files[] = $file;
|
216 |
+
}
|
217 |
+
}
|
218 |
+
return $files;
|
219 |
+
}*/
|
220 |
+
|
221 |
+
private function get_sorted_file_names($parent_dir, $sort_by, $sort_order) {
|
222 |
+
$file_names = scandir($parent_dir);
|
223 |
+
|
224 |
+
global $p_dir;
|
225 |
+
global $s_order;
|
226 |
+
|
227 |
+
$p_dir = $parent_dir;
|
228 |
+
$s_order = $sort_order;
|
229 |
+
|
230 |
+
function sort_by_size ($a, $b) {
|
231 |
+
global $p_dir;
|
232 |
+
global $s_order;
|
233 |
+
|
234 |
+
$size_of_a = filesize($p_dir . '/' . $a);
|
235 |
+
$size_of_b = filesize($p_dir . '/' . $b);
|
236 |
+
return $s_order == 'asc' ? $size_of_a > $size_of_b : $size_of_a < $size_of_b;
|
237 |
+
}
|
238 |
+
|
239 |
+
function sort_by_date($a, $b) {
|
240 |
+
global $p_dir;
|
241 |
+
global $s_order;
|
242 |
+
|
243 |
+
$m_time_a = filemtime($p_dir . '/' . $a);
|
244 |
+
$m_time_b = filemtime($p_dir . '/' . $b);
|
245 |
+
return $s_order == 'asc' ? $m_time_a > $m_time_b : $m_time_a < $m_time_b;
|
246 |
+
}
|
247 |
+
|
248 |
+
switch ($sort_by) {
|
249 |
+
case 'name':
|
250 |
+
natcasesort($file_names);
|
251 |
+
if ($sort_order == 'desc') {
|
252 |
+
$file_names = array_reverse($file_names);
|
253 |
+
}
|
254 |
+
break;
|
255 |
+
case 'size':
|
256 |
+
usort($file_names, 'sort_by_size');
|
257 |
+
break;
|
258 |
+
case 'date_modified':
|
259 |
+
usort($file_names, 'sort_by_date');
|
260 |
+
break;
|
261 |
+
}
|
262 |
+
return $file_names;
|
263 |
+
}
|
264 |
+
|
265 |
+
private function is_img($file_type) {
|
266 |
+
switch ($file_type) {
|
267 |
+
case 'jpg':
|
268 |
+
case 'jpeg':
|
269 |
+
case 'png':
|
270 |
+
case 'bmp':
|
271 |
+
case 'gif':
|
272 |
+
return true;
|
273 |
+
break;
|
274 |
+
}
|
275 |
+
return false;
|
276 |
+
}
|
277 |
+
|
278 |
+
|
279 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
280 |
+
// Listeners //
|
281 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
282 |
+
}
|
filemanager/view.php
ADDED
@@ -0,0 +1,449 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Author: Rob
|
4 |
+
* Date: 6/24/13
|
5 |
+
* Time: 11:48 AM
|
6 |
+
*/
|
7 |
+
|
8 |
+
class FilemanagerView {
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
// Events //
|
11 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
// Constants //
|
14 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
// Variables //
|
17 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
18 |
+
private $controller;
|
19 |
+
private $model;
|
20 |
+
|
21 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
22 |
+
// Constructor & Destructor //
|
23 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
24 |
+
public function __construct($controller, $model) {
|
25 |
+
$this->controller = $controller;
|
26 |
+
$this->model = $model;
|
27 |
+
}
|
28 |
+
|
29 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
30 |
+
// Public Methods //
|
31 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
32 |
+
public function display() {
|
33 |
+
if (isset($_GET['filemanager_msg']) && esc_html($_GET['filemanager_msg']) != '') {
|
34 |
+
?>
|
35 |
+
<div id="file_manager_message" style="height:40px;">
|
36 |
+
<div style="background-color: #FFEBE8; border: 1px solid #CC0000; margin: 5px 15px 2px; padding: 5px 10px;">
|
37 |
+
<strong style="font-size:14px"><?php echo esc_html(stripslashes($_GET['filemanager_msg'])); ?></strong>
|
38 |
+
</div>
|
39 |
+
</div>
|
40 |
+
<?php
|
41 |
+
$_GET['filemanager_msg'] = '';
|
42 |
+
}
|
43 |
+
//$bwg_options = $this->controller->get_options_data();
|
44 |
+
$file_manager_data = $this->model->get_file_manager_data();
|
45 |
+
$items_view = $file_manager_data['session_data']['items_view'];
|
46 |
+
$sort_by = $file_manager_data['session_data']['sort_by'];
|
47 |
+
$sort_order = $file_manager_data['session_data']['sort_order'];
|
48 |
+
$clipboard_task = $file_manager_data['session_data']['clipboard_task'];
|
49 |
+
$clipboard_files = $file_manager_data['session_data']['clipboard_files'];
|
50 |
+
$clipboard_src = $file_manager_data['session_data']['clipboard_src'];
|
51 |
+
$clipboard_dest = $file_manager_data['session_data']['clipboard_dest'];
|
52 |
+
$icons_dir_url = WD_S_URL . '/filemanager/images/file_icons';
|
53 |
+
$sort_icon = $icons_dir_url . '/' . $sort_order;
|
54 |
+
wp_print_scripts('jquery');
|
55 |
+
wp_print_scripts('jquery-ui-widget');
|
56 |
+
?>
|
57 |
+
<script src="<?php echo WD_S_URL; ?>/filemanager/js/jq_uploader/jquery.iframe-transport.js"></script>
|
58 |
+
<script src="<?php echo WD_S_URL; ?>/filemanager/js/jq_uploader/jquery.fileupload.js"></script>
|
59 |
+
<script>
|
60 |
+
var DS = "<?php echo addslashes('/'); ?>";
|
61 |
+
|
62 |
+
var errorLoadingFile = "<?php echo 'File loading failed'; ?>";
|
63 |
+
|
64 |
+
var warningRemoveItems = "<?php echo 'Are you sure you want to permanently remove selected items?'; ?>";
|
65 |
+
var warningCancelUploads = "<?php echo 'This will cancel uploads. Continue?'; ?>";
|
66 |
+
|
67 |
+
var messageEnterDirName = "<?php echo 'Enter directory name'; ?>";
|
68 |
+
var messageEnterNewName = "<?php echo 'Enter new name'; ?>";
|
69 |
+
var messageFilesUploadComplete = "<?php echo 'Files upload complete'; ?>";
|
70 |
+
|
71 |
+
var root = "<?php echo addslashes($this->controller->get_uploads_dir()); ?>";
|
72 |
+
var dir = "<?php echo (isset($_REQUEST['dir']) ? addslashes(esc_html($_REQUEST['dir'])) : ''); ?>";
|
73 |
+
var dirUrl = "<?php echo $this->controller->get_uploads_url() . (isset($_REQUEST['dir']) ? esc_html($_REQUEST['dir']) . '/' : ''); ?>";
|
74 |
+
var callback = "<?php echo (isset($_REQUEST['callback']) ? esc_html($_REQUEST['callback']) : ''); ?>";
|
75 |
+
var image_for = "<?php echo (isset($_REQUEST['image_for']) ? esc_html($_REQUEST['image_for']) : ''); ?>";
|
76 |
+
var slide_id = "<?php echo (isset($_REQUEST['slide_id']) ? esc_html($_REQUEST['slide_id']) : ''); ?>";
|
77 |
+
var sortBy = "<?php echo $sort_by; ?>";
|
78 |
+
var sortOrder = "<?php echo $sort_order; ?>";
|
79 |
+
|
80 |
+
|
81 |
+
|
82 |
+
</script>
|
83 |
+
<script src="<?php echo WD_S_URL; ?>/filemanager/js/default.js?ver=<?php echo get_option("wd_bwg_version"); ?>"></script>
|
84 |
+
<link href="<?php echo WD_S_URL; ?>/filemanager/css/default.css?ver=<?php echo get_option("wd_bwg_version"); ?>" type="text/css" rel="stylesheet">
|
85 |
+
<?php
|
86 |
+
switch ($items_view) {
|
87 |
+
case 'list':
|
88 |
+
?>
|
89 |
+
<link href="<?php echo WD_S_URL; ?>/filemanager/css/default_view_list.css?ver=<?php echo get_option("wd_bwg_version"); ?>" type="text/css" rel="stylesheet">
|
90 |
+
<?php
|
91 |
+
break;
|
92 |
+
case 'thumbs':
|
93 |
+
?>
|
94 |
+
<link href="<?php echo WD_S_URL; ?>/filemanager/css/default_view_thumbs.css?ver=<?php echo get_option("wd_bwg_version"); ?>" type="text/css" rel="stylesheet">
|
95 |
+
<?php
|
96 |
+
break;
|
97 |
+
}
|
98 |
+
$i = 0;
|
99 |
+
?>
|
100 |
+
|
101 |
+
<form id="adminForm" name="adminForm" action="" method="post">
|
102 |
+
<div id="wrapper">
|
103 |
+
<div id="opacity_div" style="background-color: rgba(0, 0, 0, 0.2); position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 99998;"></div>
|
104 |
+
<div id="loading_div" style="text-align: center; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 99999;">
|
105 |
+
<img src="<?php echo WD_S_URL . '/images/ajax_loader.png'; ?>" class="spider_ajax_loading" style="margin-top: 200px; width:50px;">
|
106 |
+
</div>
|
107 |
+
<div id="file_manager">
|
108 |
+
<div class="ctrls_bar ctrls_bar_header">
|
109 |
+
<div class="ctrls_left">
|
110 |
+
<a class="ctrl_bar_btn btn_up" onclick="onBtnUpClick(event, this);" title="<?php echo 'Up'; ?>"></a>
|
111 |
+
<a class="ctrl_bar_btn btn_make_dir" onclick="onBtnMakeDirClick(event, this);" title="<?php echo 'Make a directory'; ?>"></a>
|
112 |
+
<a class="ctrl_bar_btn btn_rename_item" onclick="onBtnRenameItemClick(event, this);" title="<?php echo 'Rename item'; ?>"></a>
|
113 |
+
<span class="ctrl_bar_divider"></span>
|
114 |
+
<a class="ctrl_bar_btn btn_copy" onclick="onBtnCopyClick(event, this);" title="<?php echo 'Copy'; ?>"></a>
|
115 |
+
<a class="ctrl_bar_btn btn_cut" onclick="onBtnCutClick(event, this);" title="<?php echo 'Cut'; ?>"></a>
|
116 |
+
<a class="ctrl_bar_btn btn_paste" onclick="onBtnPasteClick(event, this);" title="<?php echo 'Paste'; ?>"> </a>
|
117 |
+
<a class="ctrl_bar_btn btn_remove_items" onclick="onBtnRemoveItemsClick(event, this);" title="<?php echo 'Remove items'; ?>"></a>
|
118 |
+
<span class="ctrl_bar_divider"></span>
|
119 |
+
<span class="ctrl_bar_btn btn_primary">
|
120 |
+
<a class="ctrl_bar_btn btn_upload_files" onclick="onBtnShowUploaderClick(event, this);"><?php echo 'Upload files'; ?></a>
|
121 |
+
</span>
|
122 |
+
<?php if (/*$bwg_options->enable_ML_import*/FALSE) { ?>
|
123 |
+
<span class="ctrl_bar_divider"></span>
|
124 |
+
<span class="ctrl_bar_btn btn_primary">
|
125 |
+
<a class="ctrl_bar_btn btn_import_files" onclick="onBtnShowImportClick(event, this);"><?php echo 'Media library'; ?></a>
|
126 |
+
</span>
|
127 |
+
<?php } ?>
|
128 |
+
</div>
|
129 |
+
<div class="ctrls_right">
|
130 |
+
<a class="ctrl_bar_btn btn_view_thumbs" onclick="onBtnViewThumbsClick(event, this);" title="<?php echo 'View thumbs'; ?>"></a>
|
131 |
+
<a class="ctrl_bar_btn btn_view_list" onclick="onBtnViewListClick(event, this);" title="<?php echo 'View list'; ?>"></a>
|
132 |
+
</div>
|
133 |
+
</div>
|
134 |
+
<div id="path">
|
135 |
+
<?php
|
136 |
+
foreach ($file_manager_data['path_components'] as $key => $path_component) {
|
137 |
+
?>
|
138 |
+
<a class="path_component path_dir"
|
139 |
+
onclick="onPathComponentClick(event, this, '<?php echo addslashes($path_component['path']); ?>');">
|
140 |
+
<?php echo $path_component['name']; ?></a>
|
141 |
+
<a class="path_component path_separator"><?php echo '/'; ?></a>
|
142 |
+
<?php
|
143 |
+
}
|
144 |
+
?>
|
145 |
+
</div>
|
146 |
+
<div id="explorer">
|
147 |
+
<div id="explorer_header_wrapper">
|
148 |
+
<div id="explorer_header_container">
|
149 |
+
<div id="explorer_header">
|
150 |
+
<span class="item_numbering">#</span>
|
151 |
+
<span class="item_icon"></span>
|
152 |
+
<span class="item_name">
|
153 |
+
<span class="clickable" onclick="onNameHeaderClick(event, this);">
|
154 |
+
<?php
|
155 |
+
echo 'Name';
|
156 |
+
if ($sort_by == 'name') {
|
157 |
+
?>
|
158 |
+
<span class="sort_order_<?php echo $sort_order; ?>"></span>
|
159 |
+
<?php
|
160 |
+
}
|
161 |
+
?>
|
162 |
+
</span>
|
163 |
+
</span>
|
164 |
+
<span class="item_size">
|
165 |
+
<span class="clickable" onclick="onSizeHeaderClick(event, this);">
|
166 |
+
<?php
|
167 |
+
echo 'Size';
|
168 |
+
if ($sort_by == 'size') {
|
169 |
+
?>
|
170 |
+
<span class="sort_order_<?php echo $sort_order; ?>"></span>
|
171 |
+
<?php
|
172 |
+
}
|
173 |
+
?>
|
174 |
+
</span>
|
175 |
+
</span>
|
176 |
+
<span class="item_date_modified">
|
177 |
+
<span class="clickable" onclick="onDateModifiedHeaderClick(event, this);">
|
178 |
+
<?php
|
179 |
+
echo 'Date modified';
|
180 |
+
if ($sort_by == 'date_modified') {
|
181 |
+
?>
|
182 |
+
<span class="sort_order_<?php echo $sort_order; ?>"></span>
|
183 |
+
<?php
|
184 |
+
}
|
185 |
+
?>
|
186 |
+
</span>
|
187 |
+
</span>
|
188 |
+
<span class="scrollbar_filler"></span>
|
189 |
+
</div>
|
190 |
+
</div>
|
191 |
+
</div>
|
192 |
+
<div id="explorer_body_wrapper">
|
193 |
+
<div id="explorer_body_container">
|
194 |
+
<div id="explorer_body">
|
195 |
+
<?php
|
196 |
+
foreach ($file_manager_data['files'] as $file) {
|
197 |
+
?>
|
198 |
+
<div class="explorer_item" draggable="true"
|
199 |
+
name="<?php echo $file['name']; ?>"
|
200 |
+
filename="<?php echo $file['filename']; ?>"
|
201 |
+
filethumb="<?php echo $file['thumb']; ?>"
|
202 |
+
filesize="<?php echo $file['size']; ?>"
|
203 |
+
filetype="<?php echo strtoupper($file['type']); ?>"
|
204 |
+
date_modified="<?php echo $file['date_modified']; ?>"
|
205 |
+
fileresolution="<?php echo $file['resolution']; ?>"
|
206 |
+
onmouseover="onFileMOver(event, this);"
|
207 |
+
onmouseout="onFileMOut(event, this);"
|
208 |
+
onclick="onFileClick(event, this);"
|
209 |
+
ondblclick="onFileDblClick(event, this);"
|
210 |
+
ondragstart="onFileDragStart(event, this);"
|
211 |
+
<?php
|
212 |
+
if ($file['is_dir'] == true) {
|
213 |
+
?>
|
214 |
+
ondragover="onFileDragOver(event, this);"
|
215 |
+
ondrop="onFileDrop(event, this);"
|
216 |
+
<?php
|
217 |
+
}
|
218 |
+
?>
|
219 |
+
isDir="<?php echo $file['is_dir'] == true ? 'true' : 'false'; ?>">
|
220 |
+
<span class="item_numbering"><?php echo ++$i; ?></span>
|
221 |
+
<span class="item_thumb">
|
222 |
+
<img src="<?php echo $file['thumb']; ?>"/>
|
223 |
+
</span>
|
224 |
+
<span class="item_icon">
|
225 |
+
<img src="<?php echo $file['icon']; ?>"/>
|
226 |
+
</span>
|
227 |
+
<span class="item_name">
|
228 |
+
<?php echo $file['name']; ?>
|
229 |
+
</span>
|
230 |
+
<span class="item_size">
|
231 |
+
<?php echo $file['size']; ?>
|
232 |
+
</span>
|
233 |
+
<span class="item_date_modified">
|
234 |
+
<?php echo $file['date_modified']; ?>
|
235 |
+
</span>
|
236 |
+
</div>
|
237 |
+
<?php
|
238 |
+
}
|
239 |
+
?>
|
240 |
+
</div>
|
241 |
+
</div>
|
242 |
+
</div>
|
243 |
+
</div>
|
244 |
+
<div class="ctrls_bar ctrls_bar_footer">
|
245 |
+
<div class="ctrls_left">
|
246 |
+
<a class="ctrl_bar_btn btn_open btn_primary none_select" onclick="onBtnSelectAllClick();"><?php echo 'Select All'; ?></a>
|
247 |
+
</div>
|
248 |
+
<div class="ctrls_right">
|
249 |
+
<span id="file_names_span">
|
250 |
+
<span>
|
251 |
+
</span>
|
252 |
+
</span>
|
253 |
+
<a class="ctrl_bar_btn btn_open btn_primary none_select" onclick="onBtnOpenClick(event, this);"><?php echo ((isset($_REQUEST['image_for']) && esc_html($_REQUEST['image_for']) == 'add_slides') ? 'Add selected images to slider' : 'Add image to slider'); ?></a>
|
254 |
+
<span class="ctrl_bar_empty_devider"></span>
|
255 |
+
<a class="ctrl_bar_btn btn_cancel btn_secondary none_select" onclick="onBtnCancelClick(event, this);"><?php echo 'Cancel'; ?></a>
|
256 |
+
</div>
|
257 |
+
</div>
|
258 |
+
</div>
|
259 |
+
<!--<div id="importer" style="display: none;">
|
260 |
+
<div id="importer_bg"></div>
|
261 |
+
<div class="ctrls_bar ctrls_bar_header">
|
262 |
+
<div class="ctrls_left upload_thumb">
|
263 |
+
Thumbnail Maximum Dimensions:
|
264 |
+
<input type="text" class="upload_thumb_dim" name="importer_thumb_width" id="importer_thumb_width" value="<?php echo /*$bwg_options->upload_thumb_width;*/ 300; ?>" /> x
|
265 |
+
<input type="text" class="upload_thumb_dim" name="importer_thumb_height" id="importer_thumb_height" value="<?php echo /*$bwg_options->upload_thumb_height;*/ 300;?>" /> px
|
266 |
+
</div>
|
267 |
+
<div class="ctrls_right">
|
268 |
+
<a class="ctrl_bar_btn btn_back" onclick="onBtnBackClick(event, this);" title="<?php echo 'Back'; ?>"></a>
|
269 |
+
</div>
|
270 |
+
<div class="ctrls_right_img upload_thumb">
|
271 |
+
Image Maximum Dimensions:
|
272 |
+
<input type="text" class="upload_thumb_dim" name="importer_img_width" id="importer_img_width" value="<?php echo /*$bwg_options->upload_img_width;*/ 1200;?>" /> x
|
273 |
+
<input type="text" class="upload_thumb_dim" name="importer_img_height" id="importer_img_height" value="<?php echo /*$bwg_options->upload_img_height;*/ 1200;?>" /> px
|
274 |
+
</div>
|
275 |
+
</div>
|
276 |
+
<div id="importer_body_wrapper">
|
277 |
+
<div id="importer_body_container">
|
278 |
+
<div id="importer_body">
|
279 |
+
<?php
|
280 |
+
foreach ($file_manager_data['media_library_files'] as $file) {
|
281 |
+
?>
|
282 |
+
<div class="importer_item" draggable="true"
|
283 |
+
name="<?php echo $file['name']; ?>"
|
284 |
+
path="<?php echo $file['path']; ?>"
|
285 |
+
filename="<?php echo $file['filename']; ?>"
|
286 |
+
filethumb="<?php echo $file['thumb']; ?>"
|
287 |
+
filesize="<?php echo $file['size']; ?>"
|
288 |
+
filetype="<?php echo strtoupper($file['type']); ?>"
|
289 |
+
date_modified="<?php echo $file['date_modified']; ?>"
|
290 |
+
fileresolution="<?php echo $file['resolution']; ?>"
|
291 |
+
onmouseover="onFileMOverML(event, this);"
|
292 |
+
onmouseout="onFileMOutML(event, this);"
|
293 |
+
onclick="onFileClickML(event, this);"
|
294 |
+
ondblclick="onFileDblClickML(event, this);"
|
295 |
+
isDir="<?php echo $file['is_dir'] == true ? 'true' : 'false'; ?>">
|
296 |
+
<span class="item_numbering"><?php echo ++$i; ?></span>
|
297 |
+
<span class="item_thumb">
|
298 |
+
<img src="<?php echo $file['thumb']; ?>"/>
|
299 |
+
</span>
|
300 |
+
<span class="item_icon">
|
301 |
+
<img src="<?php echo $file['icon']; ?>"/>
|
302 |
+
</span>
|
303 |
+
<span class="item_name">
|
304 |
+
<?php echo $file['name']; ?>
|
305 |
+
</span>
|
306 |
+
<span class="item_size">
|
307 |
+
<?php echo $file['size']; ?>
|
308 |
+
</span>
|
309 |
+
<span class="item_date_modified">
|
310 |
+
<?php echo $file['date_modified']; ?>
|
311 |
+
</span>
|
312 |
+
</div>
|
313 |
+
<?php
|
314 |
+
}
|
315 |
+
?>
|
316 |
+
</div>
|
317 |
+
</div>
|
318 |
+
</div>
|
319 |
+
<div class="ctrls_bar ctrls_bar_footer">
|
320 |
+
<div class="ctrls_left">
|
321 |
+
<a class="ctrl_bar_btn btn_open btn_primary none_select" onclick="onBtnSelectAllMediLibraryClick();"><?php echo 'Select All'; ?></a>
|
322 |
+
</div>
|
323 |
+
<div class="ctrls_right">
|
324 |
+
<span id="file_names_span">
|
325 |
+
<span>
|
326 |
+
</span>
|
327 |
+
</span>
|
328 |
+
<a class="ctrl_bar_btn btn_open btn_primary none_select" onclick="onBtnImportClick(event, this);">Import selected images</a>
|
329 |
+
</div>
|
330 |
+
</div>
|
331 |
+
</div>-->
|
332 |
+
<div id="uploader">
|
333 |
+
<div id="uploader_bg"></div>
|
334 |
+
<div class="ctrls_bar ctrls_bar_header">
|
335 |
+
<div class="ctrls_left upload_thumb">
|
336 |
+
Thumbnail Maximum Dimensions:
|
337 |
+
<input type="text" class="upload_thumb_dim" name="upload_thumb_width" id="upload_thumb_width" value="<?php echo /*$bwg_options->upload_thumb_width;*/ 300; ?>" /> x
|
338 |
+
<input type="text" class="upload_thumb_dim" name="upload_thumb_height" id="upload_thumb_height" value="<?php echo /*$bwg_options->upload_thumb_height;*/ 300; ?>" /> px
|
339 |
+
</div>
|
340 |
+
<div class="ctrls_right">
|
341 |
+
<a class="ctrl_bar_btn btn_back" onclick="onBtnBackClick(event, this);" title="<?php echo 'Back'; ?>"></a>
|
342 |
+
</div>
|
343 |
+
<div class="ctrls_right_img upload_thumb">
|
344 |
+
Image Maximum Dimensions:
|
345 |
+
<input type="text" class="upload_thumb_dim" name="upload_img_width" id="upload_img_width" value="<?php echo /*$bwg_options->upload_img_width;*/ 1200; ?>" /> x
|
346 |
+
<input type="text" class="upload_thumb_dim" name="upload_img_height" id="upload_img_height" value="<?php echo /*$bwg_options->upload_img_height;*/ 1200; ?>" /> px
|
347 |
+
</div>
|
348 |
+
</div>
|
349 |
+
<label for="jQueryUploader">
|
350 |
+
<div id="uploader_hitter">
|
351 |
+
<div id="drag_message">
|
352 |
+
<span><?php echo 'Drag files here or click the button below' . '<br />' . 'to upload files' ?></span>
|
353 |
+
</div>
|
354 |
+
<div id="btnBrowseContainer">
|
355 |
+
<input id="jQueryUploader" type="file" name="files[]"
|
356 |
+
data-url="<?php echo add_query_arg(array('action' => 'wds_UploadHandler', 'dir' => $this->controller->get_uploads_dir() . '/' . (isset($_REQUEST['dir']) ? esc_html($_REQUEST['dir']) : '') . '/'), admin_url('admin-ajax.php')); ?>"
|
357 |
+
multiple>
|
358 |
+
</div>
|
359 |
+
<script>
|
360 |
+
jQuery("#jQueryUploader").fileupload({
|
361 |
+
dataType: "json",
|
362 |
+
dropZone: jQuery("#uploader_hitter"),
|
363 |
+
submit: function (e, data) {
|
364 |
+
jQuery("#uploader_progress_text").removeClass("uploader_text");
|
365 |
+
isUploading = true;
|
366 |
+
jQuery("#uploader_progress_bar").fadeIn();
|
367 |
+
},
|
368 |
+
progressall: function (e, data) {
|
369 |
+
var progress = parseInt(data.loaded / data.total * 100, 10);
|
370 |
+
jQuery("#uploader_progress_text").text("Progress " + progress + "%");
|
371 |
+
jQuery("#uploader_progress div div").css({width: progress + "%"});
|
372 |
+
if (data.loaded == data.total) {
|
373 |
+
isUploading = false;
|
374 |
+
jQuery("#uploader_progress_bar").fadeOut(function () {
|
375 |
+
jQuery("#uploader_progress_text").text(messageFilesUploadComplete);
|
376 |
+
jQuery("#uploader_progress_text").addClass("uploader_text");
|
377 |
+
});
|
378 |
+
}
|
379 |
+
},
|
380 |
+
stop: function (e, data) {
|
381 |
+
onBtnBackClick();
|
382 |
+
},
|
383 |
+
done: function (e, data) {
|
384 |
+
jQuery.each(data.result.files, function (index, file) {
|
385 |
+
if (file.error) {
|
386 |
+
alert(errorLoadingFile + ' :: ' + file.error);
|
387 |
+
}
|
388 |
+
if (file.error) {
|
389 |
+
jQuery("#uploaded_files ul").prepend(jQuery("<li class=uploaded_item_failed>" + "<?php echo 'Upload failed' ?> :: " + file.error + "</li>"));
|
390 |
+
}
|
391 |
+
else {
|
392 |
+
jQuery("#uploaded_files ul").prepend(jQuery("<li class=uploaded_item>" + file.name + " (<?php echo 'Uploaded' ?>)" + "</li>"));
|
393 |
+
}
|
394 |
+
});
|
395 |
+
}
|
396 |
+
});
|
397 |
+
jQuery(window).load(function () {
|
398 |
+
jQuery("#opacity_div").hide();
|
399 |
+
jQuery("#loading_div").hide();
|
400 |
+
})
|
401 |
+
</script>
|
402 |
+
</div>
|
403 |
+
</label>
|
404 |
+
<div id="uploaded_files">
|
405 |
+
<ul></ul>
|
406 |
+
</div>
|
407 |
+
<div id="uploader_progress">
|
408 |
+
<div id="uploader_progress_bar">
|
409 |
+
<div></div>
|
410 |
+
</div>
|
411 |
+
<span id="uploader_progress_text" class="uploader_text">
|
412 |
+
<?php echo 'No files to upload'; ?>
|
413 |
+
</span>
|
414 |
+
</div>
|
415 |
+
</div>
|
416 |
+
</div>
|
417 |
+
|
418 |
+
<input type="hidden" name="task" value="">
|
419 |
+
<input type="hidden" name="extensions" value="<?php echo (isset($_REQUEST['extensions']) ? esc_html($_REQUEST['extensions']) : '*'); ?>">
|
420 |
+
<input type="hidden" name="callback" value="<?php echo (isset($_REQUEST['callback']) ? esc_html($_REQUEST['callback']) : ''); ?>">
|
421 |
+
<input type="hidden" name="image_for" value="<?php echo (isset($_REQUEST['image_for']) ? esc_html($_REQUEST['image_for']) : ''); ?>">
|
422 |
+
<input type="hidden" name="slide_id" value="<?php echo (isset($_REQUEST['slide_id']) ? esc_html($_REQUEST['slide_id']) : ''); ?>">
|
423 |
+
<input type="hidden" name="sort_by" value="<?php echo $sort_by; ?>">
|
424 |
+
<input type="hidden" name="sort_order" value="<?php echo $sort_order; ?>">
|
425 |
+
<input type="hidden" name="items_view" value="<?php echo $items_view; ?>">
|
426 |
+
<input type="hidden" name="dir" value="<?php echo (isset($_REQUEST['dir']) ? esc_html($_REQUEST['dir']) : ''); ?>"/>
|
427 |
+
<input type="hidden" name="file_names" value=""/>
|
428 |
+
<input type="hidden" name="file_namesML" value=""/>
|
429 |
+
<input type="hidden" name="file_new_name" value=""/>
|
430 |
+
<input type="hidden" name="new_dir_name" value=""/>
|
431 |
+
<input type="hidden" name="clipboard_task" value="<?php echo $clipboard_task; ?>"/>
|
432 |
+
<input type="hidden" name="clipboard_files" value="<?php echo $clipboard_files; ?>"/>
|
433 |
+
<input type="hidden" name="clipboard_src" value="<?php echo $clipboard_src; ?>"/>
|
434 |
+
<input type="hidden" name="clipboard_dest" value="<?php echo $clipboard_dest; ?>"/>
|
435 |
+
</form>
|
436 |
+
<?php
|
437 |
+
die();
|
438 |
+
}
|
439 |
+
|
440 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
441 |
+
// Getters & Setters //
|
442 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
443 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
444 |
+
// Private Methods //
|
445 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
446 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
447 |
+
// Listeners //
|
448 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
449 |
+
}
|
framework/WDW_S_Library.php
CHANGED
@@ -144,20 +144,55 @@ class WDW_S_Library {
|
|
144 |
break;
|
145 |
|
146 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
}
|
148 |
return '<div style="width:99%"><div class="' . $type . '"><p><strong>' . $message . '</strong></p></div></div>';
|
149 |
}
|
150 |
}
|
151 |
|
152 |
public static function message($message, $type) {
|
153 |
-
return '<div style="width: 99%"><div class="' . $type . '"><p><strong>' . $message . '</strong></p></div></div>';
|
154 |
}
|
155 |
|
156 |
public static function search($search_by, $search_value, $form_id) {
|
157 |
?>
|
158 |
<div class="alignleft actions" style="clear:both;">
|
159 |
<script>
|
160 |
-
function spider_search() {
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
document.getElementById("page_number").value = "1";
|
162 |
document.getElementById("search_or_not").value = "search";
|
163 |
document.getElementById("<?php echo $form_id; ?>").submit();
|
@@ -171,7 +206,13 @@ class WDW_S_Library {
|
|
171 |
</script>
|
172 |
<div class="alignleft actions" style="">
|
173 |
<label for="search_value" style="font-size:14px; width:50px; display:inline-block;"><?php echo $search_by; ?>:</label>
|
174 |
-
<input type="text"
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
</div>
|
176 |
<div class="alignleft actions">
|
177 |
<input type="button" value="Search" onclick="spider_search()" class="button-secondary action">
|
@@ -222,8 +263,8 @@ class WDW_S_Library {
|
|
222 |
}
|
223 |
?>
|
224 |
<script type="text/javascript">
|
225 |
-
|
226 |
-
|
227 |
switch (y) {
|
228 |
case 1:
|
229 |
if (x >= items_county) {
|
@@ -252,6 +293,19 @@ class WDW_S_Library {
|
|
252 |
}
|
253 |
document.getElementById('<?php echo $form_id; ?>').submit();
|
254 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
255 |
</script>
|
256 |
<div class="tablenav-pages">
|
257 |
<span class="displaying-num">
|
@@ -284,7 +338,10 @@ class WDW_S_Library {
|
|
284 |
<a class="<?php echo $first_page; ?>" title="Go to the first page" href="javascript:spider_page(<?php echo $page_number; ?>,-2);">«</a>
|
285 |
<a class="<?php echo $prev_page; ?>" title="Go to the previous page" href="javascript:spider_page(<?php echo $page_number; ?>,-1);">‹</a>
|
286 |
<span class="paging-input">
|
287 |
-
<span class="total-pages"
|
|
|
|
|
|
|
288 |
<?php echo $items_county; ?>
|
289 |
</span>
|
290 |
</span>
|
@@ -343,8 +400,8 @@ class WDW_S_Library {
|
|
343 |
}
|
344 |
?>
|
345 |
<script type="text/javascript">
|
|
|
346 |
function spider_page(x, y) {
|
347 |
-
var items_county = <?php echo $items_county; ?>;
|
348 |
switch (y) {
|
349 |
case 1:
|
350 |
if (x >= items_county) {
|
@@ -373,6 +430,20 @@ class WDW_S_Library {
|
|
373 |
}
|
374 |
spider_ajax_save('<?php echo $form_id; ?>');
|
375 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
376 |
</script>
|
377 |
<div id="tablenav-pages" class="tablenav-pages">
|
378 |
<span class="displaying-num">
|
@@ -405,7 +476,10 @@ class WDW_S_Library {
|
|
405 |
<a class="<?php echo $first_page; ?>" title="Go to the first page" onclick="spider_page(<?php echo $page_number; ?>,-2)">«</a>
|
406 |
<a class="<?php echo $prev_page; ?>" title="Go to the previous page" onclick="spider_page(<?php echo $page_number; ?>,-1)">‹</a>
|
407 |
<span class="paging-input">
|
408 |
-
<span class="total-pages"
|
|
|
|
|
|
|
409 |
<?php echo $items_county; ?>
|
410 |
</span>
|
411 |
</span>
|
144 |
break;
|
145 |
|
146 |
}
|
147 |
+
case 18: {
|
148 |
+
$message = 'You must set watermark type.';
|
149 |
+
$type = 'error';
|
150 |
+
break;
|
151 |
+
|
152 |
+
}
|
153 |
+
case 19: {
|
154 |
+
$message = 'Watermark Succesfully Set.';
|
155 |
+
$type = 'updated';
|
156 |
+
break;
|
157 |
+
|
158 |
+
}
|
159 |
+
case 20: {
|
160 |
+
$message = 'Watermark Succesfully Reset.';
|
161 |
+
$type = 'updated';
|
162 |
+
break;
|
163 |
+
|
164 |
+
}
|
165 |
+
case 21: {
|
166 |
+
$message = 'Settings Succesfully Reset.';
|
167 |
+
$type = 'updated';
|
168 |
+
break;
|
169 |
+
|
170 |
+
}
|
171 |
+
default: {
|
172 |
+
$message = '';
|
173 |
+
$type = 'error';
|
174 |
+
break;
|
175 |
+
}
|
176 |
}
|
177 |
return '<div style="width:99%"><div class="' . $type . '"><p><strong>' . $message . '</strong></p></div></div>';
|
178 |
}
|
179 |
}
|
180 |
|
181 |
public static function message($message, $type) {
|
182 |
+
return '<div style="width: 99%" class="spider_message"><div class="' . $type . '"><p><strong>' . $message . '</strong></p></div></div>';
|
183 |
}
|
184 |
|
185 |
public static function search($search_by, $search_value, $form_id) {
|
186 |
?>
|
187 |
<div class="alignleft actions" style="clear:both;">
|
188 |
<script>
|
189 |
+
function spider_search(event) {
|
190 |
+
if (typeof event != 'undefined') {
|
191 |
+
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
|
192 |
+
if (keyCode != 13) {
|
193 |
+
return false;
|
194 |
+
}
|
195 |
+
}
|
196 |
document.getElementById("page_number").value = "1";
|
197 |
document.getElementById("search_or_not").value = "search";
|
198 |
document.getElementById("<?php echo $form_id; ?>").submit();
|
206 |
</script>
|
207 |
<div class="alignleft actions" style="">
|
208 |
<label for="search_value" style="font-size:14px; width:50px; display:inline-block;"><?php echo $search_by; ?>:</label>
|
209 |
+
<input type="text"
|
210 |
+
id="search_value"
|
211 |
+
name="search_value"
|
212 |
+
class="spider_search_value"
|
213 |
+
value="<?php echo esc_html($search_value); ?>"
|
214 |
+
style="width: 150px;<?php echo (get_bloginfo('version') > '3.7') ? ' height: 28px;' : ''; ?>"
|
215 |
+
onkeypress="spider_search(event)" />
|
216 |
</div>
|
217 |
<div class="alignleft actions">
|
218 |
<input type="button" value="Search" onclick="spider_search()" class="button-secondary action">
|
263 |
}
|
264 |
?>
|
265 |
<script type="text/javascript">
|
266 |
+
var items_county = <?php echo $items_county; ?>;
|
267 |
+
function spider_page(x, y) {
|
268 |
switch (y) {
|
269 |
case 1:
|
270 |
if (x >= items_county) {
|
293 |
}
|
294 |
document.getElementById('<?php echo $form_id; ?>').submit();
|
295 |
}
|
296 |
+
function check_enter_key(e) {
|
297 |
+
var key_code = (e.keyCode ? e.keyCode : e.which);
|
298 |
+
if (key_code == 13) { /*Enter keycode*/
|
299 |
+
if (jQuery('#current_page').val() >= items_county) {
|
300 |
+
document.getElementById('page_number').value = items_county;
|
301 |
+
}
|
302 |
+
else {
|
303 |
+
document.getElementById('page_number').value = jQuery('#current_page').val();
|
304 |
+
}
|
305 |
+
return true;
|
306 |
+
}
|
307 |
+
return true;
|
308 |
+
}
|
309 |
</script>
|
310 |
<div class="tablenav-pages">
|
311 |
<span class="displaying-num">
|
338 |
<a class="<?php echo $first_page; ?>" title="Go to the first page" href="javascript:spider_page(<?php echo $page_number; ?>,-2);">«</a>
|
339 |
<a class="<?php echo $prev_page; ?>" title="Go to the previous page" href="javascript:spider_page(<?php echo $page_number; ?>,-1);">‹</a>
|
340 |
<span class="paging-input">
|
341 |
+
<span class="total-pages">
|
342 |
+
<input class="current_page" id="current_page" name="current_page" value="<?php echo $page_number; ?>" onkeypress="return check_enter_key(event)" title="Go to the page" type="text" size="1" />
|
343 |
+
</span> of
|
344 |
+
<span class="total-pages">
|
345 |
<?php echo $items_county; ?>
|
346 |
</span>
|
347 |
</span>
|
400 |
}
|
401 |
?>
|
402 |
<script type="text/javascript">
|
403 |
+
var items_county = <?php echo $items_county; ?>;
|
404 |
function spider_page(x, y) {
|
|
|
405 |
switch (y) {
|
406 |
case 1:
|
407 |
if (x >= items_county) {
|
430 |
}
|
431 |
spider_ajax_save('<?php echo $form_id; ?>');
|
432 |
}
|
433 |
+
function check_enter_key(e) {
|
434 |
+
var key_code = (e.keyCode ? e.keyCode : e.which);
|
435 |
+
if (key_code == 13) { /*Enter keycode*/
|
436 |
+
if (jQuery('#current_page').val() >= items_county) {
|
437 |
+
document.getElementById('page_number').value = items_county;
|
438 |
+
}
|
439 |
+
else {
|
440 |
+
document.getElementById('page_number').value = jQuery('#current_page').val();
|
441 |
+
}
|
442 |
+
spider_ajax_save('<?php echo $form_id; ?>');
|
443 |
+
return false;
|
444 |
+
}
|
445 |
+
return true;
|
446 |
+
}
|
447 |
</script>
|
448 |
<div id="tablenav-pages" class="tablenav-pages">
|
449 |
<span class="displaying-num">
|
476 |
<a class="<?php echo $first_page; ?>" title="Go to the first page" onclick="spider_page(<?php echo $page_number; ?>,-2)">«</a>
|
477 |
<a class="<?php echo $prev_page; ?>" title="Go to the previous page" onclick="spider_page(<?php echo $page_number; ?>,-1)">‹</a>
|
478 |
<span class="paging-input">
|
479 |
+
<span class="total-pages">
|
480 |
+
<input class="current_page" id="current_page" name="current_page" value="<?php echo $page_number; ?>" onkeypress="return check_enter_key(event)" title="Go to the page" type="text" size="1" />
|
481 |
+
</span> of
|
482 |
+
<span class="total-pages">
|
483 |
<?php echo $items_county; ?>
|
484 |
</span>
|
485 |
</span>
|
frontend/views/WDSViewSlider.php
CHANGED
@@ -64,7 +64,14 @@ class WDSViewSlider {
|
|
64 |
else {
|
65 |
$autoplay = FALSE;
|
66 |
}
|
67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
$enable_slideshow_music = $slider_row->music;
|
69 |
$slideshow_music_url = $slider_row->music_url;
|
70 |
|
@@ -105,7 +112,7 @@ class WDSViewSlider {
|
|
105 |
<style>
|
106 |
#wds_container1_<?php echo $wds; ?> #wds_container2_<?php echo $wds; ?> {
|
107 |
text-align: <?php echo $slider_row->align; ?>;
|
108 |
-
margin: <?php echo $slider_row->glb_margin; ?>px;
|
109 |
visibility: hidden;
|
110 |
<?php echo $slider_row->full_width ? 'position: relative;' : ''; ?>
|
111 |
}
|
@@ -237,7 +244,8 @@ class WDSViewSlider {
|
|
237 |
left: <?php echo $navigation; ?>px;
|
238 |
}
|
239 |
#wds_container1_<?php echo $wds; ?> #wds_container2_<?php echo $wds; ?> #wds_slideshow_play_pause_<?php echo $wds; ?> {
|
240 |
-
opacity:
|
|
|
241 |
}
|
242 |
#wds_container1_<?php echo $wds; ?> #wds_container2_<?php echo $wds; ?> .wds_left-ico_<?php echo $wds; ?>:hover,
|
243 |
#wds_container1_<?php echo $wds; ?> #wds_container2_<?php echo $wds; ?> .wds_right-ico_<?php echo $wds; ?>:hover {
|
@@ -311,7 +319,7 @@ class WDSViewSlider {
|
|
311 |
position: absolute;
|
312 |
width: 100%;
|
313 |
<?php echo $bull_position; ?>: <?php echo ($bull_position == $filmstrip_position) ? $filmstrip_height : 0; ?>px;
|
314 |
-
z-index: 17
|
315 |
}
|
316 |
#wds_container1_<?php echo $wds; ?> #wds_container2_<?php echo $wds; ?> .wds_slideshow_dots_thumbnails_<?php echo $wds; ?> {
|
317 |
left: 0px;
|
@@ -421,30 +429,32 @@ class WDSViewSlider {
|
|
421 |
<div class="wds_slideshow_image_wrap_<?php echo $wds; ?>">
|
422 |
<?php
|
423 |
$current_pos = 0;
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
<?php
|
429 |
-
foreach ($slide_rows as $key => $slide_row) {
|
430 |
?>
|
431 |
-
|
432 |
-
|
433 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
434 |
<?php
|
435 |
-
|
|
|
436 |
?>
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
}
|
441 |
-
if ($slider_row->timer_bar_type != 'none') {
|
442 |
?>
|
443 |
-
<div class="wds_line_timer_container_<?php echo $wds; ?>"><div class="wds_line_timer_<?php echo $wds; ?>"></div></div>
|
444 |
-
<?php
|
445 |
-
}
|
446 |
-
?>
|
447 |
-
<div id="wds_slideshow_image_container_<?php echo $wds; ?>" class="wds_slideshow_image_container_<?php echo $wds; ?>">
|
448 |
<div class="wds_slide_container_<?php echo $wds; ?>">
|
449 |
<div class="wds_slide_bg_<?php echo $wds; ?>">
|
450 |
<div class="wds_slider_<?php echo $wds; ?>">
|
@@ -498,6 +508,7 @@ class WDSViewSlider {
|
|
498 |
<style>
|
499 |
#wds_container1_<?php echo $wds; ?> #wds_container2_<?php echo $wds; ?> #<?php echo $prefix; ?> {
|
500 |
font-size: <?php echo $layer->size; ?>px;
|
|
|
501 |
padding: <?php echo $layer->padding; ?>;
|
502 |
}
|
503 |
#wds_container1_<?php echo $wds; ?> #wds_container2_<?php echo $wds; ?> .wds_layer_<?php echo $layer->id; ?>{
|
@@ -506,7 +517,7 @@ class WDSViewSlider {
|
|
506 |
}
|
507 |
</style>
|
508 |
<span class="wds_layer_<?php echo $layer->id; ?>" id="<?php echo $prefix; ?>" wds_fsize="<?php echo $layer->size; ?>"
|
509 |
-
style="<?php echo $layer->image_width ? 'width: ' . $layer->image_width . '%; ' : ''; ?><?php echo $layer->image_height ? 'height: ' . $layer->image_height . '%; ' : ''; ?>word-break: <?php echo ($layer->image_scale ? 'keep-all' : 'break-all'); ?>; text-align: initial; <?php echo $layer->link ? '
|
510 |
onclick="<?php echo $layer->link ? 'window.open(\'' . $layer->link . '\');' : ''; ?>event.stopPropagation();"><?php echo str_replace(array("\r\n", "\r", "\n"), "<br>", $layer->text); ?></span>
|
511 |
<?php
|
512 |
break;
|
@@ -514,18 +525,13 @@ class WDSViewSlider {
|
|
514 |
case 'image': {
|
515 |
?>
|
516 |
<style>
|
517 |
-
#wds_container1_<?php echo $wds; ?> #wds_container2_<?php echo $wds; ?> #<?php echo $prefix; ?> {
|
518 |
-
max-width: <?php echo $layer->image_width; ?>px;
|
519 |
-
max-height: <?php echo $layer->image_height; ?>px;
|
520 |
-
<?php echo ($layer->image_scale != 'on') ? 'width: ' . $layer->image_width . 'px; height: ' . $layer->image_height . 'px;' : ''; ?>
|
521 |
-
}
|
522 |
#wds_container1_<?php echo $wds; ?> #wds_container2_<?php echo $wds; ?> .wds_layer_<?php echo $layer->id; ?>{
|
523 |
opacity: <?php echo ($layer->layer_effect_in != 'none') ? '0 !important' : '1'; ?>;
|
524 |
filter: "Alpha(opacity=<?php echo ($layer->layer_effect_in != 'none') ? '0' : '100'; ?>)" !important;
|
525 |
}
|
526 |
</style>
|
527 |
<img class="wds_layer_<?php echo $layer->id; ?>" id="<?php echo $prefix; ?>" src="<?php echo $layer->image_url; ?>"
|
528 |
-
style="<?php echo $layer->link ? '
|
529 |
onclick="<?php echo $layer->link ? 'window.open(\'' . $layer->link . '\');' : ''; ?>event.stopPropagation();"
|
530 |
wds_scale="<?php echo $layer->image_scale; ?>"
|
531 |
wds_image_width="<?php echo $layer->image_width; ?>"
|
@@ -790,10 +796,12 @@ class WDSViewSlider {
|
|
790 |
cur_img.css('opacity', 1);
|
791 |
grid.remove();
|
792 |
wds_trans_in_progress_<?php echo $wds; ?> = false;
|
793 |
-
if (typeof wds_event_stack_<?php echo $wds; ?> !== 'undefined'
|
794 |
-
|
795 |
-
|
796 |
-
|
|
|
|
|
797 |
}
|
798 |
}
|
799 |
}
|
@@ -863,16 +871,15 @@ class WDSViewSlider {
|
|
863 |
<?php
|
864 |
}
|
865 |
?>
|
866 |
-
jQuery(".wds_line_timer_<?php echo $wds; ?>").finish();
|
867 |
/* Pause videos.*/
|
868 |
jQuery("#wds_slideshow_image_container_<?php echo $wds; ?>").find("iframe").each(function () {
|
869 |
jQuery(this)[0].contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
|
870 |
jQuery(this)[0].contentWindow.postMessage('{ "method": "pause" }', "*");
|
871 |
});
|
872 |
if (wds_data_<?php echo $wds; ?>[key]) {
|
873 |
-
if (jQuery('.wds_ctrl_btn_<?php echo $wds; ?>').hasClass('fa-pause') || ('<?php echo $autoplay; ?>')) {
|
874 |
play_<?php echo $wds; ?>();
|
875 |
-
}
|
876 |
if (!from_effect) {
|
877 |
/* Change image key.*/
|
878 |
jQuery("#wds_current_image_key_<?php echo $wds; ?>").val(key);
|
@@ -894,8 +901,6 @@ class WDSViewSlider {
|
|
894 |
else if (wds_current_key_<?php echo $wds; ?> == key) {
|
895 |
return;
|
896 |
}
|
897 |
-
jQuery(".wds_slideshow_title_text_<?php echo $wds; ?>").css({display: 'none'});
|
898 |
-
jQuery(".wds_slideshow_description_text_<?php echo $wds; ?>").css({display: 'none'});
|
899 |
/* Set active thumbnail position.*/
|
900 |
wds_current_filmstrip_pos_<?php echo $wds; ?> = key * (jQuery(".wds_slideshow_filmstrip_thumbnail_<?php echo $wds; ?>").<?php echo $width_or_height; ?>() + 2 + 2 * 0);
|
901 |
wds_current_key_<?php echo $wds; ?> = key;
|
@@ -947,13 +952,15 @@ class WDSViewSlider {
|
|
947 |
/* Effects out part.*/
|
948 |
function set_layer_effect_out(i) {
|
949 |
wds_clear_layers_effects_out_<?php echo $wds; ?>[key][i] = setTimeout(function() {
|
950 |
-
if (wds_data_<?php echo $wds; ?>[key]["layer_" + i + "
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
|
|
|
|
957 |
}
|
958 |
}, wds_data_<?php echo $wds; ?>[key]["layer_" + i + "_end"]);
|
959 |
}
|
@@ -979,8 +986,24 @@ class WDSViewSlider {
|
|
979 |
set_layer_effect_out(i);
|
980 |
}
|
981 |
setTimeout(function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
982 |
wds_<?php echo $slideshow_effect; ?>_<?php echo $wds; ?>(current_image_class, next_image_class, direction);
|
983 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
984 |
if ($bull_position != 'none' && $slides_count > 1) {
|
985 |
?>
|
986 |
wds_move_dots_<?php echo $wds; ?>();
|
@@ -1009,9 +1032,9 @@ class WDSViewSlider {
|
|
1009 |
if ($slider_row->full_width) {
|
1010 |
?>
|
1011 |
ratio = jQuery(window).width() / slide_orig_width;
|
1012 |
-
slide_orig_width = jQuery(window).width();
|
1013 |
slide_orig_height = <?php echo $image_height; ?> * slide_orig_width / <?php echo $image_width; ?>;
|
1014 |
-
slide_width = jQuery(window).width();
|
1015 |
wds_full_width_<?php echo $wds; ?>();
|
1016 |
<?php
|
1017 |
}
|
@@ -1026,21 +1049,48 @@ class WDSViewSlider {
|
|
1026 |
jQuery(".wds_slideshow_image_<?php echo $wds; ?>").height(slide_height);
|
1027 |
jQuery(".wds_slideshow_video_<?php echo $wds; ?>").height(slide_height);
|
1028 |
jQuery(".wds_slideshow_image_<?php echo $wds; ?> img").each(function () {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1029 |
jQuery(this).css({
|
1030 |
-
maxWidth: (parseFloat(
|
1031 |
-
maxHeight: (parseFloat(
|
1032 |
});
|
1033 |
if (jQuery(this).attr("wds_scale") != "on") {
|
1034 |
jQuery(this).css({
|
1035 |
-
width: (parseFloat(
|
1036 |
-
height: (parseFloat(
|
1037 |
});
|
1038 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1039 |
});
|
1040 |
jQuery(".wds_slideshow_image_<?php echo $wds; ?> span, .wds_slideshow_image_<?php echo $wds; ?> i").each(function () {
|
1041 |
jQuery(this).css({
|
1042 |
fontSize: (parseFloat(jQuery(this).attr("wds_fsize")) * ratio) + "px",
|
1043 |
-
lineHeight:
|
1044 |
paddingLeft: (parseFloat(jQuery(this).css("paddingLeft")) * ratio) + "px",
|
1045 |
paddingRight: (parseFloat(jQuery(this).css("paddingRight")) * ratio) + "px",
|
1046 |
paddingTop: (parseFloat(jQuery(this).css("paddingTop")) * ratio) + "px",
|
@@ -1070,8 +1120,8 @@ class WDSViewSlider {
|
|
1070 |
function wds_full_width_<?php echo $wds; ?>() {
|
1071 |
var left = jQuery("#wds_container1_<?php echo $wds; ?>").offset().left;
|
1072 |
jQuery(".wds_slideshow_image_wrap_<?php echo $wds; ?>").css({
|
1073 |
-
left: -left + "px",
|
1074 |
-
width: jQuery(window).width() + "px",
|
1075 |
maxWidth: "none"
|
1076 |
});
|
1077 |
}
|
@@ -1107,73 +1157,27 @@ class WDSViewSlider {
|
|
1107 |
<?php
|
1108 |
}
|
1109 |
?>
|
1110 |
-
if (typeof jQuery().swiperight !== 'undefined'
|
1111 |
-
jQuery(
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
|
|
|
|
1115 |
}
|
1116 |
-
if (typeof jQuery().swipeleft !== 'undefined'
|
1117 |
-
jQuery(
|
1118 |
-
|
1119 |
-
|
1120 |
-
|
|
|
|
|
1121 |
}
|
1122 |
|
1123 |
var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
|
1124 |
var wds_click = isMobile ? 'touchend' : 'click';
|
1125 |
|
1126 |
var mousewheelevt = (/Firefox/i.test(navigator.userAgent)) ? "DOMMouseScroll" : "mousewheel"; /* FF doesn't recognize mousewheel as of FF3.x */
|
1127 |
-
jQuery('.wds_slideshow_filmstrip_<?php echo $wds; ?>').bind(mousewheelevt, function(e) {
|
1128 |
-
var evt = window.event || e; /* Equalize event object.*/
|
1129 |
-
evt = evt.originalEvent ? evt.originalEvent : evt; /* Convert to originalEvent if possible.*/
|
1130 |
-
var delta = evt.detail ? evt.detail*(-40) : evt.wheelDelta; /* Check for detail first, because it is used by Opera and FF.*/
|
1131 |
-
if (delta > 0) {
|
1132 |
-
/* Scroll up.*/
|
1133 |
-
jQuery(".wds_slideshow_filmstrip_left_<?php echo $wds; ?>").trigger("click");
|
1134 |
-
}
|
1135 |
-
else {
|
1136 |
-
/* Scroll down.*/
|
1137 |
-
jQuery(".wds_slideshow_filmstrip_right_<?php echo $wds; ?>").trigger("click");
|
1138 |
-
}
|
1139 |
-
return false;
|
1140 |
-
});
|
1141 |
-
jQuery(".wds_slideshow_filmstrip_right_<?php echo $wds; ?>").on(wds_click, function () {
|
1142 |
-
jQuery( ".wds_slideshow_filmstrip_thumbnails_<?php echo $wds; ?>" ).stop(true, false);
|
1143 |
-
if (jQuery(".wds_slideshow_filmstrip_thumbnails_<?php echo $wds; ?>").position().<?php echo $left_or_top; ?> >= -(jQuery(".wds_slideshow_filmstrip_thumbnails_<?php echo $wds; ?>").<?php echo $width_or_height; ?>() - jQuery(".wds_slideshow_filmstrip_<?php echo $wds; ?>").<?php echo $width_or_height; ?>())) {
|
1144 |
-
jQuery(".wds_slideshow_filmstrip_left_<?php echo $wds; ?>").css({opacity: 1, filter: "Alpha(opacity=100)"});
|
1145 |
-
if (jQuery(".wds_slideshow_filmstrip_thumbnails_<?php echo $wds; ?>").position().<?php echo $left_or_top; ?> < -(jQuery(".wds_slideshow_filmstrip_thumbnails_<?php echo $wds; ?>").<?php echo $width_or_height; ?>() - jQuery(".wds_slideshow_filmstrip_<?php echo $wds; ?>").<?php echo $width_or_height; ?>() - <?php echo $filmstrip_thumb_margin_hor + $filmstrip_width; ?>)) {
|
1146 |
-
jQuery(".wds_slideshow_filmstrip_thumbnails_<?php echo $wds; ?>").animate({<?php echo $left_or_top; ?>: -(jQuery(".wds_slideshow_filmstrip_thumbnails_<?php echo $wds; ?>").<?php echo $width_or_height; ?>() - jQuery(".wds_slideshow_filmstrip_<?php echo $wds; ?>").<?php echo $width_or_height; ?>())}, 500, 'linear');
|
1147 |
-
}
|
1148 |
-
else {
|
1149 |
-
jQuery(".wds_slideshow_filmstrip_thumbnails_<?php echo $wds; ?>").animate({<?php echo $left_or_top; ?>: (jQuery(".wds_slideshow_filmstrip_thumbnails_<?php echo $wds; ?>").position().<?php echo $left_or_top; ?> - <?php echo $filmstrip_thumb_margin_hor + $filmstrip_width; ?>)}, 500, 'linear');
|
1150 |
-
}
|
1151 |
-
}
|
1152 |
-
/* Disable right arrow.*/
|
1153 |
-
window.setTimeout(function() {
|
1154 |
-
if (jQuery(".wds_slideshow_filmstrip_thumbnails_<?php echo $wds; ?>").position().<?php echo $left_or_top; ?> == -(jQuery(".wds_slideshow_filmstrip_thumbnails_<?php echo $wds; ?>").<?php echo $width_or_height; ?>() - jQuery(".wds_slideshow_filmstrip_<?php echo $wds; ?>").<?php echo $width_or_height; ?>())) {
|
1155 |
-
jQuery(".wds_slideshow_filmstrip_right_<?php echo $wds; ?>").css({opacity: 0.3, filter: "Alpha(opacity=30)"});
|
1156 |
-
}
|
1157 |
-
}, 500);
|
1158 |
-
});
|
1159 |
-
jQuery(".wds_slideshow_filmstrip_left_<?php echo $wds; ?>").on(wds_click, function () {
|
1160 |
-
jQuery( ".wds_slideshow_filmstrip_thumbnails_<?php echo $wds; ?>" ).stop(true, false);
|
1161 |
-
if (jQuery(".wds_slideshow_filmstrip_thumbnails_<?php echo $wds; ?>").position().<?php echo $left_or_top; ?> < 0) {
|
1162 |
-
jQuery(".wds_slideshow_filmstrip_right_<?php echo $wds; ?>").css({opacity: 1, filter: "Alpha(opacity=100)"});
|
1163 |
-
if (jQuery(".wds_slideshow_filmstrip_thumbnails_<?php echo $wds; ?>").position().<?php echo $left_or_top; ?> > - <?php echo $filmstrip_thumb_margin_hor + $filmstrip_width; ?>) {
|
1164 |
-
jQuery(".wds_slideshow_filmstrip_thumbnails_<?php echo $wds; ?>").animate({<?php echo $left_or_top; ?>: 0}, 500, 'linear');
|
1165 |
-
}
|
1166 |
-
else {
|
1167 |
-
jQuery(".wds_slideshow_filmstrip_thumbnails_<?php echo $wds; ?>").animate({<?php echo $left_or_top; ?>: (jQuery(".wds_slideshow_filmstrip_thumbnails_<?php echo $wds; ?>").position().<?php echo $left_or_top; ?> + <?php echo $filmstrip_thumb_margin_hor + $filmstrip_width; ?>)}, 500, 'linear');
|
1168 |
-
}
|
1169 |
-
}
|
1170 |
-
/* Disable left arrow.*/
|
1171 |
-
window.setTimeout(function(){
|
1172 |
-
if (jQuery(".wds_slideshow_filmstrip_thumbnails_<?php echo $wds; ?>").position().<?php echo $left_or_top; ?> == 0) {
|
1173 |
-
jQuery(".wds_slideshow_filmstrip_left_<?php echo $wds; ?>").css({opacity: 0.3, filter: "Alpha(opacity=30)"});
|
1174 |
-
}
|
1175 |
-
}, 500);
|
1176 |
-
});
|
1177 |
/* Play/pause.*/
|
1178 |
jQuery("#wds_slideshow_play_pause_<?php echo $wds; ?>").on(wds_click, function () {
|
1179 |
if (jQuery(".wds_ctrl_btn_<?php echo $wds; ?>").hasClass("fa-play")) {
|
@@ -1192,7 +1196,11 @@ class WDSViewSlider {
|
|
1192 |
if (<?php echo $enable_slideshow_music ?>) {
|
1193 |
document.getElementById("wds_audio_<?php echo $wds; ?>").pause();
|
1194 |
}
|
1195 |
-
jQuery(
|
|
|
|
|
|
|
|
|
1196 |
}
|
1197 |
});
|
1198 |
if (<?php echo $enable_slideshow_autoplay; ?>) {
|
@@ -1240,26 +1248,31 @@ class WDSViewSlider {
|
|
1240 |
/* Effects out part.*/
|
1241 |
function set_layer_effect_out_onload_<?php echo $wds; ?>(i) {
|
1242 |
wds_clear_layers_effects_out_<?php echo $wds; ?>[0][i] = setTimeout(function() {
|
1243 |
-
if (wds_data_<?php echo $wds; ?>[0]["layer_" + i + "
|
1244 |
-
|
1245 |
-
|
1246 |
-
|
1247 |
-
|
1248 |
-
|
1249 |
-
|
|
|
|
|
1250 |
}
|
1251 |
}, wds_data_<?php echo $wds; ?>[0]["layer_" + i + "_end"]);
|
1252 |
}
|
1253 |
function play_<?php echo $wds; ?>() {
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
|
|
|
|
|
|
1263 |
window.clearInterval(wds_playInterval_<?php echo $wds; ?>);
|
1264 |
/* Play.*/
|
1265 |
wds_playInterval_<?php echo $wds; ?> = setInterval(function () {
|
@@ -1271,8 +1284,10 @@ class WDSViewSlider {
|
|
1271 |
}, '<?php echo $slideshow_interval * 1000; ?>');
|
1272 |
}
|
1273 |
jQuery(window).focus(function() {
|
1274 |
-
if (jQuery(".wds_ctrl_btn_<?php echo $wds; ?>").hasClass("fa-
|
1275 |
-
|
|
|
|
|
1276 |
}
|
1277 |
var i_<?php echo $wds; ?> = 0;
|
1278 |
jQuery(".wds_slider_<?php echo $wds; ?>").children("span").each(function () {
|
@@ -1285,7 +1300,11 @@ class WDSViewSlider {
|
|
1285 |
jQuery(window).blur(function() {
|
1286 |
wds_event_stack_<?php echo $wds; ?> = [];
|
1287 |
window.clearInterval(wds_playInterval_<?php echo $wds; ?>);
|
1288 |
-
jQuery(
|
|
|
|
|
|
|
|
|
1289 |
});
|
1290 |
</script>
|
1291 |
<?php
|
64 |
else {
|
65 |
$autoplay = FALSE;
|
66 |
}
|
67 |
+
if ($slider_row->navigation == 'always') {
|
68 |
+
$navigation = 0;
|
69 |
+
$pp_btn_opacity = 1;
|
70 |
+
}
|
71 |
+
else {
|
72 |
+
$navigation = 4000;
|
73 |
+
$pp_btn_opacity = 0;
|
74 |
+
}
|
75 |
$enable_slideshow_music = $slider_row->music;
|
76 |
$slideshow_music_url = $slider_row->music_url;
|
77 |
|
112 |
<style>
|
113 |
#wds_container1_<?php echo $wds; ?> #wds_container2_<?php echo $wds; ?> {
|
114 |
text-align: <?php echo $slider_row->align; ?>;
|
115 |
+
margin: <?php echo $slider_row->glb_margin; ?>px <?php echo $slider_row->full_width ? 0 : ''; ?>;
|
116 |
visibility: hidden;
|
117 |
<?php echo $slider_row->full_width ? 'position: relative;' : ''; ?>
|
118 |
}
|
244 |
left: <?php echo $navigation; ?>px;
|
245 |
}
|
246 |
#wds_container1_<?php echo $wds; ?> #wds_container2_<?php echo $wds; ?> #wds_slideshow_play_pause_<?php echo $wds; ?> {
|
247 |
+
opacity: <?php echo $pp_btn_opacity; ?>;
|
248 |
+
filter: "Alpha(opacity=<?php echo $pp_btn_opacity * 100; ?>)";
|
249 |
}
|
250 |
#wds_container1_<?php echo $wds; ?> #wds_container2_<?php echo $wds; ?> .wds_left-ico_<?php echo $wds; ?>:hover,
|
251 |
#wds_container1_<?php echo $wds; ?> #wds_container2_<?php echo $wds; ?> .wds_right-ico_<?php echo $wds; ?>:hover {
|
319 |
position: absolute;
|
320 |
width: 100%;
|
321 |
<?php echo $bull_position; ?>: <?php echo ($bull_position == $filmstrip_position) ? $filmstrip_height : 0; ?>px;
|
322 |
+
/*z-index: 17;*/
|
323 |
}
|
324 |
#wds_container1_<?php echo $wds; ?> #wds_container2_<?php echo $wds; ?> .wds_slideshow_dots_thumbnails_<?php echo $wds; ?> {
|
325 |
left: 0px;
|
429 |
<div class="wds_slideshow_image_wrap_<?php echo $wds; ?>">
|
430 |
<?php
|
431 |
$current_pos = 0;
|
432 |
+
?>
|
433 |
+
<div id="wds_slideshow_image_container_<?php echo $wds; ?>" class="wds_slideshow_image_container_<?php echo $wds; ?>">
|
434 |
+
<?php
|
435 |
+
if ($bull_position != 'none' && $slides_count > 1) {
|
|
|
|
|
436 |
?>
|
437 |
+
<div class="wds_slideshow_dots_container_<?php echo $wds; ?>">
|
438 |
+
<div class="wds_slideshow_dots_thumbnails_<?php echo $wds; ?>">
|
439 |
+
<?php
|
440 |
+
foreach ($slide_rows as $key => $slide_row) {
|
441 |
+
?>
|
442 |
+
<i id="wds_dots_<?php echo $key; ?>_<?php echo $wds; ?>"
|
443 |
+
class="wds_slideshow_dots_<?php echo $wds; ?> fa <?php echo (($slide_row->id == $current_image_id) ? $bull_style_active . ' wds_slideshow_dots_active_' . $wds : $bull_style_deactive . ' wds_slideshow_dots_deactive_' . $wds); ?>"
|
444 |
+
onclick="wds_change_image_<?php echo $wds; ?>(parseInt(jQuery('#wds_current_image_key_<?php echo $wds; ?>').val()), '<?php echo $key; ?>', wds_data_<?php echo $wds; ?>)" image_id="<?php echo $slide_row->id; ?>" image_key="<?php echo $key; ?>"></i>
|
445 |
+
<?php
|
446 |
+
}
|
447 |
+
?>
|
448 |
+
</div>
|
449 |
+
</div>
|
450 |
<?php
|
451 |
+
}
|
452 |
+
if ($slider_row->timer_bar_type != 'none') {
|
453 |
?>
|
454 |
+
<div class="wds_line_timer_container_<?php echo $wds; ?>"><div class="wds_line_timer_<?php echo $wds; ?>"></div></div>
|
455 |
+
<?php
|
456 |
+
}
|
|
|
|
|
457 |
?>
|
|
|
|
|
|
|
|
|
|
|
458 |
<div class="wds_slide_container_<?php echo $wds; ?>">
|
459 |
<div class="wds_slide_bg_<?php echo $wds; ?>">
|
460 |
<div class="wds_slider_<?php echo $wds; ?>">
|
508 |
<style>
|
509 |
#wds_container1_<?php echo $wds; ?> #wds_container2_<?php echo $wds; ?> #<?php echo $prefix; ?> {
|
510 |
font-size: <?php echo $layer->size; ?>px;
|
511 |
+
line-height: 1.25em;
|
512 |
padding: <?php echo $layer->padding; ?>;
|
513 |
}
|
514 |
#wds_container1_<?php echo $wds; ?> #wds_container2_<?php echo $wds; ?> .wds_layer_<?php echo $layer->id; ?>{
|
517 |
}
|
518 |
</style>
|
519 |
<span class="wds_layer_<?php echo $layer->id; ?>" id="<?php echo $prefix; ?>" wds_fsize="<?php echo $layer->size; ?>"
|
520 |
+
style="<?php echo $layer->image_width ? 'width: ' . $layer->image_width . '%; ' : ''; ?><?php echo $layer->image_height ? 'height: ' . $layer->image_height . '%; ' : ''; ?>word-break: <?php echo ($layer->image_scale ? 'keep-all' : 'break-all'); ?>; text-align: initial; <?php echo $layer->link ? 'cursor: pointer; ' : ''; ?>opacity: 1; filter: 'Alpha(opacity=100)'; display: inline-block; position: absolute; left: <?php echo $left_percent; ?>%; top: <?php echo $top_percent; ?>%; z-index: <?php echo $layer->depth; ?>; color: #<?php echo $layer->color; ?>; font-family: <?php echo $layer->ffamily; ?>; font-weight: <?php echo $layer->fweight; ?>; background-color: <?php echo WDW_S_Library::spider_hex2rgba($layer->fbgcolor, (100 - $layer->transparent) / 100); ?>; border: <?php echo $layer->border_width; ?>px <?php echo $layer->border_style; ?> #<?php echo $layer->border_color; ?>; border-radius: <?php echo $layer->border_radius; ?>; box-shadow: <?php echo $layer->shadow; ?>"
|
521 |
onclick="<?php echo $layer->link ? 'window.open(\'' . $layer->link . '\');' : ''; ?>event.stopPropagation();"><?php echo str_replace(array("\r\n", "\r", "\n"), "<br>", $layer->text); ?></span>
|
522 |
<?php
|
523 |
break;
|
525 |
case 'image': {
|
526 |
?>
|
527 |
<style>
|
|
|
|
|
|
|
|
|
|
|
528 |
#wds_container1_<?php echo $wds; ?> #wds_container2_<?php echo $wds; ?> .wds_layer_<?php echo $layer->id; ?>{
|
529 |
opacity: <?php echo ($layer->layer_effect_in != 'none') ? '0 !important' : '1'; ?>;
|
530 |
filter: "Alpha(opacity=<?php echo ($layer->layer_effect_in != 'none') ? '0' : '100'; ?>)" !important;
|
531 |
}
|
532 |
</style>
|
533 |
<img class="wds_layer_<?php echo $layer->id; ?>" id="<?php echo $prefix; ?>" src="<?php echo $layer->image_url; ?>"
|
534 |
+
style="<?php echo $layer->link ? 'cursor: pointer; ' : ''; ?>opacity: <?php echo number_format((100 - $layer->imgtransparent) / 100, 2, ".", ""); ?>; filter: Alpha(opacity=<?php echo 100 - $layer->imgtransparent; ?>); position: absolute; left: <?php echo $left_percent; ?>%; top: <?php echo $top_percent; ?>%; z-index: <?php echo $layer->depth; ?>; border: <?php echo $layer->border_width; ?>px <?php echo $layer->border_style; ?> #<?php echo $layer->border_color; ?>; border-radius: <?php echo $layer->border_radius; ?>; box-shadow: <?php echo $layer->shadow; ?>"
|
535 |
onclick="<?php echo $layer->link ? 'window.open(\'' . $layer->link . '\');' : ''; ?>event.stopPropagation();"
|
536 |
wds_scale="<?php echo $layer->image_scale; ?>"
|
537 |
wds_image_width="<?php echo $layer->image_width; ?>"
|
796 |
cur_img.css('opacity', 1);
|
797 |
grid.remove();
|
798 |
wds_trans_in_progress_<?php echo $wds; ?> = false;
|
799 |
+
if (typeof wds_event_stack_<?php echo $wds; ?> !== 'undefined') {
|
800 |
+
if (wds_event_stack_<?php echo $wds; ?>.length > 0) {
|
801 |
+
key = wds_event_stack_<?php echo $wds; ?>[0].split("-");
|
802 |
+
wds_event_stack_<?php echo $wds; ?>.shift();
|
803 |
+
wds_change_image_<?php echo $wds; ?>(key[0], key[1], wds_data_<?php echo $wds; ?>, true);
|
804 |
+
}
|
805 |
}
|
806 |
}
|
807 |
}
|
871 |
<?php
|
872 |
}
|
873 |
?>
|
|
|
874 |
/* Pause videos.*/
|
875 |
jQuery("#wds_slideshow_image_container_<?php echo $wds; ?>").find("iframe").each(function () {
|
876 |
jQuery(this)[0].contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
|
877 |
jQuery(this)[0].contentWindow.postMessage('{ "method": "pause" }', "*");
|
878 |
});
|
879 |
if (wds_data_<?php echo $wds; ?>[key]) {
|
880 |
+
/*if (jQuery('.wds_ctrl_btn_<?php echo $wds; ?>').hasClass('fa-pause') || ('<?php echo $autoplay; ?>')) {
|
881 |
play_<?php echo $wds; ?>();
|
882 |
+
}*/
|
883 |
if (!from_effect) {
|
884 |
/* Change image key.*/
|
885 |
jQuery("#wds_current_image_key_<?php echo $wds; ?>").val(key);
|
901 |
else if (wds_current_key_<?php echo $wds; ?> == key) {
|
902 |
return;
|
903 |
}
|
|
|
|
|
904 |
/* Set active thumbnail position.*/
|
905 |
wds_current_filmstrip_pos_<?php echo $wds; ?> = key * (jQuery(".wds_slideshow_filmstrip_thumbnail_<?php echo $wds; ?>").<?php echo $width_or_height; ?>() + 2 + 2 * 0);
|
906 |
wds_current_key_<?php echo $wds; ?> = key;
|
952 |
/* Effects out part.*/
|
953 |
function set_layer_effect_out(i) {
|
954 |
wds_clear_layers_effects_out_<?php echo $wds; ?>[key][i] = setTimeout(function() {
|
955 |
+
if (wds_data_<?php echo $wds; ?>[key]["layer_" + i + "_layer_effect_out"] != 'none') {
|
956 |
+
if (wds_data_<?php echo $wds; ?>[key]["layer_" + i + "_type"] != 'social') {
|
957 |
+
jQuery('#wds_<?php echo $wds; ?>_slide' + wds_data_<?php echo $wds; ?>[key]["id"] + '_layer' + wds_data_<?php echo $wds; ?>[key]["layer_" + i + "_id"]).css('-webkit-animation-duration' , wds_data_<?php echo $wds; ?>[key]["layer_" + i + "_duration_eff_out"] / 1000 + 's').css('animation-duration' , wds_data_<?php echo $wds; ?>[key]["layer_" + i + "_duration_eff_out"] / 1000 + 's');
|
958 |
+
jQuery('#wds_<?php echo $wds; ?>_slide' + wds_data_<?php echo $wds; ?>[key]["id"] + '_layer' + wds_data_<?php echo $wds; ?>[key]["layer_" + i + "_id"]).removeClass().addClass( wds_data_<?php echo $wds; ?>[key]["layer_" + i + "_layer_effect_out"] + ' animated');
|
959 |
+
}
|
960 |
+
else {
|
961 |
+
jQuery('#wds_<?php echo $wds; ?>_slide' + wds_data_<?php echo $wds; ?>[key]["id"] + '_layer' + wds_data_<?php echo $wds; ?>[key]["layer_" + i + "_id"]).css('-webkit-animation-duration' , wds_data_<?php echo $wds; ?>[key]["layer_" + i + "_duration_eff_out"] / 1000 + 's').css('animation-duration' , wds_data_<?php echo $wds; ?>[key]["layer_" + i + "_duration_eff_out"] / 1000 + 's');
|
962 |
+
jQuery('#wds_<?php echo $wds; ?>_slide' + wds_data_<?php echo $wds; ?>[key]["id"] + '_layer' + wds_data_<?php echo $wds; ?>[key]["layer_" + i + "_id"]).removeClass().addClass( wds_data_<?php echo $wds; ?>[key]["layer_" + i + "_layer_effect_out"] + ' fa fa-' + wds_data_<?php echo $wds; ?>[key]["layer_" + i + "_social_button"] + ' animated');
|
963 |
+
}
|
964 |
}
|
965 |
}, wds_data_<?php echo $wds; ?>[key]["layer_" + i + "_end"]);
|
966 |
}
|
986 |
set_layer_effect_out(i);
|
987 |
}
|
988 |
setTimeout(function() {
|
989 |
+
if (typeof jQuery().finish !== 'undefined') {
|
990 |
+
if (jQuery.isFunction(jQuery().finish)) {
|
991 |
+
jQuery(".wds_line_timer_<?php echo $wds; ?>").finish();
|
992 |
+
}
|
993 |
+
}
|
994 |
+
jQuery(".wds_line_timer_<?php echo $wds; ?>").css({width: 0});
|
995 |
wds_<?php echo $slideshow_effect; ?>_<?php echo $wds; ?>(current_image_class, next_image_class, direction);
|
996 |
<?php
|
997 |
+
if ($enable_slideshow_autoplay) {
|
998 |
+
?>
|
999 |
+
jQuery(".wds_line_timer_<?php echo $wds; ?>").animate({
|
1000 |
+
width: "100%"
|
1001 |
+
}, {
|
1002 |
+
duration: <?php echo $slideshow_interval * 1000; ?>,
|
1003 |
+
specialEasing: {width: "linear"}
|
1004 |
+
});
|
1005 |
+
<?php
|
1006 |
+
}
|
1007 |
if ($bull_position != 'none' && $slides_count > 1) {
|
1008 |
?>
|
1009 |
wds_move_dots_<?php echo $wds; ?>();
|
1032 |
if ($slider_row->full_width) {
|
1033 |
?>
|
1034 |
ratio = jQuery(window).width() / slide_orig_width;
|
1035 |
+
slide_orig_width = jQuery(window).width() - <?php echo 2 * $slider_row->glb_margin; ?>;
|
1036 |
slide_orig_height = <?php echo $image_height; ?> * slide_orig_width / <?php echo $image_width; ?>;
|
1037 |
+
slide_width = jQuery(window).width() - <?php echo 2 * $slider_row->glb_margin; ?>;
|
1038 |
wds_full_width_<?php echo $wds; ?>();
|
1039 |
<?php
|
1040 |
}
|
1049 |
jQuery(".wds_slideshow_image_<?php echo $wds; ?>").height(slide_height);
|
1050 |
jQuery(".wds_slideshow_video_<?php echo $wds; ?>").height(slide_height);
|
1051 |
jQuery(".wds_slideshow_image_<?php echo $wds; ?> img").each(function () {
|
1052 |
+
var wds_theImage = new Image();
|
1053 |
+
wds_theImage.src = jQuery(this).attr("src");
|
1054 |
+
var wds_origWidth = wds_theImage.width;
|
1055 |
+
var wds_origHeight = wds_theImage.height;
|
1056 |
+
var wds_imageWidth = jQuery(this).attr("wds_image_width");
|
1057 |
+
var wds_imageHeight = jQuery(this).attr("wds_image_height");
|
1058 |
+
var wds_width = wds_imageWidth;
|
1059 |
+
if (wds_origWidth <= wds_imageWidth) {
|
1060 |
+
wds_width = wds_origWidth;
|
1061 |
+
}
|
1062 |
+
var wds_height = wds_imageHeight;
|
1063 |
+
if (wds_origHeight <= wds_imageHeight) {
|
1064 |
+
wds_height = wds_origHeight;
|
1065 |
+
}
|
1066 |
jQuery(this).css({
|
1067 |
+
maxWidth: (parseFloat(wds_imageWidth) * ratio) + "px",
|
1068 |
+
maxHeight: (parseFloat(wds_imageHeight) * ratio) + "px",
|
1069 |
});
|
1070 |
if (jQuery(this).attr("wds_scale") != "on") {
|
1071 |
jQuery(this).css({
|
1072 |
+
width: (parseFloat(wds_imageWidth) * ratio) + "px",
|
1073 |
+
height: (parseFloat(wds_imageHeight) * ratio) + "px"
|
1074 |
});
|
1075 |
}
|
1076 |
+
else if (wds_origWidth <= wds_imageWidth || wds_origHeight <= wds_imageHeight) {
|
1077 |
+
if (wds_origWidth / wds_imageWidth > wds_origHeight / wds_imageHeight) {
|
1078 |
+
jQuery(this).css({
|
1079 |
+
width: (parseFloat(wds_imageWidth) * ratio) + "px"
|
1080 |
+
});
|
1081 |
+
}
|
1082 |
+
else {
|
1083 |
+
jQuery(this).css({
|
1084 |
+
height: (parseFloat(wds_imageHeight) * ratio) + "px"
|
1085 |
+
});
|
1086 |
+
}
|
1087 |
+
}
|
1088 |
+
|
1089 |
});
|
1090 |
jQuery(".wds_slideshow_image_<?php echo $wds; ?> span, .wds_slideshow_image_<?php echo $wds; ?> i").each(function () {
|
1091 |
jQuery(this).css({
|
1092 |
fontSize: (parseFloat(jQuery(this).attr("wds_fsize")) * ratio) + "px",
|
1093 |
+
lineHeight: "1.25em",
|
1094 |
paddingLeft: (parseFloat(jQuery(this).css("paddingLeft")) * ratio) + "px",
|
1095 |
paddingRight: (parseFloat(jQuery(this).css("paddingRight")) * ratio) + "px",
|
1096 |
paddingTop: (parseFloat(jQuery(this).css("paddingTop")) * ratio) + "px",
|
1120 |
function wds_full_width_<?php echo $wds; ?>() {
|
1121 |
var left = jQuery("#wds_container1_<?php echo $wds; ?>").offset().left;
|
1122 |
jQuery(".wds_slideshow_image_wrap_<?php echo $wds; ?>").css({
|
1123 |
+
left: (-left + <?php echo $slider_row->glb_margin; ?>) + "px",
|
1124 |
+
width: (jQuery(window).width() - <?php echo 2 * $slider_row->glb_margin; ?>) + "px",
|
1125 |
maxWidth: "none"
|
1126 |
});
|
1127 |
}
|
1157 |
<?php
|
1158 |
}
|
1159 |
?>
|
1160 |
+
if (typeof jQuery().swiperight !== 'undefined') {
|
1161 |
+
if (jQuery.isFunction(jQuery().swiperight)) {
|
1162 |
+
jQuery('#wds_container1_<?php echo $wds; ?>').swiperight(function () {
|
1163 |
+
wds_change_image_<?php echo $wds; ?>(parseInt(jQuery('#wds_current_image_key_<?php echo $wds; ?>').val()), (parseInt(jQuery('#wds_current_image_key_<?php echo $wds; ?>').val()) - iterator_<?php echo $wds; ?>()) >= 0 ? (parseInt(jQuery('#wds_current_image_key_<?php echo $wds; ?>').val()) - iterator_<?php echo $wds; ?>()) % wds_data_<?php echo $wds; ?>.length : wds_data_<?php echo $wds; ?>.length - 1, wds_data_<?php echo $wds; ?>);
|
1164 |
+
return false;
|
1165 |
+
});
|
1166 |
+
}
|
1167 |
}
|
1168 |
+
if (typeof jQuery().swipeleft !== 'undefined') {
|
1169 |
+
if (jQuery.isFunction(jQuery().swipeleft)) {
|
1170 |
+
jQuery('#wds_container1_<?php echo $wds; ?>').swipeleft(function () {
|
1171 |
+
wds_change_image_<?php echo $wds; ?>(parseInt(jQuery('#wds_current_image_key_<?php echo $wds; ?>').val()), (parseInt(jQuery('#wds_current_image_key_<?php echo $wds; ?>').val()) + iterator_<?php echo $wds; ?>()) % wds_data_<?php echo $wds; ?>.length, wds_data_<?php echo $wds; ?>);
|
1172 |
+
return false;
|
1173 |
+
});
|
1174 |
+
}
|
1175 |
}
|
1176 |
|
1177 |
var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
|
1178 |
var wds_click = isMobile ? 'touchend' : 'click';
|
1179 |
|
1180 |
var mousewheelevt = (/Firefox/i.test(navigator.userAgent)) ? "DOMMouseScroll" : "mousewheel"; /* FF doesn't recognize mousewheel as of FF3.x */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1181 |
/* Play/pause.*/
|
1182 |
jQuery("#wds_slideshow_play_pause_<?php echo $wds; ?>").on(wds_click, function () {
|
1183 |
if (jQuery(".wds_ctrl_btn_<?php echo $wds; ?>").hasClass("fa-play")) {
|
1196 |
if (<?php echo $enable_slideshow_music ?>) {
|
1197 |
document.getElementById("wds_audio_<?php echo $wds; ?>").pause();
|
1198 |
}
|
1199 |
+
if (typeof jQuery().stop !== 'undefined') {
|
1200 |
+
if (jQuery.isFunction(jQuery().stop)) {
|
1201 |
+
jQuery(".wds_line_timer_<?php echo $wds; ?>").stop();
|
1202 |
+
}
|
1203 |
+
}
|
1204 |
}
|
1205 |
});
|
1206 |
if (<?php echo $enable_slideshow_autoplay; ?>) {
|
1248 |
/* Effects out part.*/
|
1249 |
function set_layer_effect_out_onload_<?php echo $wds; ?>(i) {
|
1250 |
wds_clear_layers_effects_out_<?php echo $wds; ?>[0][i] = setTimeout(function() {
|
1251 |
+
if (wds_data_<?php echo $wds; ?>[0]["layer_" + i + "_layer_effect_out"] != 'none') {
|
1252 |
+
if (wds_data_<?php echo $wds; ?>[0]["layer_" + i + "_type"] != 'social') {
|
1253 |
+
jQuery('#wds_<?php echo $wds; ?>_slide' + wds_data_<?php echo $wds; ?>[0]["id"] + '_layer' + wds_data_<?php echo $wds; ?>[0]["layer_" + i + "_id"]).css('-webkit-animation-duration' , wds_data_<?php echo $wds; ?>[0]["layer_" + i + "_duration_eff_out"] / 1000 + 's').css('animation-duration' , wds_data_<?php echo $wds; ?>[0]["layer_" + i + "_duration_eff_out"] / 1000 + 's');
|
1254 |
+
jQuery('#wds_<?php echo $wds; ?>_slide' + wds_data_<?php echo $wds; ?>[0]["id"] + '_layer' + wds_data_<?php echo $wds; ?>[0]["layer_" + i + "_id"]).removeClass().addClass( wds_data_<?php echo $wds; ?>[0]["layer_" + i + "_layer_effect_out"] + ' animated');
|
1255 |
+
}
|
1256 |
+
else {
|
1257 |
+
jQuery('#wds_<?php echo $wds; ?>_slide' + wds_data_<?php echo $wds; ?>[0]["id"] + '_layer' + wds_data_<?php echo $wds; ?>[0]["layer_" + i + "_id"]).css('-webkit-animation-duration' , wds_data_<?php echo $wds; ?>[0]["layer_" + i + "_duration_eff_out"] / 1000 + 's').css('animation-duration' , wds_data_<?php echo $wds; ?>[0]["layer_" + i + "_duration_eff_out"] / 1000 + 's');
|
1258 |
+
jQuery('#wds_<?php echo $wds; ?>_slide' + wds_data_<?php echo $wds; ?>[0]["id"] + '_layer' + wds_data_<?php echo $wds; ?>[0]["layer_" + i + "_id"]).removeClass().addClass( wds_data_<?php echo $wds; ?>[0]["layer_" + i + "_layer_effect_out"] + ' fa fa-' + wds_data_<?php echo $wds; ?>[0]["layer_" + i + "_social_button"] + ' animated');
|
1259 |
+
}
|
1260 |
}
|
1261 |
}, wds_data_<?php echo $wds; ?>[0]["layer_" + i + "_end"]);
|
1262 |
}
|
1263 |
function play_<?php echo $wds; ?>() {
|
1264 |
+
<?php
|
1265 |
+
if ($enable_slideshow_autoplay) {
|
1266 |
+
?>
|
1267 |
+
jQuery(".wds_line_timer_<?php echo $wds; ?>").animate({
|
1268 |
+
width: "100%"
|
1269 |
+
}, {
|
1270 |
+
duration: <?php echo $slideshow_interval * 1000; ?>,
|
1271 |
+
specialEasing: {width: "linear"}
|
1272 |
+
});
|
1273 |
+
<?php
|
1274 |
+
}
|
1275 |
+
?>
|
1276 |
window.clearInterval(wds_playInterval_<?php echo $wds; ?>);
|
1277 |
/* Play.*/
|
1278 |
wds_playInterval_<?php echo $wds; ?> = setInterval(function () {
|
1284 |
}, '<?php echo $slideshow_interval * 1000; ?>');
|
1285 |
}
|
1286 |
jQuery(window).focus(function() {
|
1287 |
+
if (!jQuery(".wds_ctrl_btn_<?php echo $wds; ?>").hasClass("fa-play")) {
|
1288 |
+
if (<?php echo $enable_slideshow_autoplay; ?>) {
|
1289 |
+
play_<?php echo $wds; ?>();
|
1290 |
+
}
|
1291 |
}
|
1292 |
var i_<?php echo $wds; ?> = 0;
|
1293 |
jQuery(".wds_slider_<?php echo $wds; ?>").children("span").each(function () {
|
1300 |
jQuery(window).blur(function() {
|
1301 |
wds_event_stack_<?php echo $wds; ?> = [];
|
1302 |
window.clearInterval(wds_playInterval_<?php echo $wds; ?>);
|
1303 |
+
if (typeof jQuery().stop !== 'undefined') {
|
1304 |
+
if (jQuery.isFunction(jQuery().stop)) {
|
1305 |
+
jQuery(".wds_line_timer_<?php echo $wds; ?>").stop();
|
1306 |
+
}
|
1307 |
+
}
|
1308 |
});
|
1309 |
</script>
|
1310 |
<?php
|
images/wd_slider.png
CHANGED
Binary file
|
js/images/wds_edit_but.png
DELETED
Binary file
|
js/wds.js
CHANGED
@@ -1,3 +1,304 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
function spider_select_value(obj) {
|
2 |
obj.focus();
|
3 |
obj.select();
|
@@ -100,8 +401,6 @@ function wds_check_required(id, name) {
|
|
100 |
if (jQuery('#' + id).val() == '') {
|
101 |
alert(name + '* field is required.');
|
102 |
wds_change_tab(jQuery(".wds_tab_label[tab_type='slides']"), 'wds_slides_box');
|
103 |
-
/*wds_change_tab(jQuery(".wds_tab_label[tab_type='settings']"), 'wds_settings_box');
|
104 |
-
wds_change_nav(jQuery(".wds_nav_tabs li[tab_type='global']"), 'wds_nav_global_box');*/
|
105 |
jQuery('#' + id).attr('style', 'border-color: #FF0000;');
|
106 |
jQuery('#' + id).focus();
|
107 |
jQuery('html, body').animate({
|
@@ -557,6 +856,52 @@ function spider_media_uploader(id, e) {
|
|
557 |
custom_uploader.open();
|
558 |
}
|
559 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
560 |
function wds_change_sub_tab(that, box) {
|
561 |
jQuery("#sub_tab").val(jQuery(that).attr("tab_type"));
|
562 |
jQuery(".wds_tabs a").removeClass("wds_sub_active");
|
@@ -694,13 +1039,14 @@ function wds_duplicate_layer(type, id, layerID) {
|
|
694 |
"left: 0; top: 0; display: inline-block;" +
|
695 |
"color: #" + jQuery("#" + prefix + "_color").val() + "; " +
|
696 |
"font-size: " + jQuery("#" + prefix + "_size").val() + "px; " +
|
697 |
-
"line-height:
|
698 |
"font-family: " + jQuery("#" + prefix + "_ffamily").val() + "; " +
|
699 |
"font-weight: " + jQuery("#" + prefix + "_fweight").val() + "; " +
|
700 |
"padding: " + jQuery("#" + prefix + "_padding").val() + "; " +
|
701 |
"background-color: " + wds_hex_rgba(jQuery("#" + prefix+ "_fbgcolor").val(), (100 - jQuery("#" + prefix+ "_transparent").val())) + "; " +
|
702 |
"border: " + jQuery("#" + prefix + "_border_width").val() + "px " + jQuery("#" + prefix+ "_border_style").val() + " #" + jQuery("#" + prefix+ "_border_color").val() + "; " +
|
703 |
-
"border-radius: " + jQuery("#" + prefix + "_border_radius").val() + ";"
|
|
|
704 |
});
|
705 |
wds_text_width("#" + new_prefix + "_image_width", new_prefix);
|
706 |
wds_text_height("#" + new_prefix + "_image_height", new_prefix);
|
@@ -710,7 +1056,7 @@ function wds_duplicate_layer(type, id, layerID) {
|
|
710 |
jQuery("#wds_preview_image" + id).append(jQuery("<img />").attr({
|
711 |
id: new_prefix,
|
712 |
src: jQuery("#" + prefix).attr("src"),
|
713 |
-
class: "wds_draggable_" + id + " wds_draggable",
|
714 |
onclick: "wds_showhide_layer('" + new_prefix + "_tbody', 1)",
|
715 |
style: "z-index: " + jQuery("#" + new_prefix + "_depth").val() + "; " +
|
716 |
"left: 0; top: 0; " +
|
@@ -727,7 +1073,7 @@ function wds_duplicate_layer(type, id, layerID) {
|
|
727 |
}
|
728 |
|
729 |
var wds_layerID = 0;
|
730 |
-
function wds_add_layer(type, id, layerID, event, duplicate) {
|
731 |
var layers_count = jQuery(".wds_slide" + id + " tbody").length;
|
732 |
wds_layerID = layers_count;
|
733 |
if (typeof layerID == "undefined" || layerID == "") {
|
@@ -870,7 +1216,7 @@ function wds_add_layer(type, id, layerID, event, duplicate) {
|
|
870 |
var tbody = '<tr class="wds_layer_head_tr">' +
|
871 |
'<td colspan="4" class="wds_layer_head">' +
|
872 |
'<div class="handle connectedSortable" title="Drag to re-order"></div>' +
|
873 |
-
'<span class="wds_layer_label" onclick="wds_showhide_layer(\'' + tbodyID + '\', 0)"><input id="' + prefix + '_title" name="' + prefix + '_title" type="text" class="wds_layer_title" style="width: 80px;" value="Layer ' + wds_layerID + '" /></span>' +
|
874 |
'<span class="wds_layer_remove" title="Delete layer" onclick="wds_delete_layer(\'' + id + '\', \'' + layerID + '\')"></span>' +
|
875 |
'<span class="wds_layer_dublicate" title="Duplicate layer" onclick="wds_add_layer(\'' + type + '\', \'' + id + '\', \'\', event, 1); wds_duplicate_layer(\'' + type + '\', \'' + id + '\', \'' + layerID + '\');"></span>' +
|
876 |
'<input type="text" name="' + prefix + '_depth" id="' + prefix + '_depth" prefix="' + prefix + '" value="' + wds_layerID + '" class="wds_layer_depth spider_int_input" onkeypress="return spider_check_isnum(event)" onchange="jQuery(\'#' + prefix + '\').css({zIndex: jQuery(this).val()})" title="z-index" /></td>' +
|
@@ -881,15 +1227,17 @@ function wds_add_layer(type, id, layerID, event, duplicate) {
|
|
881 |
'<td>' +
|
882 |
'<input id="' + prefix + '_image_width" class="spider_int_input" type="text" onchange="wds_text_width(this,\'' + prefix + '\')" value="" name="' + prefix + '_image_width" /> x ' +
|
883 |
'<input id="' + prefix + '_image_height" class="spider_int_input" type="text" onchange="wds_text_height(this,\'' + prefix + '\')" value="" name="' + prefix + '_image_height" /> % ' +
|
884 |
-
'<input id="' + prefix + '_image_scale" type="checkbox" onchange="wds_break_word(this, \'' + prefix + '\')" name="' + prefix + '_image_scale" checked="checked"
|
885 |
-
'<div class="spider_description">Leave blank to keep the initial
|
886 |
var alt = '<td class="spider_label"><label for="' + prefix + '_alt">Alt: </label></td>' +
|
887 |
-
'<td><input type="text" id="' + prefix + '_alt" name="' + prefix + '_alt" value="" size="39"
|
|
|
888 |
var link = '<td class="spider_label"><label for="' + prefix + '_link">Link: </label></td>' +
|
889 |
'<td><input type="text" id="' + prefix + '_link" name="' + prefix + '_link" value="" size="39" /><div class="spider_description">Use http:// and https:// for external links.</div></td>';
|
890 |
var position = '<td class="spider_label"><label>Position: </label></td>' +
|
891 |
'<td> X <input type="text" name="' + prefix + '_left" id="' + prefix + '_left" value="0" class="spider_int_input" onkeypress="return spider_check_isnum(event)" onchange="jQuery(\'#' + prefix + '\').css({left: jQuery(this).val() + \'px\'})" />' +
|
892 |
-
' Y <input type="text" name="' + prefix + '_top" id="' + prefix + '_top" value="0" class="spider_int_input" onkeypress="return spider_check_isnum(event)" onchange="jQuery(\'#' + prefix + '\').css({top: jQuery(this).val() + \'px\'})"
|
|
|
893 |
var published = '<td class="spider_label"><label>Published: </label></td>' +
|
894 |
'<td><input type="radio" id="' + prefix + '_published1" name="' + prefix + '_published" checked="checked" value="1" ><label for="' + prefix + '_published1">Yes</label>' +
|
895 |
'<input type="radio" id="' + prefix + '_published0" name="' + prefix + '_published" value="0" /><label for="' + prefix + '_published0">No</label><div class="spider_description"></div></td>';
|
@@ -922,8 +1270,8 @@ function wds_add_layer(type, id, layerID, event, duplicate) {
|
|
922 |
'<input type="hidden" name="' + prefix + '_image_url" id="' + prefix + '_image_url" />' +
|
923 |
'<input type="text" name="' + prefix + '_image_width" id="' + prefix + '_image_width" value="" class="spider_int_input" onkeyup="wds_scale(\'#' + prefix + '_image_scale\', \'' + prefix + '\')" /> x ' +
|
924 |
'<input type="text" name="' + prefix + '_image_height" id="' + prefix + '_image_height" value="" class="spider_int_input" onkeyup="wds_scale(\'#' + prefix + '_image_scale\', \'' + prefix + '\')" /> px ' +
|
925 |
-
'<input type="checkbox" name="' + prefix + '_image_scale" id="' + prefix + '_image_scale" onchange="wds_scale(this, \'' + prefix + '\')"
|
926 |
-
'<div class="spider_description"
|
927 |
var social_button = '<td class="spider_label"><label for="' + prefix + '_social_button">Social button: </label></td>' +
|
928 |
'<td><select name="' + prefix + '_social_button" id="' + prefix + '_social_button" onchange="jQuery(\'#' + prefix + '\').attr(\'class\', \'wds_draggable fa fa-\' + jQuery(this).val())">' + social_button_option + '</select><div class="spider_description"></div></td>';
|
929 |
var transparent = '<td class="spider_label"><label for="' + prefix + '_transparent">Transparent: </label></td>' +
|
@@ -968,15 +1316,16 @@ function wds_add_layer(type, id, layerID, event, duplicate) {
|
|
968 |
case 'text': {
|
969 |
jQuery("#wds_preview_image" + id).append(jQuery("<span />").attr({
|
970 |
id: prefix,
|
971 |
-
class: "wds_draggable_" + id + " wds_draggable",
|
972 |
onclick: "wds_showhide_layer('" + tbodyID + "', 1)",
|
973 |
style: "z-index: " + layerID.replace("pr_", "") + "; " +
|
974 |
"word-break: keep-all;" +
|
975 |
"display: inline-block; " +
|
|
|
976 |
"left: 0; top: 0; " +
|
977 |
"color: #FFFFFF; " +
|
978 |
"font-size: 18px; " +
|
979 |
-
"line-height:
|
980 |
"font-family: Arial; " +
|
981 |
"font-weight: normal; " +
|
982 |
"padding: 5px; " +
|
@@ -1035,7 +1384,12 @@ function wds_add_layer(type, id, layerID, event, duplicate) {
|
|
1035 |
published +
|
1036 |
'</tr>' + layer_type;
|
1037 |
if (!duplicate) {
|
1038 |
-
|
|
|
|
|
|
|
|
|
|
|
1039 |
}
|
1040 |
else {
|
1041 |
jQuery("#" + tbodyID).append(tbody_html);
|
@@ -1054,11 +1408,23 @@ function wds_add_layer(type, id, layerID, event, duplicate) {
|
|
1054 |
}
|
1055 |
|
1056 |
function wds_scale(that, prefix) {
|
1057 |
-
|
1058 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1059 |
}
|
1060 |
-
else {
|
1061 |
-
|
|
|
|
|
|
|
|
|
|
|
1062 |
}
|
1063 |
}
|
1064 |
|
@@ -1135,7 +1501,7 @@ function wds_add_image_layer(prefix, e, tbodyID, id, layerID, tbody_html) {
|
|
1135 |
attachment = custom_uploader.state().get('selection').first().toJSON();
|
1136 |
jQuery("#wds_preview_image" + id).append(jQuery("<img />").attr({
|
1137 |
id: prefix,
|
1138 |
-
class: "wds_draggable_" + id + " wds_draggable",
|
1139 |
onclick: "wds_showhide_layer('" + tbodyID + "', 1)",
|
1140 |
src: attachment.url,
|
1141 |
style: "z-index: " + layerID.replace("pr_", "") + "; " +
|
@@ -1143,7 +1509,7 @@ function wds_add_image_layer(prefix, e, tbodyID, id, layerID, tbody_html) {
|
|
1143 |
"border: 2px none #FFFFFF; " +
|
1144 |
"border-radius: 2px; " +
|
1145 |
"opacity: 1; filter: Alpha(opacity=100); " +
|
1146 |
-
"
|
1147 |
}));
|
1148 |
|
1149 |
var att_width = attachment.width ? attachment.width : jQuery("#" + prefix).width();
|
@@ -1164,6 +1530,37 @@ function wds_add_image_layer(prefix, e, tbodyID, id, layerID, tbody_html) {
|
|
1164 |
custom_uploader.open();
|
1165 |
}
|
1166 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1167 |
function wds_hex_rgba(color, transparent) {
|
1168 |
color = "#" + color;
|
1169 |
var redHex = color.substring(1, 3);
|
@@ -1180,30 +1577,50 @@ function wds_hex_rgba(color, transparent) {
|
|
1180 |
|
1181 |
function wds_add_slide() {
|
1182 |
var slides_count = jQuery(".wbs_subtab a[id^='wbs_subtab']").length;
|
1183 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1184 |
jQuery("#slide_ids_string").val(jQuery("#slide_ids_string").val() + slideID + ',');
|
1185 |
jQuery(".wds_slides_box *").removeClass("wds_sub_active");
|
1186 |
jQuery(
|
1187 |
'<a id="wbs_subtab' + slideID + '" class="connectedSortable wds_sub_active" href="#">' +
|
1188 |
-
'
|
|
|
1189 |
' <span class="wds_tab_remove" title="Delete slide" onclick="wds_remove_slide(\'' + slideID + '\')"></span>' +
|
1190 |
' <input type="hidden" name="order' + slideID + '" id="order' + slideID + '" value="' + slides_count + '" /></a>').insertBefore(".wds_add_layer");
|
|
|
1191 |
jQuery(".wbs_subtab").after(
|
1192 |
'<div class="wds_box wds_sub_active wds_slide' + slideID + '">' +
|
1193 |
'<table class="ui-sortable' + slideID + '">' +
|
1194 |
'<thead><tr><td colspan="4"> </td></tr></thead>' +
|
1195 |
'<tbody>' +
|
1196 |
'<input type="hidden" name="type' + slideID + '" id="type' + slideID + '" value="image" />' +
|
1197 |
-
'<tr><td
|
1198 |
-
|
1199 |
-
|
1200 |
-
'<input id="published' + slideID + '0" type="radio" value="0" name="published' + slideID + '">' +
|
1201 |
-
'<label for="published' + slideID + '0">No</label></td>' +
|
1202 |
-
'</tr><tr id="trlink' + slideID + '"><td class="spider_label"><label for="link' + slideID + '">Link the slide: </label></td>' +
|
1203 |
-
'<td><input id="link' + slideID + '" type="text" size="39" value="" name="link' + slideID + '" /></td>' +
|
1204 |
-
'</tr><tr><td colspan="4">' +
|
1205 |
-
' <input id="button_image_url' + slideID + '" class="button-primary" type="button" value="Add Image from Media Library" onclick="spider_media_uploader(\'' + slideID + '\', event); return false;">' +
|
1206 |
-
' <input class="button-primary" type="button" value="Add Image URL" onclick="wds_add_image_url(\'' + slideID + '\')">' +
|
1207 |
' <input class="button-secondary wds_free_button" type="button" value="Add Video" onclick="alert(\'This functionality is disabled in free version.\')">' +
|
1208 |
' <input id="delete_image_url' + slideID + '" class="button-secondary" type="button" value="Remove" onclick="spider_remove_url(\'button_image_url' + slideID + '\', \'image_url' + slideID + '\', \'delete_image_url' + slideID + '\', \'wds_preview_image' + slideID + '\')">' +
|
1209 |
' <input id="image_url' + slideID + '" type="hidden" style="display: inline-block;" value="" name="image_url' + slideID + '">' +
|
@@ -1223,9 +1640,17 @@ function wds_add_slide() {
|
|
1223 |
'border-radius: ' + jQuery('#glb_border_radius').val() + '; ' +
|
1224 |
'box-shadow: ' + jQuery('#glb_box_shadow').val() + '; ' +
|
1225 |
'width: inherit; height: inherit;"> </div></div></div></td>' +
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1226 |
'</tr><tr><td colspan="4">' +
|
1227 |
-
' <input class="button-primary button button-small" type="button" value="Add Text Layer" onclick="wds_add_layer(\'text\', \'' + slideID + '\'); return false;">' +
|
1228 |
-
|
1229 |
' <input class="button-secondary button button-small wds_free_button" type="button" value="Add Social Buttons Layer" onclick="alert(\'This functionality is disabled in free version.\'); return false;"></td>' +
|
1230 |
'</tr></tbody></table>' +
|
1231 |
'<input id="slide' + slideID + '_layer_ids_string" name="slide' + slideID + '_layer_ids_string" type="hidden" value="" />' +
|
@@ -1255,11 +1680,13 @@ function wds_remove_slide(slideID) {
|
|
1255 |
|
1256 |
var slides = jQuery(".wbs_subtab a[id^='wbs_subtab']");
|
1257 |
for (var i in slides) {
|
1258 |
-
|
|
|
|
|
|
|
|
|
1259 |
break;
|
1260 |
}
|
1261 |
-
jQuery("#wbs_subtab" + firstSlideID).addClass("wds_sub_active");
|
1262 |
-
jQuery(".wds_slide" + firstSlideID).addClass("wds_sub_active");
|
1263 |
}
|
1264 |
}
|
1265 |
|
@@ -1267,7 +1694,6 @@ function wds_trans_end(id, effect) {
|
|
1267 |
var transitionEvent = wds_whichTransitionEvent();
|
1268 |
var e = document.getElementById(id);
|
1269 |
transitionEvent && e.addEventListener(transitionEvent, function() {
|
1270 |
-
console.log("aaa");
|
1271 |
jQuery("#" + id).removeClass("animated").removeClass(effect);
|
1272 |
});
|
1273 |
}
|
@@ -1377,3 +1803,29 @@ function wds_text_height(that, prefix) {
|
|
1377 |
jQuery(that).val("");
|
1378 |
}
|
1379 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
function spider_ajax_save(form_id, event) {
|
2 |
+
/* Loading.*/
|
3 |
+
jQuery(".spider_load").show();
|
4 |
+
|
5 |
+
var post_data = {};
|
6 |
+
post_data["task"] = "apply";
|
7 |
+
/* Global.*/
|
8 |
+
post_data["current_id"] = jQuery("#current_id").val();
|
9 |
+
post_data["slide_ids_string"] = jQuery("#slide_ids_string").val();
|
10 |
+
post_data["del_slide_ids_string"] = jQuery("#del_slide_ids_string").val();
|
11 |
+
post_data["nav_tab"] = jQuery("#nav_tab").val();
|
12 |
+
post_data["tab"] = jQuery("#tab").val();
|
13 |
+
post_data["sub_tab"] = jQuery("#sub_tab").val();
|
14 |
+
post_data["name"] = jQuery("#name").val();
|
15 |
+
post_data["width"] = jQuery("#width").val();
|
16 |
+
post_data["height"] = jQuery("#height").val();
|
17 |
+
post_data["full_width"] = jQuery("input[name=full_width]:checked").val();
|
18 |
+
post_data["bg_fit"] = jQuery("input[name=bg_fit]:checked").val();
|
19 |
+
post_data["align"] = jQuery("#align").val();
|
20 |
+
post_data["effect"] = jQuery("#effect").val();
|
21 |
+
post_data["time_intervval"] = jQuery("#time_intervval").val();
|
22 |
+
post_data["autoplay"] = jQuery("input[name=autoplay]:checked").val();
|
23 |
+
post_data["shuffle"] = jQuery("input[name=shuffle]:checked").val();
|
24 |
+
post_data["music"] = jQuery("input[name=music]:checked").val();
|
25 |
+
post_data["music_url"] = jQuery("#music_url").val();
|
26 |
+
post_data["preload_images"] = jQuery("input[name=preload_images]:checked").val();
|
27 |
+
post_data["background_color"] = jQuery("#background_color").val();
|
28 |
+
post_data["background_transparent"] = jQuery("#background_transparent").val();
|
29 |
+
post_data["glb_border_width"] = jQuery("#glb_border_width").val();
|
30 |
+
post_data["glb_border_style"] = jQuery("#glb_border_style").val();
|
31 |
+
post_data["glb_border_color"] = jQuery("#glb_border_color").val();
|
32 |
+
post_data["glb_border_radius"] = jQuery("#glb_border_radius").val();
|
33 |
+
post_data["glb_margin"] = jQuery("#glb_margin").val();
|
34 |
+
post_data["glb_box_shadow"] = jQuery("#glb_box_shadow").val();
|
35 |
+
post_data["image_right_click"] = jQuery("input[name=image_right_click]:checked").val();
|
36 |
+
post_data["layer_out_next"] = jQuery("input[name=layer_out_next]:checked").val();
|
37 |
+
post_data["published"] = jQuery("input[name=published]:checked").val();
|
38 |
+
|
39 |
+
/* Navigation.*/
|
40 |
+
post_data["prev_next_butt"] = jQuery("input[name=prev_next_butt]:checked").val();
|
41 |
+
post_data["play_paus_butt"] = jQuery("input[name=play_paus_butt]:checked").val();
|
42 |
+
post_data["navigation"] = jQuery("input[name=navigation]:checked").val();
|
43 |
+
post_data["rl_butt_style"] = jQuery("#rl_butt_style").val();
|
44 |
+
post_data["rl_butt_size"] = jQuery("#rl_butt_size").val();
|
45 |
+
post_data["pp_butt_size"] = jQuery("#pp_butt_size").val();
|
46 |
+
post_data["butts_color"] = jQuery("#butts_color").val();
|
47 |
+
post_data["hover_color"] = jQuery("#hover_color").val();
|
48 |
+
post_data["nav_border_width"] = jQuery("#nav_border_width").val();
|
49 |
+
post_data["nav_border_style"] = jQuery("#nav_border_style").val();
|
50 |
+
post_data["nav_border_color"] = jQuery("#nav_border_color").val();
|
51 |
+
post_data["nav_border_radius"] = jQuery("#nav_border_radius").val();
|
52 |
+
post_data["nav_bg_color"] = jQuery("#nav_bg_color").val();
|
53 |
+
post_data["butts_transparent"] = jQuery("#butts_transparent").val();
|
54 |
+
|
55 |
+
/* Bullets.*/
|
56 |
+
post_data["enable_bullets"] = jQuery("input[name=enable_bullets]:checked").val();
|
57 |
+
post_data["bull_position"] = jQuery("#bull_position").val();
|
58 |
+
post_data["bull_style"] = jQuery("#bull_style").val();
|
59 |
+
post_data["bull_size"] = jQuery("#bull_size").val();
|
60 |
+
post_data["bull_color"] = jQuery("#bull_color").val();
|
61 |
+
post_data["bull_act_color"] = jQuery("#bull_act_color").val();
|
62 |
+
post_data["bull_margin"] = jQuery("#bull_margin").val();
|
63 |
+
|
64 |
+
/* Filmstrip.*/
|
65 |
+
post_data["enable_filmstrip"] = jQuery("input[name=enable_filmstrip]:checked").val();
|
66 |
+
post_data["film_pos"] = jQuery("#film_pos").val();
|
67 |
+
post_data["film_thumb_width"] = jQuery("#film_thumb_width").val();
|
68 |
+
post_data["film_thumb_height"] = jQuery("#film_thumb_height").val();
|
69 |
+
post_data["film_bg_color"] = jQuery("#film_bg_color").val();
|
70 |
+
post_data["film_tmb_margin"] = jQuery("#film_tmb_margin").val();
|
71 |
+
post_data["film_act_border_width"] = jQuery("#film_act_border_width").val();
|
72 |
+
post_data["film_act_border_style"] = jQuery("#film_act_border_style").val();
|
73 |
+
post_data["film_act_border_color"] = jQuery("#film_act_border_color").val();
|
74 |
+
post_data["film_dac_transparent"] = jQuery("#film_dac_transparent").val();
|
75 |
+
|
76 |
+
/* Timer bar.*/
|
77 |
+
post_data["enable_time_bar"] = jQuery("input[name=enable_time_bar]:checked").val();
|
78 |
+
post_data["timer_bar_type"] = jQuery("#timer_bar_type").val();
|
79 |
+
post_data["timer_bar_size"] = jQuery("#timer_bar_size").val();
|
80 |
+
post_data["timer_bar_color"] = jQuery("#timer_bar_color").val();
|
81 |
+
post_data["timer_bar_transparent"] = jQuery("#timer_bar_transparent").val();
|
82 |
+
|
83 |
+
/* Watermark.*/
|
84 |
+
post_data["built_in_watermark_type"] = jQuery("input[name=built_in_watermark_type]:checked").val();
|
85 |
+
post_data["built_in_watermark_text"] = jQuery("#built_in_watermark_text").val();
|
86 |
+
post_data["built_in_watermark_font_size"] = jQuery("#built_in_watermark_font_size").val();
|
87 |
+
post_data["built_in_watermark_font"] = jQuery("#built_in_watermark_font").val();
|
88 |
+
post_data["built_in_watermark_color"] = jQuery("#built_in_watermark_color").val();
|
89 |
+
post_data["built_in_watermark_opacity"] = jQuery("#built_in_watermark_opacity").val();
|
90 |
+
post_data["built_in_watermark_position"] = jQuery("input[name=built_in_watermark_position]:checked").val();
|
91 |
+
post_data["built_in_watermark_url"] = jQuery("#built_in_watermark_url").val();
|
92 |
+
post_data["built_in_watermark_size"] = jQuery("#built_in_watermark_size").val();
|
93 |
+
|
94 |
+
post_data["spider_uploader"] = jQuery("input[name=spider_uploader]:checked").val();
|
95 |
+
|
96 |
+
/* Css.*/
|
97 |
+
post_data["css"] = jQuery("#css").val();
|
98 |
+
|
99 |
+
var wds_slide_ids = jQuery("#slide_ids_string").val();
|
100 |
+
var slide_ids_array = wds_slide_ids.split(",");
|
101 |
+
for (var i in slide_ids_array) {
|
102 |
+
if (slide_ids_array.hasOwnProperty(i) && slide_ids_array[i] && slide_ids_array[i] != ",") {
|
103 |
+
var slide_id = slide_ids_array[i];
|
104 |
+
post_data["title" + slide_id] = jQuery("#title" + slide_id).val();
|
105 |
+
post_data["order" + slide_id] = jQuery("#order" + slide_id).val();
|
106 |
+
post_data["published" + slide_id] = jQuery("input[name=published" + slide_id + "]:checked").val();
|
107 |
+
post_data["link" + slide_id] = jQuery("#link" + slide_id).val();
|
108 |
+
post_data["type" + slide_id] = jQuery("#type" + slide_id).val();
|
109 |
+
post_data["image_url" + slide_id] = jQuery("#image_url" + slide_id).val();
|
110 |
+
post_data["thumb_url" + slide_id] = jQuery("#thumb_url" + slide_id).val();
|
111 |
+
var layer_ids_string = jQuery("#slide" + slide_id + "_layer_ids_string").val();
|
112 |
+
post_data["slide" + slide_id + "_layer_ids_string"] = layer_ids_string;
|
113 |
+
post_data["slide" + slide_id + "_del_layer_ids_string"] = jQuery("#slide" + slide_id + "_del_layer_ids_string").val();
|
114 |
+
if (layer_ids_string) {
|
115 |
+
var layer_ids_array = layer_ids_string.split(",");
|
116 |
+
for (var i in layer_ids_array) {
|
117 |
+
if (layer_ids_array.hasOwnProperty(i) && layer_ids_array[i] && layer_ids_array[i] != ",") {
|
118 |
+
var json_data = {};
|
119 |
+
var layer_id = layer_ids_array[i];
|
120 |
+
var prefix = "slide" + slide_id + "_layer" + layer_id;
|
121 |
+
var type = jQuery("#" + prefix + "_type").val();
|
122 |
+
json_data["type"] = type;
|
123 |
+
json_data["title"] = jQuery("#" + prefix + "_title").val();
|
124 |
+
json_data["depth"] = jQuery("#" + prefix + "_depth").val();
|
125 |
+
switch (type) {
|
126 |
+
case "text": {
|
127 |
+
json_data["text"] = jQuery("#" + prefix + "_text").val();
|
128 |
+
json_data["image_width"] = jQuery("#" + prefix + "_image_width").val();
|
129 |
+
json_data["image_height"] = jQuery("#" + prefix + "_image_height").val();
|
130 |
+
json_data["image_scale"] = jQuery("input[name=slide" + slide_id + "_layer" + layer_id + "_image_scale]:checked").val();
|
131 |
+
json_data["size"] = jQuery("#" + prefix + "_size").val();
|
132 |
+
json_data["color"] = jQuery("#" + prefix + "_color").val();
|
133 |
+
json_data["ffamily"] = jQuery("#" + prefix + "_ffamily").val();
|
134 |
+
json_data["fweight"] = jQuery("#" + prefix + "_fweight").val();
|
135 |
+
json_data["link"] = jQuery("#" + prefix + "_link").val();
|
136 |
+
json_data["padding"] = jQuery("#" + prefix + "_padding").val();
|
137 |
+
json_data["fbgcolor"] = jQuery("#" + prefix + "_fbgcolor").val();
|
138 |
+
json_data["transparent"] = jQuery("#" + prefix + "_transparent").val();
|
139 |
+
json_data["border_width"] = jQuery("#" + prefix + "_border_width").val();
|
140 |
+
json_data["border_style"] = jQuery("#" + prefix + "_border_style").val();
|
141 |
+
json_data["border_color"] = jQuery("#" + prefix + "_border_color").val();
|
142 |
+
json_data["border_radius"] = jQuery("#" + prefix + "_border_radius").val();
|
143 |
+
json_data["shadow"] = jQuery("#" + prefix + "_shadow").val();
|
144 |
+
break;
|
145 |
+
}
|
146 |
+
case "image": {
|
147 |
+
json_data["image_url"] = jQuery("#" + prefix + "_image_url").val();
|
148 |
+
json_data["image_width"] = jQuery("#" + prefix + "_image_width").val();
|
149 |
+
json_data["image_height"] = jQuery("#" + prefix + "_image_height").val();
|
150 |
+
json_data["image_scale"] = jQuery("input[name=slide" + slide_id + "_layer" + layer_id + "_image_scale]:checked").val();
|
151 |
+
json_data["alt"] = jQuery("#" + prefix + "_alt").val();
|
152 |
+
json_data["link"] = jQuery("#" + prefix + "_link").val();
|
153 |
+
json_data["imgtransparent"] = jQuery("#" + prefix + "_imgtransparent").val();
|
154 |
+
json_data["border_width"] = jQuery("#" + prefix + "_border_width").val();
|
155 |
+
json_data["border_style"] = jQuery("#" + prefix + "_border_style").val();
|
156 |
+
json_data["border_color"] = jQuery("#" + prefix + "_border_color").val();
|
157 |
+
json_data["border_radius"] = jQuery("#" + prefix + "_border_radius").val();
|
158 |
+
json_data["shadow"] = jQuery("#" + prefix + "_shadow").val();
|
159 |
+
break;
|
160 |
+
}
|
161 |
+
case "social": {
|
162 |
+
json_data["social_button"] = jQuery("#" + prefix + "_social_button").val();
|
163 |
+
json_data["size"] = jQuery("#" + prefix + "_size").val();
|
164 |
+
json_data["transparent"] = jQuery("#" + prefix + "_transparent").val();
|
165 |
+
json_data["color"] = jQuery("#" + prefix + "_color").val();
|
166 |
+
json_data["hover_color"] = jQuery("#" + prefix + "_hover_color").val();
|
167 |
+
break;
|
168 |
+
}
|
169 |
+
default:
|
170 |
+
break;
|
171 |
+
}
|
172 |
+
json_data["left"] = jQuery("#" + prefix + "_left").val();
|
173 |
+
json_data["top"] = jQuery("#" + prefix + "_top").val();
|
174 |
+
json_data["published"] = jQuery("input[name=slide" + slide_id + "_layer" + layer_id + "_published]:checked").val();
|
175 |
+
json_data["start"] = jQuery("#" + prefix + "_start").val();
|
176 |
+
json_data["layer_effect_in"] = jQuery("#" + prefix + "_layer_effect_in").val();
|
177 |
+
json_data["duration_eff_in"] = jQuery("#" + prefix + "_duration_eff_in").val();
|
178 |
+
json_data["end"] = jQuery("#" + prefix + "_end").val();
|
179 |
+
json_data["layer_effect_out"] = jQuery("#" + prefix + "_layer_effect_out").val();
|
180 |
+
json_data["duration_eff_out"] = jQuery("#" + prefix + "_duration_eff_out").val();
|
181 |
+
post_data[prefix + "_json"] = JSON.stringify(json_data);
|
182 |
+
json_data = null;
|
183 |
+
}
|
184 |
+
}
|
185 |
+
}
|
186 |
+
}
|
187 |
+
}
|
188 |
+
|
189 |
+
jQuery.post(
|
190 |
+
jQuery('#' + form_id).action,
|
191 |
+
post_data,
|
192 |
+
function (data) {
|
193 |
+
var content = jQuery(data).find(".wds_nav_global_box").parent();
|
194 |
+
var str = content.html();
|
195 |
+
jQuery(".wds_nav_global_box").parent().html(str);
|
196 |
+
var str = jQuery(data).find(".wds_task_cont").html();
|
197 |
+
jQuery(".wds_task_cont").html(str);
|
198 |
+
var str = jQuery(data).find(".wds_buttons").html();
|
199 |
+
jQuery(".wds_buttons").html(str);
|
200 |
+
var content = jQuery(data).find(".wds_slides_box");
|
201 |
+
var str = content.html();
|
202 |
+
jQuery(".wds_slides_box").html(str);
|
203 |
+
}
|
204 |
+
).success(function (data, textStatus, errorThrown) {
|
205 |
+
wds_success(form_id, 0);
|
206 |
+
});
|
207 |
+
if (event.preventDefault) {
|
208 |
+
event.preventDefault();
|
209 |
+
}
|
210 |
+
else {
|
211 |
+
event.returnValue = false;
|
212 |
+
}
|
213 |
+
}
|
214 |
+
|
215 |
+
function wds_action_after_save(form_id) {
|
216 |
+
var post_data = {};
|
217 |
+
post_data["task"] = jQuery("#task").val();
|
218 |
+
post_data["current_id"] = jQuery("#current_id").val();
|
219 |
+
jQuery.post(
|
220 |
+
jQuery("#" + form_id).attr("action"),
|
221 |
+
post_data,
|
222 |
+
function (data) {
|
223 |
+
jQuery(".wds_preview").find("div[class^='wds_preview_image']").each(function() {
|
224 |
+
var image = jQuery(this).css("background-image");
|
225 |
+
jQuery(this).css({backgroundImage: image.replace('")', Math.floor((Math.random() * 100) + 1) + '")')});
|
226 |
+
});
|
227 |
+
}
|
228 |
+
).success(function (data, textStatus, errorThrown) {
|
229 |
+
wds_success(form_id, 1);
|
230 |
+
});
|
231 |
+
}
|
232 |
+
|
233 |
+
function wds_success(form_id, end) {
|
234 |
+
jQuery("#" + form_id).parent().find(".spider_message").remove();
|
235 |
+
var task = jQuery("#task").val();
|
236 |
+
var message;
|
237 |
+
switch (task) {
|
238 |
+
case "save": {
|
239 |
+
jQuery("#" + form_id).submit();
|
240 |
+
break;
|
241 |
+
}
|
242 |
+
case "set_watermark": {
|
243 |
+
if (end) {
|
244 |
+
if (jQuery("input[name=built_in_watermark_type]:checked").val() == 'none') {
|
245 |
+
message = "<div class='error'><strong><p>You must set watermark type.</p></strong></div>";
|
246 |
+
}
|
247 |
+
else {
|
248 |
+
message = "<div class='updated'><strong><p>Watermark Succesfully Set.</p></strong></div>";
|
249 |
+
}
|
250 |
+
}
|
251 |
+
else {
|
252 |
+
wds_action_after_save(form_id);
|
253 |
+
}
|
254 |
+
break;
|
255 |
+
}
|
256 |
+
case "reset_watermark": {
|
257 |
+
if (end) {
|
258 |
+
message = "<div class='updated'><strong><p>Watermark Succesfully Reset.</p></strong></div>";
|
259 |
+
}
|
260 |
+
else {
|
261 |
+
wds_action_after_save(form_id);
|
262 |
+
}
|
263 |
+
break;
|
264 |
+
}
|
265 |
+
case "reset": {
|
266 |
+
jQuery("#" + form_id).submit();
|
267 |
+
break;
|
268 |
+
}
|
269 |
+
default: {
|
270 |
+
message = "<div class='updated'><strong><p>Items Succesfully Saved.</p></strong></div>";
|
271 |
+
break;
|
272 |
+
}
|
273 |
+
}
|
274 |
+
/* Loading.*/
|
275 |
+
jQuery(".spider_load").hide();
|
276 |
+
if (message) {
|
277 |
+
jQuery(".spider_message_cont").html(message);
|
278 |
+
jQuery(".spider_message_cont").show();
|
279 |
+
}
|
280 |
+
wds_onload();
|
281 |
+
jscolor.bind();
|
282 |
+
}
|
283 |
+
|
284 |
+
|
285 |
+
function wds_onload() {
|
286 |
+
jQuery(".wds_tabs").show();
|
287 |
+
var nav_tab = jQuery("#nav_tab").val();
|
288 |
+
wds_change_nav(jQuery(".wds_nav_tabs li[tab_type='" + nav_tab + "']"), 'wds_nav_' + nav_tab + '_box');
|
289 |
+
var tab = jQuery("#tab").val();
|
290 |
+
wds_change_tab(jQuery(".wds_tab_label[tab_type='" + tab + "']"), 'wds_' + tab + '_box');
|
291 |
+
bwg_built_in_watermark("watermark_type_" + jQuery("input[name=built_in_watermark_type]:checked").val());
|
292 |
+
preview_built_in_watermark();
|
293 |
+
wds_slide_weights();
|
294 |
+
if (jQuery("#music1").is(":checked")) {
|
295 |
+
bwg_enable_disable('', 'tr_music_url', 'music1');
|
296 |
+
}
|
297 |
+
else {
|
298 |
+
bwg_enable_disable('none', 'tr_music_url', 'music0');
|
299 |
+
}
|
300 |
+
}
|
301 |
+
|
302 |
function spider_select_value(obj) {
|
303 |
obj.focus();
|
304 |
obj.select();
|
401 |
if (jQuery('#' + id).val() == '') {
|
402 |
alert(name + '* field is required.');
|
403 |
wds_change_tab(jQuery(".wds_tab_label[tab_type='slides']"), 'wds_slides_box');
|
|
|
|
|
404 |
jQuery('#' + id).attr('style', 'border-color: #FF0000;');
|
405 |
jQuery('#' + id).focus();
|
406 |
jQuery('html, body').animate({
|
856 |
custom_uploader.open();
|
857 |
}
|
858 |
|
859 |
+
function wds_add_image(files, image_for, slide_id) {
|
860 |
+
switch (image_for) {
|
861 |
+
case 'add_slides': {
|
862 |
+
/* Add one or more slides.*/
|
863 |
+
for (var i in files) {
|
864 |
+
wds_add_slide();
|
865 |
+
var slides_count = jQuery(".wbs_subtab a[id^='wbs_subtab']").length;
|
866 |
+
var new_slide_id = "pr_" + slides_count;
|
867 |
+
jQuery("#image_url" + new_slide_id).val(files[i]['url']);
|
868 |
+
jQuery("#thumb_url" + new_slide_id).val(files[i]['thumb_url']);
|
869 |
+
jQuery("#wds_preview_image" + new_slide_id).css("background-image", 'url("' + files[i]['url'] + '")');
|
870 |
+
jQuery("#delete_image_url" + new_slide_id).css("display", "inline-block");
|
871 |
+
jQuery("#wds_preview_image" + new_slide_id).css("display", "inline-block");
|
872 |
+
jQuery("#type" + new_slide_id).val("image");
|
873 |
+
jQuery("#trlink" + new_slide_id).show();
|
874 |
+
}
|
875 |
+
break;
|
876 |
+
}
|
877 |
+
case 'add_layer': {
|
878 |
+
/* Add image layer to current slide.*/
|
879 |
+
wds_add_layer('image', slide_id, '', '', '', files);
|
880 |
+
break;
|
881 |
+
}
|
882 |
+
case 'add_update_slide': {
|
883 |
+
/* Add or update current slide.*/
|
884 |
+
var file_resolution = [];
|
885 |
+
jQuery("#image_url" + slide_id).val(files[0]['url']);
|
886 |
+
jQuery("#thumb_url" + slide_id).val(files[0]['thumb_url']);
|
887 |
+
jQuery("#wds_preview_image" + slide_id).css("background-image", 'url("' + files[0]['url'] + '")');
|
888 |
+
jQuery("#delete_image_url" + slide_id).css("display", "inline-block");
|
889 |
+
jQuery("#wds_preview_image" + slide_id).css("display", "inline-block");
|
890 |
+
jQuery("#type" + slide_id).val("image");
|
891 |
+
jQuery("#trlink" + slide_id).show();
|
892 |
+
}
|
893 |
+
case 'watermark': {
|
894 |
+
/* Add image for watermark.*/
|
895 |
+
document.getElementById("built_in_watermark_url").value = files[0]['url'];
|
896 |
+
preview_built_in_watermark();
|
897 |
+
break;
|
898 |
+
}
|
899 |
+
default: {
|
900 |
+
break;
|
901 |
+
}
|
902 |
+
}
|
903 |
+
}
|
904 |
+
|
905 |
function wds_change_sub_tab(that, box) {
|
906 |
jQuery("#sub_tab").val(jQuery(that).attr("tab_type"));
|
907 |
jQuery(".wds_tabs a").removeClass("wds_sub_active");
|
1039 |
"left: 0; top: 0; display: inline-block;" +
|
1040 |
"color: #" + jQuery("#" + prefix + "_color").val() + "; " +
|
1041 |
"font-size: " + jQuery("#" + prefix + "_size").val() + "px; " +
|
1042 |
+
"line-height: 1.25em; " +
|
1043 |
"font-family: " + jQuery("#" + prefix + "_ffamily").val() + "; " +
|
1044 |
"font-weight: " + jQuery("#" + prefix + "_fweight").val() + "; " +
|
1045 |
"padding: " + jQuery("#" + prefix + "_padding").val() + "; " +
|
1046 |
"background-color: " + wds_hex_rgba(jQuery("#" + prefix+ "_fbgcolor").val(), (100 - jQuery("#" + prefix+ "_transparent").val())) + "; " +
|
1047 |
"border: " + jQuery("#" + prefix + "_border_width").val() + "px " + jQuery("#" + prefix+ "_border_style").val() + " #" + jQuery("#" + prefix+ "_border_color").val() + "; " +
|
1048 |
+
"border-radius: " + jQuery("#" + prefix + "_border_radius").val() + ";" +
|
1049 |
+
"position: absolute;"
|
1050 |
});
|
1051 |
wds_text_width("#" + new_prefix + "_image_width", new_prefix);
|
1052 |
wds_text_height("#" + new_prefix + "_image_height", new_prefix);
|
1056 |
jQuery("#wds_preview_image" + id).append(jQuery("<img />").attr({
|
1057 |
id: new_prefix,
|
1058 |
src: jQuery("#" + prefix).attr("src"),
|
1059 |
+
"class": "wds_draggable_" + id + " wds_draggable",
|
1060 |
onclick: "wds_showhide_layer('" + new_prefix + "_tbody', 1)",
|
1061 |
style: "z-index: " + jQuery("#" + new_prefix + "_depth").val() + "; " +
|
1062 |
"left: 0; top: 0; " +
|
1073 |
}
|
1074 |
|
1075 |
var wds_layerID = 0;
|
1076 |
+
function wds_add_layer(type, id, layerID, event, duplicate, files) {
|
1077 |
var layers_count = jQuery(".wds_slide" + id + " tbody").length;
|
1078 |
wds_layerID = layers_count;
|
1079 |
if (typeof layerID == "undefined" || layerID == "") {
|
1216 |
var tbody = '<tr class="wds_layer_head_tr">' +
|
1217 |
'<td colspan="4" class="wds_layer_head">' +
|
1218 |
'<div class="handle connectedSortable" title="Drag to re-order"></div>' +
|
1219 |
+
'<span class="wds_layer_label" onclick="wds_showhide_layer(\'' + tbodyID + '\', 0)"><input id="' + prefix + '_title" name="' + prefix + '_title" type="text" class="wds_layer_title" style="width: 80px;" value="Layer ' + wds_layerID + '" title="Layer title" /></span>' +
|
1220 |
'<span class="wds_layer_remove" title="Delete layer" onclick="wds_delete_layer(\'' + id + '\', \'' + layerID + '\')"></span>' +
|
1221 |
'<span class="wds_layer_dublicate" title="Duplicate layer" onclick="wds_add_layer(\'' + type + '\', \'' + id + '\', \'\', event, 1); wds_duplicate_layer(\'' + type + '\', \'' + id + '\', \'' + layerID + '\');"></span>' +
|
1222 |
'<input type="text" name="' + prefix + '_depth" id="' + prefix + '_depth" prefix="' + prefix + '" value="' + wds_layerID + '" class="wds_layer_depth spider_int_input" onkeypress="return spider_check_isnum(event)" onchange="jQuery(\'#' + prefix + '\').css({zIndex: jQuery(this).val()})" title="z-index" /></td>' +
|
1227 |
'<td>' +
|
1228 |
'<input id="' + prefix + '_image_width" class="spider_int_input" type="text" onchange="wds_text_width(this,\'' + prefix + '\')" value="" name="' + prefix + '_image_width" /> x ' +
|
1229 |
'<input id="' + prefix + '_image_height" class="spider_int_input" type="text" onchange="wds_text_height(this,\'' + prefix + '\')" value="" name="' + prefix + '_image_height" /> % ' +
|
1230 |
+
'<input id="' + prefix + '_image_scale" type="checkbox" onchange="wds_break_word(this, \'' + prefix + '\')" name="' + prefix + '_image_scale" checked="checked"/><label for="' + prefix + '_image_scale">Break-word</label>' +
|
1231 |
+
'<div class="spider_description">Leave blank to keep the initial width and height.</div></td>';
|
1232 |
var alt = '<td class="spider_label"><label for="' + prefix + '_alt">Alt: </label></td>' +
|
1233 |
+
'<td><input type="text" id="' + prefix + '_alt" name="' + prefix + '_alt" value="" size="39" />' +
|
1234 |
+
'<div class="spider_description">Set the HTML attribute specified in the IMG tag.</div></td>';
|
1235 |
var link = '<td class="spider_label"><label for="' + prefix + '_link">Link: </label></td>' +
|
1236 |
'<td><input type="text" id="' + prefix + '_link" name="' + prefix + '_link" value="" size="39" /><div class="spider_description">Use http:// and https:// for external links.</div></td>';
|
1237 |
var position = '<td class="spider_label"><label>Position: </label></td>' +
|
1238 |
'<td> X <input type="text" name="' + prefix + '_left" id="' + prefix + '_left" value="0" class="spider_int_input" onkeypress="return spider_check_isnum(event)" onchange="jQuery(\'#' + prefix + '\').css({left: jQuery(this).val() + \'px\'})" />' +
|
1239 |
+
' Y <input type="text" name="' + prefix + '_top" id="' + prefix + '_top" value="0" class="spider_int_input" onkeypress="return spider_check_isnum(event)" onchange="jQuery(\'#' + prefix + '\').css({top: jQuery(this).val() + \'px\'})" />' +
|
1240 |
+
'<div class="spider_description">In addition you can drag and drop the layer to a desired position.</div></td>';
|
1241 |
var published = '<td class="spider_label"><label>Published: </label></td>' +
|
1242 |
'<td><input type="radio" id="' + prefix + '_published1" name="' + prefix + '_published" checked="checked" value="1" ><label for="' + prefix + '_published1">Yes</label>' +
|
1243 |
'<input type="radio" id="' + prefix + '_published0" name="' + prefix + '_published" value="0" /><label for="' + prefix + '_published0">No</label><div class="spider_description"></div></td>';
|
1270 |
'<input type="hidden" name="' + prefix + '_image_url" id="' + prefix + '_image_url" />' +
|
1271 |
'<input type="text" name="' + prefix + '_image_width" id="' + prefix + '_image_width" value="" class="spider_int_input" onkeyup="wds_scale(\'#' + prefix + '_image_scale\', \'' + prefix + '\')" /> x ' +
|
1272 |
'<input type="text" name="' + prefix + '_image_height" id="' + prefix + '_image_height" value="" class="spider_int_input" onkeyup="wds_scale(\'#' + prefix + '_image_scale\', \'' + prefix + '\')" /> px ' +
|
1273 |
+
'<input type="checkbox" name="' + prefix + '_image_scale" id="' + prefix + '_image_scale" onchange="wds_scale(this, \'' + prefix + '\')" /><label for="' + prefix + '_image_scale">Scale</label>' +
|
1274 |
+
'<div class="spider_description">Set width and height of the image.</div></td>';
|
1275 |
var social_button = '<td class="spider_label"><label for="' + prefix + '_social_button">Social button: </label></td>' +
|
1276 |
'<td><select name="' + prefix + '_social_button" id="' + prefix + '_social_button" onchange="jQuery(\'#' + prefix + '\').attr(\'class\', \'wds_draggable fa fa-\' + jQuery(this).val())">' + social_button_option + '</select><div class="spider_description"></div></td>';
|
1277 |
var transparent = '<td class="spider_label"><label for="' + prefix + '_transparent">Transparent: </label></td>' +
|
1316 |
case 'text': {
|
1317 |
jQuery("#wds_preview_image" + id).append(jQuery("<span />").attr({
|
1318 |
id: prefix,
|
1319 |
+
"class": "wds_draggable_" + id + " wds_draggable",
|
1320 |
onclick: "wds_showhide_layer('" + tbodyID + "', 1)",
|
1321 |
style: "z-index: " + layerID.replace("pr_", "") + "; " +
|
1322 |
"word-break: keep-all;" +
|
1323 |
"display: inline-block; " +
|
1324 |
+
"position: absolute;" +
|
1325 |
"left: 0; top: 0; " +
|
1326 |
"color: #FFFFFF; " +
|
1327 |
"font-size: 18px; " +
|
1328 |
+
"line-height: 1.25em; " +
|
1329 |
"font-family: Arial; " +
|
1330 |
"font-weight: normal; " +
|
1331 |
"padding: 5px; " +
|
1384 |
published +
|
1385 |
'</tr>' + layer_type;
|
1386 |
if (!duplicate) {
|
1387 |
+
if(spider_uploader) { // Add image layer by spider uploader
|
1388 |
+
wds_add_image_layer_by_spider_uploader(prefix, files, tbodyID, id, layerID, tbody_html);
|
1389 |
+
}
|
1390 |
+
else { // Add image layer by media uploader
|
1391 |
+
image_escape = wds_add_image_layer(prefix, event, tbodyID, id, layerID, tbody_html);
|
1392 |
+
}
|
1393 |
}
|
1394 |
else {
|
1395 |
jQuery("#" + tbodyID).append(tbody_html);
|
1408 |
}
|
1409 |
|
1410 |
function wds_scale(that, prefix) {
|
1411 |
+
var wds_theImage = new Image();
|
1412 |
+
wds_theImage.src = jQuery("#" + prefix).attr("src");
|
1413 |
+
var wds_origWidth = wds_theImage.width;
|
1414 |
+
var wds_origHeight = wds_theImage.height;
|
1415 |
+
var width = jQuery("#" + prefix + "_image_width").val();
|
1416 |
+
var height = jQuery("#" + prefix + "_image_height").val();
|
1417 |
+
jQuery("#" + prefix).css({maxWidth: width + "px", maxHeight: height + "px", width: "", height: ""});
|
1418 |
+
if (!jQuery(that).is(':checked')) {
|
1419 |
+
jQuery("#" + prefix).css({width: width + "px", height: height + "px"});
|
1420 |
}
|
1421 |
+
else if (wds_origWidth <= width || wds_origHeight <= height) {
|
1422 |
+
if (wds_origWidth / width > wds_origHeight / height) {
|
1423 |
+
jQuery("#" + prefix).css({width: width + "px"});
|
1424 |
+
}
|
1425 |
+
else {
|
1426 |
+
jQuery("#" + prefix).css({height: height + "px"});
|
1427 |
+
}
|
1428 |
}
|
1429 |
}
|
1430 |
|
1501 |
attachment = custom_uploader.state().get('selection').first().toJSON();
|
1502 |
jQuery("#wds_preview_image" + id).append(jQuery("<img />").attr({
|
1503 |
id: prefix,
|
1504 |
+
"class": "wds_draggable_" + id + " wds_draggable",
|
1505 |
onclick: "wds_showhide_layer('" + tbodyID + "', 1)",
|
1506 |
src: attachment.url,
|
1507 |
style: "z-index: " + layerID.replace("pr_", "") + "; " +
|
1509 |
"border: 2px none #FFFFFF; " +
|
1510 |
"border-radius: 2px; " +
|
1511 |
"opacity: 1; filter: Alpha(opacity=100); " +
|
1512 |
+
"position: absolute;"
|
1513 |
}));
|
1514 |
|
1515 |
var att_width = attachment.width ? attachment.width : jQuery("#" + prefix).width();
|
1530 |
custom_uploader.open();
|
1531 |
}
|
1532 |
|
1533 |
+
function wds_add_image_layer_by_spider_uploader(prefix, files, tbodyID, id, layerID, tbody_html) {
|
1534 |
+
var file_resolution = [];
|
1535 |
+
jQuery("#" + tbodyID).append(tbody_html);
|
1536 |
+
jQuery("#wds_preview_image" + id).append(jQuery("<img />").attr({
|
1537 |
+
id: prefix,
|
1538 |
+
class: "wds_draggable_" + id + " wds_draggable",
|
1539 |
+
onclick: "wds_showhide_layer('" + tbodyID + "', 1)",
|
1540 |
+
src: files[0]['url'],
|
1541 |
+
style: "z-index: " + layerID.replace("pr_", "") + "; " +
|
1542 |
+
"left: 0; top: 0; " +
|
1543 |
+
"border: 2px none #FFFFFF; " +
|
1544 |
+
"border-radius: 2px; " +
|
1545 |
+
"opacity: 1; filter: Alpha(opacity=100); " +
|
1546 |
+
"position: absolute;"
|
1547 |
+
}));
|
1548 |
+
|
1549 |
+
file_resolution = files[0]['resolution'].split('x');
|
1550 |
+
var file_width = parseInt(file_resolution[0]) ? parseInt(file_resolution[0]) : jQuery("#" + prefix).width();
|
1551 |
+
var file_height = parseInt(file_resolution[1]) ? parseInt(file_resolution[1]) : jQuery("#" + prefix).height();
|
1552 |
+
var width = Math.min(file_width, jQuery("#wds_preview_image" + id).width());
|
1553 |
+
var height = Math.min(file_height, jQuery("#wds_preview_image" + id).height());
|
1554 |
+
|
1555 |
+
jQuery("#" + prefix + "_image_url").val(files[0]['url']);
|
1556 |
+
jQuery("#" + prefix + "_image_width").val(width);
|
1557 |
+
jQuery("#" + prefix + "_image_height").val(height);
|
1558 |
+
jQuery("#" + prefix + "_image_scale").attr("checked", "checked");
|
1559 |
+
wds_scale("#" + prefix + "_image_scale", prefix);
|
1560 |
+
wds_drag_layer(id);
|
1561 |
+
jscolor.bind();
|
1562 |
+
}
|
1563 |
+
|
1564 |
function wds_hex_rgba(color, transparent) {
|
1565 |
color = "#" + color;
|
1566 |
var redHex = color.substring(1, 3);
|
1577 |
|
1578 |
function wds_add_slide() {
|
1579 |
var slides_count = jQuery(".wbs_subtab a[id^='wbs_subtab']").length;
|
1580 |
+
var tmp_arr = [];
|
1581 |
+
var tmp_i = 0;
|
1582 |
+
jQuery(".wbs_subtab a[id^='wbs_subtab']").each(function() {
|
1583 |
+
var tmp_id = jQuery(this).attr("id");
|
1584 |
+
if (tmp_id.indexOf("pr_") !== -1) {
|
1585 |
+
tmp_arr[tmp_i++] = tmp_id.replace("wbs_subtabpr_", "");
|
1586 |
+
}
|
1587 |
+
});
|
1588 |
+
if (typeof tmp_arr !== 'undefined' && tmp_arr.length > 0) {
|
1589 |
+
var slideID = "pr_" + (Math.max.apply(Math, tmp_arr) + 1);
|
1590 |
+
++slides_count;
|
1591 |
+
}
|
1592 |
+
else {
|
1593 |
+
var slideID = "pr_" + ++slides_count;
|
1594 |
+
}
|
1595 |
+
|
1596 |
+
var uploader_href_for_add_slide = uploader_href.replace('slideID', slideID);
|
1597 |
+
var uploader_href_for_add_layer = uploader_href_for_add_slide.replace('add_update_slide', 'add_layer');
|
1598 |
+
if (spider_uploader) {
|
1599 |
+
slide_upload_by = ' <a href="' + uploader_href_for_add_slide + '" class="button-primary thickbox thickbox-preview" id="content-add_media" title="Add Image" onclick="return false;">Add Image</a>';
|
1600 |
+
img_layer_upload_by = ' <a href="' + (!fv ? uploader_href_for_add_layer : "") + '" class="button-' + (!fv ? "primary thickbox thickbox-preview" : "secondary wds_free_button") + ' button button-small" id="content-add_media" title="Add Image Layer" onclick="' + (!fv ? "" : "alert('This functionality is disabled in free version.')") + '; return false;">Add Image Layer</a>';
|
1601 |
+
}
|
1602 |
+
else {
|
1603 |
+
slide_upload_by = ' <input id="button_image_url' + slideID + '" class="button-primary" type="button" value="Add Image from Media Library" onclick="spider_media_uploader(\'' + slideID + '\', event); return false;" />';
|
1604 |
+
img_layer_upload_by = ' <input class="button-' + (!fv ? "primary" : "secondary wds_free_button") + ' button button-small" type="button" value="Add Image Layer" onclick="' + (!fv ? "wds_add_layer(\'image\', \'' + slideID + '\', \'\', event)" : "alert('This functionality is disabled in free version.')") + '; return false;" />';
|
1605 |
+
}
|
1606 |
jQuery("#slide_ids_string").val(jQuery("#slide_ids_string").val() + slideID + ',');
|
1607 |
jQuery(".wds_slides_box *").removeClass("wds_sub_active");
|
1608 |
jQuery(
|
1609 |
'<a id="wbs_subtab' + slideID + '" class="connectedSortable wds_sub_active" href="#">' +
|
1610 |
+
'<div class="handle" title="Drag to re-order"></div>' +
|
1611 |
+
' <input type="text" id="title' + slideID + '" name="title' + slideID + '" value="Slide ' + slides_count + '" class="wds_tab_title" tab_type="slide' + slideID + '" onclick="wds_change_sub_tab(this, \'wds_slide' + slideID + '\')" />' +
|
1612 |
' <span class="wds_tab_remove" title="Delete slide" onclick="wds_remove_slide(\'' + slideID + '\')"></span>' +
|
1613 |
' <input type="hidden" name="order' + slideID + '" id="order' + slideID + '" value="' + slides_count + '" /></a>').insertBefore(".wds_add_layer");
|
1614 |
+
wds_change_sub_tab(jQuery('#title' + slideID), 'wds_slide' + slideID);
|
1615 |
jQuery(".wbs_subtab").after(
|
1616 |
'<div class="wds_box wds_sub_active wds_slide' + slideID + '">' +
|
1617 |
'<table class="ui-sortable' + slideID + '">' +
|
1618 |
'<thead><tr><td colspan="4"> </td></tr></thead>' +
|
1619 |
'<tbody>' +
|
1620 |
'<input type="hidden" name="type' + slideID + '" id="type' + slideID + '" value="image" />' +
|
1621 |
+
'<tr><td colspan="4">' +
|
1622 |
+
slide_upload_by +
|
1623 |
+
' <input class="button-primary" type="button" value="Add Image by URL" onclick="wds_add_image_url(\'' + slideID + '\')">' +
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1624 |
' <input class="button-secondary wds_free_button" type="button" value="Add Video" onclick="alert(\'This functionality is disabled in free version.\')">' +
|
1625 |
' <input id="delete_image_url' + slideID + '" class="button-secondary" type="button" value="Remove" onclick="spider_remove_url(\'button_image_url' + slideID + '\', \'image_url' + slideID + '\', \'delete_image_url' + slideID + '\', \'wds_preview_image' + slideID + '\')">' +
|
1626 |
' <input id="image_url' + slideID + '" type="hidden" style="display: inline-block;" value="" name="image_url' + slideID + '">' +
|
1640 |
'border-radius: ' + jQuery('#glb_border_radius').val() + '; ' +
|
1641 |
'box-shadow: ' + jQuery('#glb_box_shadow').val() + '; ' +
|
1642 |
'width: inherit; height: inherit;"> </div></div></div></td>' +
|
1643 |
+
'</tr><tr><td class="spider_label"><label>Published: </label></td>' +
|
1644 |
+
'<td><input id="published' + slideID + '1" type="radio" value="1" checked="checked" name="published' + slideID + '">' +
|
1645 |
+
'<label for="published' + slideID + '1">Yes</label>' +
|
1646 |
+
'<input id="published' + slideID + '0" type="radio" value="0" name="published' + slideID + '">' +
|
1647 |
+
'<label for="published' + slideID + '0">No</label></td>' +
|
1648 |
+
'</tr><tr id="trlink' + slideID + '"><td class="spider_label"><label for="link' + slideID + '">Link the slide to: </label></td>' +
|
1649 |
+
'<td><input id="link' + slideID + '" type="text" size="39" value="" name="link' + slideID + '" />' +
|
1650 |
+
'<div class="spider_description">You can set a redirection link, so that the user will get to the mentioned location upon hitting the slide.<br />Use http:// and https:// for external links.</div></td>' +
|
1651 |
'</tr><tr><td colspan="4">' +
|
1652 |
+
' <input class="button-' + (!fv ? "primary" : "secondary wds_free_button") + ' button button-small" type="button" value="Add Text Layer" onclick="' + (!fv ? "wds_add_layer(\'text\', \'' + slideID + '\')" : "alert('This functionality is disabled in free version.')") + '; return false;">' +
|
1653 |
+
img_layer_upload_by +
|
1654 |
' <input class="button-secondary button button-small wds_free_button" type="button" value="Add Social Buttons Layer" onclick="alert(\'This functionality is disabled in free version.\'); return false;"></td>' +
|
1655 |
'</tr></tbody></table>' +
|
1656 |
'<input id="slide' + slideID + '_layer_ids_string" name="slide' + slideID + '_layer_ids_string" type="hidden" value="" />' +
|
1680 |
|
1681 |
var slides = jQuery(".wbs_subtab a[id^='wbs_subtab']");
|
1682 |
for (var i in slides) {
|
1683 |
+
if (slides[i]) {
|
1684 |
+
firstSlideID = slides[i].id.replace("wbs_subtab", "");
|
1685 |
+
jQuery("#wbs_subtab" + firstSlideID).addClass("wds_sub_active");
|
1686 |
+
jQuery(".wds_slide" + firstSlideID).addClass("wds_sub_active");
|
1687 |
+
}
|
1688 |
break;
|
1689 |
}
|
|
|
|
|
1690 |
}
|
1691 |
}
|
1692 |
|
1694 |
var transitionEvent = wds_whichTransitionEvent();
|
1695 |
var e = document.getElementById(id);
|
1696 |
transitionEvent && e.addEventListener(transitionEvent, function() {
|
|
|
1697 |
jQuery("#" + id).removeClass("animated").removeClass(effect);
|
1698 |
});
|
1699 |
}
|
1803 |
jQuery(that).val("");
|
1804 |
}
|
1805 |
}
|
1806 |
+
|
1807 |
+
function wds_whr(forfield) {
|
1808 |
+
var width = jQuery("#width").val();
|
1809 |
+
var height = jQuery("#height").val();
|
1810 |
+
var ratio = jQuery("#ratio").val();
|
1811 |
+
if (forfield == 'width') {
|
1812 |
+
if (width && height) {
|
1813 |
+
jQuery("#ratio").val(Math.round((width / height) * 100) / 100);
|
1814 |
+
}
|
1815 |
+
else if (width && ratio) {
|
1816 |
+
jQuery("#height").val(Math.round((width / ratio) * 100) / 100);
|
1817 |
+
}
|
1818 |
+
}
|
1819 |
+
else if (forfield == 'height') {
|
1820 |
+
if (width && height) {
|
1821 |
+
jQuery("#ratio").val(Math.round((width / height) * 100) / 100);
|
1822 |
+
}
|
1823 |
+
}
|
1824 |
+
else {
|
1825 |
+
if (width && ratio) {
|
1826 |
+
jQuery("#height").val(Math.round((width / ratio) * 100) / 100);
|
1827 |
+
}
|
1828 |
+
}
|
1829 |
+
jQuery('.wds_preview_wrapper').width(jQuery("#width").val());
|
1830 |
+
jQuery('.wds_preview_wrapper').height(jQuery("#height").val());
|
1831 |
+
}
|
js/wds_edit_button.js
DELETED
@@ -1,22 +0,0 @@
|
|
1 |
-
(function() {
|
2 |
-
tinymce.create('tinymce.plugins.wds_mce', {
|
3 |
-
init : function(ed, url) {
|
4 |
-
ed.addCommand('mcewds_mce', function() {
|
5 |
-
ed.windowManager.open({
|
6 |
-
file : wds_admin_ajax,
|
7 |
-
width : 400 + ed.getLang('wds_mce.delta_width', 0),
|
8 |
-
height : 250 + ed.getLang('wds_mce.delta_height', 0),
|
9 |
-
inline : 1
|
10 |
-
}, {
|
11 |
-
plugin_url : url /* Plugin absolute URL.*/
|
12 |
-
});
|
13 |
-
});
|
14 |
-
ed.addButton('wds_mce', {
|
15 |
-
title : 'Insert Slider',
|
16 |
-
cmd : 'mcewds_mce',
|
17 |
-
image: url + '/images/wds_edit_but.png'
|
18 |
-
});
|
19 |
-
}
|
20 |
-
});
|
21 |
-
tinymce.PluginManager.add('wds_mce', tinymce.plugins.wds_mce);
|
22 |
-
})();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/wds_shortcode.js
DELETED
@@ -1,446 +0,0 @@
|
|
1 |
-
function wds_shortcode_load() {
|
2 |
-
jQuery(".spider_int_input").keypress(function (event) {
|
3 |
-
var chCode1 = event.which || event.paramlist_keyCode;
|
4 |
-
if (chCode1 > 31 && (chCode1 < 48 || chCode1 > 57) && (chCode1 != 46)) {
|
5 |
-
return false;
|
6 |
-
}
|
7 |
-
return true;
|
8 |
-
});
|
9 |
-
jQuery("#display_panel").tooltip({
|
10 |
-
track: true,
|
11 |
-
content: function () {
|
12 |
-
return jQuery(this).prop('title');
|
13 |
-
}
|
14 |
-
});
|
15 |
-
}
|
16 |
-
|
17 |
-
function bwg_watermark(watermark_type) {
|
18 |
-
jQuery("#" + watermark_type).prop('checked', true);
|
19 |
-
jQuery("#tr_watermark_link").css('display', 'none');
|
20 |
-
jQuery("#tr_watermark_url").css('display', 'none');
|
21 |
-
jQuery("#tr_watermark_width_height").css('display', 'none');
|
22 |
-
jQuery("#tr_watermark_opacity").css('display', 'none');
|
23 |
-
jQuery("#tr_watermark_text").css('display', 'none');
|
24 |
-
jQuery("#tr_watermark_font_size").css('display', 'none');
|
25 |
-
jQuery("#tr_watermark_font").css('display', 'none');
|
26 |
-
jQuery("#tr_watermark_color").css('display', 'none');
|
27 |
-
jQuery("#tr_watermark_position").css('display', 'none');
|
28 |
-
bwg_enable_disable('', '', 'watermark_bottom_right');
|
29 |
-
switch (watermark_type) {
|
30 |
-
case 'watermark_type_text': {
|
31 |
-
jQuery("#tr_watermark_link").css('display', '');
|
32 |
-
jQuery("#tr_watermark_opacity").css('display', '');
|
33 |
-
jQuery("#tr_watermark_text").css('display', '');
|
34 |
-
jQuery("#tr_watermark_font_size").css('display', '');
|
35 |
-
jQuery("#tr_watermark_font").css('display', '');
|
36 |
-
jQuery("#tr_watermark_color").css('display', '');
|
37 |
-
jQuery("#tr_watermark_position").css('display', '');
|
38 |
-
break;
|
39 |
-
|
40 |
-
}
|
41 |
-
case 'watermark_type_image': {
|
42 |
-
jQuery("#tr_watermark_link").css('display', '');
|
43 |
-
jQuery("#tr_watermark_url").css('display', '');
|
44 |
-
jQuery("#tr_watermark_width_height").css('display', '');
|
45 |
-
jQuery("#tr_watermark_opacity").css('display', '');
|
46 |
-
jQuery("#tr_watermark_position").css('display', '');
|
47 |
-
break;
|
48 |
-
}
|
49 |
-
}
|
50 |
-
}
|
51 |
-
|
52 |
-
function bwg_enable_disable(display, id, current) {
|
53 |
-
jQuery("#" + current).prop('checked', true);
|
54 |
-
jQuery("#" + id).css('display', display);
|
55 |
-
}
|
56 |
-
|
57 |
-
function bwg_popup_fullscreen() {
|
58 |
-
if (jQuery("#popup_fullscreen_1").is(':checked')) {
|
59 |
-
jQuery("#tr_popup_width_height").css('display', 'none');
|
60 |
-
}
|
61 |
-
else {
|
62 |
-
jQuery("#tr_popup_width_height").css('display', '');
|
63 |
-
}
|
64 |
-
}
|
65 |
-
|
66 |
-
function bwg_thumb_click_action() {
|
67 |
-
if (!jQuery("#thumb_click_action_2").is(':checked')) {
|
68 |
-
jQuery("#tr_thumb_link_target").css('display', 'none');
|
69 |
-
jQuery("#tbody_popup").css('display', '');
|
70 |
-
jQuery("#tr_popup_width_height").css('display', '');
|
71 |
-
jQuery("#tr_popup_effect").css('display', '');
|
72 |
-
jQuery("#tr_popup_interval").css('display', '');
|
73 |
-
jQuery("#tr_popup_enable_filmstrip").css('display', '');
|
74 |
-
if (jQuery("input[name=popup_enable_filmstrip]:checked").val() == 1) {
|
75 |
-
bwg_enable_disable('', 'tr_popup_filmstrip_height', 'popup_filmstrip_yes');
|
76 |
-
}
|
77 |
-
else {
|
78 |
-
bwg_enable_disable('none', 'tr_popup_filmstrip_height', 'popup_filmstrip_no');
|
79 |
-
}
|
80 |
-
jQuery("#tr_popup_enable_ctrl_btn").css('display', '');
|
81 |
-
if (jQuery("input[name=popup_enable_ctrl_btn]:checked").val() == 1) {
|
82 |
-
bwg_enable_disable('', 'tbody_popup_ctrl_btn', 'popup_ctrl_btn_yes');
|
83 |
-
}
|
84 |
-
else {
|
85 |
-
bwg_enable_disable('none', 'tbody_popup_ctrl_btn', 'popup_ctrl_btn_no');
|
86 |
-
}
|
87 |
-
jQuery("#tr_popup_enable_fullscreen").css('display', '');
|
88 |
-
jQuery("#tr_popup_enable_info").css('display', '');
|
89 |
-
jQuery("#tr_popup_enable_rate").css('display', '');
|
90 |
-
jQuery("#tr_popup_enable_comment").css('display', '');
|
91 |
-
jQuery("#tr_popup_enable_facebook").css('display', '');
|
92 |
-
jQuery("#tr_popup_enable_twitter").css('display', '');
|
93 |
-
jQuery("#tr_popup_enable_google").css('display', '');
|
94 |
-
jQuery("#tr_popup_enable_pinterest").css('display', '');
|
95 |
-
jQuery("#tr_popup_enable_tumblr").css('display', '');
|
96 |
-
bwg_popup_fullscreen();
|
97 |
-
}
|
98 |
-
else {
|
99 |
-
jQuery("#tr_thumb_link_target").css('display', '');
|
100 |
-
jQuery("#tbody_popup").css('display', 'none');
|
101 |
-
jQuery("#tbody_popup_ctrl_btn").css('display', 'none');
|
102 |
-
}
|
103 |
-
}
|
104 |
-
|
105 |
-
function bwg_show_search_box() {
|
106 |
-
if (jQuery("#show_search_box_1").is(':checked')) {
|
107 |
-
jQuery("#tr_search_box_width").css('display', '');
|
108 |
-
}
|
109 |
-
else {
|
110 |
-
jQuery("#tr_search_box_width").css('display', 'none');
|
111 |
-
}
|
112 |
-
}
|
113 |
-
|
114 |
-
function bwg_change_compuct_album_view_type() {
|
115 |
-
if (jQuery("input[name=compuct_album_view_type]:checked").val() == 'thumbnail') {
|
116 |
-
jQuery("#compuct_album_image_thumb_dimensions").html('Image thumbnail dimensions: ');
|
117 |
-
jQuery("#compuct_album_image_thumb_dimensions_x").css('display', '');
|
118 |
-
jQuery("#compuct_album_image_thumb_height").css('display', '');
|
119 |
-
jQuery("#tr_compuct_album_image_title").css('display', '');
|
120 |
-
}
|
121 |
-
else {
|
122 |
-
jQuery("#compuct_album_image_thumb_dimensions").html('Image thumbnail width: ');
|
123 |
-
jQuery("#compuct_album_image_thumb_dimensions_x").css('display', 'none');
|
124 |
-
jQuery("#compuct_album_image_thumb_height").css('display', 'none');
|
125 |
-
jQuery("#tr_compuct_album_image_title").css('display', 'none');
|
126 |
-
}
|
127 |
-
}
|
128 |
-
|
129 |
-
function bwg_change_extended_album_view_type() {
|
130 |
-
if (jQuery("input[name=extended_album_view_type]:checked").val() == 'thumbnail') {
|
131 |
-
jQuery("#extended_album_image_thumb_dimensions").html('Image thumbnail dimensions: ');
|
132 |
-
jQuery("#extended_album_image_thumb_dimensions_x").css('display', '');
|
133 |
-
jQuery("#extended_album_image_thumb_height").css('display', '');
|
134 |
-
jQuery("#tr_extended_album_image_title").css('display', '');
|
135 |
-
}
|
136 |
-
else {
|
137 |
-
jQuery("#extended_album_image_thumb_dimensions").html('Image thumbnail width: ');
|
138 |
-
jQuery("#extended_album_image_thumb_dimensions_x").css('display', 'none');
|
139 |
-
jQuery("#extended_album_image_thumb_height").css('display', 'none');
|
140 |
-
jQuery("#tr_extended_album_image_title").css('display', 'none');
|
141 |
-
}
|
142 |
-
}
|
143 |
-
|
144 |
-
function bwg_change_label(id, text) {
|
145 |
-
jQuery('#' + id).html(text);
|
146 |
-
}
|
147 |
-
|
148 |
-
function bwg_gallery_type(gallery_type) {
|
149 |
-
jQuery("#" + gallery_type).prop('checked', true);
|
150 |
-
jQuery("#tr_gallery").css('display', 'none');
|
151 |
-
jQuery("#tr_sort_by").css('display', 'none');
|
152 |
-
jQuery("#tr_order_by").css('display', 'none');
|
153 |
-
jQuery("#tr_show_search_box").css('display', 'none');
|
154 |
-
jQuery("#tr_search_box_width").css('display', 'none');
|
155 |
-
jQuery("#tr_album").css('display', 'none');
|
156 |
-
|
157 |
-
// Thumbnails, Masonry.
|
158 |
-
jQuery("#tr_masonry_hor_ver").css('display', 'none');
|
159 |
-
bwg_change_label("col_num_label", 'Max. number of image columns');
|
160 |
-
jQuery("#tr_image_column_number").css('display', 'none');
|
161 |
-
jQuery("#tr_images_per_page").css('display', 'none');
|
162 |
-
jQuery("#tr_image_title_hover").css('display', 'none');
|
163 |
-
jQuery("#tr_image_enable_page").css('display', 'none');
|
164 |
-
jQuery("#tr_thumb_width_height").css('display', 'none');
|
165 |
-
|
166 |
-
// Compact Album.
|
167 |
-
jQuery("#tr_compuct_album_column_number").css('display', 'none');
|
168 |
-
jQuery("#tr_compuct_albums_per_page").css('display', 'none');
|
169 |
-
jQuery("#tr_compuct_album_title_hover").css('display', 'none');
|
170 |
-
jQuery("#tr_compuct_album_view_type").css('display', 'none');
|
171 |
-
jQuery("#tr_compuct_album_thumb_width_height").css('display', 'none');
|
172 |
-
jQuery("#tr_compuct_album_image_column_number").css('display', 'none');
|
173 |
-
jQuery("#tr_compuct_album_images_per_page").css('display', 'none');
|
174 |
-
jQuery("#tr_compuct_album_image_title").css('display', 'none');
|
175 |
-
jQuery("#tr_compuct_album_image_title").css('display', 'none');
|
176 |
-
jQuery("#tr_compuct_album_image_thumb_width_height").css('display', 'none');
|
177 |
-
jQuery("#tr_compuct_album_enable_page").css('display', 'none');
|
178 |
-
|
179 |
-
// Extended Album.
|
180 |
-
jQuery("#tr_extended_albums_per_page").css('display', 'none');
|
181 |
-
jQuery("#tr_extended_album_height").css('display', 'none');
|
182 |
-
jQuery("#tr_extended_album_description_enable").css('display', 'none');
|
183 |
-
jQuery("#tr_extended_album_view_type").css('display', 'none');
|
184 |
-
jQuery("#tr_extended_album_thumb_width_height").css('display', 'none');
|
185 |
-
jQuery("#tr_extended_album_image_column_number").css('display', 'none');
|
186 |
-
jQuery("#tr_extended_album_images_per_page").css('display', 'none');
|
187 |
-
jQuery("#tr_extended_album_image_title").css('display', 'none');
|
188 |
-
jQuery("#tr_extended_album_image_thumb_width_height").css('display', 'none');
|
189 |
-
jQuery("#tr_extended_album_enable_page").css('display', 'none');
|
190 |
-
|
191 |
-
// Image Browser.
|
192 |
-
jQuery("#tr_image_browser_width_height").css('display', 'none');
|
193 |
-
jQuery("#tr_image_browser_title_enable").css('display', 'none');
|
194 |
-
jQuery("#tr_image_browser_description_enable").css('display', 'none');
|
195 |
-
|
196 |
-
// Blog Style.
|
197 |
-
jQuery("#tr_blog_style_width_height").css('display', 'none');
|
198 |
-
jQuery("#tr_blog_style_title_enable").css('display', 'none');
|
199 |
-
jQuery("#tr_blog_style_images_per_page").css('display', 'none');
|
200 |
-
jQuery("#tr_blog_style_enable_page").css('display', 'none');
|
201 |
-
|
202 |
-
// Slideshow.
|
203 |
-
jQuery("#tbody_slideshow").css('display', 'none');
|
204 |
-
jQuery("#tr_slideshow_effect").css('display', 'none');
|
205 |
-
jQuery("#tr_slideshow_interval").css('display', 'none');
|
206 |
-
jQuery("#tr_slideshow_width_height").css('display', 'none');
|
207 |
-
jQuery("#tr_enable_slideshow_autoplay").css('display', 'none');
|
208 |
-
jQuery("#tr_enable_slideshow_shuffle").css('display', 'none');
|
209 |
-
jQuery("#tr_enable_slideshow_ctrl").css('display', 'none');
|
210 |
-
jQuery("#tr_enable_slideshow_filmstrip").css('display', 'none');
|
211 |
-
jQuery("#tr_slideshow_filmstrip_height").css('display', 'none');
|
212 |
-
jQuery("#tr_slideshow_enable_title").css('display', 'none');
|
213 |
-
jQuery("#tr_slideshow_title_position").css('display', 'none');
|
214 |
-
jQuery("#tr_slideshow_enable_description").css('display', 'none');
|
215 |
-
jQuery("#tr_slideshow_description_position").css('display', 'none');
|
216 |
-
jQuery("#tr_enable_slideshow_music").css('display', 'none');
|
217 |
-
jQuery("#tr_slideshow_music_url").css('display', 'none');
|
218 |
-
|
219 |
-
// Popup.
|
220 |
-
jQuery("#tbody_popup_other").css('display', 'none');
|
221 |
-
jQuery("#tbody_popup").css('display', 'none');
|
222 |
-
jQuery("#tr_popup_width_height").css('display', 'none');
|
223 |
-
jQuery("#tr_popup_effect").css('display', 'none');
|
224 |
-
jQuery("#tr_popup_interval").css('display', 'none');
|
225 |
-
jQuery("#tr_popup_enable_filmstrip").css('display', 'none');
|
226 |
-
jQuery("#tr_popup_filmstrip_height").css('display', 'none');
|
227 |
-
jQuery("#tr_popup_enable_ctrl_btn").css('display', 'none');
|
228 |
-
jQuery("#tr_popup_enable_fullscreen").css('display', 'none');
|
229 |
-
jQuery("#tr_popup_enable_info").css('display', 'none');
|
230 |
-
jQuery("#tr_popup_enable_rate").css('display', 'none');
|
231 |
-
jQuery("#tr_popup_enable_comment").css('display', 'none');
|
232 |
-
jQuery("#tr_popup_enable_facebook").css('display', 'none');
|
233 |
-
jQuery("#tr_popup_enable_twitter").css('display', 'none');
|
234 |
-
jQuery("#tr_popup_enable_google").css('display', 'none');
|
235 |
-
jQuery("#tr_popup_enable_pinterest").css('display', 'none');
|
236 |
-
jQuery("#tr_popup_enable_tumblr").css('display', 'none');
|
237 |
-
|
238 |
-
// Watermark.
|
239 |
-
jQuery("#tr_watermark_type").css('display', '');
|
240 |
-
if (jQuery("input[name=watermark_type]:checked").val() == 'image') {
|
241 |
-
bwg_watermark('watermark_type_image');
|
242 |
-
}
|
243 |
-
else if (jQuery("input[name=watermark_type]:checked").val() == 'text'){
|
244 |
-
bwg_watermark('watermark_type_text');
|
245 |
-
}
|
246 |
-
else {
|
247 |
-
bwg_watermark('watermark_type_none');
|
248 |
-
}
|
249 |
-
switch (gallery_type) {
|
250 |
-
case 'thumbnails': {
|
251 |
-
jQuery("#tr_gallery").css('display', '');
|
252 |
-
jQuery("#tr_sort_by").css('display', '');
|
253 |
-
jQuery("#tr_order_by").css('display', '');
|
254 |
-
jQuery("#tr_show_search_box").css('display', '');
|
255 |
-
bwg_change_label('image_column_number_label', 'Max. number of image columns: ');
|
256 |
-
bwg_change_label('thumb_width_height_label', 'Image thumbnail dimensions: ');
|
257 |
-
jQuery('#thumb_width').show();
|
258 |
-
jQuery('#thumb_height').show();
|
259 |
-
jQuery('#thumb_width_height_separator').show();
|
260 |
-
jQuery("#tr_image_column_number").css('display', '');
|
261 |
-
jQuery("#tr_images_per_page").css('display', '');
|
262 |
-
jQuery("#tr_image_title_hover").css('display', '');
|
263 |
-
jQuery("#tr_image_enable_page").css('display', '');
|
264 |
-
jQuery("#tr_thumb_width_height").css('display', '');
|
265 |
-
bwg_show_search_box();
|
266 |
-
break;
|
267 |
-
|
268 |
-
}
|
269 |
-
case 'thumbnails_masonry': {
|
270 |
-
jQuery("#tr_gallery").css('display', '');
|
271 |
-
jQuery("#tr_sort_by").css('display', '');
|
272 |
-
jQuery("#tr_order_by").css('display', '');
|
273 |
-
jQuery("#tr_show_search_box").css('display', '');
|
274 |
-
if (jQuery("input[name=masonry_hor_ver]:checked").val() == 'horizontal') {
|
275 |
-
bwg_change_label('image_column_number_label', 'Number of image rows: ');
|
276 |
-
bwg_change_label('thumb_width_height_label', 'Image thumbnail height: ');
|
277 |
-
jQuery('#thumb_width').hide();
|
278 |
-
jQuery('#thumb_height').show();
|
279 |
-
}
|
280 |
-
else {
|
281 |
-
bwg_change_label('image_column_number_label', 'Max. number of image columns: ');
|
282 |
-
bwg_change_label('thumb_width_height_label', 'Image thumbnail width: ');
|
283 |
-
jQuery('#thumb_width').show();
|
284 |
-
jQuery('#thumb_height').hide();
|
285 |
-
}
|
286 |
-
jQuery("#tr_masonry_hor_ver").css('display', '');
|
287 |
-
jQuery('#thumb_width_height_separator').hide();
|
288 |
-
jQuery("#tr_image_column_number").css('display', '');
|
289 |
-
jQuery("#tr_images_per_page").css('display', '');
|
290 |
-
jQuery("#tr_image_enable_page").css('display', '');
|
291 |
-
jQuery("#tr_thumb_width_height").css('display', '');
|
292 |
-
bwg_show_search_box();
|
293 |
-
break;
|
294 |
-
|
295 |
-
}
|
296 |
-
case 'slideshow': {
|
297 |
-
jQuery("#tr_gallery").css('display', '');
|
298 |
-
jQuery("#tr_sort_by").css('display', '');
|
299 |
-
jQuery("#tr_order_by").css('display', '');
|
300 |
-
jQuery("#tr_slideshow_effect").css('display', '');
|
301 |
-
jQuery("#tr_slideshow_interval").css('display', '');
|
302 |
-
jQuery("#tr_slideshow_width_height").css('display', '');
|
303 |
-
jQuery("#tbody_slideshow").css('display', '');
|
304 |
-
jQuery("#tr_enable_slideshow_autoplay").css('display', '');
|
305 |
-
jQuery("#tr_enable_slideshow_shuffle").css('display', '');
|
306 |
-
jQuery("#tr_enable_slideshow_ctrl").css('display', '');
|
307 |
-
jQuery("#tr_enable_slideshow_filmstrip").css('display', '');
|
308 |
-
if (jQuery("input[name=enable_slideshow_filmstrip]:checked").val() == 1) {
|
309 |
-
bwg_enable_disable('', 'tr_slideshow_filmstrip_height', 'slideshow_filmstrip_yes');
|
310 |
-
}
|
311 |
-
else {
|
312 |
-
bwg_enable_disable('none', 'tr_slideshow_filmstrip_height', 'slideshow_filmstrip_no');
|
313 |
-
}
|
314 |
-
jQuery("#tr_slideshow_enable_title").css('display', '');
|
315 |
-
if (jQuery("input[name=slideshow_enable_title]:checked").val() == 1) {
|
316 |
-
bwg_enable_disable('', 'tr_slideshow_title_position', 'slideshow_title_yes');
|
317 |
-
}
|
318 |
-
else {
|
319 |
-
bwg_enable_disable('none', 'tr_slideshow_title_position', 'slideshow_title_no');
|
320 |
-
}
|
321 |
-
jQuery("#tr_slideshow_enable_description").css('display', '');
|
322 |
-
if (jQuery("input[name=slideshow_enable_description]:checked").val() == 1) {
|
323 |
-
bwg_enable_disable('', 'tr_slideshow_description_position', 'slideshow_description_yes');
|
324 |
-
}
|
325 |
-
else {
|
326 |
-
bwg_enable_disable('none', 'tr_slideshow_description_position', 'slideshow_description_no');
|
327 |
-
}
|
328 |
-
jQuery("#tr_enable_slideshow_music").css('display', '');
|
329 |
-
if (jQuery("input[name=enable_slideshow_music]:checked").val() == 1) {
|
330 |
-
bwg_enable_disable('', 'tr_slideshow_music_url', 'slideshow_music_yes');
|
331 |
-
}
|
332 |
-
else {
|
333 |
-
bwg_enable_disable('none', 'tr_slideshow_music_url', 'slideshow_music_no');
|
334 |
-
}
|
335 |
-
break;
|
336 |
-
|
337 |
-
}
|
338 |
-
case 'image_browser': {
|
339 |
-
jQuery("#tr_gallery").css('display', '');
|
340 |
-
jQuery("#tr_sort_by").css('display', '');
|
341 |
-
jQuery("#tr_order_by").css('display', '');
|
342 |
-
jQuery("#tr_show_search_box").css('display', '');
|
343 |
-
jQuery("#tr_image_browser_width_height").css('display', '');
|
344 |
-
jQuery("#tr_image_browser_title_enable").css('display', '');
|
345 |
-
jQuery("#tr_image_browser_description_enable").css('display', '');
|
346 |
-
bwg_show_search_box();
|
347 |
-
break;
|
348 |
-
|
349 |
-
}
|
350 |
-
case 'album_compact_preview': {
|
351 |
-
jQuery("#tr_album").css('display', '');
|
352 |
-
jQuery("#tr_sort_by").css('display', '');
|
353 |
-
jQuery("#tr_order_by").css('display', '');
|
354 |
-
jQuery("#tr_show_search_box").css('display', '');
|
355 |
-
jQuery("#tr_compuct_album_column_number").css('display', '');
|
356 |
-
jQuery("#tr_compuct_albums_per_page").css('display', '');
|
357 |
-
jQuery("#tr_compuct_album_title_hover").css('display', '');
|
358 |
-
jQuery("#tr_compuct_album_view_type").css('display', '');
|
359 |
-
jQuery("#tr_compuct_album_thumb_width_height").css('display', '');
|
360 |
-
jQuery("#tr_compuct_album_image_column_number").css('display', '');
|
361 |
-
jQuery("#tr_compuct_album_images_per_page").css('display', '');
|
362 |
-
jQuery("#tr_compuct_album_image_title").css('display', '');
|
363 |
-
jQuery("#tr_compuct_album_image_title").css('display', '');
|
364 |
-
jQuery("#tr_compuct_album_image_thumb_width_height").css('display', '');
|
365 |
-
jQuery("#tr_compuct_album_enable_page").css('display', '');
|
366 |
-
bwg_change_compuct_album_view_type();
|
367 |
-
bwg_show_search_box();
|
368 |
-
break;
|
369 |
-
|
370 |
-
}
|
371 |
-
case 'album_extended_preview': {
|
372 |
-
jQuery("#tr_album").css('display', '');
|
373 |
-
jQuery("#tr_sort_by").css('display', '');
|
374 |
-
jQuery("#tr_order_by").css('display', '');
|
375 |
-
jQuery("#tr_show_search_box").css('display', '');
|
376 |
-
jQuery("#tr_extended_albums_per_page").css('display', '');
|
377 |
-
jQuery("#tr_extended_album_height").css('display', '');
|
378 |
-
jQuery("#tr_extended_album_description_enable").css('display', '');
|
379 |
-
jQuery("#tr_extended_album_view_type").css('display', '');
|
380 |
-
jQuery("#tr_extended_album_thumb_width_height").css('display', '');
|
381 |
-
jQuery("#tr_extended_album_image_column_number").css('display', '');
|
382 |
-
jQuery("#tr_extended_album_images_per_page").css('display', '');
|
383 |
-
jQuery("#tr_extended_album_image_title").css('display', '');
|
384 |
-
jQuery("#tr_extended_album_image_thumb_width_height").css('display', '');
|
385 |
-
jQuery("#tr_extended_album_enable_page").css('display', '');
|
386 |
-
bwg_change_extended_album_view_type();
|
387 |
-
bwg_show_search_box();
|
388 |
-
break;
|
389 |
-
|
390 |
-
}
|
391 |
-
case 'blog_style': {
|
392 |
-
jQuery("#tr_gallery").css('display', '');
|
393 |
-
jQuery("#tr_sort_by").css('display', '');
|
394 |
-
jQuery("#tr_order_by").css('display', '');
|
395 |
-
jQuery("#tr_show_search_box").css('display', '');
|
396 |
-
jQuery("#tr_blog_style_width_height").css('display', '');
|
397 |
-
jQuery("#tr_blog_style_title_enable").css('display', '');
|
398 |
-
jQuery("#tr_blog_style_images_per_page").css('display', '');
|
399 |
-
jQuery("#tr_blog_style_enable_page").css('display', '');
|
400 |
-
bwg_show_search_box();
|
401 |
-
break;
|
402 |
-
}
|
403 |
-
}
|
404 |
-
if (gallery_type != 'slideshow') {
|
405 |
-
jQuery("#tbody_popup_other").css('display', '');
|
406 |
-
jQuery("#tbody_popup").css('display', '');
|
407 |
-
jQuery("#tr_popup_width_height").css('display', '');
|
408 |
-
jQuery("#tr_popup_effect").css('display', '');
|
409 |
-
jQuery("#tr_popup_interval").css('display', '');
|
410 |
-
jQuery("#tr_popup_enable_filmstrip").css('display', '');
|
411 |
-
if (jQuery("input[name=popup_enable_filmstrip]:checked").val() == 1) {
|
412 |
-
bwg_enable_disable('', 'tr_popup_filmstrip_height', 'popup_filmstrip_yes');
|
413 |
-
}
|
414 |
-
else {
|
415 |
-
bwg_enable_disable('none', 'tr_popup_filmstrip_height', 'popup_filmstrip_no');
|
416 |
-
}
|
417 |
-
jQuery("#tr_popup_enable_ctrl_btn").css('display', '');
|
418 |
-
if (jQuery("input[name=popup_enable_ctrl_btn]:checked").val() == 1) {
|
419 |
-
bwg_enable_disable('', 'tbody_popup_ctrl_btn', 'popup_ctrl_btn_yes');
|
420 |
-
}
|
421 |
-
else {
|
422 |
-
bwg_enable_disable('none', 'tbody_popup_ctrl_btn', 'popup_ctrl_btn_no');
|
423 |
-
}
|
424 |
-
jQuery("#tr_popup_enable_fullscreen").css('display', '');
|
425 |
-
jQuery("#tr_popup_enable_info").css('display', '');
|
426 |
-
jQuery("#tr_popup_enable_rate").css('display', '');
|
427 |
-
jQuery("#tr_popup_enable_comment").css('display', '');
|
428 |
-
jQuery("#tr_popup_enable_facebook").css('display', '');
|
429 |
-
jQuery("#tr_popup_enable_twitter").css('display', '');
|
430 |
-
jQuery("#tr_popup_enable_google").css('display', '');
|
431 |
-
jQuery("#tr_popup_enable_pinterest").css('display', '');
|
432 |
-
jQuery("#tr_popup_enable_tumblr").css('display', '');
|
433 |
-
bwg_popup_fullscreen();
|
434 |
-
bwg_thumb_click_action();
|
435 |
-
}
|
436 |
-
}
|
437 |
-
|
438 |
-
function bwg_onKeyDown(e) {
|
439 |
-
var e = e || window.event;
|
440 |
-
var chCode1 = e.which || e.paramlist_keyCode;
|
441 |
-
if (chCode1 != 37 && chCode1 != 38 && chCode1 != 39 && chCode1 != 40) {
|
442 |
-
if ((!e.ctrlKey && !e.metaKey) || (chCode1 != 86 && chCode1 != 67 && chCode1 != 65 && chCode1 != 88)) {
|
443 |
-
e.preventDefault();
|
444 |
-
}
|
445 |
-
}
|
446 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
licensing/images/Plus.png
ADDED
Binary file
|
licensing/licensing.php
ADDED
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if (get_option("wds_theme_version")) {
|
3 |
+
$old_version = FALSE;
|
4 |
+
}
|
5 |
+
else {
|
6 |
+
$old_version = TRUE;
|
7 |
+
}
|
8 |
+
?>
|
9 |
+
<div style="text-align:center; float: left;">
|
10 |
+
<table class="data-bordered">
|
11 |
+
<thead>
|
12 |
+
<tr>
|
13 |
+
<th class="top first" nowrap="nowrap" scope="col">Features of the Slider WD</th>
|
14 |
+
<th class="top notranslate" nowrap="nowrap" scope="col">Free</th>
|
15 |
+
<th class="top notranslate" nowrap="nowrap" scope="col">Pro Version</th>
|
16 |
+
</tr>
|
17 |
+
</thead>
|
18 |
+
<tbody>
|
19 |
+
<tr class="alt">
|
20 |
+
<td>Responsive design and layout</td>
|
21 |
+
<td class="icon-replace yes">yes</td>
|
22 |
+
<td class="icon-replace yes">yes</td>
|
23 |
+
</tr>
|
24 |
+
<tr>
|
25 |
+
<td>Unlimited amount of sliders and layers</td>
|
26 |
+
<td class="icon-replace yes">yes</td>
|
27 |
+
<td class="icon-replace yes">yes</td>
|
28 |
+
</tr>
|
29 |
+
<tr class="alt">
|
30 |
+
<td>Full Width slider support</td>
|
31 |
+
<td class="icon-replace yes">yes</td>
|
32 |
+
<td class="icon-replace yes">yes</td>
|
33 |
+
</tr>
|
34 |
+
<?php if ($old_version) { ?>
|
35 |
+
<tr>
|
36 |
+
<td>Layers (text and image)</td>
|
37 |
+
<td class="icon-replace yes">yes</td>
|
38 |
+
<td class="icon-replace yes">yes</td>
|
39 |
+
</tr>
|
40 |
+
<?php } ?>
|
41 |
+
<tr class="alt">
|
42 |
+
<td>Possibility of linking slides to specific URLs</td>
|
43 |
+
<td class="icon-replace yes">yes</td>
|
44 |
+
<td class="icon-replace yes">yes</td>
|
45 |
+
</tr>
|
46 |
+
<tr>
|
47 |
+
<td>Autoplay</td>
|
48 |
+
<td class="icon-replace yes">yes</td>
|
49 |
+
<td class="icon-replace yes">yes</td>
|
50 |
+
</tr>
|
51 |
+
<tr class="alt">
|
52 |
+
<td>Shuffle</td>
|
53 |
+
<td class="icon-replace yes">yes</td>
|
54 |
+
<td class="icon-replace yes">yes</td>
|
55 |
+
</tr>
|
56 |
+
<tr>
|
57 |
+
<td>Timer Bar</td>
|
58 |
+
<td class="icon-replace yes">yes</td>
|
59 |
+
<td class="icon-replace yes">yes</td>
|
60 |
+
</tr>
|
61 |
+
<tr class="alt">
|
62 |
+
<td>Navigation bullets</td>
|
63 |
+
<td class="icon-replace yes">yes</td>
|
64 |
+
<td class="icon-replace yes">yes</td>
|
65 |
+
</tr>
|
66 |
+
<tr>
|
67 |
+
<td>Right-click protection for slides</td>
|
68 |
+
<td class="icon-replace yes">yes</td>
|
69 |
+
<td class="icon-replace yes">yes</td>
|
70 |
+
</tr>
|
71 |
+
<tr class="alt">
|
72 |
+
<td>Music playback</td>
|
73 |
+
<td class="icon-replace yes">yes</td>
|
74 |
+
<td class="icon-replace yes">yes</td>
|
75 |
+
</tr>
|
76 |
+
<tr>
|
77 |
+
<td>Custom CSS</td>
|
78 |
+
<td class="icon-replace yes">yes</td>
|
79 |
+
<td class="icon-replace yes">yes</td>
|
80 |
+
</tr>
|
81 |
+
<tr class="alt">
|
82 |
+
<td>Watermark support</td>
|
83 |
+
<td class="icon-replace yes">yes</td>
|
84 |
+
<td class="icon-replace yes">yes</td>
|
85 |
+
</tr>
|
86 |
+
<tr>
|
87 |
+
<td>Transition effects</td>
|
88 |
+
<td style="text-align:center;">5</td>
|
89 |
+
<td style="text-align:center;">26</td>
|
90 |
+
</tr>
|
91 |
+
<tr>
|
92 |
+
<td>Layer effects</td>
|
93 |
+
<td style="text-align:center;"><?php ($old_version ? 5 : ''); ?></td>
|
94 |
+
<td style="text-align:center;">38</td>
|
95 |
+
</tr>
|
96 |
+
<tr class="alt">
|
97 |
+
<td>Video Slide support (YouTube and Vimeo)</td>
|
98 |
+
<td class="icon-replace no">no</td>
|
99 |
+
<td class="icon-replace yes">yes</td>
|
100 |
+
</tr>
|
101 |
+
<?php if (!$old_version) { ?>
|
102 |
+
<tr>
|
103 |
+
<td>Text and image layers</td>
|
104 |
+
<td class="icon-replace no">no</td>
|
105 |
+
<td class="icon-replace yes">yes</td>
|
106 |
+
</tr>
|
107 |
+
<?php } ?>
|
108 |
+
<tr>
|
109 |
+
<td>Social sharing buttons layer (Google+, Tumblr, Twitter, Pinterest and Facebook)</td>
|
110 |
+
<td class="icon-replace no">no</td>
|
111 |
+
<td class="icon-replace yes">yes</td>
|
112 |
+
</tr>
|
113 |
+
<?php if (!$old_version) { ?>
|
114 |
+
<tr>
|
115 |
+
<td>Navigation buttons and bullet styles</td>
|
116 |
+
<td class="icon-replace no">no</td>
|
117 |
+
<td class="icon-replace yes">yes</td>
|
118 |
+
</tr>
|
119 |
+
<?php } ?>
|
120 |
+
<tr class="alt">
|
121 |
+
<td>Filmstrip support</td>
|
122 |
+
<td class="icon-replace no">no</td>
|
123 |
+
<td class="icon-replace yes">yes</td>
|
124 |
+
</tr>
|
125 |
+
</tbody>
|
126 |
+
</table>
|
127 |
+
</div>
|
128 |
+
<div style="float: right; text-align: right;">
|
129 |
+
<a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/files/fromslider.php">
|
130 |
+
<img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_S_URL . '/images/wd_logo.png'; ?>" />
|
131 |
+
</a>
|
132 |
+
</div>
|
133 |
+
<div style="float: left; clear: both;">
|
134 |
+
<p>After purchasing the commercial version follow these steps:</p>
|
135 |
+
<ol>
|
136 |
+
<li>Deactivate Slider WD plugin.</li>
|
137 |
+
<li>Delete Slider WD plugin.</li>
|
138 |
+
<li>Install the downloaded commercial version of the plugin.</li>
|
139 |
+
</ol>
|
140 |
+
</div>
|
licensing/style.css
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.data-bordered th {
|
2 |
+
background-color: #106EA2;
|
3 |
+
border-left: solid 1px #f28705;
|
4 |
+
border-top: none;
|
5 |
+
border-right: solid 1px #f28705;
|
6 |
+
color: #ffffff;
|
7 |
+
font: bold 0.85em;
|
8 |
+
font-size: 30px;
|
9 |
+
line-height: normal;
|
10 |
+
text-transform: none;
|
11 |
+
}
|
12 |
+
|
13 |
+
.data-bordered td.yes {
|
14 |
+
background-image: url("images/Plus.png");
|
15 |
+
}
|
16 |
+
.data-bordered th,
|
17 |
+
.data-bordered td {
|
18 |
+
border-left: solid 1px #b4b4b4;
|
19 |
+
border-top: solid 1px #b4b4b4;
|
20 |
+
border-right: solid 1px #b4b4b4;
|
21 |
+
padding: 5px 10px;
|
22 |
+
vertical-align: top;
|
23 |
+
}
|
24 |
+
.data-bordered {
|
25 |
+
color: #555;
|
26 |
+
border-bottom: 1px solid #B4B4B4;
|
27 |
+
border-collapse: collapse;
|
28 |
+
border-spacing: 0;
|
29 |
+
margin: 10px 0px;
|
30 |
+
text-align: center;
|
31 |
+
width: 543px;
|
32 |
+
}
|
33 |
+
.data-bordered .alt td {
|
34 |
+
background-color: #E5E5E5;
|
35 |
+
}
|
36 |
+
.data-bordered td {
|
37 |
+
font-size: 13px;
|
38 |
+
line-height: 15px;
|
39 |
+
text-align:left;
|
40 |
+
vertical-align: middle;
|
41 |
+
}
|
42 |
+
.data-bordered td.no,
|
43 |
+
.data-bordered td.yes {
|
44 |
+
background-position: center center;
|
45 |
+
background-repeat: no-repeat;
|
46 |
+
overflow: hidden;
|
47 |
+
text-indent: -9999px;
|
48 |
+
}
|
49 |
+
.data-bordered .alt td {
|
50 |
+
background-color: #E5E5E5;
|
51 |
+
}
|
52 |
+
.data-bordered .icon-replace {
|
53 |
+
min-width: 74px;
|
54 |
+
}
|
readme.txt
CHANGED
@@ -4,11 +4,11 @@ Donate link: http://web-dorado.com/products/wordpress-slider-plugin.html
|
|
4 |
Tags: best slider plugin, carousel, carousel slider, coin slider, content slider, content slideshow, custom video slider, flex slider, free video slider, free video slideshow, Horizontal slider, Image Rotator, image slider, image slideshow, javascript slider, javascript slideshow, jquery slider, jquery slideshow, Photo Slider, posts slider, responsive slider, responsive slideshow, sidebar, slide, slide show, slider, slider plugin, slider widget, slides, slideshow,slideshow manager, slideshow plugin, vertical slider, video slider, video slideshow,vimeo slideshow, vimeo slider, widget slider, widget slideshow, wordpress slider, wordpress slideshow, wp slider, youtube slider, youtube slideshow, post slider, fullscreen Slider, css3 slider, responsive image slider, banner slider, social slider, cycle slider, text slider, revolution slider, thumbnail slider, touch slider, sliders, parallax slider
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.0
|
7 |
-
Stable tag: 1.0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
-
Slider WD is a great tool for creating responsive sliders. It uses various transition effects
|
12 |
|
13 |
== Description ==
|
14 |
|
@@ -16,31 +16,31 @@ Slider WD is a great tool for creating responsive sliders. It uses various trans
|
|
16 |
[User Manual](http://web-dorado.com/wordpress-slider-wd-guide-step-1.html)
|
17 |
[Support Forum](http://web-dorado.com/forum/slider-plugin.html)
|
18 |
|
19 |
-
Slider WD is an effective tool for adding responsive sliders to your website. The slider plugin can be added both as a widget and plugin, as well as be included in the theme for displaying the slider within the theme using PHP function. Slider WD allows adding both images and videos (currently supporting YouTube and Vimeo to be displayed as slider slides). The numerous transition
|
|
|
|
|
20 |
|
21 |
-
The number of the slides for each slider is not limited. Various layers can be applied for each individual slide. There are three basic types of layers designed for the slides. Those are for sharing textual content, images and sharing buttons (Google+, Tumblr, Twitter, Pinterest and Facebook.)
|
22 |
-
The slides can be used for redirection to another location. Similar feature is also available with the text and image layers.
|
23 |
|
24 |
* Responsiveness
|
25 |
-
* Possibility of adding unlimited sliders and unlimited images
|
26 |
-
*
|
27 |
* Full-width slider support
|
28 |
* 5 transition effects
|
29 |
-
* 5 layer effects
|
30 |
-
* 2 types of Layers (text, image)
|
31 |
* Autoplay
|
32 |
* Shuffle
|
33 |
* Shortcode for easy insert of the slider into post/pages
|
34 |
-
* Possibility of changing the slide
|
|
|
35 |
* Support for music playback
|
36 |
* Time setting feature for the effect changes
|
37 |
* Right-click protection
|
38 |
* Image changing possibility using bullets
|
39 |
-
* Possibility to change design for the bullets, navigation buttons
|
40 |
* Timer bar
|
41 |
* Support for watermarks
|
42 |
* Design customization for almost all features
|
43 |
-
* Custom CSS support for adding additional styling features to the slider
|
|
|
44 |
|
45 |
Upgrade to [WordPress Slider Pro](http://web-dorado.com/products/wordpress-slider-plugin.html) to add features:
|
46 |
* 26 transition effects
|
@@ -48,7 +48,8 @@ Upgrade to [WordPress Slider Pro](http://web-dorado.com/products/wordpress-slide
|
|
48 |
* 3 types of Layers (text, image, social sharing)
|
49 |
* Slider Share feature for sliders (Google+, Tumblr, Twitter, Pinterest and Facebook)
|
50 |
* Slider Filmstrip possibility
|
51 |
-
*
|
|
|
52 |
|
53 |
### Supported languages
|
54 |
|
@@ -127,6 +128,15 @@ If any problem occurs, please contact us at [info@web-dorado.com](mailto:info@w
|
|
127 |
|
128 |
|
129 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
= 1.0.1 =
|
131 |
* User manual links added.
|
132 |
|
4 |
Tags: best slider plugin, carousel, carousel slider, coin slider, content slider, content slideshow, custom video slider, flex slider, free video slider, free video slideshow, Horizontal slider, Image Rotator, image slider, image slideshow, javascript slider, javascript slideshow, jquery slider, jquery slideshow, Photo Slider, posts slider, responsive slider, responsive slideshow, sidebar, slide, slide show, slider, slider plugin, slider widget, slides, slideshow,slideshow manager, slideshow plugin, vertical slider, video slider, video slideshow,vimeo slideshow, vimeo slider, widget slider, widget slideshow, wordpress slider, wordpress slideshow, wp slider, youtube slider, youtube slideshow, post slider, fullscreen Slider, css3 slider, responsive image slider, banner slider, social slider, cycle slider, text slider, revolution slider, thumbnail slider, touch slider, sliders, parallax slider
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.0
|
7 |
+
Stable tag: 1.0.2
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
+
Slider WD is a great tool for creating responsive sliders. It uses various transition effects.
|
12 |
|
13 |
== Description ==
|
14 |
|
16 |
[User Manual](http://web-dorado.com/wordpress-slider-wd-guide-step-1.html)
|
17 |
[Support Forum](http://web-dorado.com/forum/slider-plugin.html)
|
18 |
|
19 |
+
Slider WD is an effective tool for adding responsive sliders to your website. The slider plugin can be added both as a widget and plugin, as well as be included in the theme for displaying the slider within the theme using PHP function. Slider WD allows adding both images and videos (currently supporting YouTube and Vimeo to be displayed as slider slides). The numerous transition effects and layer support enhance the functionality of the product.
|
20 |
+
|
21 |
+
The number of the slides for each slider is not limited. Various layers can be applied for each individual slide. There are three basic types of layers designed for the slides. Those are for sharing textual content, images and sharing buttons (Google+, Tumblr, Twitter, Pinterest and Facebook.) The slides can be used for redirection to another location. Similar feature is also available with the text and image layers.
|
22 |
|
|
|
|
|
23 |
|
24 |
* Responsiveness
|
25 |
+
* Possibility of adding unlimited sliders and unlimited images for each slider
|
26 |
+
* Three options for adding images (from Media Library, by Slider WD Media Upload option or by using image URL)
|
27 |
* Full-width slider support
|
28 |
* 5 transition effects
|
|
|
|
|
29 |
* Autoplay
|
30 |
* Shuffle
|
31 |
* Shortcode for easy insert of the slider into post/pages
|
32 |
+
* Possibility of changing the slide orders (using drag and drop feature)
|
33 |
+
* Possibility to provide titles for the slides
|
34 |
* Support for music playback
|
35 |
* Time setting feature for the effect changes
|
36 |
* Right-click protection
|
37 |
* Image changing possibility using bullets
|
38 |
+
* Possibility to change design for the bullets, navigation buttons
|
39 |
* Timer bar
|
40 |
* Support for watermarks
|
41 |
* Design customization for almost all features
|
42 |
+
* Custom CSS support for adding additional styling features to the slider
|
43 |
+
* Possibility to use Slider WD Media Upload for uploading multiple images at once
|
44 |
|
45 |
Upgrade to [WordPress Slider Pro](http://web-dorado.com/products/wordpress-slider-plugin.html) to add features:
|
46 |
* 26 transition effects
|
48 |
* 3 types of Layers (text, image, social sharing)
|
49 |
* Slider Share feature for sliders (Google+, Tumblr, Twitter, Pinterest and Facebook)
|
50 |
* Slider Filmstrip possibility
|
51 |
+
* Navigation button/bullet styles
|
52 |
+
* Support for Vimeo and YouTube videos
|
53 |
|
54 |
### Supported languages
|
55 |
|
128 |
|
129 |
|
130 |
== Changelog ==
|
131 |
+
= 1.0.2 =
|
132 |
+
|
133 |
+
* Turn SliderWD Media Upload
|
134 |
+
* Ajax save
|
135 |
+
* Images Bulk Add
|
136 |
+
* Timer bar bug fixed
|
137 |
+
* change shortcode button
|
138 |
+
* fullwidth slider margin bug fixed
|
139 |
+
|
140 |
= 1.0.1 =
|
141 |
* User manual links added.
|
142 |
|
slider-wd.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/**
|
4 |
* Plugin Name: Slider WD
|
5 |
* Plugin URI: http://web-dorado.com/products/wordpress-slider-plugin.html
|
6 |
-
* Description: Slider WD is a great tool for creating responsive sliders. It uses various transition effects
|
7 |
-
* Version: 1.0.
|
8 |
* Author: WebDorado
|
9 |
* Author URI: http://web-dorado.com/
|
10 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
@@ -12,6 +12,14 @@
|
|
12 |
|
13 |
define('WD_S_DIR', WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__)));
|
14 |
define('WD_S_URL', plugins_url(plugin_basename(dirname(__FILE__))));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
// Plugin menu.
|
17 |
function wds_options_panel() {
|
@@ -20,6 +28,7 @@ function wds_options_panel() {
|
|
20 |
add_action('admin_print_styles-' . $sliders_page, 'wds_styles');
|
21 |
add_action('admin_print_scripts-' . $sliders_page, 'wds_scripts');
|
22 |
|
|
|
23 |
add_submenu_page('sliders_wds', 'Featured Plugins', 'Featured Plugins', 'manage_options', 'featured_plugins_wds', 'wds_featured');
|
24 |
|
25 |
$uninstall_page = add_submenu_page('sliders_wds', 'Uninstall', 'Uninstall', 'manage_options', 'uninstall_wds', 'wd_sliders');
|
@@ -39,6 +48,12 @@ function wd_sliders() {
|
|
39 |
}
|
40 |
}
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
function wds_featured() {
|
43 |
require_once(WD_S_DIR . '/featured/featured.php');
|
44 |
wp_register_style('wds_featured', WD_S_URL . '/featured/style.css', array(), get_option("wds_version"));
|
@@ -91,33 +106,74 @@ function wds_front_end($id) {
|
|
91 |
return;
|
92 |
}
|
93 |
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
}
|
|
|
99 |
|
100 |
-
//
|
101 |
-
|
102 |
-
$url = WD_S_URL . '/js/wds_edit_button.js';
|
103 |
-
$plugin_array["wds_mce"] = $url;
|
104 |
-
return $plugin_array;
|
105 |
-
}
|
106 |
|
107 |
function wds_admin_ajax() {
|
108 |
?>
|
109 |
<script>
|
110 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
</script>
|
112 |
<?php
|
113 |
}
|
114 |
add_action('admin_head', 'wds_admin_ajax');
|
115 |
|
116 |
-
// Add
|
117 |
-
add_action('
|
118 |
-
|
119 |
-
|
|
|
|
|
|
|
|
|
120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
// Slider Widget.
|
122 |
if (class_exists('WP_Widget')) {
|
123 |
require_once(WD_S_DIR . '/admin/controllers/WDSControllerWidgetSlideshow.php');
|
@@ -126,8 +182,22 @@ if (class_exists('WP_Widget')) {
|
|
126 |
|
127 |
// Activate plugin.
|
128 |
function wds_activate() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
$version = get_option("wds_version");
|
130 |
-
$new_version = '1.0.
|
131 |
if ($version && version_compare($version, $new_version, '<')) {
|
132 |
require_once WD_S_DIR . "/sliders-update.php";
|
133 |
wds_update($version);
|
@@ -136,13 +206,15 @@ function wds_activate() {
|
|
136 |
else {
|
137 |
require_once WD_S_DIR . "/sliders-insert.php";
|
138 |
wds_insert();
|
|
|
|
|
|
|
|
|
139 |
add_option("wds_version", $new_version, '', 'no');
|
140 |
}
|
141 |
}
|
142 |
-
register_activation_hook(__FILE__, 'wds_activate');
|
143 |
-
|
144 |
if (!isset($_GET['action']) || $_GET['action'] != 'deactivate') {
|
145 |
-
add_action('admin_init', '
|
146 |
}
|
147 |
|
148 |
// Plugin styles.
|
@@ -155,11 +227,11 @@ function wds_styles() {
|
|
155 |
function wds_scripts() {
|
156 |
$version = get_option("wds_version");
|
157 |
wp_enqueue_media();
|
158 |
-
wp_enqueue_script('jquery-ui-draggable');
|
159 |
wp_enqueue_script('thickbox');
|
160 |
-
wp_enqueue_script('wds_admin', WD_S_URL . '/js/wds.js', array(), get_option("wds_version"));
|
161 |
wp_enqueue_script('jquery');
|
162 |
wp_enqueue_script('jquery-ui-sortable');
|
|
|
|
|
163 |
wp_enqueue_script('jscolor', WD_S_URL . '/js/jscolor/jscolor.js', array(), '1.3.9');
|
164 |
wp_enqueue_style('wds_font-awesome', WD_S_URL . '/css/font-awesome-4.0.1/font-awesome.css', array(), '4.0.1');
|
165 |
wp_enqueue_style('wds_effects', WD_S_URL . '/css/wds_effects.css', array(), $version);
|
3 |
/**
|
4 |
* Plugin Name: Slider WD
|
5 |
* Plugin URI: http://web-dorado.com/products/wordpress-slider-plugin.html
|
6 |
+
* Description: Slider WD is a great tool for creating responsive sliders. It uses various transition effects.
|
7 |
+
* Version: 1.0.2
|
8 |
* Author: WebDorado
|
9 |
* Author URI: http://web-dorado.com/
|
10 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
12 |
|
13 |
define('WD_S_DIR', WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__)));
|
14 |
define('WD_S_URL', plugins_url(plugin_basename(dirname(__FILE__))));
|
15 |
+
global $wpdb;
|
16 |
+
if (/*$wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "bwg_option'")*/ false) {
|
17 |
+
$WD_S_UPLOAD_DIR = $wpdb->get_var($wpdb->prepare('SELECT images_directory FROM ' . $wpdb->prefix . 'bwg_option WHERE id="%d"', 1)) . '/slider-wd';
|
18 |
+
}
|
19 |
+
else {
|
20 |
+
$upload_dir = wp_upload_dir();
|
21 |
+
$WD_S_UPLOAD_DIR = str_replace(ABSPATH, '', $upload_dir['basedir']) . '/slider-wd';
|
22 |
+
}
|
23 |
|
24 |
// Plugin menu.
|
25 |
function wds_options_panel() {
|
28 |
add_action('admin_print_styles-' . $sliders_page, 'wds_styles');
|
29 |
add_action('admin_print_scripts-' . $sliders_page, 'wds_scripts');
|
30 |
|
31 |
+
add_submenu_page('sliders_wds', 'Licensing', 'Licensing', 'manage_options', 'licensing_wds', 'wds_licensing');
|
32 |
add_submenu_page('sliders_wds', 'Featured Plugins', 'Featured Plugins', 'manage_options', 'featured_plugins_wds', 'wds_featured');
|
33 |
|
34 |
$uninstall_page = add_submenu_page('sliders_wds', 'Uninstall', 'Uninstall', 'manage_options', 'uninstall_wds', 'wd_sliders');
|
48 |
}
|
49 |
}
|
50 |
|
51 |
+
function wds_licensing() {
|
52 |
+
wp_register_style('wds_licensing', WD_S_URL . '/licensing/style.css', array(), get_option("wds_version"));
|
53 |
+
wp_print_styles('wds_licensing');
|
54 |
+
require_once(WD_S_DIR . '/licensing/licensing.php');
|
55 |
+
}
|
56 |
+
|
57 |
function wds_featured() {
|
58 |
require_once(WD_S_DIR . '/featured/featured.php');
|
59 |
wp_register_style('wds_featured', WD_S_URL . '/featured/style.css', array(), get_option("wds_version"));
|
106 |
return;
|
107 |
}
|
108 |
|
109 |
+
function wds_media_button($context) {
|
110 |
+
global $pagenow;
|
111 |
+
if (in_array($pagenow, array('post.php', 'page.php', 'post-new.php', 'post-edit.php'))) {
|
112 |
+
$context .= '
|
113 |
+
<a onclick="tb_click.call(this); wds_thickDims(); return false;" href="' . add_query_arg(array('action' => 'WDSShortcode', 'TB_iframe' => '1'), admin_url('admin-ajax.php')) . '" class="wds_thickbox button" style="padding-left: 0.4em;" title="Select slider">
|
114 |
+
<span class="wp-media-buttons-icon wds_media_button_icon" style="vertical-align: text-bottom; background: url(' . WD_S_URL . '/images/wd_slider.png) no-repeat scroll left top rgba(0, 0, 0, 0);"></span>
|
115 |
+
Add Slider WD
|
116 |
+
</a>';
|
117 |
+
}
|
118 |
+
return $context;
|
119 |
}
|
120 |
+
add_filter('media_buttons_context', 'wds_media_button');
|
121 |
|
122 |
+
// Add the Slider button to editor.
|
123 |
+
add_action('wp_ajax_WDSShortcode', 'wds_ajax');
|
|
|
|
|
|
|
|
|
124 |
|
125 |
function wds_admin_ajax() {
|
126 |
?>
|
127 |
<script>
|
128 |
+
var wds_thickDims, wds_tbWidth, wds_tbHeight;
|
129 |
+
wds_tbWidth = 400;
|
130 |
+
wds_tbHeight = 200;
|
131 |
+
wds_thickDims = function() {
|
132 |
+
var tbWindow = jQuery('#TB_window'), H = jQuery(window).height(), W = jQuery(window).width(), w, h;
|
133 |
+
w = (wds_tbWidth && wds_tbWidth < W - 90) ? wds_tbWidth : W - 40;
|
134 |
+
h = (wds_tbHeight && wds_tbHeight < H - 60) ? wds_tbHeight : H - 40;
|
135 |
+
if (tbWindow.size()) {
|
136 |
+
tbWindow.width(w).height(h);
|
137 |
+
jQuery('#TB_iframeContent').width(w).height(h - 27);
|
138 |
+
tbWindow.css({'margin-left': '-' + parseInt((w / 2),10) + 'px'});
|
139 |
+
if (typeof document.body.style.maxWidth != 'undefined') {
|
140 |
+
tbWindow.css({'top':(H-h)/2,'margin-top':'0'});
|
141 |
+
}
|
142 |
+
}
|
143 |
+
};
|
144 |
</script>
|
145 |
<?php
|
146 |
}
|
147 |
add_action('admin_head', 'wds_admin_ajax');
|
148 |
|
149 |
+
// Add images to Slider
|
150 |
+
add_action('wp_ajax_wds_UploadHandler', 'wds_UploadHandler');
|
151 |
+
add_action('wp_ajax_addImage', 'wds_filemanager_ajax');
|
152 |
+
|
153 |
+
// Upload.
|
154 |
+
function wds_UploadHandler() {
|
155 |
+
require_once(WD_S_DIR . '/filemanager/UploadHandler.php');
|
156 |
+
}
|
157 |
|
158 |
+
function wds_filemanager_ajax() {
|
159 |
+
if (function_exists('current_user_can')) {
|
160 |
+
if (!current_user_can('publish_posts')) {
|
161 |
+
die('Access Denied');
|
162 |
+
}
|
163 |
+
}
|
164 |
+
else {
|
165 |
+
die('Access Denied');
|
166 |
+
}
|
167 |
+
global $wpdb;
|
168 |
+
require_once(WD_S_DIR . '/framework/WDW_S_Library.php');
|
169 |
+
$page = WDW_S_Library::get('action');
|
170 |
+
if (($page != '') && (($page == 'addImage') || ($page == 'addMusic'))) {
|
171 |
+
require_once(WD_S_DIR . '/filemanager/controller.php');
|
172 |
+
$controller_class = 'FilemanagerController';
|
173 |
+
$controller = new $controller_class();
|
174 |
+
$controller->execute();
|
175 |
+
}
|
176 |
+
}
|
177 |
// Slider Widget.
|
178 |
if (class_exists('WP_Widget')) {
|
179 |
require_once(WD_S_DIR . '/admin/controllers/WDSControllerWidgetSlideshow.php');
|
182 |
|
183 |
// Activate plugin.
|
184 |
function wds_activate() {
|
185 |
+
global $wpdb;
|
186 |
+
wds_install();
|
187 |
+
if (!$wpdb->get_var("SELECT * FROM " . $wpdb->prefix . "wdsslider")) {
|
188 |
+
$wpdb->query('INSERT INTO `' . $wpdb->prefix . 'wdsslider` VALUES(1, "Default slider", 1, 0, 800, 300, "cover", "center", "none", 5, 1, 0, 0, "", 1, "000000", 100, 0, "none", "FFFFFF", "", 0, "", 0, 1, 1, 0, "hover", "fa-angle", 40, 40, "FFFFFF", 100, "CCCCCC", 0, "none", "FFFFFF", "20px", "FFFFFF", "bottom", "fa-square-o", 20, "FFFFFF", "FFFFFF", 3, "none", 100, 50, "000000", 0, 0, "none", "FFFFFF", 50, "none", "middle-center", 15, "", "", 20, "arial.ttf", "FFFFFF", 70, "#wds_0_slide2_layer2 {\r\n text-align: center !important;\r\n}", "none", 5, "FFFFFF", 50, 1)');
|
189 |
+
}
|
190 |
+
if (!$wpdb->get_var("SELECT * FROM " . $wpdb->prefix . "wdsslide")) {
|
191 |
+
$wpdb->query('INSERT INTO `' . $wpdb->prefix . 'wdsslide` VALUES(1, 1, "Slide 1", "image", "' . WD_S_URL . '/demo/1.jpg", "' . WD_S_URL . '/demo/1-150x150.jpg", 1, "", 1)');
|
192 |
+
$wpdb->query('INSERT INTO `' . $wpdb->prefix . 'wdsslide` VALUES(2, 1, "Slide 2", "image", "' . WD_S_URL . '/demo/2.jpg", "' . WD_S_URL . '/demo/2-150x150.jpg", 1, "", 2)');
|
193 |
+
$wpdb->query('INSERT INTO `' . $wpdb->prefix . 'wdsslide` VALUES(3, 1, "Slide 3", "image", "' . WD_S_URL . '/demo/3.jpg", "' . WD_S_URL . '/demo/3-150x150.jpg", 1, "", 3)');
|
194 |
+
}
|
195 |
+
}
|
196 |
+
register_activation_hook(__FILE__, 'wds_activate');
|
197 |
+
|
198 |
+
function wds_install() {
|
199 |
$version = get_option("wds_version");
|
200 |
+
$new_version = '1.0.2';
|
201 |
if ($version && version_compare($version, $new_version, '<')) {
|
202 |
require_once WD_S_DIR . "/sliders-update.php";
|
203 |
wds_update($version);
|
206 |
else {
|
207 |
require_once WD_S_DIR . "/sliders-insert.php";
|
208 |
wds_insert();
|
209 |
+
if (!$version) {
|
210 |
+
var_dump('aa');
|
211 |
+
add_option("wds_theme_version", '1.0.0', '', 'no');
|
212 |
+
}
|
213 |
add_option("wds_version", $new_version, '', 'no');
|
214 |
}
|
215 |
}
|
|
|
|
|
216 |
if (!isset($_GET['action']) || $_GET['action'] != 'deactivate') {
|
217 |
+
add_action('admin_init', 'wds_install');
|
218 |
}
|
219 |
|
220 |
// Plugin styles.
|
227 |
function wds_scripts() {
|
228 |
$version = get_option("wds_version");
|
229 |
wp_enqueue_media();
|
|
|
230 |
wp_enqueue_script('thickbox');
|
|
|
231 |
wp_enqueue_script('jquery');
|
232 |
wp_enqueue_script('jquery-ui-sortable');
|
233 |
+
wp_enqueue_script('jquery-ui-draggable');
|
234 |
+
wp_enqueue_script('wds_admin', WD_S_URL . '/js/wds.js', array(), get_option("wds_version"));
|
235 |
wp_enqueue_script('jscolor', WD_S_URL . '/js/jscolor/jscolor.js', array(), '1.3.9');
|
236 |
wp_enqueue_style('wds_font-awesome', WD_S_URL . '/css/font-awesome-4.0.1/font-awesome.css', array(), '4.0.1');
|
237 |
wp_enqueue_style('wds_effects', WD_S_URL . '/css/wds_effects.css', array(), $version);
|
sliders-insert.php
CHANGED
@@ -71,6 +71,7 @@ function wds_insert() {
|
|
71 |
`timer_bar_size` int(4) NOT NULL,
|
72 |
`timer_bar_color` varchar(8) NOT NULL,
|
73 |
`timer_bar_transparent` int(4) NOT NULL,
|
|
|
74 |
PRIMARY KEY (`id`)
|
75 |
) DEFAULT CHARSET=utf8;";
|
76 |
$wpdb->query($wdsslider);
|
71 |
`timer_bar_size` int(4) NOT NULL,
|
72 |
`timer_bar_color` varchar(8) NOT NULL,
|
73 |
`timer_bar_transparent` int(4) NOT NULL,
|
74 |
+
`spider_uploader` tinyint(1) NOT NULL,
|
75 |
PRIMARY KEY (`id`)
|
76 |
) DEFAULT CHARSET=utf8;";
|
77 |
$wpdb->query($wdsslider);
|
sliders-update.php
CHANGED
@@ -2,6 +2,10 @@
|
|
2 |
|
3 |
function wds_update($version) {
|
4 |
global $wpdb;
|
|
|
|
|
|
|
|
|
5 |
return;
|
6 |
}
|
7 |
|
2 |
|
3 |
function wds_update($version) {
|
4 |
global $wpdb;
|
5 |
+
if (version_compare($version, '1.0.2') == -1) {
|
6 |
+
// Add spider uploader option.
|
7 |
+
$wpdb->query("ALTER TABLE " . $wpdb->prefix . "wdsslider ADD `spider_uploader` tinyint(1) NOT NULL DEFAULT 0");
|
8 |
+
}
|
9 |
return;
|
10 |
}
|
11 |
|