Image Widget - Version 3.2.9

Version Description

  • Minor JS fix to hopefully address issues of lightbox not working
  • Use new the new jQuery.fn.on method for forward compatibility.
Download this release

Release Info

Developer mattwiebe
Plugin Icon 128x128 Image Widget
Version 3.2.9
Comparing to
See all releases

Code changes from version 3.2.8 to 3.2.9

Files changed (3) hide show
  1. image-widget.js +14 -5
  2. image-widget.php +8 -8
  3. readme.txt +4 -3
image-widget.js CHANGED
@@ -88,13 +88,22 @@
88
  'class', (align == 'none' ? '' : 'align'+align)
89
  );
90
  }
 
 
 
 
 
 
91
 
92
  $(document).ready(function() {
93
- $("a.thickbox-image-widget").live('click', function(event) {
94
- event.preventDefault();
95
- window.send_to_editor = image_widget_send_to_editor;
96
- tb_show("Add an Image", event.target.href, false);
97
- });
 
 
 
98
  // Modify thickbox link to fit window. Adapted from wp-admin\js\media-upload.dev.js.
99
  $('a.thickbox-image-widget').each( function() {
100
  var href = $(this).attr('href'), width = $(window).width(), H = $(window).height(), W = ( 720 < width ) ? 720 : width;
88
  'class', (align == 'none' ? '' : 'align'+align)
89
  );
90
  }
91
+
92
+ function imgHandler(ev) {
93
+ ev.preventDefault();
94
+ window.send_to_editor = image_widget_send_to_editor;
95
+ tb_show("Add an Image", event.target.href, false);
96
+ }
97
 
98
  $(document).ready(function() {
99
+ // Use new style event handling since $.fn.live() will be deprecated
100
+ if ( typeof $.fn.on === 'function' ) {
101
+ $("#widgets-right").on("click", "a.thickbox-image-widget", imgHandler);
102
+ }
103
+ else {
104
+ $("a.thickbox-image-widget").live('click', imgHandler);
105
+ }
106
+
107
  // Modify thickbox link to fit window. Adapted from wp-admin\js\media-upload.dev.js.
108
  $('a.thickbox-image-widget').each( function() {
109
  var href = $(this).attr('href'), width = $(window).width(), H = $(window).height(), W = ( 720 < width ) ? 720 : width;
image-widget.php CHANGED
@@ -3,23 +3,23 @@
3
  Plugin Name: Image Widget
4
  Plugin URI: http://wordpress.org/extend/plugins/image-widget/
5
  Description: Simple image widget that uses native Wordpress upload thickbox to add image widgets to your site.
6
- Author: Shane and Peter, Inc.
7
- Version: 3.2.8
8
- Author URI: http://www.shaneandpeter.com
9
  */
10
 
11
  // Load the widget on widgets_init
12
- function load_sp_image_widget() {
13
- register_widget('SP_Image_Widget');
14
  }
15
- add_action('widgets_init', 'load_sp_image_widget');
16
 
17
  /**
18
  * SP Image Widget class
19
  *
20
  * @author Shane & Peter, Inc. (Peter Chester)
21
  **/
22
- class SP_Image_Widget extends WP_Widget {
23
 
24
  var $pluginDomain = 'sp_image_widget';
25
 
@@ -29,7 +29,7 @@ class SP_Image_Widget extends WP_Widget {
29
  * @return void
30
  * @author Shane & Peter, Inc. (Peter Chester)
31
  */
32
- function SP_Image_Widget() {
33
  $this->loadPluginTextDomain();
34
  $widget_ops = array( 'classname' => 'widget_sp_image', 'description' => __( 'Showcase a single image with a Title, URL, and a Description', $this->pluginDomain ) );
35
  $control_ops = array( 'id_base' => 'widget_sp_image' );
3
  Plugin Name: Image Widget
4
  Plugin URI: http://wordpress.org/extend/plugins/image-widget/
5
  Description: Simple image widget that uses native Wordpress upload thickbox to add image widgets to your site.
6
+ Author: Modern Tribe, Inc.
7
+ Version: 3.2.9
8
+ Author URI: http://tri.be/
9
  */
10
 
11
  // Load the widget on widgets_init
12
+ function tribe_load_image_widget() {
13
+ register_widget('Tribe_Image_Widget');
14
  }
15
+ add_action('widgets_init', 'tribe_load_image_widget');
16
 
17
  /**
18
  * SP Image Widget class
19
  *
20
  * @author Shane & Peter, Inc. (Peter Chester)
21
  **/
22
+ class Tribe_Image_Widget extends WP_Widget {
23
 
24
  var $pluginDomain = 'sp_image_widget';
25
 
29
  * @return void
30
  * @author Shane & Peter, Inc. (Peter Chester)
31
  */
32
+ function Tribe_Image_Widget() {
33
  $this->loadPluginTextDomain();
34
  $widget_ops = array( 'classname' => 'widget_sp_image', 'description' => __( 'Showcase a single image with a Title, URL, and a Description', $this->pluginDomain ) );
35
  $control_ops = array( 'id_base' => 'widget_sp_image' );
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Image Widget ===
2
- Contributors: Shane & Peter, Inc., mattwiebe
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4BSPTNFFY6AL6
4
  Tags: widget, image, ad, banner, simple, upload, sidebar, admin, thickbox, resize
5
  Requires at least: 3.0
6
- Tested up to: 3.1
7
- Stable tag: 3.2.8
8
 
9
  == Description ==
10
 
@@ -71,6 +71,7 @@ function my_template_filter($template) {
71
  = 3.2.9 =
72
 
73
  * Minor JS fix to hopefully address issues of lightbox not working
 
74
 
75
  = 3.2.8 =
76
 
1
  === Image Widget ===
2
+ Contributors: moderntribe, peterchester, mattwiebe, Produced by Modern Tribe, Inc.
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4BSPTNFFY6AL6
4
  Tags: widget, image, ad, banner, simple, upload, sidebar, admin, thickbox, resize
5
  Requires at least: 3.0
6
+ Tested up to: 3.3
7
+ Stable tag: 3.2.9
8
 
9
  == Description ==
10
 
71
  = 3.2.9 =
72
 
73
  * Minor JS fix to hopefully address issues of lightbox not working
74
+ * Use new the new [jQuery.fn.on](http://api.jquery.com/on/) method for forward compatibility.
75
 
76
  = 3.2.8 =
77