Gravity Forms CSS Ready Class Selector - Version 1.0.1

Version Description

Download this release

Release Info

Developer bradvin
Plugin Icon wp plugin Gravity Forms CSS Ready Class Selector
Version 1.0.1
Comparing to
See all releases

Code changes from version 1.0 to 1.0.1

Files changed (2) hide show
  1. gf-readyclasses-addon.php +41 -41
  2. readme.txt +7 -4
gf-readyclasses-addon.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Gravity Forms CSS Ready Class Selector
4
  Plugin URI: http://themergency.com/plugins/gravity-forms-custom-post-types/
5
  Description: Easily select a CSS "Ready Class" for your fields within Gravity Forms
6
- Version: 1.0
7
  Author: Brad Vincent
8
  Author URI: http://themergency.com/
9
  License: GPL2
@@ -34,7 +34,7 @@ if (!class_exists('RGFormsModel'))
34
  if (!class_exists('GFCommon'))
35
  @include_once(WP_PLUGIN_DIR . '/gravityforms/common.php');
36
 
37
- @include_once "GFAddonCommon.php";
38
 
39
  add_action('init', array('GFReadyClassesAddon', 'init'));
40
  add_action('admin_notices', array('GFReadyClassesAddon', 'admin_warnings'));
@@ -187,51 +187,51 @@ if (!class_exists('GFReadyClassesAddon')) {
187
  jQuery(document).bind("gform_load_field_settings", function(event, field, form){
188
 
189
  if (jQuery("#css_ready_selector").length == 0) {
190
- //jQuery("#css_ready_selector").remove();
191
- //jQuery("#css_ready_modal").remove();
192
 
193
- //add some html after the CSS Class Name input
194
- var $select_link = jQuery("<a id='css_ready_selector' href='#'><img src='<?php echo $btn_url; ?>' /></a>");
195
-
196
- var $modal = jQuery("<?php echo preg_replace( '/\s*[\r\n\t]+\s*/', '', $modal_html ); ?>").hide();
197
-
198
- jQuery(".css_class_setting").append($select_link).append($modal);
199
-
200
- $select_link.click(function(e) {
201
- e.preventDefault();
202
- var $m = jQuery("#css_ready_modal");
203
 
204
- $m.find(".cssr_acc_link").unbind("click").click(function(e) {
205
- e.preventDefault();
206
- jQuery('.cssr_accordian:visible').slideUp();
207
- jQuery(this).parent("li:first").find(".cssr_accordian").slideDown();
208
- });
209
 
210
- var $links = $m.find(".cssr_link");
211
 
212
- $links.unbind("click").click(function(e) {
213
  e.preventDefault();
214
- var css = jQuery(this).attr("rel");
215
- addTokenToInput(jQuery("#field_css_class"), css, ' ');
216
- });
217
-
218
- $links.unbind("dblclick").dblclick(function(e) {
219
- e.preventDefault();
220
- var css = jQuery(this).attr("rel");
221
- addTokenToInput(jQuery("#field_css_class"), css, ' ');
222
- jQuery.modal.close();
223
- });
224
-
225
- $m.modal({
226
- onOpen: function (dialog) {
227
- dialog.overlay.fadeIn(function () {
228
- dialog.container.slideDown(function () {
229
- dialog.data.fadeIn('slow');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
230
  });
231
- });
232
- }
233
- });
234
- });
235
 
236
  }
237
 
3
  Plugin Name: Gravity Forms CSS Ready Class Selector
4
  Plugin URI: http://themergency.com/plugins/gravity-forms-custom-post-types/
5
  Description: Easily select a CSS "Ready Class" for your fields within Gravity Forms
6
+ Version: 1.0.1
7
  Author: Brad Vincent
8
  Author URI: http://themergency.com/
9
  License: GPL2
34
  if (!class_exists('GFCommon'))
35
  @include_once(WP_PLUGIN_DIR . '/gravityforms/common.php');
36
 
37
+ @include_once "gfaddoncommon.php";
38
 
39
  add_action('init', array('GFReadyClassesAddon', 'init'));
40
  add_action('admin_notices', array('GFReadyClassesAddon', 'admin_warnings'));
187
  jQuery(document).bind("gform_load_field_settings", function(event, field, form){
188
 
189
  if (jQuery("#css_ready_selector").length == 0) {
 
 
190
 
191
+ //add some html after the CSS Class Name input
192
+ var $select_link = jQuery("<a id='css_ready_selector' href='#'><img src='<?php echo $btn_url; ?>' /></a>");
 
 
 
 
 
 
 
 
193
 
194
+ var $modal = jQuery("<?php echo preg_replace( '/\s*[\r\n\t]+\s*/', '', $modal_html ); ?>").hide();
 
 
 
 
195
 
196
+ jQuery(".css_class_setting").append($select_link).append($modal);
197
 
198
+ $select_link.click(function(e) {
199
  e.preventDefault();
200
+ var $m = jQuery("#css_ready_modal");
201
+
202
+ $m.find(".cssr_acc_link").unbind("click").click(function(e) {
203
+ e.preventDefault();
204
+ jQuery('.cssr_accordian:visible').slideUp();
205
+ jQuery(this).parent("li:first").find(".cssr_accordian").slideDown();
206
+ });
207
+
208
+ var $links = $m.find(".cssr_link");
209
+
210
+ $links.unbind("click").click(function(e) {
211
+ e.preventDefault();
212
+ var css = jQuery(this).attr("rel");
213
+ addTokenToInput(jQuery("#field_css_class"), css, ' ');
214
+ SetFieldProperty('cssClass', jQuery("#field_css_class").val().trim());
215
+ });
216
+
217
+ $links.unbind("dblclick").dblclick(function(e) {
218
+ e.preventDefault();
219
+ var css = jQuery(this).attr("rel");
220
+ addTokenToInput(jQuery("#field_css_class"), css, ' ');
221
+ SetFieldProperty('cssClass', jQuery("#field_css_class").val().trim());
222
+ jQuery.modal.close();
223
+ });
224
+
225
+ $m.modal({
226
+ onOpen: function (dialog) {
227
+ dialog.overlay.fadeIn(function () {
228
+ dialog.container.slideDown(function () {
229
+ dialog.data.fadeIn('slow');
230
+ });
231
  });
232
+ }
233
+ });
234
+ });
 
235
 
236
  }
237
 
readme.txt CHANGED
@@ -4,14 +4,14 @@ Donate link: http://themergency.com/donate/
4
  Tags: form,forms,gravity,gravity form,gravity forms,ready classes,CSS Ready,CSS,class
5
  Requires at least: 3.0
6
  Tested up to: 3.2
7
- Stable tag: 1.0
8
 
9
  Easily select a CSS "Ready Class" for your fields within Gravity Forms
10
 
11
  == Description ==
12
 
13
- > This plugin is an add-on for the [Gravity Forms Plugin](http://bit.ly/getgravityforms "visit the Gravity Forms website").
14
- > If you don't yet own a license of the best forms plugin for WordPress, go and [buy one now!](http://bit.ly/getgravityforms "purchase Gravity Forms!")
15
 
16
  **Requires at least v1.5 of Gravity Forms**
17
 
@@ -40,10 +40,13 @@ Easily select a CSS "Ready Class" for your fields within Gravity Forms
40
  = 1.0 =
41
  * Initial Relase. First version.
42
 
 
 
 
43
  == Frequently Asked Questions ==
44
 
45
  = Does this plugin rely on anything? =
46
- Yes, you need to install the [Gravity Forms Plugin](http://bit.ly/getgravityforms "visit the Gravity Forms website") for this plugin to work. And it needs to be at leat v1.5
47
 
48
  == Upgrade Notice ==
49
 
4
  Tags: form,forms,gravity,gravity form,gravity forms,ready classes,CSS Ready,CSS,class
5
  Requires at least: 3.0
6
  Tested up to: 3.2
7
+ Stable tag: 1.0.1
8
 
9
  Easily select a CSS "Ready Class" for your fields within Gravity Forms
10
 
11
  == Description ==
12
 
13
+ > This plugin is an add-on for the amazing *Gravity Forms Plugin*.
14
+ > Check out my other free [Add-ons for Gravity Forms](http://themergency.com/gravity-forms-addon-plugins/)
15
 
16
  **Requires at least v1.5 of Gravity Forms**
17
 
40
  = 1.0 =
41
  * Initial Relase. First version.
42
 
43
+ = 1.1 =
44
+ * Fixed bug where classes were not being updated.
45
+
46
  == Frequently Asked Questions ==
47
 
48
  = Does this plugin rely on anything? =
49
+ Yes, you need to install the [Gravity Forms Plugin](http://themergency.com/gravity-forms-addon-plugins/) for this plugin to work. And it needs to be at leat v1.5
50
 
51
  == Upgrade Notice ==
52