Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added jquery as dependency all over

  • Loading branch information...
commit 4fe35099a873c95e4c4188aba15c7a78f78f571d 1 parent 53aecc5
@franz-josef-kaiser authored
View
2  inc/fields/color.php
@@ -19,7 +19,7 @@ class RWMB_Color_Field
static function admin_print_styles()
{
wp_enqueue_style( 'rwmb-color', RWMB_CSS_URL.'color.css', array( 'farbtastic' ), RWMB_VER );
- wp_enqueue_script( 'rwmb-color', RWMB_JS_URL.'color.js', array( 'farbtastic' ), RWMB_VER, true );
+ wp_enqueue_script( 'rwmb-color', RWMB_JS_URL.'color.js', array( 'jquery', 'farbtastic' ), RWMB_VER, true );
}
/**
View
8 inc/fields/datetime.php
@@ -26,10 +26,10 @@ static function admin_print_styles( )
wp_enqueue_style( 'jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.css", array( 'jquery-ui-datepicker', 'jquery-ui-slider' ), '0.9.7' );
$url = RWMB_JS_URL . 'jqueryui';
- wp_register_script( 'jquery-ui-datepicker', "{$url}/jquery.ui.datepicker.min.js", array( 'jquery-ui-core' ), '1.8.17', true );
- 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 );
- wp_register_script( 'jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.js", array( 'jquery-ui-datepicker', 'jquery-ui-slider' ), '0.9.7', true );
- wp_enqueue_script( 'rwmb-datetime', RWMB_JS_URL . 'datetime.js', array( 'jquery-ui-timepicker' ), RWMB_VER, true );
+ wp_register_script( 'jquery-ui-datepicker', "{$url}/jquery.ui.datepicker.min.js", array( 'jquery', 'jquery-ui-core' ), '1.8.17', true );
+ 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 );
+ wp_register_script( 'jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.js", array( 'jquery', 'jquery-ui-datepicker', 'jquery-ui-slider' ), '0.9.7', true );
+ wp_enqueue_script( 'rwmb-datetime', RWMB_JS_URL . 'datetime.js', array( 'jquery', 'jquery-ui-timepicker' ), RWMB_VER, true );
}
/**
View
8 inc/fields/file.php
@@ -1,6 +1,6 @@
<?php
// Prevent loading this file directly - Busted!
-if( ! class_exists('WP') )
+if ( ! class_exists('WP') )
{
header( 'Status: 403 Forbidden' );
header( 'HTTP/1.1 403 Forbidden' );
@@ -64,9 +64,13 @@ static function wp_ajax_delete_file()
$ok = $ok && wp_delete_attachment( $attachment_id );
if ( $ok )
+ {
RW_Meta_Box::ajax_response( '', 'success' );
+ }
else
+ {
RW_Meta_Box::ajax_response( __( "Error: Cannot delete file", 'rwmb' ), 'error' );
+ }
}
/**
@@ -176,7 +180,7 @@ static function fix_file_array( $files )
{
foreach ( $list as $index => $value )
{
- $output[$index][$key] = $value;
+ $output[ $index ][ $key ] = $value;
}
}
return $output;
View
12 inc/fields/image.php
@@ -1,6 +1,6 @@
<?php
// Prevent loading this file directly - Busted!
-if( ! class_exists('WP') )
+if ( ! class_exists('WP') )
{
header( 'Status: 403 Forbidden' );
header( 'HTTP/1.1 403 Forbidden' );
@@ -23,7 +23,7 @@ static function admin_print_styles()
wp_enqueue_style( 'rwmb-image', RWMB_CSS_URL.'image.css', array(), RWMB_VER );
- wp_enqueue_script( 'rwmb-image', RWMB_JS_URL.'image.js', array( 'jquery-ui-sortable', 'wp-ajax-response' ), RWMB_VER, true );
+ wp_enqueue_script( 'rwmb-image', RWMB_JS_URL.'image.js', array( 'jquery', 'jquery-ui-sortable', 'wp-ajax-response' ), RWMB_VER, true );
}
/**
@@ -149,12 +149,14 @@ static function meta( $meta, $post_id, $saved, $field )
$meta = implode( ',' , $meta );
// Re-arrange images with 'menu_order', thanks Onur
- $meta = $wpdb->get_col( "
+ $meta = $wpdb->get_col( $wpdb->prepare( "
SELECT ID FROM {$wpdb->posts}
WHERE post_type = 'attachment'
- AND ID in ({$meta})
+ AND ID in (%s)
ORDER BY menu_order ASC
- " );
+ ",
+ $meta
+ ) );
return (array) $meta;
}
View
30 inc/fields/plupload-image.php
@@ -98,21 +98,23 @@ static function admin_print_styles()
wp_enqueue_script( 'plupload-all' );
wp_enqueue_style( 'rwmb-plupload-image', RWMB_CSS_URL.'plupload-image.css', array(), RWMB_VER );
- wp_enqueue_script( 'rwmb-plupload-image', RWMB_JS_URL.'plupload-image.js', array( 'jquery-ui-sortable', 'wp-ajax-response', 'plupload-all' ), RWMB_VER, true );
- //Heartcode Canvas Loader
- wp_enqueue_script('heartcode-canvasloader', 'http://heartcode-canvasloader.googlecode.com/files/heartcode-canvasloader-min-0.9.1.js');
+
+ 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 );
+ // Heartcode Canvas Loader
+ 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 );
+
wp_localize_script( 'rwmb-plupload-image', 'rwmb_plupload_defaults', array(
- 'runtimes' => 'html5,silverlight,flash,html4',
- 'file_data_name' => 'async-upload',
- 'multiple_queues' => true,
- 'max_file_size' => wp_max_upload_size().'b',
- 'url' => admin_url('admin-ajax.php'),
- 'flash_swf_url' => includes_url( 'js/plupload/plupload.flash.swf' ),
- 'silverlight_xap_url' => includes_url( 'js/plupload/plupload.silverlight.xap' ),
- 'filters' => array( array( 'title' => _x( 'Allowed Image Files', 'image upload', 'rwmb' ), 'extensions' => 'jpg,jpeg,gif,png' ) ),
- 'multipart' => true,
- 'urlstream_upload' => true,
- ));
+ 'runtimes' => 'html5,silverlight,flash,html4',
+ 'file_data_name' => 'async-upload',
+ 'multiple_queues' => true,
+ 'max_file_size' => wp_max_upload_size().'b',
+ 'url' => admin_url('admin-ajax.php'),
+ 'flash_swf_url' => includes_url( 'js/plupload/plupload.flash.swf' ),
+ 'silverlight_xap_url' => includes_url( 'js/plupload/plupload.silverlight.xap' ),
+ 'filters' => array( array( 'title' => _x( 'Allowed Image Files', 'image upload', 'rwmb' ), 'extensions' => 'jpg,jpeg,gif,png' ) ),
+ 'multipart' => true,
+ 'urlstream_upload' => true
+ ) );
}
/**
View
4 inc/fields/slider.php
@@ -23,8 +23,8 @@ static function admin_print_styles()
wp_enqueue_style( 'jquery-ui-theme', "{$url}/jquery.ui.theme.css", array(), '1.8.17' );
$url = RWMB_JS_URL . 'jqueryui';
- wp_enqueue_script( 'jquery-ui-slider', "{$url}/jquery.ui.slider.min.js", array( 'jquery-ui-core' ), '1.8.17', true );
- wp_enqueue_script( 'rwmb-slider', RWMB_JS_URL . 'slider.js', array( 'jquery-ui-slider' ), RWMB_VER, true );
+ wp_enqueue_script( 'jquery-ui-slider', "{$url}/jquery.ui.slider.min.js", array( 'jquery', 'jquery-ui-core' ), '1.8.17', true );
+ wp_enqueue_script( 'rwmb-slider', RWMB_JS_URL . 'slider.js', array( 'jquery', 'jquery-ui-slider' ), RWMB_VER, true );
}
/**
View
12 inc/fields/time.php
@@ -19,17 +19,17 @@ class RWMB_Time_Field
static function admin_print_styles( )
{
$url = RWMB_CSS_URL . 'jqueryui';
- wp_register_style( 'jquery-ui-core', "{$url}/jquery.ui.core.css", array( ), '1.8.17' );
- wp_register_style( 'jquery-ui-theme', "{$url}/jquery.ui.theme.css", array( ), '1.8.17' );
+ wp_register_style( 'jquery-ui-core', "{$url}/jquery.ui.core.css", array(), '1.8.17' );
+ wp_register_style( 'jquery-ui-theme', "{$url}/jquery.ui.theme.css", array(), '1.8.17' );
wp_register_style( 'jquery-ui-datepicker', "{$url}/jquery.ui.datepicker.css", array( 'jquery-ui-core', 'jquery-ui-theme' ), '1.8.17' );
wp_register_style( 'jquery-ui-slider', "{$url}/jquery.ui.slider.css", array( 'jquery-ui-core', 'jquery-ui-theme' ), '1.8.17' );
wp_enqueue_style( 'jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.css", array( 'jquery-ui-datepicker', 'jquery-ui-slider' ), '0.9.7' );
$url = RWMB_JS_URL . 'jqueryui';
- wp_register_script( 'jquery-ui-datepicker', "{$url}/jquery.ui.datepicker.min.js", array( 'jquery-ui-core' ), '1.8.17', true );
- 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 );
- wp_register_script( 'jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.js", array( 'jquery-ui-datepicker', 'jquery-ui-slider' ), '0.9.7', true );
- wp_enqueue_script( 'rwmb-time', RWMB_JS_URL.'time.js', array( 'jquery-ui-timepicker' ), RWMB_VER, true );
+ wp_register_script( 'jquery-ui-datepicker', "{$url}/jquery.ui.datepicker.min.js", array( 'jquery', 'jquery-ui-core' ), '1.8.17', true );
+ 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 );
+ wp_register_script( 'jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.js", array( 'jquery', 'jquery-ui-datepicker', 'jquery-ui-slider' ), '0.9.7', true );
+ wp_enqueue_script( 'rwmb-time', RWMB_JS_URL.'time.js', array( 'jquery', 'jquery-ui-timepicker' ), RWMB_VER, true );
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.