Version Description
- added option titlePosition : over / inside / outside
- added option transitionIn : elastic / fade / none
- added option transitionOut : elastic / fade / none
Download this release
Release Info
Developer | RavanH |
Plugin | Easy FancyBox |
Version | 1.3.1.2 |
Comparing to | |
See all releases |
Code changes from version 1.3.1 to 1.3.1.2
- fancybox.php +105 -9
- readme.txt +21 -6
fancybox.php
CHANGED
@@ -2,31 +2,124 @@
|
|
2 |
/*
|
3 |
Plugin Name: Easy FancyBox
|
4 |
Plugin URI: http://4visions.nl/en/wordpress-plugins/easy-fancybox/
|
5 |
-
Description: Hassle-free, no-settings, auto-enable <a href="http://fancybox.net/">FancyBox 1.3.1</a> on all image links including BMP, GIF, JPG, JPEG, and PNG. Uses packed Javascript. Happy with it? Please leave me a small <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&
|
6 |
-
Version: 1.3.1
|
7 |
Author: RavanH
|
8 |
Author URI: http://4visions.nl/
|
9 |
*/
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
// FUNCTIONS //
|
12 |
|
|
|
13 |
function easy_fancybox() {
|
14 |
-
|
15 |
?>
|
16 |
<script type="text/javascript">
|
17 |
jQuery(document).ready(function($){
|
18 |
var select = $('a[href$=".bmp"],a[href$=".gif"],a[href$=".jpg"],a[href$=".jpeg"],a[href$=".png"],a[href$=".BMP"],a[href$=".GIF"],a[href$=".JPG"],a[href$=".JPEG"],a[href$=".PNG"]');
|
19 |
-
select.attr('rel', 'fancybox')
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
|
|
|
|
|
|
24 |
});
|
25 |
});
|
26 |
</script>
|
27 |
<?php
|
28 |
}
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
// HOOKS //
|
31 |
|
32 |
if (!is_admin()) {
|
@@ -41,4 +134,7 @@ if (!is_admin()) {
|
|
41 |
wp_enqueue_script('jquery.mousewheel', plugins_url($efb, __FILE__).'/jquery.mousewheel.pack.js', array('jquery'), '3.0.2');
|
42 |
wp_enqueue_style('jquery.fancybox', plugins_url($efb, __FILE__).'/jquery.fancybox.css.php', false, '1.3.1');
|
43 |
add_action('wp_head', 'easy_fancybox');
|
44 |
-
}
|
|
|
|
|
|
2 |
/*
|
3 |
Plugin Name: Easy FancyBox
|
4 |
Plugin URI: http://4visions.nl/en/wordpress-plugins/easy-fancybox/
|
5 |
+
Description: Hassle-free, no-settings, auto-enable <a href="http://fancybox.net/">FancyBox 1.3.1</a> on all image links including BMP, GIF, JPG, JPEG, and PNG. Uses packed Javascript. Happy with it? Please leave me a small <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=Easy%20FancyBox&item_number=1%2e3%2e1&no_shipping=0&tax=0&bn=PP%2dDonationsBF&charset=UTF%2d8&lc=us">TIP</a> for development and support on this plugin and please consider a DONATION to the <a href="http://fancybox.net/">FancyBox project</a>.
|
6 |
+
Version: 1.3.1.2
|
7 |
Author: RavanH
|
8 |
Author URI: http://4visions.nl/
|
9 |
*/
|
10 |
|
11 |
+
$easy_fancybox_array = array(
|
12 |
+
'titlePosition' => array (
|
13 |
+
'title' => __('Title Position','easy-fancybox'),
|
14 |
+
'options' => array(
|
15 |
+
'over' => __('Overlay','easy-fancybox'),
|
16 |
+
'inside' => __('Inside','easy-fancybox'),
|
17 |
+
'outside' => __('Outside','easy-fancybox')
|
18 |
+
),
|
19 |
+
'default' => 'over',
|
20 |
+
'description' => __('Position of the overlay content title.','easy-fancybox')
|
21 |
+
),
|
22 |
+
'transitionIn' => array (
|
23 |
+
'title' => __('Transition In','easy-fancybox'),
|
24 |
+
'options' => array(
|
25 |
+
'elastic' => __('Elastic','easy-fancybox'),
|
26 |
+
'fade' => __('Fade in','easy-fancybox'),
|
27 |
+
'none' => __('None','easy-fancybox')
|
28 |
+
),
|
29 |
+
'default' => 'elastic',
|
30 |
+
'description' => __('Transition effect when opening the overlay.','easy-fancybox')
|
31 |
+
),
|
32 |
+
'transitionOut' => array (
|
33 |
+
'title' => __('Transition Out','easy-fancybox'),
|
34 |
+
'options' => array(
|
35 |
+
'elastic' => __('Elastic','easy-fancybox'),
|
36 |
+
'fade' => __('Fade out','easy-fancybox'),
|
37 |
+
'none' => __('None','easy-fancybox')
|
38 |
+
),
|
39 |
+
'default' => 'elastic',
|
40 |
+
'description' => __('Transition effect when closing the overlay.','easy-fancybox')
|
41 |
+
),
|
42 |
+
);
|
43 |
// FUNCTIONS //
|
44 |
|
45 |
+
// What about other things than link with img, like: div[class$="fancybox"] ?
|
46 |
function easy_fancybox() {
|
47 |
+
global $easy_fancybox_array;
|
48 |
?>
|
49 |
<script type="text/javascript">
|
50 |
jQuery(document).ready(function($){
|
51 |
var select = $('a[href$=".bmp"],a[href$=".gif"],a[href$=".jpg"],a[href$=".jpeg"],a[href$=".png"],a[href$=".BMP"],a[href$=".GIF"],a[href$=".JPG"],a[href$=".JPEG"],a[href$=".PNG"]');
|
52 |
+
select.attr('rel', 'fancybox').fancybox({
|
53 |
+
<?php
|
54 |
+
foreach ($easy_fancybox_array as $key => $values) {
|
55 |
+
$value = (get_option("fancybox_".$key)) ? get_option("fancybox_".$key) : $values['default'];
|
56 |
+
echo "
|
57 |
+
'".$key."' : '".$value."',";
|
58 |
+
}
|
59 |
+
?>
|
60 |
});
|
61 |
});
|
62 |
</script>
|
63 |
<?php
|
64 |
}
|
65 |
|
66 |
+
// FancyBox Media Settings
|
67 |
+
function easy_fancybox_options_section() {
|
68 |
+
echo '<p>'.__('The settings listed below determine the image overlay behaviour controlled by FancyBox.','easy-fancybox').'</p>';
|
69 |
+
}
|
70 |
+
|
71 |
+
function easy_fancybox_option_titlePosition(){
|
72 |
+
global $easy_fancybox_array;
|
73 |
+
echo '
|
74 |
+
<label><select name="fancybox_titlePosition" id="fancybox_titlePosition">';
|
75 |
+
foreach ($easy_fancybox_array['titlePosition']['options'] as $optionkey => $optionvalue) {
|
76 |
+
$selected = (get_option('fancybox_titlePosition') == $optionkey) ? ' selected="selected"' : '';
|
77 |
+
echo '
|
78 |
+
<option value="'.esc_attr($optionkey).'"'.$selected.'>'.$optionvalue.'</option>';
|
79 |
+
}
|
80 |
+
echo '
|
81 |
+
</select> '.$easy_fancybox_array['titlePosition']['description'].'</label>';
|
82 |
+
}
|
83 |
+
|
84 |
+
function easy_fancybox_option_transitionIn(){
|
85 |
+
global $easy_fancybox_array;
|
86 |
+
echo '
|
87 |
+
<label><select name="fancybox_transitionIn" id="fancybox_transitionIn">';
|
88 |
+
foreach ($easy_fancybox_array['transitionIn']['options'] as $optionkey => $optionvalue) {
|
89 |
+
$selected = (get_option('fancybox_transitionIn') == $optionkey) ? ' selected="selected"' : '';
|
90 |
+
echo '
|
91 |
+
<option value="'.esc_attr($optionkey).'"'.$selected.'>'.$optionvalue.'</option>';
|
92 |
+
}
|
93 |
+
echo '
|
94 |
+
</select> '.$easy_fancybox_array['transitionIn']['description'].'</label>';
|
95 |
+
}
|
96 |
+
|
97 |
+
function easy_fancybox_option_transitionOut(){
|
98 |
+
global $easy_fancybox_array;
|
99 |
+
echo '
|
100 |
+
<label><select name="fancybox_transitionOut" id="fancybox_transitionOut">';
|
101 |
+
foreach ($easy_fancybox_array['transitionOut']['options'] as $optionkey => $optionvalue) {
|
102 |
+
$selected = (get_option('fancybox_transitionOut') == $optionkey) ? ' selected="selected"' : '';
|
103 |
+
echo '
|
104 |
+
<option value="'.esc_attr($optionkey).'"'.$selected.'>'.$optionvalue.'</option>';
|
105 |
+
}
|
106 |
+
echo '
|
107 |
+
</select> '.$easy_fancybox_array['transitionOut']['description'].'</label>';
|
108 |
+
}
|
109 |
+
|
110 |
+
function easy_fancybox_admin_init(){
|
111 |
+
global $easy_fancybox_array;
|
112 |
+
load_plugin_textdomain('easy-fancybox');
|
113 |
+
|
114 |
+
add_settings_section('fancybox_section', __('FancyBox','easy-fancybox'), 'easy_fancybox_options_section', 'media');
|
115 |
+
|
116 |
+
foreach ($easy_fancybox_array as $key => $value) {
|
117 |
+
add_settings_field( 'fancybox_'.$key, $value['title'], 'easy_fancybox_option_'.$key, 'media', 'fancybox_section');
|
118 |
+
register_setting( 'media', 'fancybox_'.$key );
|
119 |
+
}
|
120 |
+
}
|
121 |
+
|
122 |
+
|
123 |
// HOOKS //
|
124 |
|
125 |
if (!is_admin()) {
|
134 |
wp_enqueue_script('jquery.mousewheel', plugins_url($efb, __FILE__).'/jquery.mousewheel.pack.js', array('jquery'), '3.0.2');
|
135 |
wp_enqueue_style('jquery.fancybox', plugins_url($efb, __FILE__).'/jquery.fancybox.css.php', false, '1.3.1');
|
136 |
add_action('wp_head', 'easy_fancybox');
|
137 |
+
}
|
138 |
+
|
139 |
+
add_action('admin_init','easy_fancybox_admin_init');
|
140 |
+
|
readme.txt
CHANGED
@@ -1,17 +1,21 @@
|
|
1 |
=== Easy FancyBox ===
|
2 |
Contributors: RavanH
|
3 |
-
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&
|
4 |
Tags: fancybox, jquery, images, lightbox, gallery, image overlay
|
5 |
Requires at least: 2.7
|
6 |
Tested up to: 3.0.1
|
7 |
-
Stable tag: 1.3.1
|
8 |
|
9 |
-
Hassle-free, no
|
10 |
|
11 |
== Description ==
|
12 |
|
13 |
No options to be set. No configuration pages. It just gives you FancyBox-in-a-Box :)
|
14 |
|
|
|
|
|
|
|
|
|
15 |
Check out the [Screenshot](http://wordpress.org/extend/plugins/easy-fancybox/screenshots/) and you know how images will be presented on your site as soon as you have installed and (network) activated this simple plugin.
|
16 |
|
17 |
Easy FancyBox uses the jQuery library that comes packed with WordPress.
|
@@ -40,6 +44,8 @@ Follow these steps:
|
|
40 |
|
41 |
Done! Check your sparkling new FancyBoxed images :)
|
42 |
|
|
|
|
|
43 |
= WordPress 3+ in Multi Site mode =
|
44 |
|
45 |
Same as above but do a **Network Activate** to activate FancyBox image overlays on each site on your network.
|
@@ -66,7 +72,7 @@ The same version as this plugin has. I aim to keep close pace to FancyBox upgrad
|
|
66 |
|
67 |
= Where is the settings page? =
|
68 |
|
69 |
-
There is no settings page.
|
70 |
|
71 |
= Is Easy FancyBox multi-site compatible? =
|
72 |
|
@@ -82,13 +88,22 @@ Yes. Upload the complete /easy-fancybox/ directory to /wp-content/mu-plugins/ an
|
|
82 |
|
83 |
== Screenshots ==
|
84 |
|
85 |
-
1. Example image with **Overlay** caption. This is the
|
86 |
|
87 |
== Changelog ==
|
88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
= 1.3.1 =
|
90 |
* Using FancyBox version 1.3.1
|
91 |
|
92 |
== Upgrade Notice ==
|
93 |
|
94 |
-
|
|
1 |
=== Easy FancyBox ===
|
2 |
Contributors: RavanH
|
3 |
+
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=Easy%20FancyBox&item_number=1%2e3%2e1&no_shipping=0&tax=0&bn=PP%2dDonationsBF&charset=UTF%2d8&lc=us
|
4 |
Tags: fancybox, jquery, images, lightbox, gallery, image overlay
|
5 |
Requires at least: 2.7
|
6 |
Tested up to: 3.0.1
|
7 |
+
Stable tag: 1.3.1.2
|
8 |
|
9 |
+
Hassle-free, no options pages, auto-enable FancyBox on all image links. Uses packed Javascript and is WP3.0 Multi-Site compatible.
|
10 |
|
11 |
== Description ==
|
12 |
|
13 |
No options to be set. No configuration pages. It just gives you FancyBox-in-a-Box :)
|
14 |
|
15 |
+
Looking for some basic control? You can find a new section **FancyBox** on your **Settings > Media** admin page.
|
16 |
+
* titlePosition ( over / inside / outside ) controls the position of the image title. Includes the new "Overlay" position.
|
17 |
+
* transitionIn and transitionOut ( elastic / fade / none ) control the transition effects during open and close.
|
18 |
+
|
19 |
Check out the [Screenshot](http://wordpress.org/extend/plugins/easy-fancybox/screenshots/) and you know how images will be presented on your site as soon as you have installed and (network) activated this simple plugin.
|
20 |
|
21 |
Easy FancyBox uses the jQuery library that comes packed with WordPress.
|
44 |
|
45 |
Done! Check your sparkling new FancyBoxed images :)
|
46 |
|
47 |
+
Not happy with the default settings? Check out the new options under **Settings > Media**.
|
48 |
+
|
49 |
= WordPress 3+ in Multi Site mode =
|
50 |
|
51 |
Same as above but do a **Network Activate** to activate FancyBox image overlays on each site on your network.
|
72 |
|
73 |
= Where is the settings page? =
|
74 |
|
75 |
+
There is no settings page but there are a few options you can change. See the new **FancyBox** section on **Settings > Media**. To see the default, check out the example under Screenshots and you see what that is...
|
76 |
|
77 |
= Is Easy FancyBox multi-site compatible? =
|
78 |
|
88 |
|
89 |
== Screenshots ==
|
90 |
|
91 |
+
1. Example image with **Overlay** caption. This is the default way Easy FancyBox displays images. Other options are **Inside** and the old **Outside**.
|
92 |
|
93 |
== Changelog ==
|
94 |
|
95 |
+
= 1.3.1.2 =
|
96 |
+
* added option titlePosition : over / inside / outside
|
97 |
+
* added option transitionIn : elastic / fade / none
|
98 |
+
* added option transitionOut : elastic / fade / none
|
99 |
+
|
100 |
+
= 1.3.1.1 =
|
101 |
+
* small jQuery speed improvement by chaining object calls
|
102 |
+
|
103 |
= 1.3.1 =
|
104 |
* Using FancyBox version 1.3.1
|
105 |
|
106 |
== Upgrade Notice ==
|
107 |
|
108 |
+
= 1.3.1.2 =
|
109 |
+
Control FancyBox options transitionIn, transitionOut and titlePosition including the new Overlay position.
|