Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added jquery as dependency all over

  • Loading branch information...
commit 4fe35099a873c95e4c4188aba15c7a78f78f571d 1 parent 53aecc5
Kaiser authored
2  inc/fields/color.php
@@ -19,7 +19,7 @@ class RWMB_Color_Field
19 19 static function admin_print_styles()
20 20 {
21 21 wp_enqueue_style( 'rwmb-color', RWMB_CSS_URL.'color.css', array( 'farbtastic' ), RWMB_VER );
22   - wp_enqueue_script( 'rwmb-color', RWMB_JS_URL.'color.js', array( 'farbtastic' ), RWMB_VER, true );
  22 + wp_enqueue_script( 'rwmb-color', RWMB_JS_URL.'color.js', array( 'jquery', 'farbtastic' ), RWMB_VER, true );
23 23 }
24 24
25 25 /**
8 inc/fields/datetime.php
@@ -26,10 +26,10 @@ static function admin_print_styles( )
26 26 wp_enqueue_style( 'jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.css", array( 'jquery-ui-datepicker', 'jquery-ui-slider' ), '0.9.7' );
27 27
28 28 $url = RWMB_JS_URL . 'jqueryui';
29   - wp_register_script( 'jquery-ui-datepicker', "{$url}/jquery.ui.datepicker.min.js", array( 'jquery-ui-core' ), '1.8.17', true );
30   - wp_register_script( 'jquery-ui-slider', "{$url}/jquery.ui.slider.min.js", array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-mouse' ), '1.8.17', true );
31   - wp_register_script( 'jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.js", array( 'jquery-ui-datepicker', 'jquery-ui-slider' ), '0.9.7', true );
32   - wp_enqueue_script( 'rwmb-datetime', RWMB_JS_URL . 'datetime.js', array( 'jquery-ui-timepicker' ), RWMB_VER, true );
  29 + wp_register_script( 'jquery-ui-datepicker', "{$url}/jquery.ui.datepicker.min.js", array( 'jquery', 'jquery-ui-core' ), '1.8.17', true );
  30 + wp_register_script( 'jquery-ui-slider', "{$url}/jquery.ui.slider.min.js", array( 'jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-mouse' ), '1.8.17', true );
  31 + wp_register_script( 'jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.js", array( 'jquery', 'jquery-ui-datepicker', 'jquery-ui-slider' ), '0.9.7', true );
  32 + wp_enqueue_script( 'rwmb-datetime', RWMB_JS_URL . 'datetime.js', array( 'jquery', 'jquery-ui-timepicker' ), RWMB_VER, true );
33 33 }
34 34
35 35 /**
8 inc/fields/file.php
... ... @@ -1,6 +1,6 @@
1 1 <?php
2 2 // Prevent loading this file directly - Busted!
3   -if( ! class_exists('WP') )
  3 +if ( ! class_exists('WP') )
4 4 {
5 5 header( 'Status: 403 Forbidden' );
6 6 header( 'HTTP/1.1 403 Forbidden' );
@@ -64,9 +64,13 @@ static function wp_ajax_delete_file()
64 64 $ok = $ok && wp_delete_attachment( $attachment_id );
65 65
66 66 if ( $ok )
  67 + {
67 68 RW_Meta_Box::ajax_response( '', 'success' );
  69 + }
68 70 else
  71 + {
69 72 RW_Meta_Box::ajax_response( __( "Error: Cannot delete file", 'rwmb' ), 'error' );
  73 + }
70 74 }
71 75
72 76 /**
@@ -176,7 +180,7 @@ static function fix_file_array( $files )
176 180 {
177 181 foreach ( $list as $index => $value )
178 182 {
179   - $output[$index][$key] = $value;
  183 + $output[ $index ][ $key ] = $value;
180 184 }
181 185 }
182 186 return $output;
12 inc/fields/image.php
... ... @@ -1,6 +1,6 @@
1 1 <?php
2 2 // Prevent loading this file directly - Busted!
3   -if( ! class_exists('WP') )
  3 +if ( ! class_exists('WP') )
4 4 {
5 5 header( 'Status: 403 Forbidden' );
6 6 header( 'HTTP/1.1 403 Forbidden' );
@@ -23,7 +23,7 @@ static function admin_print_styles()
23 23
24 24 wp_enqueue_style( 'rwmb-image', RWMB_CSS_URL.'image.css', array(), RWMB_VER );
25 25
26   - wp_enqueue_script( 'rwmb-image', RWMB_JS_URL.'image.js', array( 'jquery-ui-sortable', 'wp-ajax-response' ), RWMB_VER, true );
  26 + wp_enqueue_script( 'rwmb-image', RWMB_JS_URL.'image.js', array( 'jquery', 'jquery-ui-sortable', 'wp-ajax-response' ), RWMB_VER, true );
27 27 }
28 28
29 29 /**
@@ -149,12 +149,14 @@ static function meta( $meta, $post_id, $saved, $field )
149 149 $meta = implode( ',' , $meta );
150 150
151 151 // Re-arrange images with 'menu_order', thanks Onur
152   - $meta = $wpdb->get_col( "
  152 + $meta = $wpdb->get_col( $wpdb->prepare( "
153 153 SELECT ID FROM {$wpdb->posts}
154 154 WHERE post_type = 'attachment'
155   - AND ID in ({$meta})
  155 + AND ID in (%s)
156 156 ORDER BY menu_order ASC
157   - " );
  157 + ",
  158 + $meta
  159 + ) );
158 160
159 161 return (array) $meta;
160 162 }
30 inc/fields/plupload-image.php
@@ -98,21 +98,23 @@ static function admin_print_styles()
98 98 wp_enqueue_script( 'plupload-all' );
99 99
100 100 wp_enqueue_style( 'rwmb-plupload-image', RWMB_CSS_URL.'plupload-image.css', array(), RWMB_VER );
101   - wp_enqueue_script( 'rwmb-plupload-image', RWMB_JS_URL.'plupload-image.js', array( 'jquery-ui-sortable', 'wp-ajax-response', 'plupload-all' ), RWMB_VER, true );
102   - //Heartcode Canvas Loader
103   - wp_enqueue_script('heartcode-canvasloader', 'http://heartcode-canvasloader.googlecode.com/files/heartcode-canvasloader-min-0.9.1.js');
  101 +
  102 + wp_enqueue_script( 'rwmb-plupload-image', RWMB_JS_URL.'plupload-image.js', array( 'jquery', 'jquery-ui-sortable', 'wp-ajax-response', 'plupload-all' ), RWMB_VER, true );
  103 + // Heartcode Canvas Loader
  104 + wp_enqueue_script( 'heartcode-canvasloader', RWMB_JS_URL.'external/heartcode_canvasloader_0.9.1.min.js', array( 'jquery', 'jquery-ui-sortable', 'wp-ajax-response', 'plupload-all' ), RWMB_VER, true );
  105 +
104 106 wp_localize_script( 'rwmb-plupload-image', 'rwmb_plupload_defaults', array(
105   - 'runtimes' => 'html5,silverlight,flash,html4',
106   - 'file_data_name' => 'async-upload',
107   - 'multiple_queues' => true,
108   - 'max_file_size' => wp_max_upload_size().'b',
109   - 'url' => admin_url('admin-ajax.php'),
110   - 'flash_swf_url' => includes_url( 'js/plupload/plupload.flash.swf' ),
111   - 'silverlight_xap_url' => includes_url( 'js/plupload/plupload.silverlight.xap' ),
112   - 'filters' => array( array( 'title' => _x( 'Allowed Image Files', 'image upload', 'rwmb' ), 'extensions' => 'jpg,jpeg,gif,png' ) ),
113   - 'multipart' => true,
114   - 'urlstream_upload' => true,
115   - ));
  107 + 'runtimes' => 'html5,silverlight,flash,html4',
  108 + 'file_data_name' => 'async-upload',
  109 + 'multiple_queues' => true,
  110 + 'max_file_size' => wp_max_upload_size().'b',
  111 + 'url' => admin_url('admin-ajax.php'),
  112 + 'flash_swf_url' => includes_url( 'js/plupload/plupload.flash.swf' ),
  113 + 'silverlight_xap_url' => includes_url( 'js/plupload/plupload.silverlight.xap' ),
  114 + 'filters' => array( array( 'title' => _x( 'Allowed Image Files', 'image upload', 'rwmb' ), 'extensions' => 'jpg,jpeg,gif,png' ) ),
  115 + 'multipart' => true,
  116 + 'urlstream_upload' => true
  117 + ) );
116 118 }
117 119
118 120 /**
4 inc/fields/slider.php
@@ -23,8 +23,8 @@ static function admin_print_styles()
23 23 wp_enqueue_style( 'jquery-ui-theme', "{$url}/jquery.ui.theme.css", array(), '1.8.17' );
24 24
25 25 $url = RWMB_JS_URL . 'jqueryui';
26   - wp_enqueue_script( 'jquery-ui-slider', "{$url}/jquery.ui.slider.min.js", array( 'jquery-ui-core' ), '1.8.17', true );
27   - wp_enqueue_script( 'rwmb-slider', RWMB_JS_URL . 'slider.js', array( 'jquery-ui-slider' ), RWMB_VER, true );
  26 + wp_enqueue_script( 'jquery-ui-slider', "{$url}/jquery.ui.slider.min.js", array( 'jquery', 'jquery-ui-core' ), '1.8.17', true );
  27 + wp_enqueue_script( 'rwmb-slider', RWMB_JS_URL . 'slider.js', array( 'jquery', 'jquery-ui-slider' ), RWMB_VER, true );
28 28 }
29 29
30 30 /**
12 inc/fields/time.php
@@ -19,17 +19,17 @@ class RWMB_Time_Field
19 19 static function admin_print_styles( )
20 20 {
21 21 $url = RWMB_CSS_URL . 'jqueryui';
22   - wp_register_style( 'jquery-ui-core', "{$url}/jquery.ui.core.css", array( ), '1.8.17' );
23   - wp_register_style( 'jquery-ui-theme', "{$url}/jquery.ui.theme.css", array( ), '1.8.17' );
  22 + wp_register_style( 'jquery-ui-core', "{$url}/jquery.ui.core.css", array(), '1.8.17' );
  23 + wp_register_style( 'jquery-ui-theme', "{$url}/jquery.ui.theme.css", array(), '1.8.17' );
24 24 wp_register_style( 'jquery-ui-datepicker', "{$url}/jquery.ui.datepicker.css", array( 'jquery-ui-core', 'jquery-ui-theme' ), '1.8.17' );
25 25 wp_register_style( 'jquery-ui-slider', "{$url}/jquery.ui.slider.css", array( 'jquery-ui-core', 'jquery-ui-theme' ), '1.8.17' );
26 26 wp_enqueue_style( 'jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.css", array( 'jquery-ui-datepicker', 'jquery-ui-slider' ), '0.9.7' );
27 27
28 28 $url = RWMB_JS_URL . 'jqueryui';
29   - wp_register_script( 'jquery-ui-datepicker', "{$url}/jquery.ui.datepicker.min.js", array( 'jquery-ui-core' ), '1.8.17', true );
30   - wp_register_script( 'jquery-ui-slider', "{$url}/jquery.ui.slider.min.js", array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-mouse' ), '1.8.17', true );
31   - wp_register_script( 'jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.js", array( 'jquery-ui-datepicker', 'jquery-ui-slider' ), '0.9.7', true );
32   - wp_enqueue_script( 'rwmb-time', RWMB_JS_URL.'time.js', array( 'jquery-ui-timepicker' ), RWMB_VER, true );
  29 + wp_register_script( 'jquery-ui-datepicker', "{$url}/jquery.ui.datepicker.min.js", array( 'jquery', 'jquery-ui-core' ), '1.8.17', true );
  30 + wp_register_script( 'jquery-ui-slider', "{$url}/jquery.ui.slider.min.js", array( 'jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-mouse' ), '1.8.17', true );
  31 + wp_register_script( 'jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.js", array( 'jquery', 'jquery-ui-datepicker', 'jquery-ui-slider' ), '0.9.7', true );
  32 + wp_enqueue_script( 'rwmb-time', RWMB_JS_URL.'time.js', array( 'jquery', 'jquery-ui-timepicker' ), RWMB_VER, true );
33 33 }
34 34
35 35 /**

0 comments on commit 4fe3509

Please sign in to comment.
Something went wrong with that request. Please try again.