author | ymh <ymh.work@gmail.com> |
Fri, 05 Sep 2025 18:52:52 +0200 | |
changeset 22 | 8c2e4d02f4ef |
parent 21 | 48c4eec2b7e6 |
permissions | -rw-r--r-- |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1 |
/******/ (() => { // webpackBootstrap |
19 | 2 |
/******/ var __webpack_modules__ = ({ |
3 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
4 |
/***/ 175: |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
5 |
/***/ ((module) => { |
19 | 6 |
|
7 |
var MediaDetails = wp.media.view.MediaFrame.MediaDetails, |
|
8 |
MediaLibrary = wp.media.controller.MediaLibrary, |
|
9 |
||
10 |
l10n = wp.media.view.l10n, |
|
11 |
AudioDetails; |
|
12 |
||
13 |
/** |
|
14 |
* wp.media.view.MediaFrame.AudioDetails |
|
15 |
* |
|
16 |
* @memberOf wp.media.view.MediaFrame |
|
17 |
* |
|
18 |
* @class |
|
19 |
* @augments wp.media.view.MediaFrame.MediaDetails |
|
20 |
* @augments wp.media.view.MediaFrame.Select |
|
21 |
* @augments wp.media.view.MediaFrame |
|
22 |
* @augments wp.media.view.Frame |
|
23 |
* @augments wp.media.View |
|
24 |
* @augments wp.Backbone.View |
|
25 |
* @augments Backbone.View |
|
26 |
* @mixes wp.media.controller.StateMachine |
|
27 |
*/ |
|
28 |
AudioDetails = MediaDetails.extend(/** @lends wp.media.view.MediaFrame.AudioDetails.prototype */{ |
|
29 |
defaults: { |
|
30 |
id: 'audio', |
|
31 |
url: '', |
|
32 |
menu: 'audio-details', |
|
33 |
content: 'audio-details', |
|
34 |
toolbar: 'audio-details', |
|
35 |
type: 'link', |
|
36 |
title: l10n.audioDetailsTitle, |
|
37 |
priority: 120 |
|
38 |
}, |
|
39 |
||
40 |
initialize: function( options ) { |
|
41 |
options.DetailsView = wp.media.view.AudioDetails; |
|
42 |
options.cancelText = l10n.audioDetailsCancel; |
|
43 |
options.addText = l10n.audioAddSourceTitle; |
|
44 |
||
45 |
MediaDetails.prototype.initialize.call( this, options ); |
|
46 |
}, |
|
47 |
||
48 |
bindHandlers: function() { |
|
49 |
MediaDetails.prototype.bindHandlers.apply( this, arguments ); |
|
50 |
||
51 |
this.on( 'toolbar:render:replace-audio', this.renderReplaceToolbar, this ); |
|
52 |
this.on( 'toolbar:render:add-audio-source', this.renderAddSourceToolbar, this ); |
|
53 |
}, |
|
54 |
||
55 |
createStates: function() { |
|
56 |
this.states.add([ |
|
57 |
new wp.media.controller.AudioDetails( { |
|
58 |
media: this.media |
|
59 |
} ), |
|
60 |
||
61 |
new MediaLibrary( { |
|
62 |
type: 'audio', |
|
63 |
id: 'replace-audio', |
|
64 |
title: l10n.audioReplaceTitle, |
|
65 |
toolbar: 'replace-audio', |
|
66 |
media: this.media, |
|
67 |
menu: 'audio-details' |
|
68 |
} ), |
|
69 |
||
70 |
new MediaLibrary( { |
|
71 |
type: 'audio', |
|
72 |
id: 'add-audio-source', |
|
73 |
title: l10n.audioAddSourceTitle, |
|
74 |
toolbar: 'add-audio-source', |
|
75 |
media: this.media, |
|
76 |
menu: false |
|
77 |
} ) |
|
78 |
]); |
|
79 |
} |
|
80 |
}); |
|
81 |
||
82 |
module.exports = AudioDetails; |
|
83 |
||
84 |
||
85 |
/***/ }), |
|
86 |
||
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
87 |
/***/ 241: |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
88 |
/***/ ((module) => { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
89 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
90 |
/** |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
91 |
* wp.media.model.PostMedia |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
92 |
* |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
93 |
* Shared model class for audio and video. Updates the model after |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
94 |
* "Add Audio|Video Source" and "Replace Audio|Video" states return |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
95 |
* |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
96 |
* @memberOf wp.media.model |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
97 |
* |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
98 |
* @class |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
99 |
* @augments Backbone.Model |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
100 |
*/ |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
101 |
var PostMedia = Backbone.Model.extend(/** @lends wp.media.model.PostMedia.prototype */{ |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
102 |
initialize: function() { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
103 |
this.attachment = false; |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
104 |
}, |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
105 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
106 |
setSource: function( attachment ) { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
107 |
this.attachment = attachment; |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
108 |
this.extension = attachment.get( 'filename' ).split('.').pop(); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
109 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
110 |
if ( this.get( 'src' ) && this.extension === this.get( 'src' ).split('.').pop() ) { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
111 |
this.unset( 'src' ); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
112 |
} |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
113 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
114 |
if ( _.contains( wp.media.view.settings.embedExts, this.extension ) ) { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
115 |
this.set( this.extension, this.attachment.get( 'url' ) ); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
116 |
} else { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
117 |
this.unset( this.extension ); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
118 |
} |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
119 |
}, |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
120 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
121 |
changeAttachment: function( attachment ) { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
122 |
this.setSource( attachment ); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
123 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
124 |
this.unset( 'src' ); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
125 |
_.each( _.without( wp.media.view.settings.embedExts, this.extension ), function( ext ) { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
126 |
this.unset( ext ); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
127 |
}, this ); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
128 |
} |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
129 |
}); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
130 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
131 |
module.exports = PostMedia; |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
132 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
133 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
134 |
/***/ }), |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
135 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
136 |
/***/ 741: |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
137 |
/***/ ((module) => { |
19 | 138 |
|
139 |
var Select = wp.media.view.MediaFrame.Select, |
|
140 |
l10n = wp.media.view.l10n, |
|
141 |
MediaDetails; |
|
142 |
||
143 |
/** |
|
144 |
* wp.media.view.MediaFrame.MediaDetails |
|
145 |
* |
|
146 |
* @memberOf wp.media.view.MediaFrame |
|
147 |
* |
|
148 |
* @class |
|
149 |
* @augments wp.media.view.MediaFrame.Select |
|
150 |
* @augments wp.media.view.MediaFrame |
|
151 |
* @augments wp.media.view.Frame |
|
152 |
* @augments wp.media.View |
|
153 |
* @augments wp.Backbone.View |
|
154 |
* @augments Backbone.View |
|
155 |
* @mixes wp.media.controller.StateMachine |
|
156 |
*/ |
|
157 |
MediaDetails = Select.extend(/** @lends wp.media.view.MediaFrame.MediaDetails.prototype */{ |
|
158 |
defaults: { |
|
159 |
id: 'media', |
|
160 |
url: '', |
|
161 |
menu: 'media-details', |
|
162 |
content: 'media-details', |
|
163 |
toolbar: 'media-details', |
|
164 |
type: 'link', |
|
165 |
priority: 120 |
|
166 |
}, |
|
167 |
||
168 |
initialize: function( options ) { |
|
169 |
this.DetailsView = options.DetailsView; |
|
170 |
this.cancelText = options.cancelText; |
|
171 |
this.addText = options.addText; |
|
172 |
||
173 |
this.media = new wp.media.model.PostMedia( options.metadata ); |
|
174 |
this.options.selection = new wp.media.model.Selection( this.media.attachment, { multiple: false } ); |
|
175 |
Select.prototype.initialize.apply( this, arguments ); |
|
176 |
}, |
|
177 |
||
178 |
bindHandlers: function() { |
|
179 |
var menu = this.defaults.menu; |
|
180 |
||
181 |
Select.prototype.bindHandlers.apply( this, arguments ); |
|
182 |
||
183 |
this.on( 'menu:create:' + menu, this.createMenu, this ); |
|
184 |
this.on( 'content:render:' + menu, this.renderDetailsContent, this ); |
|
185 |
this.on( 'menu:render:' + menu, this.renderMenu, this ); |
|
186 |
this.on( 'toolbar:render:' + menu, this.renderDetailsToolbar, this ); |
|
187 |
}, |
|
188 |
||
189 |
renderDetailsContent: function() { |
|
190 |
var view = new this.DetailsView({ |
|
191 |
controller: this, |
|
192 |
model: this.state().media, |
|
193 |
attachment: this.state().media.attachment |
|
194 |
}).render(); |
|
195 |
||
196 |
this.content.set( view ); |
|
197 |
}, |
|
198 |
||
199 |
renderMenu: function( view ) { |
|
200 |
var lastState = this.lastState(), |
|
201 |
previous = lastState && lastState.id, |
|
202 |
frame = this; |
|
203 |
||
204 |
view.set({ |
|
205 |
cancel: { |
|
206 |
text: this.cancelText, |
|
207 |
priority: 20, |
|
208 |
click: function() { |
|
209 |
if ( previous ) { |
|
210 |
frame.setState( previous ); |
|
211 |
} else { |
|
212 |
frame.close(); |
|
213 |
} |
|
214 |
} |
|
215 |
}, |
|
216 |
separateCancel: new wp.media.View({ |
|
217 |
className: 'separator', |
|
218 |
priority: 40 |
|
219 |
}) |
|
220 |
}); |
|
221 |
||
222 |
}, |
|
223 |
||
224 |
setPrimaryButton: function(text, handler) { |
|
225 |
this.toolbar.set( new wp.media.view.Toolbar({ |
|
226 |
controller: this, |
|
227 |
items: { |
|
228 |
button: { |
|
229 |
style: 'primary', |
|
230 |
text: text, |
|
231 |
priority: 80, |
|
232 |
click: function() { |
|
233 |
var controller = this.controller; |
|
234 |
handler.call( this, controller, controller.state() ); |
|
235 |
// Restore and reset the default state. |
|
236 |
controller.setState( controller.options.state ); |
|
237 |
controller.reset(); |
|
238 |
} |
|
239 |
} |
|
240 |
} |
|
241 |
}) ); |
|
242 |
}, |
|
243 |
||
244 |
renderDetailsToolbar: function() { |
|
245 |
this.setPrimaryButton( l10n.update, function( controller, state ) { |
|
246 |
controller.close(); |
|
247 |
state.trigger( 'update', controller.media.toJSON() ); |
|
248 |
} ); |
|
249 |
}, |
|
250 |
||
251 |
renderReplaceToolbar: function() { |
|
252 |
this.setPrimaryButton( l10n.replace, function( controller, state ) { |
|
253 |
var attachment = state.get( 'selection' ).single(); |
|
254 |
controller.media.changeAttachment( attachment ); |
|
255 |
state.trigger( 'replace', controller.media.toJSON() ); |
|
256 |
} ); |
|
257 |
}, |
|
258 |
||
259 |
renderAddSourceToolbar: function() { |
|
260 |
this.setPrimaryButton( this.addText, function( controller, state ) { |
|
261 |
var attachment = state.get( 'selection' ).single(); |
|
262 |
controller.media.setSource( attachment ); |
|
263 |
state.trigger( 'add-source', controller.media.toJSON() ); |
|
264 |
} ); |
|
265 |
} |
|
266 |
}); |
|
267 |
||
268 |
module.exports = MediaDetails; |
|
269 |
||
270 |
||
271 |
/***/ }), |
|
272 |
||
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
273 |
/***/ 1206: |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
274 |
/***/ ((module) => { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
275 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
276 |
var State = wp.media.controller.State, |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
277 |
l10n = wp.media.view.l10n, |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
278 |
AudioDetails; |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
279 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
280 |
/** |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
281 |
* wp.media.controller.AudioDetails |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
282 |
* |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
283 |
* The controller for the Audio Details state |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
284 |
* |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
285 |
* @memberOf wp.media.controller |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
286 |
* |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
287 |
* @class |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
288 |
* @augments wp.media.controller.State |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
289 |
* @augments Backbone.Model |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
290 |
*/ |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
291 |
AudioDetails = State.extend(/** @lends wp.media.controller.AudioDetails.prototype */{ |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
292 |
defaults: { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
293 |
id: 'audio-details', |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
294 |
toolbar: 'audio-details', |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
295 |
title: l10n.audioDetailsTitle, |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
296 |
content: 'audio-details', |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
297 |
menu: 'audio-details', |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
298 |
router: false, |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
299 |
priority: 60 |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
300 |
}, |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
301 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
302 |
initialize: function( options ) { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
303 |
this.media = options.media; |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
304 |
State.prototype.initialize.apply( this, arguments ); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
305 |
} |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
306 |
}); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
307 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
308 |
module.exports = AudioDetails; |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
309 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
310 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
311 |
/***/ }), |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
312 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
313 |
/***/ 3713: |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
314 |
/***/ ((module) => { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
315 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
316 |
var MediaDetails = wp.media.view.MediaDetails, |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
317 |
AudioDetails; |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
318 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
319 |
/** |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
320 |
* wp.media.view.AudioDetails |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
321 |
* |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
322 |
* @memberOf wp.media.view |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
323 |
* |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
324 |
* @class |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
325 |
* @augments wp.media.view.MediaDetails |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
326 |
* @augments wp.media.view.Settings.AttachmentDisplay |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
327 |
* @augments wp.media.view.Settings |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
328 |
* @augments wp.media.View |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
329 |
* @augments wp.Backbone.View |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
330 |
* @augments Backbone.View |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
331 |
*/ |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
332 |
AudioDetails = MediaDetails.extend(/** @lends wp.media.view.AudioDetails.prototype */{ |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
333 |
className: 'audio-details', |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
334 |
template: wp.template('audio-details'), |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
335 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
336 |
setMedia: function() { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
337 |
var audio = this.$('.wp-audio-shortcode'); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
338 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
339 |
if ( audio.find( 'source' ).length ) { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
340 |
if ( audio.is(':hidden') ) { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
341 |
audio.show(); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
342 |
} |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
343 |
this.media = MediaDetails.prepareSrc( audio.get(0) ); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
344 |
} else { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
345 |
audio.hide(); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
346 |
this.media = false; |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
347 |
} |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
348 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
349 |
return this; |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
350 |
} |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
351 |
}); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
352 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
353 |
module.exports = AudioDetails; |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
354 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
355 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
356 |
/***/ }), |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
357 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
358 |
/***/ 5039: |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
359 |
/***/ ((module) => { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
360 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
361 |
/** |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
362 |
* wp.media.controller.VideoDetails |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
363 |
* |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
364 |
* The controller for the Video Details state |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
365 |
* |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
366 |
* @memberOf wp.media.controller |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
367 |
* |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
368 |
* @class |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
369 |
* @augments wp.media.controller.State |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
370 |
* @augments Backbone.Model |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
371 |
*/ |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
372 |
var State = wp.media.controller.State, |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
373 |
l10n = wp.media.view.l10n, |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
374 |
VideoDetails; |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
375 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
376 |
VideoDetails = State.extend(/** @lends wp.media.controller.VideoDetails.prototype */{ |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
377 |
defaults: { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
378 |
id: 'video-details', |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
379 |
toolbar: 'video-details', |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
380 |
title: l10n.videoDetailsTitle, |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
381 |
content: 'video-details', |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
382 |
menu: 'video-details', |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
383 |
router: false, |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
384 |
priority: 60 |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
385 |
}, |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
386 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
387 |
initialize: function( options ) { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
388 |
this.media = options.media; |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
389 |
State.prototype.initialize.apply( this, arguments ); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
390 |
} |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
391 |
}); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
392 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
393 |
module.exports = VideoDetails; |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
394 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
395 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
396 |
/***/ }), |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
397 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
398 |
/***/ 5836: |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
399 |
/***/ ((module) => { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
400 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
401 |
var MediaDetails = wp.media.view.MediaDetails, |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
402 |
VideoDetails; |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
403 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
404 |
/** |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
405 |
* wp.media.view.VideoDetails |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
406 |
* |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
407 |
* @memberOf wp.media.view |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
408 |
* |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
409 |
* @class |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
410 |
* @augments wp.media.view.MediaDetails |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
411 |
* @augments wp.media.view.Settings.AttachmentDisplay |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
412 |
* @augments wp.media.view.Settings |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
413 |
* @augments wp.media.View |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
414 |
* @augments wp.Backbone.View |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
415 |
* @augments Backbone.View |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
416 |
*/ |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
417 |
VideoDetails = MediaDetails.extend(/** @lends wp.media.view.VideoDetails.prototype */{ |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
418 |
className: 'video-details', |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
419 |
template: wp.template('video-details'), |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
420 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
421 |
setMedia: function() { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
422 |
var video = this.$('.wp-video-shortcode'); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
423 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
424 |
if ( video.find( 'source' ).length ) { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
425 |
if ( video.is(':hidden') ) { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
426 |
video.show(); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
427 |
} |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
428 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
429 |
if ( ! video.hasClass( 'youtube-video' ) && ! video.hasClass( 'vimeo-video' ) ) { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
430 |
this.media = MediaDetails.prepareSrc( video.get(0) ); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
431 |
} else { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
432 |
this.media = video.get(0); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
433 |
} |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
434 |
} else { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
435 |
video.hide(); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
436 |
this.media = false; |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
437 |
} |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
438 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
439 |
return this; |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
440 |
} |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
441 |
}); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
442 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
443 |
module.exports = VideoDetails; |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
444 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
445 |
|
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
446 |
/***/ }), |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
447 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
448 |
/***/ 8646: |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
449 |
/***/ ((module) => { |
19 | 450 |
|
451 |
var MediaDetails = wp.media.view.MediaFrame.MediaDetails, |
|
452 |
MediaLibrary = wp.media.controller.MediaLibrary, |
|
453 |
l10n = wp.media.view.l10n, |
|
454 |
VideoDetails; |
|
455 |
||
456 |
/** |
|
457 |
* wp.media.view.MediaFrame.VideoDetails |
|
458 |
* |
|
459 |
* @memberOf wp.media.view.MediaFrame |
|
460 |
* |
|
461 |
* @class |
|
462 |
* @augments wp.media.view.MediaFrame.MediaDetails |
|
463 |
* @augments wp.media.view.MediaFrame.Select |
|
464 |
* @augments wp.media.view.MediaFrame |
|
465 |
* @augments wp.media.view.Frame |
|
466 |
* @augments wp.media.View |
|
467 |
* @augments wp.Backbone.View |
|
468 |
* @augments Backbone.View |
|
469 |
* @mixes wp.media.controller.StateMachine |
|
470 |
*/ |
|
471 |
VideoDetails = MediaDetails.extend(/** @lends wp.media.view.MediaFrame.VideoDetails.prototype */{ |
|
472 |
defaults: { |
|
473 |
id: 'video', |
|
474 |
url: '', |
|
475 |
menu: 'video-details', |
|
476 |
content: 'video-details', |
|
477 |
toolbar: 'video-details', |
|
478 |
type: 'link', |
|
479 |
title: l10n.videoDetailsTitle, |
|
480 |
priority: 120 |
|
481 |
}, |
|
482 |
||
483 |
initialize: function( options ) { |
|
484 |
options.DetailsView = wp.media.view.VideoDetails; |
|
485 |
options.cancelText = l10n.videoDetailsCancel; |
|
486 |
options.addText = l10n.videoAddSourceTitle; |
|
487 |
||
488 |
MediaDetails.prototype.initialize.call( this, options ); |
|
489 |
}, |
|
490 |
||
491 |
bindHandlers: function() { |
|
492 |
MediaDetails.prototype.bindHandlers.apply( this, arguments ); |
|
493 |
||
494 |
this.on( 'toolbar:render:replace-video', this.renderReplaceToolbar, this ); |
|
495 |
this.on( 'toolbar:render:add-video-source', this.renderAddSourceToolbar, this ); |
|
496 |
this.on( 'toolbar:render:select-poster-image', this.renderSelectPosterImageToolbar, this ); |
|
497 |
this.on( 'toolbar:render:add-track', this.renderAddTrackToolbar, this ); |
|
498 |
}, |
|
499 |
||
500 |
createStates: function() { |
|
501 |
this.states.add([ |
|
502 |
new wp.media.controller.VideoDetails({ |
|
503 |
media: this.media |
|
504 |
}), |
|
505 |
||
506 |
new MediaLibrary( { |
|
507 |
type: 'video', |
|
508 |
id: 'replace-video', |
|
509 |
title: l10n.videoReplaceTitle, |
|
510 |
toolbar: 'replace-video', |
|
511 |
media: this.media, |
|
512 |
menu: 'video-details' |
|
513 |
} ), |
|
514 |
||
515 |
new MediaLibrary( { |
|
516 |
type: 'video', |
|
517 |
id: 'add-video-source', |
|
518 |
title: l10n.videoAddSourceTitle, |
|
519 |
toolbar: 'add-video-source', |
|
520 |
media: this.media, |
|
521 |
menu: false |
|
522 |
} ), |
|
523 |
||
524 |
new MediaLibrary( { |
|
525 |
type: 'image', |
|
526 |
id: 'select-poster-image', |
|
527 |
title: l10n.videoSelectPosterImageTitle, |
|
528 |
toolbar: 'select-poster-image', |
|
529 |
media: this.media, |
|
530 |
menu: 'video-details' |
|
531 |
} ), |
|
532 |
||
533 |
new MediaLibrary( { |
|
534 |
type: 'text', |
|
535 |
id: 'add-track', |
|
536 |
title: l10n.videoAddTrackTitle, |
|
537 |
toolbar: 'add-track', |
|
538 |
media: this.media, |
|
539 |
menu: 'video-details' |
|
540 |
} ) |
|
541 |
]); |
|
542 |
}, |
|
543 |
||
544 |
renderSelectPosterImageToolbar: function() { |
|
545 |
this.setPrimaryButton( l10n.videoSelectPosterImageTitle, function( controller, state ) { |
|
546 |
var urls = [], attachment = state.get( 'selection' ).single(); |
|
547 |
||
548 |
controller.media.set( 'poster', attachment.get( 'url' ) ); |
|
549 |
state.trigger( 'set-poster-image', controller.media.toJSON() ); |
|
550 |
||
551 |
_.each( wp.media.view.settings.embedExts, function (ext) { |
|
552 |
if ( controller.media.get( ext ) ) { |
|
553 |
urls.push( controller.media.get( ext ) ); |
|
554 |
} |
|
555 |
} ); |
|
556 |
||
557 |
wp.ajax.send( 'set-attachment-thumbnail', { |
|
558 |
data : { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
559 |
_ajax_nonce: wp.media.view.settings.nonce.setAttachmentThumbnail, |
19 | 560 |
urls: urls, |
561 |
thumbnail_id: attachment.get( 'id' ) |
|
562 |
} |
|
563 |
} ); |
|
564 |
} ); |
|
565 |
}, |
|
566 |
||
567 |
renderAddTrackToolbar: function() { |
|
568 |
this.setPrimaryButton( l10n.videoAddTrackTitle, function( controller, state ) { |
|
569 |
var attachment = state.get( 'selection' ).single(), |
|
570 |
content = controller.media.get( 'content' ); |
|
571 |
||
572 |
if ( -1 === content.indexOf( attachment.get( 'url' ) ) ) { |
|
573 |
content += [ |
|
574 |
'<track srclang="en" label="English" kind="subtitles" src="', |
|
575 |
attachment.get( 'url' ), |
|
576 |
'" />' |
|
577 |
].join(''); |
|
578 |
||
579 |
controller.media.set( 'content', content ); |
|
580 |
} |
|
581 |
state.trigger( 'add-track', controller.media.toJSON() ); |
|
582 |
} ); |
|
583 |
} |
|
584 |
}); |
|
585 |
||
586 |
module.exports = VideoDetails; |
|
587 |
||
588 |
||
589 |
/***/ }), |
|
590 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
591 |
/***/ 9467: |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
592 |
/***/ ((module) => { |
18 | 593 |
|
594 |
/* global MediaElementPlayer */ |
|
595 |
var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay, |
|
596 |
$ = jQuery, |
|
597 |
MediaDetails; |
|
598 |
||
599 |
/** |
|
600 |
* wp.media.view.MediaDetails |
|
601 |
* |
|
602 |
* @memberOf wp.media.view |
|
603 |
* |
|
604 |
* @class |
|
605 |
* @augments wp.media.view.Settings.AttachmentDisplay |
|
606 |
* @augments wp.media.view.Settings |
|
607 |
* @augments wp.media.View |
|
608 |
* @augments wp.Backbone.View |
|
609 |
* @augments Backbone.View |
|
610 |
*/ |
|
611 |
MediaDetails = AttachmentDisplay.extend(/** @lends wp.media.view.MediaDetails.prototype */{ |
|
612 |
initialize: function() { |
|
613 |
_.bindAll(this, 'success'); |
|
614 |
this.players = []; |
|
615 |
this.listenTo( this.controller.states, 'close', wp.media.mixin.unsetPlayers ); |
|
616 |
this.on( 'ready', this.setPlayer ); |
|
617 |
this.on( 'media:setting:remove', wp.media.mixin.unsetPlayers, this ); |
|
618 |
this.on( 'media:setting:remove', this.render ); |
|
619 |
this.on( 'media:setting:remove', this.setPlayer ); |
|
620 |
||
621 |
AttachmentDisplay.prototype.initialize.apply( this, arguments ); |
|
622 |
}, |
|
623 |
||
624 |
events: function(){ |
|
625 |
return _.extend( { |
|
626 |
'click .remove-setting' : 'removeSetting', |
|
627 |
'change .content-track' : 'setTracks', |
|
628 |
'click .remove-track' : 'setTracks', |
|
629 |
'click .add-media-source' : 'addSource' |
|
630 |
}, AttachmentDisplay.prototype.events ); |
|
631 |
}, |
|
632 |
||
633 |
prepare: function() { |
|
634 |
return _.defaults({ |
|
635 |
model: this.model.toJSON() |
|
636 |
}, this.options ); |
|
637 |
}, |
|
638 |
||
639 |
/** |
|
640 |
* Remove a setting's UI when the model unsets it |
|
641 |
* |
|
642 |
* @fires wp.media.view.MediaDetails#media:setting:remove |
|
643 |
* |
|
644 |
* @param {Event} e |
|
645 |
*/ |
|
646 |
removeSetting : function(e) { |
|
647 |
var wrap = $( e.currentTarget ).parent(), setting; |
|
648 |
setting = wrap.find( 'input' ).data( 'setting' ); |
|
649 |
||
650 |
if ( setting ) { |
|
651 |
this.model.unset( setting ); |
|
652 |
this.trigger( 'media:setting:remove', this ); |
|
653 |
} |
|
654 |
||
655 |
wrap.remove(); |
|
656 |
}, |
|
657 |
||
658 |
/** |
|
659 |
* |
|
660 |
* @fires wp.media.view.MediaDetails#media:setting:remove |
|
661 |
*/ |
|
662 |
setTracks : function() { |
|
663 |
var tracks = ''; |
|
664 |
||
665 |
_.each( this.$('.content-track'), function(track) { |
|
666 |
tracks += $( track ).val(); |
|
667 |
} ); |
|
668 |
||
669 |
this.model.set( 'content', tracks ); |
|
670 |
this.trigger( 'media:setting:remove', this ); |
|
671 |
}, |
|
672 |
||
673 |
addSource : function( e ) { |
|
674 |
this.controller.lastMime = $( e.currentTarget ).data( 'mime' ); |
|
675 |
this.controller.setState( 'add-' + this.controller.defaults.id + '-source' ); |
|
676 |
}, |
|
677 |
||
678 |
loadPlayer: function () { |
|
679 |
this.players.push( new MediaElementPlayer( this.media, this.settings ) ); |
|
680 |
this.scriptXhr = false; |
|
681 |
}, |
|
682 |
||
683 |
setPlayer : function() { |
|
684 |
var src; |
|
685 |
||
686 |
if ( this.players.length || ! this.media || this.scriptXhr ) { |
|
687 |
return; |
|
688 |
} |
|
689 |
||
690 |
src = this.model.get( 'src' ); |
|
691 |
||
692 |
if ( src && src.indexOf( 'vimeo' ) > -1 && ! ( 'Vimeo' in window ) ) { |
|
693 |
this.scriptXhr = $.getScript( 'https://player.vimeo.com/api/player.js', _.bind( this.loadPlayer, this ) ); |
|
694 |
} else { |
|
695 |
this.loadPlayer(); |
|
696 |
} |
|
697 |
}, |
|
698 |
||
699 |
/** |
|
700 |
* @abstract |
|
701 |
*/ |
|
702 |
setMedia : function() { |
|
703 |
return this; |
|
704 |
}, |
|
705 |
||
706 |
success : function(mejs) { |
|
707 |
var autoplay = mejs.attributes.autoplay && 'false' !== mejs.attributes.autoplay; |
|
708 |
||
709 |
if ( 'flash' === mejs.pluginType && autoplay ) { |
|
710 |
mejs.addEventListener( 'canplay', function() { |
|
711 |
mejs.play(); |
|
712 |
}, false ); |
|
713 |
} |
|
714 |
||
715 |
this.mejs = mejs; |
|
716 |
}, |
|
717 |
||
718 |
/** |
|
719 |
* @return {media.view.MediaDetails} Returns itself to allow chaining. |
|
720 |
*/ |
|
721 |
render: function() { |
|
722 |
AttachmentDisplay.prototype.render.apply( this, arguments ); |
|
723 |
||
724 |
setTimeout( _.bind( function() { |
|
725 |
this.scrollToTop(); |
|
726 |
}, this ), 10 ); |
|
727 |
||
728 |
this.settings = _.defaults( { |
|
729 |
success : this.success |
|
730 |
}, wp.media.mixin.mejsSettings ); |
|
731 |
||
732 |
return this.setMedia(); |
|
733 |
}, |
|
734 |
||
735 |
scrollToTop: function() { |
|
736 |
this.$( '.embed-media-settings' ).scrollTop( 0 ); |
|
737 |
} |
|
738 |
},/** @lends wp.media.view.MediaDetails */{ |
|
739 |
instances : 0, |
|
740 |
/** |
|
741 |
* When multiple players in the DOM contain the same src, things get weird. |
|
742 |
* |
|
743 |
* @param {HTMLElement} elem |
|
744 |
* @return {HTMLElement} |
|
745 |
*/ |
|
746 |
prepareSrc : function( elem ) { |
|
747 |
var i = MediaDetails.instances++; |
|
748 |
_.each( $( elem ).find( 'source' ), function( source ) { |
|
749 |
source.src = [ |
|
750 |
source.src, |
|
751 |
source.src.indexOf('?') > -1 ? '&' : '?', |
|
752 |
'_=', |
|
753 |
i |
|
754 |
].join(''); |
|
755 |
} ); |
|
756 |
||
757 |
return elem; |
|
758 |
} |
|
759 |
}); |
|
760 |
||
761 |
module.exports = MediaDetails; |
|
762 |
||
763 |
||
19 | 764 |
/***/ }) |
18 | 765 |
|
19 | 766 |
/******/ }); |
767 |
/************************************************************************/ |
|
768 |
/******/ // The module cache |
|
769 |
/******/ var __webpack_module_cache__ = {}; |
|
770 |
/******/ |
|
771 |
/******/ // The require function |
|
772 |
/******/ function __webpack_require__(moduleId) { |
|
773 |
/******/ // Check if module is in cache |
|
774 |
/******/ var cachedModule = __webpack_module_cache__[moduleId]; |
|
775 |
/******/ if (cachedModule !== undefined) { |
|
776 |
/******/ return cachedModule.exports; |
|
777 |
/******/ } |
|
778 |
/******/ // Create a new module (and put it into the cache) |
|
779 |
/******/ var module = __webpack_module_cache__[moduleId] = { |
|
780 |
/******/ // no module.id needed |
|
781 |
/******/ // no module.loaded needed |
|
782 |
/******/ exports: {} |
|
783 |
/******/ }; |
|
784 |
/******/ |
|
785 |
/******/ // Execute the module function |
|
786 |
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
|
787 |
/******/ |
|
788 |
/******/ // Return the exports of the module |
|
789 |
/******/ return module.exports; |
|
790 |
/******/ } |
|
791 |
/******/ |
|
792 |
/************************************************************************/ |
|
9 | 793 |
/** |
794 |
* @output wp-includes/js/media-audiovideo.js |
|
795 |
*/ |
|
796 |
||
5 | 797 |
var media = wp.media, |
798 |
baseSettings = window._wpmejsSettings || {}, |
|
799 |
l10n = window._wpMediaViewsL10n || {}; |
|
800 |
||
801 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
802 |
* |
9 | 803 |
* Defines the wp.media.mixin object. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
804 |
* |
5 | 805 |
* @mixin |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
806 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
807 |
* @since 4.2.0 |
5 | 808 |
*/ |
809 |
wp.media.mixin = { |
|
810 |
mejsSettings: baseSettings, |
|
811 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
812 |
/** |
9 | 813 |
* Pauses and removes all players. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
814 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
815 |
* @since 4.2.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
816 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
817 |
* @return {void} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
818 |
*/ |
5 | 819 |
removeAllPlayers: function() { |
820 |
var p; |
|
821 |
||
822 |
if ( window.mejs && window.mejs.players ) { |
|
823 |
for ( p in window.mejs.players ) { |
|
824 |
window.mejs.players[p].pause(); |
|
825 |
this.removePlayer( window.mejs.players[p] ); |
|
826 |
} |
|
827 |
} |
|
828 |
}, |
|
829 |
||
830 |
/** |
|
9 | 831 |
* Removes the player. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
832 |
* |
5 | 833 |
* Override the MediaElement method for removing a player. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
834 |
* MediaElement tries to pull the audio/video tag out of |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
835 |
* its container and re-add it to the DOM. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
836 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
837 |
* @since 4.2.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
838 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
839 |
* @return {void} |
5 | 840 |
*/ |
841 |
removePlayer: function(t) { |
|
842 |
var featureIndex, feature; |
|
843 |
||
844 |
if ( ! t.options ) { |
|
845 |
return; |
|
846 |
} |
|
847 |
||
16 | 848 |
// Invoke features cleanup. |
5 | 849 |
for ( featureIndex in t.options.features ) { |
850 |
feature = t.options.features[featureIndex]; |
|
851 |
if ( t['clean' + feature] ) { |
|
852 |
try { |
|
853 |
t['clean' + feature](t); |
|
854 |
} catch (e) {} |
|
855 |
} |
|
856 |
} |
|
857 |
||
858 |
if ( ! t.isDynamic ) { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
859 |
t.node.remove(); |
5 | 860 |
} |
861 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
862 |
if ( 'html5' !== t.media.rendererName ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
863 |
t.media.remove(); |
5 | 864 |
} |
865 |
||
866 |
delete window.mejs.players[t.id]; |
|
867 |
||
868 |
t.container.remove(); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
869 |
t.globalUnbind('resize', t.globalResizeCallback); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
870 |
t.globalUnbind('keydown', t.globalKeydownCallback); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
871 |
t.globalUnbind('click', t.globalClickCallback); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
872 |
delete t.media.player; |
5 | 873 |
}, |
874 |
||
875 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
876 |
* |
9 | 877 |
* Removes and resets all players. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
878 |
* |
5 | 879 |
* Allows any class that has set 'player' to a MediaElementPlayer |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
880 |
* instance to remove the player when listening to events. |
5 | 881 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
882 |
* Examples: modal closes, shortcode properties are removed, etc. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
883 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
884 |
* @since 4.2.0 |
5 | 885 |
*/ |
886 |
unsetPlayers : function() { |
|
887 |
if ( this.players && this.players.length ) { |
|
888 |
_.each( this.players, function (player) { |
|
889 |
player.pause(); |
|
890 |
wp.media.mixin.removePlayer( player ); |
|
891 |
} ); |
|
892 |
this.players = []; |
|
893 |
} |
|
894 |
} |
|
895 |
}; |
|
896 |
||
897 |
/** |
|
9 | 898 |
* Shortcode modeling for playlists. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
899 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
900 |
* @since 4.2.0 |
5 | 901 |
*/ |
902 |
wp.media.playlist = new wp.media.collection({ |
|
903 |
tag: 'playlist', |
|
904 |
editTitle : l10n.editPlaylistTitle, |
|
905 |
defaults : { |
|
906 |
id: wp.media.view.settings.post.id, |
|
907 |
style: 'light', |
|
908 |
tracklist: true, |
|
909 |
tracknumbers: true, |
|
910 |
images: true, |
|
911 |
artists: true, |
|
912 |
type: 'audio' |
|
913 |
} |
|
914 |
}); |
|
915 |
||
916 |
/** |
|
9 | 917 |
* Shortcode modeling for audio. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
918 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
919 |
* `edit()` prepares the shortcode for the media modal. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
920 |
* `shortcode()` builds the new shortcode after an update. |
5 | 921 |
* |
922 |
* @namespace |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
923 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
924 |
* @since 4.2.0 |
5 | 925 |
*/ |
926 |
wp.media.audio = { |
|
927 |
coerce : wp.media.coerce, |
|
928 |
||
929 |
defaults : { |
|
930 |
id : wp.media.view.settings.post.id, |
|
931 |
src : '', |
|
932 |
loop : false, |
|
933 |
autoplay : false, |
|
934 |
preload : 'none', |
|
935 |
width : 400 |
|
936 |
}, |
|
937 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
938 |
/** |
9 | 939 |
* Instantiates a new media object with the next matching shortcode. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
940 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
941 |
* @since 4.2.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
942 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
943 |
* @param {string} data The text to apply the shortcode on. |
16 | 944 |
* @return {wp.media} The media object. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
945 |
*/ |
5 | 946 |
edit : function( data ) { |
947 |
var frame, shortcode = wp.shortcode.next( 'audio', data ).shortcode; |
|
948 |
||
949 |
frame = wp.media({ |
|
950 |
frame: 'audio', |
|
951 |
state: 'audio-details', |
|
952 |
metadata: _.defaults( shortcode.attrs.named, this.defaults ) |
|
953 |
}); |
|
954 |
||
955 |
return frame; |
|
956 |
}, |
|
957 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
958 |
/** |
9 | 959 |
* Generates an audio shortcode. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
960 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
961 |
* @since 4.2.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
962 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
963 |
* @param {Array} model Array with attributes for the shortcode. |
16 | 964 |
* @return {wp.shortcode} The audio shortcode object. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
965 |
*/ |
5 | 966 |
shortcode : function( model ) { |
967 |
var content; |
|
968 |
||
969 |
_.each( this.defaults, function( value, key ) { |
|
970 |
model[ key ] = this.coerce( model, key ); |
|
971 |
||
972 |
if ( value === model[ key ] ) { |
|
973 |
delete model[ key ]; |
|
974 |
} |
|
975 |
}, this ); |
|
976 |
||
977 |
content = model.content; |
|
978 |
delete model.content; |
|
979 |
||
980 |
return new wp.shortcode({ |
|
981 |
tag: 'audio', |
|
982 |
attrs: model, |
|
983 |
content: content |
|
984 |
}); |
|
985 |
} |
|
986 |
}; |
|
987 |
||
988 |
/** |
|
9 | 989 |
* Shortcode modeling for video. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
990 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
991 |
* `edit()` prepares the shortcode for the media modal. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
992 |
* `shortcode()` builds the new shortcode after update. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
993 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
994 |
* @since 4.2.0 |
5 | 995 |
* |
996 |
* @namespace |
|
997 |
*/ |
|
998 |
wp.media.video = { |
|
999 |
coerce : wp.media.coerce, |
|
1000 |
||
1001 |
defaults : { |
|
1002 |
id : wp.media.view.settings.post.id, |
|
1003 |
src : '', |
|
1004 |
poster : '', |
|
1005 |
loop : false, |
|
1006 |
autoplay : false, |
|
1007 |
preload : 'metadata', |
|
1008 |
content : '', |
|
1009 |
width : 640, |
|
1010 |
height : 360 |
|
1011 |
}, |
|
1012 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1013 |
/** |
9 | 1014 |
* Instantiates a new media object with the next matching shortcode. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1015 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1016 |
* @since 4.2.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1017 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1018 |
* @param {string} data The text to apply the shortcode on. |
16 | 1019 |
* @return {wp.media} The media object. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1020 |
*/ |
5 | 1021 |
edit : function( data ) { |
1022 |
var frame, |
|
1023 |
shortcode = wp.shortcode.next( 'video', data ).shortcode, |
|
1024 |
attrs; |
|
1025 |
||
1026 |
attrs = shortcode.attrs.named; |
|
1027 |
attrs.content = shortcode.content; |
|
1028 |
||
1029 |
frame = wp.media({ |
|
1030 |
frame: 'video', |
|
1031 |
state: 'video-details', |
|
1032 |
metadata: _.defaults( attrs, this.defaults ) |
|
1033 |
}); |
|
1034 |
||
1035 |
return frame; |
|
1036 |
}, |
|
1037 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1038 |
/** |
9 | 1039 |
* Generates an video shortcode. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1040 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1041 |
* @since 4.2.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1042 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1043 |
* @param {Array} model Array with attributes for the shortcode. |
16 | 1044 |
* @return {wp.shortcode} The video shortcode object. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1045 |
*/ |
5 | 1046 |
shortcode : function( model ) { |
1047 |
var content; |
|
1048 |
||
1049 |
_.each( this.defaults, function( value, key ) { |
|
1050 |
model[ key ] = this.coerce( model, key ); |
|
1051 |
||
1052 |
if ( value === model[ key ] ) { |
|
1053 |
delete model[ key ]; |
|
1054 |
} |
|
1055 |
}, this ); |
|
1056 |
||
1057 |
content = model.content; |
|
1058 |
delete model.content; |
|
1059 |
||
1060 |
return new wp.shortcode({ |
|
1061 |
tag: 'video', |
|
1062 |
attrs: model, |
|
1063 |
content: content |
|
1064 |
}); |
|
1065 |
} |
|
1066 |
}; |
|
1067 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1068 |
media.model.PostMedia = __webpack_require__( 241 ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1069 |
media.controller.AudioDetails = __webpack_require__( 1206 ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1070 |
media.controller.VideoDetails = __webpack_require__( 5039 ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1071 |
media.view.MediaFrame.MediaDetails = __webpack_require__( 741 ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1072 |
media.view.MediaFrame.AudioDetails = __webpack_require__( 175 ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1073 |
media.view.MediaFrame.VideoDetails = __webpack_require__( 8646 ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1074 |
media.view.MediaDetails = __webpack_require__( 9467 ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1075 |
media.view.AudioDetails = __webpack_require__( 3713 ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
1076 |
media.view.VideoDetails = __webpack_require__( 5836 ); |
5 | 1077 |
|
19 | 1078 |
/******/ })() |
1079 |
; |