summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/functions.gallery.php')
-rw-r--r--plugins/jetpack/functions.gallery.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/plugins/jetpack/functions.gallery.php b/plugins/jetpack/functions.gallery.php
index fd9319ed..891ecfca 100644
--- a/plugins/jetpack/functions.gallery.php
+++ b/plugins/jetpack/functions.gallery.php
@@ -22,10 +22,27 @@ class Jetpack_Gallery_Settings {
* Registers/enqueues the gallery settings admin js.
*/
function wp_enqueue_media() {
- if ( ! wp_script_is( 'jetpack-gallery-settings', 'registered' ) )
+ if ( ! wp_script_is( 'jetpack-gallery-settings', 'registered' ) ) {
+ /**
+ * This only happens if we're not in Jetpack, but on WPCOM instead.
+ * This is the correct path for WPCOM.
+ */
wp_register_script( 'jetpack-gallery-settings', plugins_url( 'gallery-settings/gallery-settings.js', __FILE__ ), array( 'media-views' ), '20121225' );
+ }
+
+ /*
+ * Register Gallery's admin.js here so we can upload images in the customizer
+ */
+ if ( ! wp_script_is( 'gallery-widget-admin', 'registered' ) ) {
+ wp_register_script( 'gallery-widget-admin', plugins_url( 'modules/widgets/gallery/js/admin.js', __FILE__ ), array(
+ 'media-models',
+ 'media-views'
+ ) );
+ }
wp_enqueue_script( 'jetpack-gallery-settings' );
+
+ wp_enqueue_script( 'gallery-widget-admin' );
}
/**