equal
deleted
inserted
replaced
|
1 /** |
|
2 * @output wp-admin/js/widgets/media-gallery-widget.js |
|
3 */ |
|
4 |
1 /* eslint consistent-this: [ "error", "control" ] */ |
5 /* eslint consistent-this: [ "error", "control" ] */ |
2 (function( component ) { |
6 (function( component ) { |
3 'use strict'; |
7 'use strict'; |
4 |
8 |
5 var GalleryWidgetModel, GalleryWidgetControl, GalleryDetailsMediaFrame; |
9 var GalleryWidgetModel, GalleryWidgetControl, GalleryDetailsMediaFrame; |
6 |
10 |
7 /** |
11 /** |
8 * Custom gallery details frame. |
12 * Custom gallery details frame. |
9 * |
13 * |
10 * @since 4.9.0 |
14 * @since 4.9.0 |
11 * @class GalleryDetailsMediaFrame |
15 * @class wp.mediaWidgets~GalleryDetailsMediaFrame |
12 * @constructor |
16 * @augments wp.media.view.MediaFrame.Post |
13 */ |
17 */ |
14 GalleryDetailsMediaFrame = wp.media.view.MediaFrame.Post.extend( { |
18 GalleryDetailsMediaFrame = wp.media.view.MediaFrame.Post.extend(/** @lends wp.mediaWidgets~GalleryDetailsMediaFrame.prototype */{ |
15 |
19 |
16 /** |
20 /** |
17 * Create the default states. |
21 * Create the default states. |
18 * |
22 * |
19 * @since 4.9.0 |
23 * @since 4.9.0 |
51 * Gallery widget model. |
55 * Gallery widget model. |
52 * |
56 * |
53 * See WP_Widget_Gallery::enqueue_admin_scripts() for amending prototype from PHP exports. |
57 * See WP_Widget_Gallery::enqueue_admin_scripts() for amending prototype from PHP exports. |
54 * |
58 * |
55 * @since 4.9.0 |
59 * @since 4.9.0 |
56 * @class GalleryWidgetModel |
60 * |
57 * @constructor |
61 * @class wp.mediaWidgets.modelConstructors.media_gallery |
|
62 * @augments wp.mediaWidgets.MediaWidgetModel |
58 */ |
63 */ |
59 GalleryWidgetModel = component.MediaWidgetModel.extend( {} ); |
64 GalleryWidgetModel = component.MediaWidgetModel.extend(/** @lends wp.mediaWidgets.modelConstructors.media_gallery.prototype */{} ); |
60 |
65 |
61 /** |
66 GalleryWidgetControl = component.MediaWidgetControl.extend(/** @lends wp.mediaWidgets.controlConstructors.media_gallery.prototype */{ |
62 * Gallery widget control. |
|
63 * |
|
64 * See WP_Widget_Gallery::enqueue_admin_scripts() for amending prototype from PHP exports. |
|
65 * |
|
66 * @since 4.9.0 |
|
67 * @class GalleryWidgetControl |
|
68 * @constructor |
|
69 */ |
|
70 GalleryWidgetControl = component.MediaWidgetControl.extend( { |
|
71 |
67 |
72 /** |
68 /** |
73 * View events. |
69 * View events. |
74 * |
70 * |
75 * @since 4.9.0 |
71 * @since 4.9.0 |
78 events: _.extend( {}, component.MediaWidgetControl.prototype.events, { |
74 events: _.extend( {}, component.MediaWidgetControl.prototype.events, { |
79 'click .media-widget-gallery-preview': 'editMedia' |
75 'click .media-widget-gallery-preview': 'editMedia' |
80 } ), |
76 } ), |
81 |
77 |
82 /** |
78 /** |
83 * Initialize. |
79 * Gallery widget control. |
|
80 * |
|
81 * See WP_Widget_Gallery::enqueue_admin_scripts() for amending prototype from PHP exports. |
|
82 * |
|
83 * @constructs wp.mediaWidgets.controlConstructors.media_gallery |
|
84 * @augments wp.mediaWidgets.MediaWidgetControl |
84 * |
85 * |
85 * @since 4.9.0 |
86 * @since 4.9.0 |
86 * @param {Object} options - Options. |
87 * @param {Object} options - Options. |
87 * @param {Backbone.Model} options.model - Model. |
88 * @param {Backbone.Model} options.model - Model. |
88 * @param {jQuery} options.el - Control field container element. |
89 * @param {jQuery} options.el - Control field container element. |