Ticket #28510: 28510.5.patch
File 28510.5.patch, 193.0 KB (added by , 10 years ago) |
---|
-
Gruntfile.js
123 123 'src/wp-includes/js/media/views.js' : [ SOURCE_DIR + 'wp-includes/js/media/views.manifest.js' ], 124 124 'src/wp-includes/js/media/audio-video.js' : [ SOURCE_DIR + 'wp-includes/js/media/audio-video.manifest.js' ], 125 125 'src/wp-includes/js/media/grid.js' : [ SOURCE_DIR + 'wp-includes/js/media/grid.manifest.js' ] 126 }, 127 options: { debug: true } 126 } 128 127 } 129 128 }, 130 129 sass: { … … 235 234 '!twenty{fourteen,fifteen}/js/html5.js' 236 235 ] 237 236 }, 237 media: { 238 options: { 239 browserify: true 240 }, 241 expand: true, 242 cwd: SOURCE_DIR, 243 src: [ 244 'wp-includes/js/media/**/*.js', 245 '!wp-includes/js/media/*.js', 246 'wp-includes/js/media/*.manifest.js' 247 ] 248 }, 238 249 core: { 239 250 expand: true, 240 251 cwd: SOURCE_DIR, … … 507 518 grunt.registerTask('colors', ['sass:colors', 'autoprefixer:colors']); 508 519 509 520 // JSHint task. 510 grunt.registerTask('jshint:corejs', ['jshint:grunt', 'jshint:tests', 'jshint:themes', 'jshint:core']); 521 grunt.registerTask( 'jshint:corejs', [ 522 'jshint:grunt', 523 'jshint:tests', 524 'jshint:themes', 525 'jshint:core', 526 'jshint:media' 527 ] ); 511 528 512 529 // Pre-commit task. 513 530 grunt.registerTask('precommit', 'Runs front-end dev/test tasks in preparation for a commit.', -
src/wp-includes/js/media/audio-video.js
1 1 (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ 2 /* global wp, _wpMediaViewsL10n, _wpmejsSettings, MediaElementPlayer */ 2 var media = wp.media, 3 baseSettings = window._wpmejsSettings || {}, 4 l10n = window._wpMediaViewsL10n || {}; 3 5 4 (function(_) { 5 var media = wp.media, 6 baseSettings = {}, 7 l10n = typeof _wpMediaViewsL10n === 'undefined' ? {} : _wpMediaViewsL10n; 6 /** 7 * @mixin 8 */ 9 wp.media.mixin = { 10 mejsSettings: baseSettings, 8 11 9 if ( ! _.isUndefined( window._wpmejsSettings ) ) { 10 baseSettings = _wpmejsSettings; 11 } 12 removeAllPlayers: function() { 13 var p; 14 15 if ( window.mejs && window.mejs.players ) { 16 for ( p in window.mejs.players ) { 17 window.mejs.players[p].pause(); 18 this.removePlayer( window.mejs.players[p] ); 19 } 20 } 21 }, 12 22 13 23 /** 14 * @mixin 24 * Override the MediaElement method for removing a player. 25 * MediaElement tries to pull the audio/video tag out of 26 * its container and re-add it to the DOM. 15 27 */ 16 wp.media.mixin ={17 mejsSettings: baseSettings,28 removePlayer: function(t) { 29 var featureIndex, feature; 18 30 19 removeAllPlayers: function() { 20 var p; 31 if ( ! t.options ) { 32 return; 33 } 21 34 22 if ( window.mejs && window.mejs.players ) { 23 for ( p in window.mejs.players ) { 24 window.mejs.players[p].pause(); 25 this.removePlayer( window.mejs.players[p] ); 26 } 35 // invoke features cleanup 36 for ( featureIndex in t.options.features ) { 37 feature = t.options.features[featureIndex]; 38 if ( t['clean' + feature] ) { 39 try { 40 t['clean' + feature](t); 41 } catch (e) {} 27 42 } 28 } ,43 } 29 44 30 /** 31 * Override the MediaElement method for removing a player. 32 * MediaElement tries to pull the audio/video tag out of 33 * its container and re-add it to the DOM. 34 */ 35 removePlayer: function(t) { 36 var featureIndex, feature; 45 if ( ! t.isDynamic ) { 46 t.$node.remove(); 47 } 37 48 38 if ( ! t.options) {39 return;40 49 if ( 'native' !== t.media.pluginType ) { 50 t.media.remove(); 51 } 41 52 42 // invoke features cleanup 43 for ( featureIndex in t.options.features ) { 44 feature = t.options.features[featureIndex]; 45 if ( t['clean' + feature] ) { 46 try { 47 t['clean' + feature](t); 48 } catch (e) {} 49 } 50 } 53 delete window.mejs.players[t.id]; 51 54 52 if ( ! t.isDynamic ) { 53 t.$node.remove(); 54 } 55 t.container.remove(); 56 t.globalUnbind(); 57 delete t.node.player; 58 }, 55 59 56 if ( 'native' !== t.media.pluginType ) { 57 t.media.remove(); 58 } 60 /** 61 * Allows any class that has set 'player' to a MediaElementPlayer 62 * instance to remove the player when listening to events. 63 * 64 * Examples: modal closes, shortcode properties are removed, etc. 65 */ 66 unsetPlayers : function() { 67 if ( this.players && this.players.length ) { 68 _.each( this.players, function (player) { 69 player.pause(); 70 wp.media.mixin.removePlayer( player ); 71 } ); 72 this.players = []; 73 } 74 } 75 }; 59 76 60 delete window.mejs.players[t.id]; 77 /** 78 * Autowire "collection"-type shortcodes 79 */ 80 wp.media.playlist = new wp.media.collection({ 81 tag: 'playlist', 82 editTitle : l10n.editPlaylistTitle, 83 defaults : { 84 id: wp.media.view.settings.post.id, 85 style: 'light', 86 tracklist: true, 87 tracknumbers: true, 88 images: true, 89 artists: true, 90 type: 'audio' 91 } 92 }); 61 93 62 t.container.remove(); 63 t.globalUnbind(); 64 delete t.node.player; 65 }, 94 /** 95 * Shortcode modeling for audio 96 * `edit()` prepares the shortcode for the media modal 97 * `shortcode()` builds the new shortcode after update 98 * 99 * @namespace 100 */ 101 wp.media.audio = { 102 coerce : wp.media.coerce, 66 103 67 /** 68 * Allows any class that has set 'player' to a MediaElementPlayer 69 * instance to remove the player when listening to events. 70 * 71 * Examples: modal closes, shortcode properties are removed, etc. 72 */ 73 unsetPlayers : function() { 74 if ( this.players && this.players.length ) { 75 _.each( this.players, function (player) { 76 player.pause(); 77 wp.media.mixin.removePlayer( player ); 78 } ); 79 this.players = []; 80 } 81 } 82 }; 104 defaults : { 105 id : wp.media.view.settings.post.id, 106 src : '', 107 loop : false, 108 autoplay : false, 109 preload : 'none', 110 width : 400 111 }, 83 112 84 /** 85 * Autowire "collection"-type shortcodes 86 */ 87 wp.media.playlist = new wp.media.collection({ 88 tag: 'playlist', 89 editTitle : l10n.editPlaylistTitle, 90 defaults : { 91 id: wp.media.view.settings.post.id, 92 style: 'light', 93 tracklist: true, 94 tracknumbers: true, 95 images: true, 96 artists: true, 97 type: 'audio' 98 } 99 }); 100 101 /** 102 * Shortcode modeling for audio 103 * `edit()` prepares the shortcode for the media modal 104 * `shortcode()` builds the new shortcode after update 105 * 106 * @namespace 107 */ 108 wp.media.audio = { 109 coerce : wp.media.coerce, 110 111 defaults : { 112 id : wp.media.view.settings.post.id, 113 src : '', 114 loop : false, 115 autoplay : false, 116 preload : 'none', 117 width : 400 118 }, 119 120 edit : function( data ) { 121 var frame, shortcode = wp.shortcode.next( 'audio', data ).shortcode; 122 123 frame = wp.media({ 124 frame: 'audio', 125 state: 'audio-details', 126 metadata: _.defaults( shortcode.attrs.named, this.defaults ) 127 }); 113 edit : function( data ) { 114 var frame, shortcode = wp.shortcode.next( 'audio', data ).shortcode; 128 115 129 return frame; 130 }, 116 frame = wp.media({ 117 frame: 'audio', 118 state: 'audio-details', 119 metadata: _.defaults( shortcode.attrs.named, this.defaults ) 120 }); 131 121 132 shortcode : function( model ) {133 var content;122 return frame; 123 }, 134 124 135 _.each( this.defaults, function( value, key) {136 model[ key ] = self.coerce( model, key );125 shortcode : function( model ) { 126 var content; 137 127 138 if ( value === model[ key ] ) { 139 delete model[ key ]; 140 } 141 }, this ); 128 _.each( this.defaults, function( value, key ) { 129 model[ key ] = this.coerce( model, key ); 142 130 143 content = model.content; 144 delete model.content; 131 if ( value === model[ key ] ) { 132 delete model[ key ]; 133 } 134 }, this ); 145 135 146 return new wp.shortcode({ 147 tag: 'audio', 148 attrs: model, 149 content: content 150 }); 151 } 152 }; 136 content = model.content; 137 delete model.content; 153 138 154 /** 155 * Shortcode modeling for video 156 * `edit()` prepares the shortcode for the media modal 157 * `shortcode()` builds the new shortcode after update 158 * 159 * @namespace 160 */ 161 wp.media.video = { 162 coerce : wp.media.coerce, 163 164 defaults : { 165 id : wp.media.view.settings.post.id, 166 src : '', 167 poster : '', 168 loop : false, 169 autoplay : false, 170 preload : 'metadata', 171 content : '', 172 width : 640, 173 height : 360 174 }, 175 176 edit : function( data ) { 177 var frame, 178 shortcode = wp.shortcode.next( 'video', data ).shortcode, 179 attrs; 180 181 attrs = shortcode.attrs.named; 182 attrs.content = shortcode.content; 183 184 frame = wp.media({ 185 frame: 'video', 186 state: 'video-details', 187 metadata: _.defaults( attrs, this.defaults ) 188 }); 139 return new wp.shortcode({ 140 tag: 'audio', 141 attrs: model, 142 content: content 143 }); 144 } 145 }; 146 147 /** 148 * Shortcode modeling for video 149 * `edit()` prepares the shortcode for the media modal 150 * `shortcode()` builds the new shortcode after update 151 * 152 * @namespace 153 */ 154 wp.media.video = { 155 coerce : wp.media.coerce, 156 157 defaults : { 158 id : wp.media.view.settings.post.id, 159 src : '', 160 poster : '', 161 loop : false, 162 autoplay : false, 163 preload : 'metadata', 164 content : '', 165 width : 640, 166 height : 360 167 }, 168 169 edit : function( data ) { 170 var frame, 171 shortcode = wp.shortcode.next( 'video', data ).shortcode, 172 attrs; 173 174 attrs = shortcode.attrs.named; 175 attrs.content = shortcode.content; 176 177 frame = wp.media({ 178 frame: 'video', 179 state: 'video-details', 180 metadata: _.defaults( attrs, this.defaults ) 181 }); 189 182 190 191 183 return frame; 184 }, 192 185 193 194 186 shortcode : function( model ) { 187 var content; 195 188 196 197 189 _.each( this.defaults, function( value, key ) { 190 model[ key ] = this.coerce( model, key ); 198 191 199 200 201 202 192 if ( value === model[ key ] ) { 193 delete model[ key ]; 194 } 195 }, this ); 203 196 204 205 197 content = model.content; 198 delete model.content; 206 199 207 208 209 210 211 212 213 200 return new wp.shortcode({ 201 tag: 'video', 202 attrs: model, 203 content: content 204 }); 205 } 206 }; 214 207 215 216 217 218 219 220 221 222 223 208 media.model.PostMedia = require( './models/post-media.js' ); 209 media.controller.AudioDetails = require( './controllers/audio-details.js' ); 210 media.controller.VideoDetails = require( './controllers/video-details.js' ); 211 media.view.MediaFrame.MediaDetails = require( './views/frame/media-details.js' ); 212 media.view.MediaFrame.AudioDetails = require( './views/frame/audio-details.js' ); 213 media.view.MediaFrame.VideoDetails = require( './views/frame/video-details.js' ); 214 media.view.MediaDetails = require( './views/media-details.js' ); 215 media.view.AudioDetails = require( './views/audio-details.js' ); 216 media.view.VideoDetails = require( './views/video-details.js' ); 224 217 225 }(_));226 218 },{"./controllers/audio-details.js":2,"./controllers/video-details.js":8,"./models/post-media.js":9,"./views/audio-details.js":21,"./views/frame/audio-details.js":25,"./views/frame/media-details.js":26,"./views/frame/video-details.js":28,"./views/media-details.js":31,"./views/video-details.js":50}],2:[function(require,module,exports){ 227 /*globals wp */228 229 219 /** 230 220 * The controller for the Audio Details state 231 221 * … … 255 245 }); 256 246 257 247 module.exports = AudioDetails; 258 },{"./state.js":7}],3:[function(require,module,exports){259 /*globals _, wp, Backbone, getUserSetting, setUserSetting */260 248 249 },{"./state.js":7}],3:[function(require,module,exports){ 261 250 /** 262 251 * wp.media.controller.Library 263 252 * … … 295 284 var selectionSync = require( '../utils/selection-sync.js' ), 296 285 State = require( './state.js' ), 297 286 l10n = wp.media.view.l10n, 287 getUserSetting = window.getUserSetting, 288 setUserSetting = window.setUserSetting, 298 289 Library; 299 290 300 291 Library = State.extend({ … … 329 320 this.set( 'library', wp.media.query() ); 330 321 } 331 322 332 if ( ! ( selection instanceof Selection) ) {323 if ( ! ( selection instanceof wp.media.model.Selection ) ) { 333 324 props = selection; 334 325 335 326 if ( ! props ) { … … 528 519 _.extend( Library.prototype, selectionSync ); 529 520 530 521 module.exports = Library; 531 },{"../utils/selection-sync.js":10,"./state.js":7}],4:[function(require,module,exports){532 /*globals _, wp */533 522 523 },{"../utils/selection-sync.js":10,"./state.js":7}],4:[function(require,module,exports){ 534 524 /** 535 525 * wp.media.controller.MediaLibrary 536 526 * … … 579 569 }); 580 570 581 571 module.exports = MediaLibrary; 582 },{"./library.js":3}],5:[function(require,module,exports){583 /*globals _, Backbone */584 572 573 },{"./library.js":3}],5:[function(require,module,exports){ 585 574 /** 586 575 * wp.media.controller.Region 587 576 * … … 759 748 }); 760 749 761 750 module.exports = Region; 762 },{}],6:[function(require,module,exports){763 /*globals _, Backbone */764 751 752 },{}],6:[function(require,module,exports){ 765 753 /** 766 754 * wp.media.controller.StateMachine 767 755 * … … 884 872 }); 885 873 886 874 module.exports = StateMachine; 887 },{}],7:[function(require,module,exports){888 /*globals _, Backbone */889 875 876 },{}],7:[function(require,module,exports){ 890 877 /** 891 878 * wp.media.controller.State 892 879 * … … 1126 1113 }); 1127 1114 1128 1115 module.exports = State; 1129 },{}],8:[function(require,module,exports){1130 /*globals wp */1131 1116 1117 },{}],8:[function(require,module,exports){ 1132 1118 /** 1133 1119 * The controller for the Video Details state 1134 1120 * … … 1158 1144 }); 1159 1145 1160 1146 module.exports = VideoDetails; 1161 },{"./state.js":7}],9:[function(require,module,exports){1162 /*globals Backbone, _, wp */1163 1147 1148 },{"./state.js":7}],9:[function(require,module,exports){ 1164 1149 /** 1165 1150 * Shared model class for audio and video. Updates the model after 1166 1151 * "Add Audio|Video Source" and "Replace Audio|Video" states return … … 1199 1184 }); 1200 1185 1201 1186 module.exports = PostMedia; 1202 },{}],10:[function(require,module,exports){1203 /*globals _ */1204 1187 1188 },{}],10:[function(require,module,exports){ 1205 1189 /** 1206 1190 * wp.media.selectionSync 1207 1191 * … … 1266 1250 }; 1267 1251 1268 1252 module.exports = selectionSync; 1269 },{}],11:[function(require,module,exports){1270 /*globals _ */1271 1253 1254 },{}],11:[function(require,module,exports){ 1272 1255 /** 1273 1256 * wp.media.view.AttachmentCompat 1274 1257 * … … 1352 1335 }); 1353 1336 1354 1337 module.exports = AttachmentCompat; 1355 },{"./view.js":51}],12:[function(require,module,exports){1356 /*globals _, jQuery */1357 1338 1339 },{"./view.js":51}],12:[function(require,module,exports){ 1358 1340 /** 1359 1341 * wp.media.view.AttachmentFilters 1360 1342 * … … 1431 1413 }); 1432 1414 1433 1415 module.exports = AttachmentFilters; 1434 },{"./view.js":51}],13:[function(require,module,exports){1435 /*globals _, wp */1436 1416 1417 },{"./view.js":51}],13:[function(require,module,exports){ 1437 1418 /** 1438 1419 * wp.media.view.AttachmentFilters.All 1439 1420 * … … 1523 1504 }); 1524 1505 1525 1506 module.exports = All; 1526 },{"../attachment-filters.js":12}],14:[function(require,module,exports){1527 /*globals _, wp */1528 1507 1508 },{"../attachment-filters.js":12}],14:[function(require,module,exports){ 1529 1509 /** 1530 1510 * A filter dropdown for month/dates. 1531 1511 * … … 1566 1546 }); 1567 1547 1568 1548 module.exports = DateFilter; 1569 },{"../attachment-filters.js":12}],15:[function(require,module,exports){1570 /*globals wp */1571 1549 1550 },{"../attachment-filters.js":12}],15:[function(require,module,exports){ 1572 1551 /** 1573 1552 * wp.media.view.AttachmentFilters.Uploaded 1574 1553 * … … 1627 1606 }); 1628 1607 1629 1608 module.exports = Uploaded; 1630 },{"../attachment-filters.js":12}],16:[function(require,module,exports){1631 /*globals _, wp, jQuery */1632 1609 1610 },{"../attachment-filters.js":12}],16:[function(require,module,exports){ 1633 1611 /** 1634 1612 * wp.media.view.Attachment 1635 1613 * … … 2182 2160 }); 2183 2161 2184 2162 module.exports = Attachment; 2185 },{"./view.js":51}],17:[function(require,module,exports){2186 /*globals _, wp */2187 2163 2164 },{"./view.js":51}],17:[function(require,module,exports){ 2188 2165 /** 2189 2166 * wp.media.view.Attachment.Details 2190 2167 * … … 2244 2221 deleteAttachment: function( event ) { 2245 2222 event.preventDefault(); 2246 2223 2247 if ( confirm( l10n.warnDelete ) ) {2224 if ( window.confirm( l10n.warnDelete ) ) { 2248 2225 this.model.destroy(); 2249 2226 // Keep focus inside media modal 2250 2227 // after image is deleted … … 2323 2300 }); 2324 2301 2325 2302 module.exports = Details; 2303 2326 2304 },{"../attachment.js":16}],18:[function(require,module,exports){ 2327 2305 /** 2328 2306 * wp.media.view.Attachment.Library … … 2343 2321 }); 2344 2322 2345 2323 module.exports = Library; 2346 },{"../attachment.js":16}],19:[function(require,module,exports){2347 /*globals _, wp, jQuery */2348 2324 2325 },{"../attachment.js":16}],19:[function(require,module,exports){ 2349 2326 /** 2350 2327 * wp.media.view.Attachments 2351 2328 * … … 2618 2595 2619 2596 // The scroll event occurs on the document, but the element 2620 2597 // that should be checked is the document body. 2621 if ( el == document ) {2598 if ( el === document ) { 2622 2599 el = document.body; 2623 2600 scrollTop = $(document).scrollTop(); 2624 2601 } … … 2644 2621 }); 2645 2622 2646 2623 module.exports = Attachments; 2647 },{"./attachment.js":16,"./view.js":51}],20:[function(require,module,exports){2648 /*globals _, wp, jQuery */2649 2624 2625 },{"./attachment.js":16,"./view.js":51}],20:[function(require,module,exports){ 2650 2626 /** 2651 2627 * wp.media.view.AttachmentsBrowser 2652 2628 * … … 2837 2813 return; 2838 2814 } 2839 2815 2840 if ( ! mediaTrash && ! confirm( l10n.warnBulkDelete ) ) {2816 if ( ! mediaTrash && ! window.confirm( l10n.warnBulkDelete ) ) { 2841 2817 return; 2842 2818 } 2843 2819 2844 2820 if ( mediaTrash && 2845 2821 'trash' !== selection.at( 0 ).get( 'status' ) && 2846 ! confirm( l10n.warnBulkTrash ) ) {2822 ! window.confirm( l10n.warnBulkTrash ) ) { 2847 2823 2848 2824 return; 2849 2825 } … … 2891 2867 click: function() { 2892 2868 var removed = [], selection = this.controller.state().get( 'selection' ); 2893 2869 2894 if ( ! selection.length || ! confirm( l10n.warnBulkDelete ) ) {2870 if ( ! selection.length || ! window.confirm( l10n.warnBulkDelete ) ) { 2895 2871 return; 2896 2872 } 2897 2873 … … 3104 3080 }); 3105 3081 3106 3082 module.exports = AttachmentsBrowser; 3107 },{"../attachment-compat.js":11,"../attachment-filters/all.js":13,"../attachment-filters/date.js":14,"../attachment-filters/uploaded.js":15,"../attachment/details.js":17,"../attachment/library.js":18,"../attachments.js":19,"../label.js":30,"../search.js":39,"../settings/attachment-display.js":41,"../sidebar.js":42,"../spinner.js":43,"../toolbar.js":44,"../uploader/inline.js":46,"../uploader/status.js":48,"../view.js":51}],21:[function(require,module,exports){3108 /*globals wp */3109 3083 3084 },{"../attachment-compat.js":11,"../attachment-filters/all.js":13,"../attachment-filters/date.js":14,"../attachment-filters/uploaded.js":15,"../attachment/details.js":17,"../attachment/library.js":18,"../attachments.js":19,"../label.js":30,"../search.js":39,"../settings/attachment-display.js":41,"../sidebar.js":42,"../spinner.js":43,"../toolbar.js":44,"../uploader/inline.js":46,"../uploader/status.js":48,"../view.js":51}],21:[function(require,module,exports){ 3110 3085 /** 3111 3086 * wp.media.view.AudioDetails 3112 3087 * … … 3143 3118 }); 3144 3119 3145 3120 module.exports = AudioDetails; 3146 },{"./media-details":31}],22:[function(require,module,exports){3147 /*globals _, Backbone */3148 3121 3122 },{"./media-details":31}],22:[function(require,module,exports){ 3149 3123 /** 3150 3124 * wp.media.view.Button 3151 3125 * … … 3233 3207 }); 3234 3208 3235 3209 module.exports = Button; 3210 3236 3211 },{"./view.js":51}],23:[function(require,module,exports){ 3237 3212 /** 3238 3213 * wp.media.view.FocusManager … … 3281 3256 }); 3282 3257 3283 3258 module.exports = FocusManager; 3284 },{"./view.js":51}],24:[function(require,module,exports){3285 /*globals _, Backbone */3286 3259 3260 },{"./view.js":51}],24:[function(require,module,exports){ 3287 3261 /** 3288 3262 * wp.media.view.Frame 3289 3263 * … … 3454 3428 _.extend( Frame.prototype, StateMachine.prototype ); 3455 3429 3456 3430 module.exports = Frame; 3457 },{"../controllers/region.js":5,"../controllers/state-machine.js":6,"../controllers/state.js":7,"./view.js":51}],25:[function(require,module,exports){3458 /*globals wp */3459 3431 3432 },{"../controllers/region.js":5,"../controllers/state-machine.js":6,"../controllers/state.js":7,"./view.js":51}],25:[function(require,module,exports){ 3460 3433 /** 3461 3434 * wp.media.view.MediaFrame.AudioDetails 3462 3435 * … … 3532 3505 }); 3533 3506 3534 3507 module.exports = AudioDetails; 3535 },{"../../controllers/audio-details.js":2,"../../controllers/media-library.js":4,"../audio-details.js":21,"./media-details":26}],26:[function(require,module,exports){3536 /*globals wp */3537 3508 3509 },{"../../controllers/audio-details.js":2,"../../controllers/media-library.js":4,"../audio-details.js":21,"./media-details":26}],26:[function(require,module,exports){ 3538 3510 /** 3539 3511 * wp.media.view.MediaFrame.MediaDetails 3540 3512 * … … 3665 3637 }); 3666 3638 3667 3639 module.exports = MediaDetails; 3668 },{"../toolbar.js":44,"../view.js":51,"./select.js":27}],27:[function(require,module,exports){3669 /*globals _, wp */3670 3640 3641 },{"../toolbar.js":44,"../view.js":51,"./select.js":27}],27:[function(require,module,exports){ 3671 3642 /** 3672 3643 * wp.media.view.MediaFrame.Select 3673 3644 * … … 3840 3811 }); 3841 3812 3842 3813 module.exports = Select; 3843 },{"../../controllers/library.js":3,"../attachments/browser.js":20,"../media-frame.js":32,"../toolbar/select.js":45,"../uploader/inline.js":46}],28:[function(require,module,exports){3844 /*globals _, wp */3845 3814 3815 },{"../../controllers/library.js":3,"../attachments/browser.js":20,"../media-frame.js":32,"../toolbar/select.js":45,"../uploader/inline.js":46}],28:[function(require,module,exports){ 3846 3816 /** 3847 3817 * wp.media.view.MediaFrame.VideoDetails 3848 3818 * … … 3978 3948 }); 3979 3949 3980 3950 module.exports = VideoDetails; 3951 3981 3952 },{"../../controllers/media-library.js":4,"../../controllers/video-details.js":8,"../video-details.js":50,"./media-details":26}],29:[function(require,module,exports){ 3982 3953 /** 3983 3954 * wp.media.view.Iframe … … 4004 3975 }); 4005 3976 4006 3977 module.exports = Iframe; 3978 4007 3979 },{"./view.js":51}],30:[function(require,module,exports){ 4008 3980 /** 4009 3981 * @class … … 4030 4002 }); 4031 4003 4032 4004 module.exports = Label; 4033 },{"./view.js":51}],31:[function(require,module,exports){4034 /*globals _, wp, jQuery */4035 4005 4006 },{"./view.js":51}],31:[function(require,module,exports){ 4036 4007 /** 4037 4008 * wp.media.view.MediaDetails 4038 4009 * … … 4116 4087 */ 4117 4088 setPlayer : function() { 4118 4089 if ( ! this.players.length && this.media ) { 4119 this.players.push( new MediaElementPlayer( this.media, this.settings ) );4090 this.players.push( new window.MediaElementPlayer( this.media, this.settings ) ); 4120 4091 } 4121 4092 }, 4122 4093 … … 4144 4115 */ 4145 4116 render: function() { 4146 4117 AttachmentDisplay.prototype.render.apply( this, arguments ); 4147 4118 4148 4119 setTimeout( _.bind( function() { 4149 4120 this.resetFocus(); 4150 4121 }, this ), 10 ); … … 4183 4154 }); 4184 4155 4185 4156 module.exports = MediaDetails; 4186 },{"./settings/attachment-display.js":41}],32:[function(require,module,exports){4187 /*globals _, wp, jQuery */4188 4157 4158 },{"./settings/attachment-display.js":41}],32:[function(require,module,exports){ 4189 4159 /** 4190 4160 * wp.media.view.MediaFrame 4191 4161 * … … 4438 4408 }); 4439 4409 4440 4410 module.exports = MediaFrame; 4441 },{"./frame.js":24,"./iframe.js":29,"./menu.js":34,"./modal.js":35,"./router.js":38,"./toolbar.js":44,"./uploader/window.js":49,"./view.js":51}],33:[function(require,module,exports){4442 /*globals wp, jQuery */4443 4411 4412 },{"./frame.js":24,"./iframe.js":29,"./menu.js":34,"./modal.js":35,"./router.js":38,"./toolbar.js":44,"./uploader/window.js":49,"./view.js":51}],33:[function(require,module,exports){ 4444 4413 /** 4445 4414 * wp.media.view.MenuItem 4446 4415 * … … 4512 4481 }); 4513 4482 4514 4483 module.exports = MenuItem; 4484 4515 4485 },{"./view.js":51}],34:[function(require,module,exports){ 4516 4486 /** 4517 4487 * wp.media.view.Menu … … 4628 4598 }); 4629 4599 4630 4600 module.exports = Menu; 4631 },{"./menu-item.js":33,"./priority-list.js":36}],35:[function(require,module,exports){4632 /*globals _, wp, jQuery */4633 4601 4602 },{"./menu-item.js":33,"./priority-list.js":36}],35:[function(require,module,exports){ 4634 4603 /** 4635 4604 * wp.media.view.Modal 4636 4605 * … … 4844 4813 }); 4845 4814 4846 4815 module.exports = Modal; 4847 },{"./focus-manager.js":23,"./view.js":51}],36:[function(require,module,exports){4848 /*globals _, Backbone */4849 4816 4817 },{"./focus-manager.js":23,"./view.js":51}],36:[function(require,module,exports){ 4850 4818 /** 4851 4819 * wp.media.view.PriorityList 4852 4820 * … … 4945 4913 }); 4946 4914 4947 4915 module.exports = PriorityList; 4916 4948 4917 },{"./view.js":51}],37:[function(require,module,exports){ 4949 4918 /** 4950 4919 * wp.media.view.RouterItem … … 4971 4940 }); 4972 4941 4973 4942 module.exports = RouterItem; 4943 4974 4944 },{"./menu-item.js":33}],38:[function(require,module,exports){ 4975 4945 /** 4976 4946 * wp.media.view.Router … … 5008 4978 }); 5009 4979 5010 4980 module.exports = Router; 5011 },{"./menu.js":34,"./router-item.js":37}],39:[function(require,module,exports){5012 /*globals wp */5013 4981 4982 },{"./menu.js":34,"./router-item.js":37}],39:[function(require,module,exports){ 5014 4983 /** 5015 4984 * wp.media.view.Search 5016 4985 * … … 5058 5027 }); 5059 5028 5060 5029 module.exports = Search; 5061 },{"./view.js":51}],40:[function(require,module,exports){5062 /*globals _, Backbone, jQuery */5063 5030 5031 },{"./view.js":51}],40:[function(require,module,exports){ 5064 5032 /** 5065 5033 * wp.media.view.Settings 5066 5034 * … … 5168 5136 // If the setting has a corresponding user setting, 5169 5137 // update that as well. 5170 5138 if ( userSetting = $setting.data('userSetting') ) { 5171 setUserSetting( userSetting, value );5139 window.setUserSetting( userSetting, value ); 5172 5140 } 5173 5141 }, 5174 5142 … … 5180 5148 }); 5181 5149 5182 5150 module.exports = Settings; 5183 },{"./view.js":51}],41:[function(require,module,exports){5184 /*globals _, wp */5185 5151 5152 },{"./view.js":51}],41:[function(require,module,exports){ 5186 5153 /** 5187 5154 * wp.media.view.Settings.AttachmentDisplay 5188 5155 * … … 5275 5242 }); 5276 5243 5277 5244 module.exports = AttachmentDisplay; 5245 5278 5246 },{"../settings.js":40}],42:[function(require,module,exports){ 5279 5247 /** 5280 5248 * wp.media.view.Sidebar … … 5293 5261 }); 5294 5262 5295 5263 module.exports = Sidebar; 5296 },{"./priority-list.js":36}],43:[function(require,module,exports){5297 /*globals _, wp */5298 5264 5265 },{"./priority-list.js":36}],43:[function(require,module,exports){ 5299 5266 /** 5300 5267 * wp.media.view.Spinner 5301 5268 * … … 5332 5299 }); 5333 5300 5334 5301 module.exports = Spinner; 5335 },{"./view.js":51}],44:[function(require,module,exports){5336 /*globals Backbone, _ */5337 5302 5303 },{"./view.js":51}],44:[function(require,module,exports){ 5338 5304 /** 5339 5305 * wp.media.view.Toolbar 5340 5306 * … … 5495 5461 }); 5496 5462 5497 5463 module.exports = Toolbar; 5498 },{"./button.js":22,"./priority-list.js":36,"./view.js":51}],45:[function(require,module,exports){5499 /*globals _, wp */5500 5464 5465 },{"./button.js":22,"./priority-list.js":36,"./view.js":51}],45:[function(require,module,exports){ 5501 5466 /** 5502 5467 * wp.media.view.Toolbar.Select 5503 5468 * … … 5566 5531 }); 5567 5532 5568 5533 module.exports = Select; 5569 },{"../toolbar.js":44}],46:[function(require,module,exports){5570 /*globals _, wp */5571 5534 5535 },{"../toolbar.js":44}],46:[function(require,module,exports){ 5572 5536 /** 5573 5537 * wp.media.view.UploaderInline 5574 5538 * … … 5699 5663 }); 5700 5664 5701 5665 module.exports = UploaderInline; 5702 },{"../view.js":51,"./status.js":48}],47:[function(require,module,exports){5703 /*globals wp */5704 5666 5667 },{"../view.js":51,"./status.js":48}],47:[function(require,module,exports){ 5705 5668 /** 5706 5669 * wp.media.view.UploaderStatusError 5707 5670 * … … 5719 5682 }); 5720 5683 5721 5684 module.exports = UploaderStatusError; 5722 },{"../view.js":51}],48:[function(require,module,exports){5723 /*globals _, wp */5724 5685 5686 },{"../view.js":51}],48:[function(require,module,exports){ 5725 5687 /** 5726 5688 * wp.media.view.UploaderStatus 5727 5689 * … … 5859 5821 }); 5860 5822 5861 5823 module.exports = UploaderStatus; 5862 },{"../view.js":51,"./status-error.js":47}],49:[function(require,module,exports){5863 /*globals _, wp, jQuery */5864 5824 5825 },{"../view.js":51,"./status-error.js":47}],49:[function(require,module,exports){ 5865 5826 /** 5866 5827 * wp.media.view.UploaderWindow 5867 5828 * … … 5972 5933 }); 5973 5934 5974 5935 module.exports = UploaderWindow; 5975 },{"../view.js":51}],50:[function(require,module,exports){5976 /*globals wp */5977 5936 5937 },{"../view.js":51}],50:[function(require,module,exports){ 5978 5938 /** 5979 5939 * wp.media.view.VideoDetails 5980 5940 * … … 6016 5976 }); 6017 5977 6018 5978 module.exports = VideoDetails; 6019 },{"./media-details":31}],51:[function(require,module,exports){6020 /*globals wp */6021 5979 5980 },{"./media-details":31}],51:[function(require,module,exports){ 6022 5981 /** 6023 5982 * wp.media.View 6024 5983 * … … 6083 6042 }); 6084 6043 6085 6044 module.exports = View; 6045 6086 6046 },{}]},{},[1]); -
src/wp-includes/js/media/audio-video.manifest.js
1 /* global wp, _wpMediaViewsL10n, _wpmejsSettings, MediaElementPlayer */ 2 3 (function(_) { 4 var media = wp.media, 5 baseSettings = {}, 6 l10n = typeof _wpMediaViewsL10n === 'undefined' ? {} : _wpMediaViewsL10n; 7 8 if ( ! _.isUndefined( window._wpmejsSettings ) ) { 9 baseSettings = _wpmejsSettings; 10 } 1 var media = wp.media, 2 baseSettings = window._wpmejsSettings || {}, 3 l10n = window._wpMediaViewsL10n || {}; 4 5 /** 6 * @mixin 7 */ 8 wp.media.mixin = { 9 mejsSettings: baseSettings, 10 11 removeAllPlayers: function() { 12 var p; 13 14 if ( window.mejs && window.mejs.players ) { 15 for ( p in window.mejs.players ) { 16 window.mejs.players[p].pause(); 17 this.removePlayer( window.mejs.players[p] ); 18 } 19 } 20 }, 11 21 12 22 /** 13 * @mixin 23 * Override the MediaElement method for removing a player. 24 * MediaElement tries to pull the audio/video tag out of 25 * its container and re-add it to the DOM. 14 26 */ 15 wp.media.mixin = { 16 mejsSettings: baseSettings, 17 18 removeAllPlayers: function() { 19 var p; 20 21 if ( window.mejs && window.mejs.players ) { 22 for ( p in window.mejs.players ) { 23 window.mejs.players[p].pause(); 24 this.removePlayer( window.mejs.players[p] ); 25 } 26 } 27 }, 27 removePlayer: function(t) { 28 var featureIndex, feature; 28 29 29 /** 30 * Override the MediaElement method for removing a player. 31 * MediaElement tries to pull the audio/video tag out of 32 * its container and re-add it to the DOM. 33 */ 34 removePlayer: function(t) { 35 var featureIndex, feature; 36 37 if ( ! t.options ) { 38 return; 39 } 40 41 // invoke features cleanup 42 for ( featureIndex in t.options.features ) { 43 feature = t.options.features[featureIndex]; 44 if ( t['clean' + feature] ) { 45 try { 46 t['clean' + feature](t); 47 } catch (e) {} 48 } 49 } 50 51 if ( ! t.isDynamic ) { 52 t.$node.remove(); 53 } 30 if ( ! t.options ) { 31 return; 32 } 54 33 55 if ( 'native' !== t.media.pluginType ) { 56 t.media.remove(); 34 // invoke features cleanup 35 for ( featureIndex in t.options.features ) { 36 feature = t.options.features[featureIndex]; 37 if ( t['clean' + feature] ) { 38 try { 39 t['clean' + feature](t); 40 } catch (e) {} 57 41 } 42 } 58 43 59 delete window.mejs.players[t.id]; 60 61 t.container.remove(); 62 t.globalUnbind(); 63 delete t.node.player; 64 }, 65 66 /** 67 * Allows any class that has set 'player' to a MediaElementPlayer 68 * instance to remove the player when listening to events. 69 * 70 * Examples: modal closes, shortcode properties are removed, etc. 71 */ 72 unsetPlayers : function() { 73 if ( this.players && this.players.length ) { 74 _.each( this.players, function (player) { 75 player.pause(); 76 wp.media.mixin.removePlayer( player ); 77 } ); 78 this.players = []; 79 } 44 if ( ! t.isDynamic ) { 45 t.$node.remove(); 80 46 } 81 };82 47 83 /** 84 * Autowire "collection"-type shortcodes 85 */ 86 wp.media.playlist = new wp.media.collection({ 87 tag: 'playlist', 88 editTitle : l10n.editPlaylistTitle, 89 defaults : { 90 id: wp.media.view.settings.post.id, 91 style: 'light', 92 tracklist: true, 93 tracknumbers: true, 94 images: true, 95 artists: true, 96 type: 'audio' 48 if ( 'native' !== t.media.pluginType ) { 49 t.media.remove(); 97 50 } 98 });99 51 100 /** 101 * Shortcode modeling for audio 102 * `edit()` prepares the shortcode for the media modal 103 * `shortcode()` builds the new shortcode after update 104 * 105 * @namespace 106 */ 107 wp.media.audio = { 108 coerce : wp.media.coerce, 52 delete window.mejs.players[t.id]; 109 53 110 defaults : { 111 id : wp.media.view.settings.post.id, 112 src : '', 113 loop : false, 114 autoplay : false, 115 preload : 'none', 116 width : 400 117 }, 118 119 edit : function( data ) { 120 var frame, shortcode = wp.shortcode.next( 'audio', data ).shortcode; 121 122 frame = wp.media({ 123 frame: 'audio', 124 state: 'audio-details', 125 metadata: _.defaults( shortcode.attrs.named, this.defaults ) 126 }); 127 128 return frame; 129 }, 130 131 shortcode : function( model ) { 132 var content; 133 134 _.each( this.defaults, function( value, key ) { 135 model[ key ] = self.coerce( model, key ); 136 137 if ( value === model[ key ] ) { 138 delete model[ key ]; 139 } 140 }, this ); 141 142 content = model.content; 143 delete model.content; 144 145 return new wp.shortcode({ 146 tag: 'audio', 147 attrs: model, 148 content: content 149 }); 150 } 151 }; 54 t.container.remove(); 55 t.globalUnbind(); 56 delete t.node.player; 57 }, 152 58 153 59 /** 154 * Shortcode modeling for video 155 * `edit()` prepares the shortcode for the media modal 156 * `shortcode()` builds the new shortcode after update 60 * Allows any class that has set 'player' to a MediaElementPlayer 61 * instance to remove the player when listening to events. 157 62 * 158 * @namespace63 * Examples: modal closes, shortcode properties are removed, etc. 159 64 */ 160 wp.media.video = { 161 coerce : wp.media.coerce, 65 unsetPlayers : function() { 66 if ( this.players && this.players.length ) { 67 _.each( this.players, function (player) { 68 player.pause(); 69 wp.media.mixin.removePlayer( player ); 70 } ); 71 this.players = []; 72 } 73 } 74 }; 75 76 /** 77 * Autowire "collection"-type shortcodes 78 */ 79 wp.media.playlist = new wp.media.collection({ 80 tag: 'playlist', 81 editTitle : l10n.editPlaylistTitle, 82 defaults : { 83 id: wp.media.view.settings.post.id, 84 style: 'light', 85 tracklist: true, 86 tracknumbers: true, 87 images: true, 88 artists: true, 89 type: 'audio' 90 } 91 }); 162 92 163 defaults : { 164 id : wp.media.view.settings.post.id, 165 src : '', 166 poster : '', 167 loop : false, 168 autoplay : false, 169 preload : 'metadata', 170 content : '', 171 width : 640, 172 height : 360 173 }, 174 175 edit : function( data ) { 176 var frame, 177 shortcode = wp.shortcode.next( 'video', data ).shortcode, 178 attrs; 179 180 attrs = shortcode.attrs.named; 181 attrs.content = shortcode.content; 182 183 frame = wp.media({ 184 frame: 'video', 185 state: 'video-details', 186 metadata: _.defaults( attrs, this.defaults ) 187 }); 188 189 return frame; 190 }, 191 192 shortcode : function( model ) { 193 var content; 194 195 _.each( this.defaults, function( value, key ) { 196 model[ key ] = this.coerce( model, key ); 197 198 if ( value === model[ key ] ) { 199 delete model[ key ]; 200 } 201 }, this ); 202 203 content = model.content; 204 delete model.content; 205 206 return new wp.shortcode({ 207 tag: 'video', 208 attrs: model, 209 content: content 210 }); 211 } 212 }; 213 214 media.model.PostMedia = require( './models/post-media.js' ); 215 media.controller.AudioDetails = require( './controllers/audio-details.js' ); 216 media.controller.VideoDetails = require( './controllers/video-details.js' ); 217 media.view.MediaFrame.MediaDetails = require( './views/frame/media-details.js' ); 218 media.view.MediaFrame.AudioDetails = require( './views/frame/audio-details.js' ); 219 media.view.MediaFrame.VideoDetails = require( './views/frame/video-details.js' ); 220 media.view.MediaDetails = require( './views/media-details.js' ); 221 media.view.AudioDetails = require( './views/audio-details.js' ); 222 media.view.VideoDetails = require( './views/video-details.js' ); 93 /** 94 * Shortcode modeling for audio 95 * `edit()` prepares the shortcode for the media modal 96 * `shortcode()` builds the new shortcode after update 97 * 98 * @namespace 99 */ 100 wp.media.audio = { 101 coerce : wp.media.coerce, 102 103 defaults : { 104 id : wp.media.view.settings.post.id, 105 src : '', 106 loop : false, 107 autoplay : false, 108 preload : 'none', 109 width : 400 110 }, 111 112 edit : function( data ) { 113 var frame, shortcode = wp.shortcode.next( 'audio', data ).shortcode; 114 115 frame = wp.media({ 116 frame: 'audio', 117 state: 'audio-details', 118 metadata: _.defaults( shortcode.attrs.named, this.defaults ) 119 }); 120 121 return frame; 122 }, 123 124 shortcode : function( model ) { 125 var content; 126 127 _.each( this.defaults, function( value, key ) { 128 model[ key ] = this.coerce( model, key ); 129 130 if ( value === model[ key ] ) { 131 delete model[ key ]; 132 } 133 }, this ); 134 135 content = model.content; 136 delete model.content; 137 138 return new wp.shortcode({ 139 tag: 'audio', 140 attrs: model, 141 content: content 142 }); 143 } 144 }; 145 146 /** 147 * Shortcode modeling for video 148 * `edit()` prepares the shortcode for the media modal 149 * `shortcode()` builds the new shortcode after update 150 * 151 * @namespace 152 */ 153 wp.media.video = { 154 coerce : wp.media.coerce, 155 156 defaults : { 157 id : wp.media.view.settings.post.id, 158 src : '', 159 poster : '', 160 loop : false, 161 autoplay : false, 162 preload : 'metadata', 163 content : '', 164 width : 640, 165 height : 360 166 }, 167 168 edit : function( data ) { 169 var frame, 170 shortcode = wp.shortcode.next( 'video', data ).shortcode, 171 attrs; 172 173 attrs = shortcode.attrs.named; 174 attrs.content = shortcode.content; 175 176 frame = wp.media({ 177 frame: 'video', 178 state: 'video-details', 179 metadata: _.defaults( attrs, this.defaults ) 180 }); 181 182 return frame; 183 }, 184 185 shortcode : function( model ) { 186 var content; 187 188 _.each( this.defaults, function( value, key ) { 189 model[ key ] = this.coerce( model, key ); 190 191 if ( value === model[ key ] ) { 192 delete model[ key ]; 193 } 194 }, this ); 195 196 content = model.content; 197 delete model.content; 198 199 return new wp.shortcode({ 200 tag: 'video', 201 attrs: model, 202 content: content 203 }); 204 } 205 }; 223 206 224 }(_)); 225 No newline at end of file 207 media.model.PostMedia = require( './models/post-media.js' ); 208 media.controller.AudioDetails = require( './controllers/audio-details.js' ); 209 media.controller.VideoDetails = require( './controllers/video-details.js' ); 210 media.view.MediaFrame.MediaDetails = require( './views/frame/media-details.js' ); 211 media.view.MediaFrame.AudioDetails = require( './views/frame/audio-details.js' ); 212 media.view.MediaFrame.VideoDetails = require( './views/frame/video-details.js' ); 213 media.view.MediaDetails = require( './views/media-details.js' ); 214 media.view.AudioDetails = require( './views/audio-details.js' ); 215 media.view.VideoDetails = require( './views/video-details.js' ); -
src/wp-includes/js/media/controllers/audio-details.js
1 /*globals wp */2 3 1 /** 4 2 * The controller for the Audio Details state 5 3 * … … 28 26 } 29 27 }); 30 28 31 module.exports = AudioDetails; 32 No newline at end of file 29 module.exports = AudioDetails; -
src/wp-includes/js/media/controllers/collection-add.js
1 /*globals _, wp */2 3 1 /** 4 2 * wp.media.controller.CollectionAdd 5 3 * … … 98 96 } 99 97 }); 100 98 101 module.exports = CollectionAdd; 102 No newline at end of file 99 module.exports = CollectionAdd; -
src/wp-includes/js/media/controllers/collection-edit.js
1 /*globals wp, jQuery, Backbone */2 3 1 /** 4 2 * wp.media.controller.CollectionEdit 5 3 * … … 159 157 } 160 158 }); 161 159 162 module.exports = CollectionEdit; 163 No newline at end of file 160 module.exports = CollectionEdit; -
src/wp-includes/js/media/controllers/cropper.js
1 /*globals _, wp, Backbone */2 3 1 /** 4 2 * wp.media.controller.Cropper 5 3 * … … 75 73 76 74 this.$el.text(l10n.cropping); 77 75 this.$el.attr('disabled', true); 78 76 79 77 controller.state().doCrop( selection ).done( function( croppedImage ) { 80 78 controller.trigger('cropped', croppedImage ); 81 79 controller.close(); … … 116 114 } 117 115 }); 118 116 119 module.exports = Cropper; 120 No newline at end of file 117 module.exports = Cropper; -
src/wp-includes/js/media/controllers/edit-attachment-metadata.js
1 /*globals wp */2 3 1 /** 4 2 * wp.media.controller.EditAttachmentMetadata 5 3 * … … 26 24 } 27 25 }); 28 26 29 module.exports = EditAttachmentMetadata; 30 No newline at end of file 27 module.exports = EditAttachmentMetadata; -
src/wp-includes/js/media/controllers/edit-image.js
1 /*globals _, wp */2 3 1 /** 4 2 * wp.media.controller.EditImage 5 3 * … … 75 73 } 76 74 }); 77 75 78 module.exports = EditImage; 79 No newline at end of file 76 module.exports = EditImage; -
src/wp-includes/js/media/controllers/embed.js
1 /*globals _, wp, jQuery, Backbone */2 3 1 /** 4 2 * wp.media.controller.Embed 5 3 * … … 134 132 } 135 133 }); 136 134 137 module.exports = Embed; 138 No newline at end of file 135 module.exports = Embed; -
src/wp-includes/js/media/controllers/featured-image.js
1 /*globals _, wp */2 3 1 /** 4 2 * wp.media.controller.FeaturedImage 5 3 * … … 119 117 } 120 118 }); 121 119 122 module.exports = FeaturedImage; 123 No newline at end of file 120 module.exports = FeaturedImage; -
src/wp-includes/js/media/controllers/gallery-add.js
1 /*globals _, wp */2 3 1 /** 4 2 * A state for selecting more images to add to a gallery. 5 3 * … … 51 49 */ 52 50 initialize: function() { 53 51 // If a library wasn't supplied, create a library of images. 54 if ( ! this.get('library') ) 52 if ( ! this.get('library') ) { 55 53 this.set( 'library', wp.media.query({ type: 'image' }) ); 54 } 56 55 57 56 Library.prototype.initialize.apply( this, arguments ); 58 57 }, … … 64 63 var library = this.get('library'), 65 64 edit = this.frame.state('gallery-edit').get('library'); 66 65 67 if ( this.editLibrary && this.editLibrary !== edit ) 66 if ( this.editLibrary && this.editLibrary !== edit ) { 68 67 library.unobserve( this.editLibrary ); 68 } 69 69 70 70 // Accepts attachments that exist in the original library and 71 71 // that do not exist in gallery's library. … … 84 84 } 85 85 }); 86 86 87 module.exports = GalleryAdd; 88 No newline at end of file 87 module.exports = GalleryAdd; -
src/wp-includes/js/media/controllers/gallery-edit.js
1 /*globals wp, Backbone */2 3 1 /** 4 2 * wp.media.controller.GalleryEdit 5 3 * … … 61 59 */ 62 60 initialize: function() { 63 61 // If we haven't been provided a `library`, create a `Selection`. 64 if ( ! this.get('library') ) 62 if ( ! this.get('library') ) { 65 63 this.set( 'library', new wp.media.model.Selection() ); 64 } 66 65 67 66 // The single `Attachment` view to be used in the `Attachments` view. 68 if ( ! this.get('AttachmentView') ) 67 if ( ! this.get('AttachmentView') ) { 69 68 this.set( 'AttachmentView', EditLibraryView ); 69 } 70 70 71 Library.prototype.initialize.apply( this, arguments ); 71 72 }, 72 73 … … 136 137 } 137 138 }); 138 139 139 module.exports = GalleryEdit; 140 No newline at end of file 140 module.exports = GalleryEdit; -
src/wp-includes/js/media/controllers/image-details.js
1 /*globals _, wp */2 3 1 /** 4 2 * wp.media.controller.ImageDetails 5 3 * … … 59 57 } 60 58 }); 61 59 62 module.exports = ImageDetails; 63 No newline at end of file 60 module.exports = ImageDetails; -
src/wp-includes/js/media/controllers/library.js
1 /*globals _, wp, Backbone, getUserSetting, setUserSetting */2 3 1 /** 4 2 * wp.media.controller.Library 5 3 * … … 37 35 var selectionSync = require( '../utils/selection-sync.js' ), 38 36 State = require( './state.js' ), 39 37 l10n = wp.media.view.l10n, 38 getUserSetting = window.getUserSetting, 39 setUserSetting = window.setUserSetting, 40 40 Library; 41 41 42 42 Library = State.extend({ … … 71 71 this.set( 'library', wp.media.query() ); 72 72 } 73 73 74 if ( ! ( selection instanceof Selection) ) {74 if ( ! ( selection instanceof wp.media.model.Selection ) ) { 75 75 props = selection; 76 76 77 77 if ( ! props ) { … … 269 269 // Make selectionSync available on any Media Library state. 270 270 _.extend( Library.prototype, selectionSync ); 271 271 272 module.exports = Library; 273 No newline at end of file 272 module.exports = Library; -
src/wp-includes/js/media/controllers/media-library.js
1 /*globals _, wp */2 3 1 /** 4 2 * wp.media.controller.MediaLibrary 5 3 * … … 47 45 } 48 46 }); 49 47 50 module.exports = MediaLibrary; 51 No newline at end of file 48 module.exports = MediaLibrary; -
src/wp-includes/js/media/controllers/region.js
1 /*globals _, Backbone */2 3 1 /** 4 2 * wp.media.controller.Region 5 3 * … … 176 174 } 177 175 }); 178 176 179 module.exports = Region; 180 No newline at end of file 177 module.exports = Region; -
src/wp-includes/js/media/controllers/replace-image.js
1 /*globals _, wp */2 3 1 /** 4 2 * wp.media.controller.ReplaceImage 5 3 * … … 105 103 } 106 104 }); 107 105 108 module.exports = ReplaceImage; 109 No newline at end of file 106 module.exports = ReplaceImage; -
src/wp-includes/js/media/controllers/state-machine.js
1 /*globals _, Backbone */2 3 1 /** 4 2 * wp.media.controller.StateMachine 5 3 * … … 121 119 }; 122 120 }); 123 121 124 module.exports = StateMachine; 125 No newline at end of file 122 module.exports = StateMachine; -
src/wp-includes/js/media/controllers/state.js
1 /*globals _, Backbone */2 3 1 /** 4 2 * wp.media.controller.State 5 3 * … … 238 236 }; 239 237 }); 240 238 241 module.exports = State; 242 No newline at end of file 239 module.exports = State; -
src/wp-includes/js/media/controllers/video-details.js
1 /*globals wp */2 3 1 /** 4 2 * The controller for the Video Details state 5 3 * … … 28 26 } 29 27 }); 30 28 31 module.exports = VideoDetails; 32 No newline at end of file 29 module.exports = VideoDetails; -
src/wp-includes/js/media/grid.js
1 1 (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ 2 /*globals wp */3 4 2 /** 5 3 * wp.media.controller.EditAttachmentMetadata 6 4 * … … 28 26 }); 29 27 30 28 module.exports = EditAttachmentMetadata; 31 },{"./state.js":6}],2:[function(require,module,exports){32 /*globals _, wp */33 29 30 },{"./state.js":6}],2:[function(require,module,exports){ 34 31 /** 35 32 * wp.media.controller.EditImage 36 33 * … … 107 104 }); 108 105 109 106 module.exports = EditImage; 110 },{"../views/toolbar.js":46,"./state.js":6}],3:[function(require,module,exports){111 /*globals _, wp, Backbone, getUserSetting, setUserSetting */112 107 108 },{"../views/toolbar.js":46,"./state.js":6}],3:[function(require,module,exports){ 113 109 /** 114 110 * wp.media.controller.Library 115 111 * … … 147 143 var selectionSync = require( '../utils/selection-sync.js' ), 148 144 State = require( './state.js' ), 149 145 l10n = wp.media.view.l10n, 146 getUserSetting = window.getUserSetting, 147 setUserSetting = window.setUserSetting, 150 148 Library; 151 149 152 150 Library = State.extend({ … … 181 179 this.set( 'library', wp.media.query() ); 182 180 } 183 181 184 if ( ! ( selection instanceof Selection) ) {182 if ( ! ( selection instanceof wp.media.model.Selection ) ) { 185 183 props = selection; 186 184 187 185 if ( ! props ) { … … 380 378 _.extend( Library.prototype, selectionSync ); 381 379 382 380 module.exports = Library; 383 },{"../utils/selection-sync.js":9,"./state.js":6}],4:[function(require,module,exports){384 /*globals _, Backbone */385 381 382 },{"../utils/selection-sync.js":9,"./state.js":6}],4:[function(require,module,exports){ 386 383 /** 387 384 * wp.media.controller.Region 388 385 * … … 560 557 }); 561 558 562 559 module.exports = Region; 563 },{}],5:[function(require,module,exports){564 /*globals _, Backbone */565 560 561 },{}],5:[function(require,module,exports){ 566 562 /** 567 563 * wp.media.controller.StateMachine 568 564 * … … 685 681 }); 686 682 687 683 module.exports = StateMachine; 688 },{}],6:[function(require,module,exports){689 /*globals _, Backbone */690 684 685 },{}],6:[function(require,module,exports){ 691 686 /** 692 687 * wp.media.controller.State 693 688 * … … 927 922 }); 928 923 929 924 module.exports = State; 925 930 926 },{}],7:[function(require,module,exports){ 931 /* global wp, _wpMediaViewsL10n, MediaElementPlayer, _wpMediaGridSettings */ 932 (function (wp) { 933 var media = wp.media; 934 935 media.controller.EditAttachmentMetadata = require( './controllers/edit-attachment-metadata.js' ); 936 media.view.MediaFrame.Manage = require( './views/frame/manage.js' ); 937 media.view.Attachment.Details.TwoColumn = require( './views/attachment/details-two-column.js' ); 938 media.view.MediaFrame.Manage.Router = require( './routers/manage.js' ); 939 media.view.EditImage.Details = require( './views/edit-image-details.js' ); 940 media.view.MediaFrame.EditAttachments = require( './views/frame/edit-attachments.js' ); 941 media.view.SelectModeToggleButton = require( './views/button/select-mode-toggle.js' ); 942 media.view.DeleteSelectedButton = require( './views/button/delete-selected.js' ); 943 media.view.DeleteSelectedPermanentlyButton = require( './views/button/delete-selected-permanently.js' ); 927 var media = wp.media; 944 928 945 }(wp)); 946 },{"./controllers/edit-attachment-metadata.js":1,"./routers/manage.js":8,"./views/attachment/details-two-column.js":16,"./views/button/delete-selected-permanently.js":22,"./views/button/delete-selected.js":23,"./views/button/select-mode-toggle.js":24,"./views/edit-image-details.js":25,"./views/frame/edit-attachments.js":29,"./views/frame/manage.js":30}],8:[function(require,module,exports){ 947 /*globals jQuery, Backbone */ 929 media.controller.EditAttachmentMetadata = require( './controllers/edit-attachment-metadata.js' ); 930 media.view.MediaFrame.Manage = require( './views/frame/manage.js' ); 931 media.view.Attachment.Details.TwoColumn = require( './views/attachment/details-two-column.js' ); 932 media.view.MediaFrame.Manage.Router = require( './routers/manage.js' ); 933 media.view.EditImage.Details = require( './views/edit-image-details.js' ); 934 media.view.MediaFrame.EditAttachments = require( './views/frame/edit-attachments.js' ); 935 media.view.SelectModeToggleButton = require( './views/button/select-mode-toggle.js' ); 936 media.view.DeleteSelectedButton = require( './views/button/delete-selected.js' ); 937 media.view.DeleteSelectedPermanentlyButton = require( './views/button/delete-selected-permanently.js' ); 948 938 939 },{"./controllers/edit-attachment-metadata.js":1,"./routers/manage.js":8,"./views/attachment/details-two-column.js":16,"./views/button/delete-selected-permanently.js":22,"./views/button/delete-selected.js":23,"./views/button/select-mode-toggle.js":24,"./views/edit-image-details.js":25,"./views/frame/edit-attachments.js":29,"./views/frame/manage.js":30}],8:[function(require,module,exports){ 949 940 /** 950 941 * A router for handling the browser history and application state. 951 942 * … … 990 981 }); 991 982 992 983 module.exports = Router; 993 },{}],9:[function(require,module,exports){994 /*globals _ */995 984 985 },{}],9:[function(require,module,exports){ 996 986 /** 997 987 * wp.media.selectionSync 998 988 * … … 1057 1047 }; 1058 1048 1059 1049 module.exports = selectionSync; 1060 },{}],10:[function(require,module,exports){1061 /*globals _ */1062 1050 1051 },{}],10:[function(require,module,exports){ 1063 1052 /** 1064 1053 * wp.media.view.AttachmentCompat 1065 1054 * … … 1143 1132 }); 1144 1133 1145 1134 module.exports = AttachmentCompat; 1146 },{"./view.js":51}],11:[function(require,module,exports){1147 /*globals _, jQuery */1148 1135 1136 },{"./view.js":51}],11:[function(require,module,exports){ 1149 1137 /** 1150 1138 * wp.media.view.AttachmentFilters 1151 1139 * … … 1222 1210 }); 1223 1211 1224 1212 module.exports = AttachmentFilters; 1225 },{"./view.js":51}],12:[function(require,module,exports){1226 /*globals _, wp */1227 1213 1214 },{"./view.js":51}],12:[function(require,module,exports){ 1228 1215 /** 1229 1216 * wp.media.view.AttachmentFilters.All 1230 1217 * … … 1314 1301 }); 1315 1302 1316 1303 module.exports = All; 1317 },{"../attachment-filters.js":11}],13:[function(require,module,exports){1318 /*globals _, wp */1319 1304 1305 },{"../attachment-filters.js":11}],13:[function(require,module,exports){ 1320 1306 /** 1321 1307 * A filter dropdown for month/dates. 1322 1308 * … … 1357 1343 }); 1358 1344 1359 1345 module.exports = DateFilter; 1360 },{"../attachment-filters.js":11}],14:[function(require,module,exports){1361 /*globals wp */1362 1346 1347 },{"../attachment-filters.js":11}],14:[function(require,module,exports){ 1363 1348 /** 1364 1349 * wp.media.view.AttachmentFilters.Uploaded 1365 1350 * … … 1418 1403 }); 1419 1404 1420 1405 module.exports = Uploaded; 1421 },{"../attachment-filters.js":11}],15:[function(require,module,exports){1422 /*globals _, wp, jQuery */1423 1406 1407 },{"../attachment-filters.js":11}],15:[function(require,module,exports){ 1424 1408 /** 1425 1409 * wp.media.view.Attachment 1426 1410 * … … 1973 1957 }); 1974 1958 1975 1959 module.exports = Attachment; 1976 },{"./view.js":51}],16:[function(require,module,exports){1977 /*globals wp */1978 1960 1961 },{"./view.js":51}],16:[function(require,module,exports){ 1979 1962 /** 1980 1963 * A similar view to media.view.Attachment.Details 1981 1964 * for use in the Edit Attachment modal. … … 2010 1993 wp.media.mixin.removeAllPlayers(); 2011 1994 this.$( 'audio, video' ).each( function (i, elem) { 2012 1995 var el = MediaDetails.prepareSrc( elem ); 2013 new MediaElementPlayer( el, wp.media.mixin.mejsSettings );1996 new window.MediaElementPlayer( el, wp.media.mixin.mejsSettings ); 2014 1997 } ); 2015 1998 } 2016 1999 }); 2017 2000 2018 2001 module.exports = TwoColumn; 2019 },{"../media-details.js":33,"./details.js":17}],17:[function(require,module,exports){2020 /*globals _, wp */2021 2002 2003 },{"../media-details.js":33,"./details.js":17}],17:[function(require,module,exports){ 2022 2004 /** 2023 2005 * wp.media.view.Attachment.Details 2024 2006 * … … 2078 2060 deleteAttachment: function( event ) { 2079 2061 event.preventDefault(); 2080 2062 2081 if ( confirm( l10n.warnDelete ) ) {2063 if ( window.confirm( l10n.warnDelete ) ) { 2082 2064 this.model.destroy(); 2083 2065 // Keep focus inside media modal 2084 2066 // after image is deleted … … 2157 2139 }); 2158 2140 2159 2141 module.exports = Details; 2142 2160 2143 },{"../attachment.js":15}],18:[function(require,module,exports){ 2161 2144 /** 2162 2145 * wp.media.view.Attachment.Library … … 2177 2160 }); 2178 2161 2179 2162 module.exports = Library; 2180 },{"../attachment.js":15}],19:[function(require,module,exports){2181 /*globals _, wp, jQuery */2182 2163 2164 },{"../attachment.js":15}],19:[function(require,module,exports){ 2183 2165 /** 2184 2166 * wp.media.view.Attachments 2185 2167 * … … 2452 2434 2453 2435 // The scroll event occurs on the document, but the element 2454 2436 // that should be checked is the document body. 2455 if ( el == document ) {2437 if ( el === document ) { 2456 2438 el = document.body; 2457 2439 scrollTop = $(document).scrollTop(); 2458 2440 } … … 2478 2460 }); 2479 2461 2480 2462 module.exports = Attachments; 2481 },{"./attachment.js":15,"./view.js":51}],20:[function(require,module,exports){2482 /*globals _, wp, jQuery */2483 2463 2464 },{"./attachment.js":15,"./view.js":51}],20:[function(require,module,exports){ 2484 2465 /** 2485 2466 * wp.media.view.AttachmentsBrowser 2486 2467 * … … 2671 2652 return; 2672 2653 } 2673 2654 2674 if ( ! mediaTrash && ! confirm( l10n.warnBulkDelete ) ) {2655 if ( ! mediaTrash && ! window.confirm( l10n.warnBulkDelete ) ) { 2675 2656 return; 2676 2657 } 2677 2658 2678 2659 if ( mediaTrash && 2679 2660 'trash' !== selection.at( 0 ).get( 'status' ) && 2680 ! confirm( l10n.warnBulkTrash ) ) {2661 ! window.confirm( l10n.warnBulkTrash ) ) { 2681 2662 2682 2663 return; 2683 2664 } … … 2725 2706 click: function() { 2726 2707 var removed = [], selection = this.controller.state().get( 'selection' ); 2727 2708 2728 if ( ! selection.length || ! confirm( l10n.warnBulkDelete ) ) {2709 if ( ! selection.length || ! window.confirm( l10n.warnBulkDelete ) ) { 2729 2710 return; 2730 2711 } 2731 2712 … … 2938 2919 }); 2939 2920 2940 2921 module.exports = AttachmentsBrowser; 2941 },{"../attachment-compat.js":10,"../attachment-filters/all.js":12,"../attachment-filters/date.js":13,"../attachment-filters/uploaded.js":14,"../attachment/details.js":17,"../attachment/library.js":18,"../attachments.js":19,"../label.js":32,"../search.js":41,"../settings/attachment-display.js":43,"../sidebar.js":44,"../spinner.js":45,"../toolbar.js":46,"../uploader/inline.js":47,"../uploader/status.js":49,"../view.js":51}],21:[function(require,module,exports){2942 /*globals _, Backbone */2943 2922 2923 },{"../attachment-compat.js":10,"../attachment-filters/all.js":12,"../attachment-filters/date.js":13,"../attachment-filters/uploaded.js":14,"../attachment/details.js":17,"../attachment/library.js":18,"../attachments.js":19,"../label.js":32,"../search.js":41,"../settings/attachment-display.js":43,"../sidebar.js":44,"../spinner.js":45,"../toolbar.js":46,"../uploader/inline.js":47,"../uploader/status.js":49,"../view.js":51}],21:[function(require,module,exports){ 2944 2924 /** 2945 2925 * wp.media.view.Button 2946 2926 * … … 3028 3008 }); 3029 3009 3030 3010 module.exports = Button; 3011 3031 3012 },{"./view.js":51}],22:[function(require,module,exports){ 3032 3013 /** 3033 3014 * When MEDIA_TRASH is true, a button that handles bulk Delete Permanently logic … … 3072 3053 }); 3073 3054 3074 3055 module.exports = DeleteSelectedPermanently; 3075 },{"../button.js":21,"./delete-selected.js":23}],23:[function(require,module,exports){3076 /*globals wp */3077 3056 3057 },{"../button.js":21,"./delete-selected.js":23}],23:[function(require,module,exports){ 3078 3058 /** 3079 3059 * A button that handles bulk Delete/Trash logic 3080 3060 * … … 3124 3104 }); 3125 3105 3126 3106 module.exports = DeleteSelected; 3127 },{"../button.js":21}],24:[function(require,module,exports){3128 /*globals wp */3129 3107 3108 },{"../button.js":21}],24:[function(require,module,exports){ 3130 3109 var Button = require( '../button.js' ), 3131 3110 l10n = wp.media.view.l10n, 3132 3111 SelectModeToggle; … … 3180 3159 }); 3181 3160 3182 3161 module.exports = SelectModeToggle; 3162 3183 3163 },{"../button.js":21}],25:[function(require,module,exports){ 3184 3164 var View = require( './view.js' ), 3185 3165 EditImage = require( './edit-image.js' ), … … 3205 3185 }); 3206 3186 3207 3187 module.exports = Details; 3208 },{"./edit-image.js":26,"./view.js":51}],26:[function(require,module,exports){3209 /*globals _, wp */3210 3188 3189 },{"./edit-image.js":26,"./view.js":51}],26:[function(require,module,exports){ 3211 3190 var View = require( './view.js' ), 3212 3191 EditImage; 3213 3192 … … 3259 3238 }); 3260 3239 3261 3240 module.exports = EditImage; 3241 3262 3242 },{"./view.js":51}],27:[function(require,module,exports){ 3263 3243 /** 3264 3244 * wp.media.view.FocusManager … … 3307 3287 }); 3308 3288 3309 3289 module.exports = FocusManager; 3310 },{"./view.js":51}],28:[function(require,module,exports){3311 /*globals _, Backbone */3312 3290 3291 },{"./view.js":51}],28:[function(require,module,exports){ 3313 3292 /** 3314 3293 * wp.media.view.Frame 3315 3294 * … … 3480 3459 _.extend( Frame.prototype, StateMachine.prototype ); 3481 3460 3482 3461 module.exports = Frame; 3483 },{"../controllers/region.js":4,"../controllers/state-machine.js":5,"../controllers/state.js":6,"./view.js":51}],29:[function(require,module,exports){3484 /*globals _, wp, jQuery */3485 3462 3463 },{"../controllers/region.js":4,"../controllers/state-machine.js":5,"../controllers/state.js":6,"./view.js":51}],29:[function(require,module,exports){ 3486 3464 /** 3487 3465 * A frame for editing the details of a specific media item. 3488 3466 * … … 3727 3705 }); 3728 3706 3729 3707 module.exports = EditAttachments; 3730 },{"../../controllers/edit-attachment-metadata.js":1,"../../controllers/edit-image.js":2,"../attachment-compat.js":10,"../attachment/details-two-column.js":16,"../edit-image-details.js":25,"../frame.js":28,"../media-frame.js":34,"../modal.js":37}],30:[function(require,module,exports){3731 /*globals _, Backbone, wp, jQuery */3732 3708 3709 },{"../../controllers/edit-attachment-metadata.js":1,"../../controllers/edit-image.js":2,"../attachment-compat.js":10,"../attachment/details-two-column.js":16,"../edit-image-details.js":25,"../frame.js":28,"../media-frame.js":34,"../modal.js":37}],30:[function(require,module,exports){ 3733 3710 /** 3734 3711 * wp.media.view.MediaFrame.Manage 3735 3712 * … … 3967 3944 // Verify pushState support and activate 3968 3945 if ( window.history && window.history.pushState ) { 3969 3946 Backbone.history.start( { 3970 root: _wpMediaGridSettings.adminUrl,3947 root: window._wpMediaGridSettings.adminUrl, 3971 3948 pushState: true 3972 3949 } ); 3973 3950 } … … 3975 3952 }); 3976 3953 3977 3954 module.exports = Manage; 3955 3978 3956 },{"../../controllers/library.js":3,"../../routers/manage.js":8,"../attachments/browser.js":20,"../media-frame.js":34,"../uploader/window.js":50}],31:[function(require,module,exports){ 3979 3957 /** 3980 3958 * wp.media.view.Iframe … … 4001 3979 }); 4002 3980 4003 3981 module.exports = Iframe; 3982 4004 3983 },{"./view.js":51}],32:[function(require,module,exports){ 4005 3984 /** 4006 3985 * @class … … 4027 4006 }); 4028 4007 4029 4008 module.exports = Label; 4030 },{"./view.js":51}],33:[function(require,module,exports){4031 /*globals _, wp, jQuery */4032 4009 4010 },{"./view.js":51}],33:[function(require,module,exports){ 4033 4011 /** 4034 4012 * wp.media.view.MediaDetails 4035 4013 * … … 4113 4091 */ 4114 4092 setPlayer : function() { 4115 4093 if ( ! this.players.length && this.media ) { 4116 this.players.push( new MediaElementPlayer( this.media, this.settings ) );4094 this.players.push( new window.MediaElementPlayer( this.media, this.settings ) ); 4117 4095 } 4118 4096 }, 4119 4097 … … 4141 4119 */ 4142 4120 render: function() { 4143 4121 AttachmentDisplay.prototype.render.apply( this, arguments ); 4144 4122 4145 4123 setTimeout( _.bind( function() { 4146 4124 this.resetFocus(); 4147 4125 }, this ), 10 ); … … 4180 4158 }); 4181 4159 4182 4160 module.exports = MediaDetails; 4183 },{"./settings/attachment-display.js":43}],34:[function(require,module,exports){4184 /*globals _, wp, jQuery */4185 4161 4162 },{"./settings/attachment-display.js":43}],34:[function(require,module,exports){ 4186 4163 /** 4187 4164 * wp.media.view.MediaFrame 4188 4165 * … … 4435 4412 }); 4436 4413 4437 4414 module.exports = MediaFrame; 4438 },{"./frame.js":28,"./iframe.js":31,"./menu.js":36,"./modal.js":37,"./router.js":40,"./toolbar.js":46,"./uploader/window.js":50,"./view.js":51}],35:[function(require,module,exports){4439 /*globals wp, jQuery */4440 4415 4416 },{"./frame.js":28,"./iframe.js":31,"./menu.js":36,"./modal.js":37,"./router.js":40,"./toolbar.js":46,"./uploader/window.js":50,"./view.js":51}],35:[function(require,module,exports){ 4441 4417 /** 4442 4418 * wp.media.view.MenuItem 4443 4419 * … … 4509 4485 }); 4510 4486 4511 4487 module.exports = MenuItem; 4488 4512 4489 },{"./view.js":51}],36:[function(require,module,exports){ 4513 4490 /** 4514 4491 * wp.media.view.Menu … … 4625 4602 }); 4626 4603 4627 4604 module.exports = Menu; 4628 },{"./menu-item.js":35,"./priority-list.js":38}],37:[function(require,module,exports){4629 /*globals _, wp, jQuery */4630 4605 4606 },{"./menu-item.js":35,"./priority-list.js":38}],37:[function(require,module,exports){ 4631 4607 /** 4632 4608 * wp.media.view.Modal 4633 4609 * … … 4841 4817 }); 4842 4818 4843 4819 module.exports = Modal; 4844 },{"./focus-manager.js":27,"./view.js":51}],38:[function(require,module,exports){4845 /*globals _, Backbone */4846 4820 4821 },{"./focus-manager.js":27,"./view.js":51}],38:[function(require,module,exports){ 4847 4822 /** 4848 4823 * wp.media.view.PriorityList 4849 4824 * … … 4942 4917 }); 4943 4918 4944 4919 module.exports = PriorityList; 4920 4945 4921 },{"./view.js":51}],39:[function(require,module,exports){ 4946 4922 /** 4947 4923 * wp.media.view.RouterItem … … 4968 4944 }); 4969 4945 4970 4946 module.exports = RouterItem; 4947 4971 4948 },{"./menu-item.js":35}],40:[function(require,module,exports){ 4972 4949 /** 4973 4950 * wp.media.view.Router … … 5005 4982 }); 5006 4983 5007 4984 module.exports = Router; 5008 },{"./menu.js":36,"./router-item.js":39}],41:[function(require,module,exports){5009 /*globals wp */5010 4985 4986 },{"./menu.js":36,"./router-item.js":39}],41:[function(require,module,exports){ 5011 4987 /** 5012 4988 * wp.media.view.Search 5013 4989 * … … 5055 5031 }); 5056 5032 5057 5033 module.exports = Search; 5058 },{"./view.js":51}],42:[function(require,module,exports){5059 /*globals _, Backbone, jQuery */5060 5034 5035 },{"./view.js":51}],42:[function(require,module,exports){ 5061 5036 /** 5062 5037 * wp.media.view.Settings 5063 5038 * … … 5165 5140 // If the setting has a corresponding user setting, 5166 5141 // update that as well. 5167 5142 if ( userSetting = $setting.data('userSetting') ) { 5168 setUserSetting( userSetting, value );5143 window.setUserSetting( userSetting, value ); 5169 5144 } 5170 5145 }, 5171 5146 … … 5177 5152 }); 5178 5153 5179 5154 module.exports = Settings; 5180 },{"./view.js":51}],43:[function(require,module,exports){5181 /*globals _, wp */5182 5155 5156 },{"./view.js":51}],43:[function(require,module,exports){ 5183 5157 /** 5184 5158 * wp.media.view.Settings.AttachmentDisplay 5185 5159 * … … 5272 5246 }); 5273 5247 5274 5248 module.exports = AttachmentDisplay; 5249 5275 5250 },{"../settings.js":42}],44:[function(require,module,exports){ 5276 5251 /** 5277 5252 * wp.media.view.Sidebar … … 5290 5265 }); 5291 5266 5292 5267 module.exports = Sidebar; 5293 },{"./priority-list.js":38}],45:[function(require,module,exports){5294 /*globals _, wp */5295 5268 5269 },{"./priority-list.js":38}],45:[function(require,module,exports){ 5296 5270 /** 5297 5271 * wp.media.view.Spinner 5298 5272 * … … 5329 5303 }); 5330 5304 5331 5305 module.exports = Spinner; 5332 },{"./view.js":51}],46:[function(require,module,exports){5333 /*globals Backbone, _ */5334 5306 5307 },{"./view.js":51}],46:[function(require,module,exports){ 5335 5308 /** 5336 5309 * wp.media.view.Toolbar 5337 5310 * … … 5492 5465 }); 5493 5466 5494 5467 module.exports = Toolbar; 5495 },{"./button.js":21,"./priority-list.js":38,"./view.js":51}],47:[function(require,module,exports){5496 /*globals _, wp */5497 5468 5469 },{"./button.js":21,"./priority-list.js":38,"./view.js":51}],47:[function(require,module,exports){ 5498 5470 /** 5499 5471 * wp.media.view.UploaderInline 5500 5472 * … … 5625 5597 }); 5626 5598 5627 5599 module.exports = UploaderInline; 5628 },{"../view.js":51,"./status.js":49}],48:[function(require,module,exports){5629 /*globals wp */5630 5600 5601 },{"../view.js":51,"./status.js":49}],48:[function(require,module,exports){ 5631 5602 /** 5632 5603 * wp.media.view.UploaderStatusError 5633 5604 * … … 5645 5616 }); 5646 5617 5647 5618 module.exports = UploaderStatusError; 5648 },{"../view.js":51}],49:[function(require,module,exports){5649 /*globals _, wp */5650 5619 5620 },{"../view.js":51}],49:[function(require,module,exports){ 5651 5621 /** 5652 5622 * wp.media.view.UploaderStatus 5653 5623 * … … 5785 5755 }); 5786 5756 5787 5757 module.exports = UploaderStatus; 5788 },{"../view.js":51,"./status-error.js":48}],50:[function(require,module,exports){5789 /*globals _, wp, jQuery */5790 5758 5759 },{"../view.js":51,"./status-error.js":48}],50:[function(require,module,exports){ 5791 5760 /** 5792 5761 * wp.media.view.UploaderWindow 5793 5762 * … … 5898 5867 }); 5899 5868 5900 5869 module.exports = UploaderWindow; 5901 },{"../view.js":51}],51:[function(require,module,exports){5902 /*globals wp */5903 5870 5871 },{"../view.js":51}],51:[function(require,module,exports){ 5904 5872 /** 5905 5873 * wp.media.View 5906 5874 * … … 5965 5933 }); 5966 5934 5967 5935 module.exports = View; 5936 5968 5937 },{}]},{},[7]); -
src/wp-includes/js/media/grid.manifest.js
1 /* global wp, _wpMediaViewsL10n, MediaElementPlayer, _wpMediaGridSettings */ 2 (function (wp) { 3 var media = wp.media; 1 var media = wp.media; 4 2 5 media.controller.EditAttachmentMetadata = require( './controllers/edit-attachment-metadata.js' ); 6 media.view.MediaFrame.Manage = require( './views/frame/manage.js' ); 7 media.view.Attachment.Details.TwoColumn = require( './views/attachment/details-two-column.js' ); 8 media.view.MediaFrame.Manage.Router = require( './routers/manage.js' ); 9 media.view.EditImage.Details = require( './views/edit-image-details.js' ); 10 media.view.MediaFrame.EditAttachments = require( './views/frame/edit-attachments.js' ); 11 media.view.SelectModeToggleButton = require( './views/button/select-mode-toggle.js' ); 12 media.view.DeleteSelectedButton = require( './views/button/delete-selected.js' ); 13 media.view.DeleteSelectedPermanentlyButton = require( './views/button/delete-selected-permanently.js' ); 14 15 }(wp)); 16 No newline at end of file 3 media.controller.EditAttachmentMetadata = require( './controllers/edit-attachment-metadata.js' ); 4 media.view.MediaFrame.Manage = require( './views/frame/manage.js' ); 5 media.view.Attachment.Details.TwoColumn = require( './views/attachment/details-two-column.js' ); 6 media.view.MediaFrame.Manage.Router = require( './routers/manage.js' ); 7 media.view.EditImage.Details = require( './views/edit-image-details.js' ); 8 media.view.MediaFrame.EditAttachments = require( './views/frame/edit-attachments.js' ); 9 media.view.SelectModeToggleButton = require( './views/button/select-mode-toggle.js' ); 10 media.view.DeleteSelectedButton = require( './views/button/delete-selected.js' ); 11 media.view.DeleteSelectedPermanentlyButton = require( './views/button/delete-selected-permanently.js' ); -
src/wp-includes/js/media/models/attachment.js
1 /*globals jQuery, Backbone, _, wp */2 3 1 /** 4 2 * wp.media.model.Attachment 5 3 * … … 128 126 return $.Deferred().rejectWith( this ).promise(); 129 127 } 130 128 131 return media.post( 'save-attachment-compat', _.defaults({129 return wp.media.post( 'save-attachment-compat', _.defaults({ 132 130 id: this.id, 133 131 nonce: this.get('nonces').update, 134 132 post_id: wp.media.model.settings.post.id … … 165 163 }) 166 164 }); 167 165 168 module.exports = Attachment; 169 No newline at end of file 166 module.exports = Attachment; -
src/wp-includes/js/media/models/attachments.js
1 /*globals jQuery, Backbone, _, wp */2 3 1 /** 4 2 * wp.media.model.Attachments 5 3 * … … 323 321 // checking if we're still mirroring that collection when 324 322 // the request resolves. 325 323 mirroring.more( options ).done( function() { 326 if ( this === attachments.mirroring ) 324 if ( this === attachments.mirroring ) { 327 325 deferred.resolveWith( this ); 326 } 328 327 }); 329 328 330 329 return deferred.promise(); … … 532 531 } 533 532 }); 534 533 535 module.exports = Attachments; 536 No newline at end of file 534 module.exports = Attachments; -
src/wp-includes/js/media/models/post-image.js
1 /*globals jQuery, Backbone */2 3 1 /** 4 2 * wp.media.model.PostImage 5 3 * … … 153 151 } 154 152 }); 155 153 156 module.exports = PostImage; 157 No newline at end of file 154 module.exports = PostImage; -
src/wp-includes/js/media/models/post-media.js
1 /*globals Backbone, _, wp */2 3 1 /** 4 2 * Shared model class for audio and video. Updates the model after 5 3 * "Add Audio|Video Source" and "Replace Audio|Video" states return … … 37 35 } 38 36 }); 39 37 40 module.exports = PostMedia; 41 No newline at end of file 38 module.exports = PostMedia; -
src/wp-includes/js/media/models/query.js
1 /*globals jQuery, _, wp */2 3 1 /** 4 2 * wp.media.model.Query 5 3 * … … 305 303 }()) 306 304 }); 307 305 308 module.exports = Query; 309 No newline at end of file 306 module.exports = Query; -
src/wp-includes/js/media/models/selection.js
1 /*globals _ */2 3 1 /** 4 2 * wp.media.model.Selection 5 3 * … … 94 92 } 95 93 }); 96 94 97 module.exports = Selection; 98 No newline at end of file 95 module.exports = Selection; -
src/wp-includes/js/media/models.js
1 1 (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ 2 /* global _wpMediaModelsL10n:false */ 2 var $ = jQuery, 3 Attachment, Attachments, l10n, media; 4 3 5 window.wp = window.wp || {}; 4 6 5 (function($){ 6 var Attachment, Attachments, l10n, media; 7 /** 8 * Create and return a media frame. 9 * 10 * Handles the default media experience. 11 * 12 * @param {object} attributes The properties passed to the main media controller. 13 * @return {wp.media.view.MediaFrame} A media workflow. 14 */ 15 media = wp.media = function( attributes ) { 16 var MediaFrame = media.view.MediaFrame, 17 frame; 7 18 8 /** 9 * Create and return a media frame. 10 * 11 * Handles the default media experience. 12 * 13 * @param {object} attributes The properties passed to the main media controller. 14 * @return {wp.media.view.MediaFrame} A media workflow. 15 */ 16 media = wp.media = function( attributes ) { 17 var MediaFrame = media.view.MediaFrame, 18 frame; 19 if ( ! MediaFrame ) { 20 return; 21 } 19 22 20 if ( ! MediaFrame ){21 return;22 }23 attributes = _.defaults( attributes || {}, { 24 frame: 'select' 25 }); 23 26 24 attributes = _.defaults( attributes || {}, { 25 frame: 'select' 26 }); 27 if ( 'select' === attributes.frame && MediaFrame.Select ) { 28 frame = new MediaFrame.Select( attributes ); 29 } else if ( 'post' === attributes.frame && MediaFrame.Post ) { 30 frame = new MediaFrame.Post( attributes ); 31 } else if ( 'manage' === attributes.frame && MediaFrame.Manage ) { 32 frame = new MediaFrame.Manage( attributes ); 33 } else if ( 'image' === attributes.frame && MediaFrame.ImageDetails ) { 34 frame = new MediaFrame.ImageDetails( attributes ); 35 } else if ( 'audio' === attributes.frame && MediaFrame.AudioDetails ) { 36 frame = new MediaFrame.AudioDetails( attributes ); 37 } else if ( 'video' === attributes.frame && MediaFrame.VideoDetails ) { 38 frame = new MediaFrame.VideoDetails( attributes ); 39 } else if ( 'edit-attachments' === attributes.frame && MediaFrame.EditAttachments ) { 40 frame = new MediaFrame.EditAttachments( attributes ); 41 } 27 42 28 if ( 'select' === attributes.frame && MediaFrame.Select ) { 29 frame = new MediaFrame.Select( attributes ); 30 } else if ( 'post' === attributes.frame && MediaFrame.Post ) { 31 frame = new MediaFrame.Post( attributes ); 32 } else if ( 'manage' === attributes.frame && MediaFrame.Manage ) { 33 frame = new MediaFrame.Manage( attributes ); 34 } else if ( 'image' === attributes.frame && MediaFrame.ImageDetails ) { 35 frame = new MediaFrame.ImageDetails( attributes ); 36 } else if ( 'audio' === attributes.frame && MediaFrame.AudioDetails ) { 37 frame = new MediaFrame.AudioDetails( attributes ); 38 } else if ( 'video' === attributes.frame && MediaFrame.VideoDetails ) { 39 frame = new MediaFrame.VideoDetails( attributes ); 40 } else if ( 'edit-attachments' === attributes.frame && MediaFrame.EditAttachments ) { 41 frame = new MediaFrame.EditAttachments( attributes ); 42 } 43 delete attributes.frame; 43 44 44 delete attributes.frame;45 media.frame = frame; 45 46 46 media.frame = frame; 47 return frame; 48 }; 47 49 48 return frame; 49 }; 50 _.extend( media, { model: {}, view: {}, controller: {}, frames: {} }); 50 51 51 _.extend( media, { model: {}, view: {}, controller: {}, frames: {} }); 52 // Link any localized strings. 53 l10n = media.model.l10n = window._wpMediaModelsL10n || {}; 52 54 53 // Link any localized strings. 54 l10n = media.model.l10n = typeof _wpMediaModelsL10n === 'undefined' ? {} : _wpMediaModelsL10n; 55 // Link any settings. 56 media.model.settings = l10n.settings || {}; 57 delete l10n.settings; 55 58 56 // Link any settings. 57 media.model.settings = l10n.settings || {}; 58 delete l10n.settings; 59 Attachments = media.model.Attachments = require( './models/attachments.js' ); 60 Attachment = media.model.Attachment = require( './models/attachment.js' ); 59 61 60 Attachments = media.model.Attachments = require( './models/attachments.js' ); 61 Attachment = media.model.Attachment = require( './models/attachment.js' ); 62 media.model.Query = require( './models/query.js' ); 63 media.model.PostImage = require( './models/post-image.js' ); 64 media.model.Selection = require( './models/selection.js' ); 62 65 63 media.model.Query = require( './models/query.js' ); 64 media.model.PostImage = require( './models/post-image.js' ); 65 media.model.Selection = require( './models/selection.js' ); 66 /** 67 * ======================================================================== 68 * UTILITIES 69 * ======================================================================== 70 */ 66 71 67 /** 68 * ======================================================================== 69 * UTILITIES 70 * ======================================================================== 71 */ 72 /** 73 * A basic equality comparator for Backbone models. 74 * 75 * Used to order models within a collection - @see wp.media.model.Attachments.comparator(). 76 * 77 * @param {mixed} a The primary parameter to compare. 78 * @param {mixed} b The primary parameter to compare. 79 * @param {string} ac The fallback parameter to compare, a's cid. 80 * @param {string} bc The fallback parameter to compare, b's cid. 81 * @return {number} -1: a should come before b. 82 * 0: a and b are of the same rank. 83 * 1: b should come before a. 84 */ 85 media.compare = function( a, b, ac, bc ) { 86 if ( _.isEqual( a, b ) ) { 87 return ac === bc ? 0 : (ac > bc ? -1 : 1); 88 } else { 89 return a > b ? -1 : 1; 90 } 91 }; 72 92 93 _.extend( media, { 73 94 /** 74 * A basic equality comparator for Backbone models. 95 * media.template( id ) 96 * 97 * Fetch a JavaScript template for an id, and return a templating function for it. 75 98 * 76 * Used to order models within a collection - @see wp.media.model.Attachments.comparator().99 * See wp.template() in `wp-includes/js/wp-util.js`. 77 100 * 78 * @param {mixed} a The primary parameter to compare. 79 * @param {mixed} b The primary parameter to compare. 80 * @param {string} ac The fallback parameter to compare, a's cid. 81 * @param {string} bc The fallback parameter to compare, b's cid. 82 * @return {number} -1: a should come before b. 83 * 0: a and b are of the same rank. 84 * 1: b should come before a. 101 * @borrows wp.template as template 85 102 */ 86 media.compare = function( a, b, ac, bc ) { 87 if ( _.isEqual( a, b ) ) { 88 return ac === bc ? 0 : (ac > bc ? -1 : 1); 89 } else { 90 return a > b ? -1 : 1; 91 } 92 }; 93 94 _.extend( media, { 95 /** 96 * media.template( id ) 97 * 98 * Fetch a JavaScript template for an id, and return a templating function for it. 99 * 100 * See wp.template() in `wp-includes/js/wp-util.js`. 101 * 102 * @borrows wp.template as template 103 */ 104 template: wp.template, 105 106 /** 107 * media.post( [action], [data] ) 108 * 109 * Sends a POST request to WordPress. 110 * See wp.ajax.post() in `wp-includes/js/wp-util.js`. 111 * 112 * @borrows wp.ajax.post as post 113 */ 114 post: wp.ajax.post, 115 116 /** 117 * media.ajax( [action], [options] ) 118 * 119 * Sends an XHR request to WordPress. 120 * See wp.ajax.send() in `wp-includes/js/wp-util.js`. 121 * 122 * @borrows wp.ajax.send as ajax 123 */ 124 ajax: wp.ajax.send, 125 126 /** 127 * Scales a set of dimensions to fit within bounding dimensions. 128 * 129 * @param {Object} dimensions 130 * @returns {Object} 131 */ 132 fit: function( dimensions ) { 133 var width = dimensions.width, 134 height = dimensions.height, 135 maxWidth = dimensions.maxWidth, 136 maxHeight = dimensions.maxHeight, 137 constraint; 138 139 // Compare ratios between the two values to determine which 140 // max to constrain by. If a max value doesn't exist, then the 141 // opposite side is the constraint. 142 if ( ! _.isUndefined( maxWidth ) && ! _.isUndefined( maxHeight ) ) { 143 constraint = ( width / height > maxWidth / maxHeight ) ? 'width' : 'height'; 144 } else if ( _.isUndefined( maxHeight ) ) { 145 constraint = 'width'; 146 } else if ( _.isUndefined( maxWidth ) && height > maxHeight ) { 147 constraint = 'height'; 148 } 149 150 // If the value of the constrained side is larger than the max, 151 // then scale the values. Otherwise return the originals; they fit. 152 if ( 'width' === constraint && width > maxWidth ) { 153 return { 154 width : maxWidth, 155 height: Math.round( maxWidth * height / width ) 156 }; 157 } else if ( 'height' === constraint && height > maxHeight ) { 158 return { 159 width : Math.round( maxHeight * width / height ), 160 height: maxHeight 161 }; 162 } else { 163 return { 164 width : width, 165 height: height 166 }; 167 } 168 }, 169 /** 170 * Truncates a string by injecting an ellipsis into the middle. 171 * Useful for filenames. 172 * 173 * @param {String} string 174 * @param {Number} [length=30] 175 * @param {String} [replacement=…] 176 * @returns {String} The string, unless length is greater than string.length. 177 */ 178 truncate: function( string, length, replacement ) { 179 length = length || 30; 180 replacement = replacement || '…'; 181 182 if ( string.length <= length ) { 183 return string; 184 } 185 186 return string.substr( 0, length / 2 ) + replacement + string.substr( -1 * length / 2 ); 187 } 188 }); 103 template: wp.template, 189 104 190 105 /** 191 * ======================================================================== 192 * MODELS 193 * ======================================================================== 106 * media.post( [action], [data] ) 107 * 108 * Sends a POST request to WordPress. 109 * See wp.ajax.post() in `wp-includes/js/wp-util.js`. 110 * 111 * @borrows wp.ajax.post as post 194 112 */ 113 post: wp.ajax.post, 114 195 115 /** 196 * wp.media.attachment116 * media.ajax( [action], [options] ) 197 117 * 198 * @static 199 * @param {String} id A string used to identify a model. 200 * @returns {wp.media.model.Attachment} 118 * Sends an XHR request to WordPress. 119 * See wp.ajax.send() in `wp-includes/js/wp-util.js`. 120 * 121 * @borrows wp.ajax.send as ajax 201 122 */ 202 media.attachment = function( id ) { 203 return Attachment.get( id ); 204 }; 123 ajax: wp.ajax.send, 205 124 206 125 /** 207 * A collection of all attachments that have been fetched from the server.126 * Scales a set of dimensions to fit within bounding dimensions. 208 127 * 209 * @ static210 * @ member {wp.media.model.Attachments}128 * @param {Object} dimensions 129 * @returns {Object} 211 130 */ 212 Attachments.all = new Attachments(); 131 fit: function( dimensions ) { 132 var width = dimensions.width, 133 height = dimensions.height, 134 maxWidth = dimensions.maxWidth, 135 maxHeight = dimensions.maxHeight, 136 constraint; 213 137 138 // Compare ratios between the two values to determine which 139 // max to constrain by. If a max value doesn't exist, then the 140 // opposite side is the constraint. 141 if ( ! _.isUndefined( maxWidth ) && ! _.isUndefined( maxHeight ) ) { 142 constraint = ( width / height > maxWidth / maxHeight ) ? 'width' : 'height'; 143 } else if ( _.isUndefined( maxHeight ) ) { 144 constraint = 'width'; 145 } else if ( _.isUndefined( maxWidth ) && height > maxHeight ) { 146 constraint = 'height'; 147 } 148 149 // If the value of the constrained side is larger than the max, 150 // then scale the values. Otherwise return the originals; they fit. 151 if ( 'width' === constraint && width > maxWidth ) { 152 return { 153 width : maxWidth, 154 height: Math.round( maxWidth * height / width ) 155 }; 156 } else if ( 'height' === constraint && height > maxHeight ) { 157 return { 158 width : Math.round( maxHeight * width / height ), 159 height: maxHeight 160 }; 161 } else { 162 return { 163 width : width, 164 height: height 165 }; 166 } 167 }, 214 168 /** 215 * wp.media.query 169 * Truncates a string by injecting an ellipsis into the middle. 170 * Useful for filenames. 216 171 * 217 * Shorthand for creating a new Attachments Query.218 * 219 * @param { object} [props]220 * @returns { wp.media.model.Attachments}172 * @param {String} string 173 * @param {Number} [length=30] 174 * @param {String} [replacement=…] 175 * @returns {String} The string, unless length is greater than string.length. 221 176 */ 222 media.query = function( props ) { 223 return new Attachments( null, { 224 props: _.extend( _.defaults( props || {}, { orderby: 'date' } ), { query: true } ) 225 }); 226 }; 177 truncate: function( string, length, replacement ) { 178 length = length || 30; 179 replacement = replacement || '…'; 227 180 228 // Clean up. Prevents mobile browsers caching 229 $(window).on('unload', function(){ 230 window.wp = null; 181 if ( string.length <= length ) { 182 return string; 183 } 184 185 return string.substr( 0, length / 2 ) + replacement + string.substr( -1 * length / 2 ); 186 } 187 }); 188 189 /** 190 * ======================================================================== 191 * MODELS 192 * ======================================================================== 193 */ 194 /** 195 * wp.media.attachment 196 * 197 * @static 198 * @param {String} id A string used to identify a model. 199 * @returns {wp.media.model.Attachment} 200 */ 201 media.attachment = function( id ) { 202 return Attachment.get( id ); 203 }; 204 205 /** 206 * A collection of all attachments that have been fetched from the server. 207 * 208 * @static 209 * @member {wp.media.model.Attachments} 210 */ 211 Attachments.all = new Attachments(); 212 213 /** 214 * wp.media.query 215 * 216 * Shorthand for creating a new Attachments Query. 217 * 218 * @param {object} [props] 219 * @returns {wp.media.model.Attachments} 220 */ 221 media.query = function( props ) { 222 return new Attachments( null, { 223 props: _.extend( _.defaults( props || {}, { orderby: 'date' } ), { query: true } ) 231 224 }); 225 }; 232 226 233 }(jQuery)); 234 },{"./models/attachment.js":2,"./models/attachments.js":3,"./models/post-image.js":4,"./models/query.js":5,"./models/selection.js":6}],2:[function(require,module,exports){ 235 /*globals jQuery, Backbone, _, wp */ 227 // Clean up. Prevents mobile browsers caching 228 $(window).on('unload', function(){ 229 window.wp = null; 230 }); 236 231 232 },{"./models/attachment.js":2,"./models/attachments.js":3,"./models/post-image.js":4,"./models/query.js":5,"./models/selection.js":6}],2:[function(require,module,exports){ 237 233 /** 238 234 * wp.media.model.Attachment 239 235 * … … 362 358 return $.Deferred().rejectWith( this ).promise(); 363 359 } 364 360 365 return media.post( 'save-attachment-compat', _.defaults({361 return wp.media.post( 'save-attachment-compat', _.defaults({ 366 362 id: this.id, 367 363 nonce: this.get('nonces').update, 368 364 post_id: wp.media.model.settings.post.id … … 400 396 }); 401 397 402 398 module.exports = Attachment; 403 },{"./attachments.js":3}],3:[function(require,module,exports){404 /*globals jQuery, Backbone, _, wp */405 399 400 },{"./attachments.js":3}],3:[function(require,module,exports){ 406 401 /** 407 402 * wp.media.model.Attachments 408 403 * … … 726 721 // checking if we're still mirroring that collection when 727 722 // the request resolves. 728 723 mirroring.more( options ).done( function() { 729 if ( this === attachments.mirroring ) 724 if ( this === attachments.mirroring ) { 730 725 deferred.resolveWith( this ); 726 } 731 727 }); 732 728 733 729 return deferred.promise(); … … 936 932 }); 937 933 938 934 module.exports = Attachments; 939 },{"./attachment.js":2,"./query.js":5}],4:[function(require,module,exports){940 /*globals jQuery, Backbone */941 935 936 },{"./attachment.js":2,"./query.js":5}],4:[function(require,module,exports){ 942 937 /** 943 938 * wp.media.model.PostImage 944 939 * … … 1093 1088 }); 1094 1089 1095 1090 module.exports = PostImage; 1096 },{"./attachment":2}],5:[function(require,module,exports){1097 /*globals jQuery, _, wp */1098 1091 1092 },{"./attachment":2}],5:[function(require,module,exports){ 1099 1093 /** 1100 1094 * wp.media.model.Query 1101 1095 * … … 1402 1396 }); 1403 1397 1404 1398 module.exports = Query; 1405 },{"./attachments.js":3}],6:[function(require,module,exports){1406 /*globals _ */1407 1399 1400 },{"./attachments.js":3}],6:[function(require,module,exports){ 1408 1401 /** 1409 1402 * wp.media.model.Selection 1410 1403 * … … 1500 1493 }); 1501 1494 1502 1495 module.exports = Selection; 1496 1503 1497 },{"./attachments.js":3}]},{},[1]); -
src/wp-includes/js/media/models.manifest.js
1 /* global _wpMediaModelsL10n:false */ 1 var $ = jQuery, 2 Attachment, Attachments, l10n, media; 3 2 4 window.wp = window.wp || {}; 3 5 4 (function($){ 5 var Attachment, Attachments, l10n, media; 6 /** 7 * Create and return a media frame. 8 * 9 * Handles the default media experience. 10 * 11 * @param {object} attributes The properties passed to the main media controller. 12 * @return {wp.media.view.MediaFrame} A media workflow. 13 */ 14 media = wp.media = function( attributes ) { 15 var MediaFrame = media.view.MediaFrame, 16 frame; 17 18 if ( ! MediaFrame ) { 19 return; 20 } 6 21 7 /** 8 * Create and return a media frame. 9 * 10 * Handles the default media experience. 11 * 12 * @param {object} attributes The properties passed to the main media controller. 13 * @return {wp.media.view.MediaFrame} A media workflow. 14 */ 15 media = wp.media = function( attributes ) { 16 var MediaFrame = media.view.MediaFrame, 17 frame; 22 attributes = _.defaults( attributes || {}, { 23 frame: 'select' 24 }); 18 25 19 if ( ! MediaFrame ) { 20 return; 21 } 26 if ( 'select' === attributes.frame && MediaFrame.Select ) { 27 frame = new MediaFrame.Select( attributes ); 28 } else if ( 'post' === attributes.frame && MediaFrame.Post ) { 29 frame = new MediaFrame.Post( attributes ); 30 } else if ( 'manage' === attributes.frame && MediaFrame.Manage ) { 31 frame = new MediaFrame.Manage( attributes ); 32 } else if ( 'image' === attributes.frame && MediaFrame.ImageDetails ) { 33 frame = new MediaFrame.ImageDetails( attributes ); 34 } else if ( 'audio' === attributes.frame && MediaFrame.AudioDetails ) { 35 frame = new MediaFrame.AudioDetails( attributes ); 36 } else if ( 'video' === attributes.frame && MediaFrame.VideoDetails ) { 37 frame = new MediaFrame.VideoDetails( attributes ); 38 } else if ( 'edit-attachments' === attributes.frame && MediaFrame.EditAttachments ) { 39 frame = new MediaFrame.EditAttachments( attributes ); 40 } 22 41 23 attributes = _.defaults( attributes || {}, { 24 frame: 'select' 25 }); 26 27 if ( 'select' === attributes.frame && MediaFrame.Select ) { 28 frame = new MediaFrame.Select( attributes ); 29 } else if ( 'post' === attributes.frame && MediaFrame.Post ) { 30 frame = new MediaFrame.Post( attributes ); 31 } else if ( 'manage' === attributes.frame && MediaFrame.Manage ) { 32 frame = new MediaFrame.Manage( attributes ); 33 } else if ( 'image' === attributes.frame && MediaFrame.ImageDetails ) { 34 frame = new MediaFrame.ImageDetails( attributes ); 35 } else if ( 'audio' === attributes.frame && MediaFrame.AudioDetails ) { 36 frame = new MediaFrame.AudioDetails( attributes ); 37 } else if ( 'video' === attributes.frame && MediaFrame.VideoDetails ) { 38 frame = new MediaFrame.VideoDetails( attributes ); 39 } else if ( 'edit-attachments' === attributes.frame && MediaFrame.EditAttachments ) { 40 frame = new MediaFrame.EditAttachments( attributes ); 41 } 42 delete attributes.frame; 42 43 43 delete attributes.frame;44 media.frame = frame; 44 45 45 media.frame = frame; 46 return frame; 47 }; 46 48 47 return frame; 48 }; 49 _.extend( media, { model: {}, view: {}, controller: {}, frames: {} }); 49 50 50 _.extend( media, { model: {}, view: {}, controller: {}, frames: {} }); 51 // Link any localized strings. 52 l10n = media.model.l10n = window._wpMediaModelsL10n || {}; 51 53 52 // Link any localized strings. 53 l10n = media.model.l10n = typeof _wpMediaModelsL10n === 'undefined' ? {} : _wpMediaModelsL10n; 54 // Link any settings. 55 media.model.settings = l10n.settings || {}; 56 delete l10n.settings; 54 57 55 // Link any settings. 56 media.model.settings = l10n.settings || {}; 57 delete l10n.settings; 58 Attachments = media.model.Attachments = require( './models/attachments.js' ); 59 Attachment = media.model.Attachment = require( './models/attachment.js' ); 58 60 59 Attachments = media.model.Attachments = require( './models/attachments.js' ); 60 Attachment = media.model.Attachment = require( './models/attachment.js' ); 61 media.model.Query = require( './models/query.js' ); 62 media.model.PostImage = require( './models/post-image.js' ); 63 media.model.Selection = require( './models/selection.js' ); 61 64 62 media.model.Query = require( './models/query.js' ); 63 media.model.PostImage = require( './models/post-image.js' ); 64 media.model.Selection = require( './models/selection.js' ); 65 /** 66 * ======================================================================== 67 * UTILITIES 68 * ======================================================================== 69 */ 65 70 66 /** 67 * ======================================================================== 68 * UTILITIES 69 * ======================================================================== 70 */ 71 /** 72 * A basic equality comparator for Backbone models. 73 * 74 * Used to order models within a collection - @see wp.media.model.Attachments.comparator(). 75 * 76 * @param {mixed} a The primary parameter to compare. 77 * @param {mixed} b The primary parameter to compare. 78 * @param {string} ac The fallback parameter to compare, a's cid. 79 * @param {string} bc The fallback parameter to compare, b's cid. 80 * @return {number} -1: a should come before b. 81 * 0: a and b are of the same rank. 82 * 1: b should come before a. 83 */ 84 media.compare = function( a, b, ac, bc ) { 85 if ( _.isEqual( a, b ) ) { 86 return ac === bc ? 0 : (ac > bc ? -1 : 1); 87 } else { 88 return a > b ? -1 : 1; 89 } 90 }; 71 91 92 _.extend( media, { 72 93 /** 73 * A basic equality comparator for Backbone models.94 * media.template( id ) 74 95 * 75 * Used to order models within a collection - @see wp.media.model.Attachments.comparator().96 * Fetch a JavaScript template for an id, and return a templating function for it. 76 97 * 77 * @param {mixed} a The primary parameter to compare. 78 * @param {mixed} b The primary parameter to compare. 79 * @param {string} ac The fallback parameter to compare, a's cid. 80 * @param {string} bc The fallback parameter to compare, b's cid. 81 * @return {number} -1: a should come before b. 82 * 0: a and b are of the same rank. 83 * 1: b should come before a. 98 * See wp.template() in `wp-includes/js/wp-util.js`. 99 * 100 * @borrows wp.template as template 84 101 */ 85 media.compare = function( a, b, ac, bc ) { 86 if ( _.isEqual( a, b ) ) { 87 return ac === bc ? 0 : (ac > bc ? -1 : 1); 88 } else { 89 return a > b ? -1 : 1; 90 } 91 }; 92 93 _.extend( media, { 94 /** 95 * media.template( id ) 96 * 97 * Fetch a JavaScript template for an id, and return a templating function for it. 98 * 99 * See wp.template() in `wp-includes/js/wp-util.js`. 100 * 101 * @borrows wp.template as template 102 */ 103 template: wp.template, 104 105 /** 106 * media.post( [action], [data] ) 107 * 108 * Sends a POST request to WordPress. 109 * See wp.ajax.post() in `wp-includes/js/wp-util.js`. 110 * 111 * @borrows wp.ajax.post as post 112 */ 113 post: wp.ajax.post, 114 115 /** 116 * media.ajax( [action], [options] ) 117 * 118 * Sends an XHR request to WordPress. 119 * See wp.ajax.send() in `wp-includes/js/wp-util.js`. 120 * 121 * @borrows wp.ajax.send as ajax 122 */ 123 ajax: wp.ajax.send, 124 125 /** 126 * Scales a set of dimensions to fit within bounding dimensions. 127 * 128 * @param {Object} dimensions 129 * @returns {Object} 130 */ 131 fit: function( dimensions ) { 132 var width = dimensions.width, 133 height = dimensions.height, 134 maxWidth = dimensions.maxWidth, 135 maxHeight = dimensions.maxHeight, 136 constraint; 137 138 // Compare ratios between the two values to determine which 139 // max to constrain by. If a max value doesn't exist, then the 140 // opposite side is the constraint. 141 if ( ! _.isUndefined( maxWidth ) && ! _.isUndefined( maxHeight ) ) { 142 constraint = ( width / height > maxWidth / maxHeight ) ? 'width' : 'height'; 143 } else if ( _.isUndefined( maxHeight ) ) { 144 constraint = 'width'; 145 } else if ( _.isUndefined( maxWidth ) && height > maxHeight ) { 146 constraint = 'height'; 147 } 148 149 // If the value of the constrained side is larger than the max, 150 // then scale the values. Otherwise return the originals; they fit. 151 if ( 'width' === constraint && width > maxWidth ) { 152 return { 153 width : maxWidth, 154 height: Math.round( maxWidth * height / width ) 155 }; 156 } else if ( 'height' === constraint && height > maxHeight ) { 157 return { 158 width : Math.round( maxHeight * width / height ), 159 height: maxHeight 160 }; 161 } else { 162 return { 163 width : width, 164 height: height 165 }; 166 } 167 }, 168 /** 169 * Truncates a string by injecting an ellipsis into the middle. 170 * Useful for filenames. 171 * 172 * @param {String} string 173 * @param {Number} [length=30] 174 * @param {String} [replacement=…] 175 * @returns {String} The string, unless length is greater than string.length. 176 */ 177 truncate: function( string, length, replacement ) { 178 length = length || 30; 179 replacement = replacement || '…'; 180 181 if ( string.length <= length ) { 182 return string; 183 } 184 185 return string.substr( 0, length / 2 ) + replacement + string.substr( -1 * length / 2 ); 186 } 187 }); 102 template: wp.template, 188 103 189 104 /** 190 * ======================================================================== 191 * MODELS 192 * ======================================================================== 105 * media.post( [action], [data] ) 106 * 107 * Sends a POST request to WordPress. 108 * See wp.ajax.post() in `wp-includes/js/wp-util.js`. 109 * 110 * @borrows wp.ajax.post as post 193 111 */ 112 post: wp.ajax.post, 113 194 114 /** 195 * wp.media.attachment 115 * media.ajax( [action], [options] ) 116 * 117 * Sends an XHR request to WordPress. 118 * See wp.ajax.send() in `wp-includes/js/wp-util.js`. 196 119 * 197 * @static 198 * @param {String} id A string used to identify a model. 199 * @returns {wp.media.model.Attachment} 120 * @borrows wp.ajax.send as ajax 200 121 */ 201 media.attachment = function( id ) { 202 return Attachment.get( id ); 203 }; 122 ajax: wp.ajax.send, 204 123 205 124 /** 206 * A collection of all attachments that have been fetched from the server.125 * Scales a set of dimensions to fit within bounding dimensions. 207 126 * 208 * @ static209 * @ member {wp.media.model.Attachments}127 * @param {Object} dimensions 128 * @returns {Object} 210 129 */ 211 Attachments.all = new Attachments(); 130 fit: function( dimensions ) { 131 var width = dimensions.width, 132 height = dimensions.height, 133 maxWidth = dimensions.maxWidth, 134 maxHeight = dimensions.maxHeight, 135 constraint; 136 137 // Compare ratios between the two values to determine which 138 // max to constrain by. If a max value doesn't exist, then the 139 // opposite side is the constraint. 140 if ( ! _.isUndefined( maxWidth ) && ! _.isUndefined( maxHeight ) ) { 141 constraint = ( width / height > maxWidth / maxHeight ) ? 'width' : 'height'; 142 } else if ( _.isUndefined( maxHeight ) ) { 143 constraint = 'width'; 144 } else if ( _.isUndefined( maxWidth ) && height > maxHeight ) { 145 constraint = 'height'; 146 } 212 147 148 // If the value of the constrained side is larger than the max, 149 // then scale the values. Otherwise return the originals; they fit. 150 if ( 'width' === constraint && width > maxWidth ) { 151 return { 152 width : maxWidth, 153 height: Math.round( maxWidth * height / width ) 154 }; 155 } else if ( 'height' === constraint && height > maxHeight ) { 156 return { 157 width : Math.round( maxHeight * width / height ), 158 height: maxHeight 159 }; 160 } else { 161 return { 162 width : width, 163 height: height 164 }; 165 } 166 }, 213 167 /** 214 * wp.media.query 168 * Truncates a string by injecting an ellipsis into the middle. 169 * Useful for filenames. 215 170 * 216 * Shorthand for creating a new Attachments Query. 217 * 218 * @param {object} [props] 219 * @returns {wp.media.model.Attachments} 220 */ 221 media.query = function( props ) { 222 return new Attachments( null, { 223 props: _.extend( _.defaults( props || {}, { orderby: 'date' } ), { query: true } ) 224 }); 225 }; 226 227 // Clean up. Prevents mobile browsers caching 228 $(window).on('unload', function(){ 229 window.wp = null; 171 * @param {String} string 172 * @param {Number} [length=30] 173 * @param {String} [replacement=…] 174 * @returns {String} The string, unless length is greater than string.length. 175 */ 176 truncate: function( string, length, replacement ) { 177 length = length || 30; 178 replacement = replacement || '…'; 179 180 if ( string.length <= length ) { 181 return string; 182 } 183 184 return string.substr( 0, length / 2 ) + replacement + string.substr( -1 * length / 2 ); 185 } 186 }); 187 188 /** 189 * ======================================================================== 190 * MODELS 191 * ======================================================================== 192 */ 193 /** 194 * wp.media.attachment 195 * 196 * @static 197 * @param {String} id A string used to identify a model. 198 * @returns {wp.media.model.Attachment} 199 */ 200 media.attachment = function( id ) { 201 return Attachment.get( id ); 202 }; 203 204 /** 205 * A collection of all attachments that have been fetched from the server. 206 * 207 * @static 208 * @member {wp.media.model.Attachments} 209 */ 210 Attachments.all = new Attachments(); 211 212 /** 213 * wp.media.query 214 * 215 * Shorthand for creating a new Attachments Query. 216 * 217 * @param {object} [props] 218 * @returns {wp.media.model.Attachments} 219 */ 220 media.query = function( props ) { 221 return new Attachments( null, { 222 props: _.extend( _.defaults( props || {}, { orderby: 'date' } ), { query: true } ) 230 223 }); 224 }; 231 225 232 }(jQuery)); 233 No newline at end of file 226 // Clean up. Prevents mobile browsers caching 227 $(window).on('unload', function(){ 228 window.wp = null; 229 }); -
src/wp-includes/js/media/routers/manage.js
1 /*globals jQuery, Backbone */2 3 1 /** 4 2 * A router for handling the browser history and application state. 5 3 * … … 43 41 } 44 42 }); 45 43 46 module.exports = Router; 47 No newline at end of file 44 module.exports = Router; -
src/wp-includes/js/media/utils/selection-sync.js
1 /*globals _ */2 3 1 /** 4 2 * wp.media.selectionSync 5 3 * … … 63 61 } 64 62 }; 65 63 66 module.exports = selectionSync; 67 No newline at end of file 64 module.exports = selectionSync; -
src/wp-includes/js/media/views/attachment/details-two-column.js
1 /*globals wp */2 3 1 /** 4 2 * A similar view to media.view.Attachment.Details 5 3 * for use in the Edit Attachment modal. … … 34 32 wp.media.mixin.removeAllPlayers(); 35 33 this.$( 'audio, video' ).each( function (i, elem) { 36 34 var el = MediaDetails.prepareSrc( elem ); 37 new MediaElementPlayer( el, wp.media.mixin.mejsSettings );35 new window.MediaElementPlayer( el, wp.media.mixin.mejsSettings ); 38 36 } ); 39 37 } 40 38 }); 41 39 42 module.exports = TwoColumn; 43 No newline at end of file 40 module.exports = TwoColumn; -
src/wp-includes/js/media/views/attachment/details.js
1 /*globals _, wp */2 3 1 /** 4 2 * wp.media.view.Attachment.Details 5 3 * … … 59 57 deleteAttachment: function( event ) { 60 58 event.preventDefault(); 61 59 62 if ( confirm( l10n.warnDelete ) ) {60 if ( window.confirm( l10n.warnDelete ) ) { 63 61 this.model.destroy(); 64 62 // Keep focus inside media modal 65 63 // after image is deleted … … 137 135 } 138 136 }); 139 137 140 module.exports = Details; 141 No newline at end of file 138 module.exports = Details; -
src/wp-includes/js/media/views/attachment/edit-library.js
16 16 } 17 17 }); 18 18 19 module.exports = EditLibrary; 20 No newline at end of file 19 module.exports = EditLibrary; -
src/wp-includes/js/media/views/attachment/edit-selection.js
17 17 } 18 18 }); 19 19 20 module.exports = EditSelection; 21 No newline at end of file 20 module.exports = EditSelection; -
src/wp-includes/js/media/views/attachment/library.js
16 16 } 17 17 }); 18 18 19 module.exports = Library; 20 No newline at end of file 19 module.exports = Library; -
src/wp-includes/js/media/views/attachment/selection.js
20 20 } 21 21 }); 22 22 23 module.exports = Selection; 24 No newline at end of file 23 module.exports = Selection; -
src/wp-includes/js/media/views/attachment-compat.js
1 /*globals _ */2 3 1 /** 4 2 * wp.media.view.AttachmentCompat 5 3 * … … 82 80 } 83 81 }); 84 82 85 module.exports = AttachmentCompat; 86 No newline at end of file 83 module.exports = AttachmentCompat; -
src/wp-includes/js/media/views/attachment-filters/all.js
1 /*globals _, wp */2 3 1 /** 4 2 * wp.media.view.AttachmentFilters.All 5 3 * … … 88 86 } 89 87 }); 90 88 91 module.exports = All; 92 No newline at end of file 89 module.exports = All; -
src/wp-includes/js/media/views/attachment-filters/date.js
1 /*globals _, wp */2 3 1 /** 4 2 * A filter dropdown for month/dates. 5 3 * … … 39 37 } 40 38 }); 41 39 42 module.exports = DateFilter; 43 No newline at end of file 40 module.exports = DateFilter; -
src/wp-includes/js/media/views/attachment-filters/uploaded.js
1 /*globals wp */2 3 1 /** 4 2 * wp.media.view.AttachmentFilters.Uploaded 5 3 * … … 57 55 } 58 56 }); 59 57 60 module.exports = Uploaded; 61 No newline at end of file 58 module.exports = Uploaded; -
src/wp-includes/js/media/views/attachment-filters.js
1 /*globals _, jQuery */2 3 1 /** 4 2 * wp.media.view.AttachmentFilters 5 3 * … … 75 73 } 76 74 }); 77 75 78 module.exports = AttachmentFilters; 79 No newline at end of file 76 module.exports = AttachmentFilters; -
src/wp-includes/js/media/views/attachment.js
1 /*globals _, wp, jQuery */2 3 1 /** 4 2 * wp.media.view.Attachment 5 3 * … … 551 549 }; 552 550 }); 553 551 554 module.exports = Attachment; 555 No newline at end of file 552 module.exports = Attachment; -
src/wp-includes/js/media/views/attachments/browser.js
1 /*globals _, wp, jQuery */2 3 1 /** 4 2 * wp.media.view.AttachmentsBrowser 5 3 * … … 190 188 return; 191 189 } 192 190 193 if ( ! mediaTrash && ! confirm( l10n.warnBulkDelete ) ) {191 if ( ! mediaTrash && ! window.confirm( l10n.warnBulkDelete ) ) { 194 192 return; 195 193 } 196 194 197 195 if ( mediaTrash && 198 196 'trash' !== selection.at( 0 ).get( 'status' ) && 199 ! confirm( l10n.warnBulkTrash ) ) {197 ! window.confirm( l10n.warnBulkTrash ) ) { 200 198 201 199 return; 202 200 } … … 244 242 click: function() { 245 243 var removed = [], selection = this.controller.state().get( 'selection' ); 246 244 247 if ( ! selection.length || ! confirm( l10n.warnBulkDelete ) ) {245 if ( ! selection.length || ! window.confirm( l10n.warnBulkDelete ) ) { 248 246 return; 249 247 } 250 248 … … 456 454 } 457 455 }); 458 456 459 module.exports = AttachmentsBrowser; 460 No newline at end of file 457 module.exports = AttachmentsBrowser; -
src/wp-includes/js/media/views/attachments/selection.js
1 /*globals _ */2 3 1 /** 4 2 * wp.media.view.Attachments.Selection 5 3 * … … 28 26 } 29 27 }); 30 28 31 module.exports = Selection; 32 No newline at end of file 29 module.exports = Selection; -
src/wp-includes/js/media/views/attachments.js
1 /*globals _, wp, jQuery */2 3 1 /** 4 2 * wp.media.view.Attachments 5 3 * … … 272 270 273 271 // The scroll event occurs on the document, but the element 274 272 // that should be checked is the document body. 275 if ( el == document ) {273 if ( el === document ) { 276 274 el = document.body; 277 275 scrollTop = $(document).scrollTop(); 278 276 } … … 297 295 } 298 296 }); 299 297 300 module.exports = Attachments; 301 No newline at end of file 298 module.exports = Attachments; -
src/wp-includes/js/media/views/audio-details.js
1 /*globals wp */2 3 1 /** 4 2 * wp.media.view.AudioDetails 5 3 * … … 35 33 } 36 34 }); 37 35 38 module.exports = AudioDetails; 39 No newline at end of file 36 module.exports = AudioDetails; -
src/wp-includes/js/media/views/button/delete-selected-permanently.js
40 40 } 41 41 }); 42 42 43 module.exports = DeleteSelectedPermanently; 44 No newline at end of file 43 module.exports = DeleteSelectedPermanently; -
src/wp-includes/js/media/views/button/delete-selected.js
1 /*globals wp */2 3 1 /** 4 2 * A button that handles bulk Delete/Trash logic 5 3 * … … 48 46 } 49 47 }); 50 48 51 module.exports = DeleteSelected; 52 No newline at end of file 49 module.exports = DeleteSelected; -
src/wp-includes/js/media/views/button/select-mode-toggle.js
1 /*globals wp */2 3 1 var Button = require( '../button.js' ), 4 2 l10n = wp.media.view.l10n, 5 3 SelectModeToggle; … … 52 50 } 53 51 }); 54 52 55 module.exports = SelectModeToggle; 56 No newline at end of file 53 module.exports = SelectModeToggle; -
src/wp-includes/js/media/views/button-group.js
1 /*globals _, Backbone, jQuery */2 3 1 /** 4 2 * wp.media.view.ButtonGroup 5 3 * … … 45 43 } 46 44 }); 47 45 48 module.exports = ButtonGroup; 49 No newline at end of file 46 module.exports = ButtonGroup; -
src/wp-includes/js/media/views/button.js
1 /*globals _, Backbone */2 3 1 /** 4 2 * wp.media.view.Button 5 3 * … … 86 84 } 87 85 }); 88 86 89 module.exports = Button; 90 No newline at end of file 87 module.exports = Button; -
src/wp-includes/js/media/views/cropper.js
1 /*globals _, wp, jQuery */2 3 1 /** 4 2 * wp.media.view.Cropper 5 3 * … … 60 58 61 59 this.views.add( '.upload-errors', new UploaderStatusError({ 62 60 filename: UploaderStatus.prototype.filename(filename), 63 message: _wpMediaViewsL10n.cropError61 message: window._wpMediaViewsL10n.cropError 64 62 }), { at: 0 }); 65 63 } 66 64 }); 67 65 68 module.exports = Cropper; 69 No newline at end of file 66 module.exports = Cropper; -
src/wp-includes/js/media/views/edit-image-details.js
21 21 } 22 22 }); 23 23 24 module.exports = Details; 25 No newline at end of file 24 module.exports = Details; -
src/wp-includes/js/media/views/edit-image.js
1 /*globals _, wp */2 3 1 var View = require( './view.js' ), 4 2 EditImage; 5 3 … … 50 48 51 49 }); 52 50 53 module.exports = EditImage; 54 No newline at end of file 51 module.exports = EditImage; -
src/wp-includes/js/media/views/embed/image.js
1 /*globals wp */2 3 1 /** 4 2 * wp.media.view.EmbedImage 5 3 * … … 30 28 } 31 29 }); 32 30 33 module.exports = EmbedImage; 34 No newline at end of file 31 module.exports = EmbedImage; -
src/wp-includes/js/media/views/embed/link.js
1 /*globals _, wp, jQuery */2 3 1 /** 4 2 * wp.media.view.EmbedLink 5 3 * … … 64 62 } 65 63 }); 66 64 67 module.exports = EmbedLink; 68 No newline at end of file 65 module.exports = EmbedLink; -
src/wp-includes/js/media/views/embed/url.js
1 /*globals _, wp, jQuery */2 3 1 /** 4 2 * wp.media.view.EmbedUrl 5 3 * … … 76 74 } 77 75 }); 78 76 79 module.exports = EmbedUrl; 80 No newline at end of file 77 module.exports = EmbedUrl; -
src/wp-includes/js/media/views/embed.js
65 65 } 66 66 }); 67 67 68 module.exports = Embed; 69 No newline at end of file 68 module.exports = Embed; -
src/wp-includes/js/media/views/focus-manager.js
44 44 45 45 }); 46 46 47 module.exports = FocusManager; 48 No newline at end of file 47 module.exports = FocusManager; -
src/wp-includes/js/media/views/frame/audio-details.js
1 /*globals wp */2 3 1 /** 4 2 * wp.media.view.MediaFrame.AudioDetails 5 3 * … … 74 72 } 75 73 }); 76 74 77 module.exports = AudioDetails; 78 No newline at end of file 75 module.exports = AudioDetails; -
src/wp-includes/js/media/views/frame/edit-attachments.js
1 /*globals _, wp, jQuery */2 3 1 /** 4 2 * A frame for editing the details of a specific media item. 5 3 * … … 243 241 } 244 242 }); 245 243 246 module.exports = EditAttachments; 247 No newline at end of file 244 module.exports = EditAttachments; -
src/wp-includes/js/media/views/frame/image-details.js
1 /*globals wp */2 3 1 /** 4 2 * wp.media.view.MediaFrame.ImageDetails 5 3 * … … 180 178 181 179 }); 182 180 183 module.exports = ImageDetails; 184 No newline at end of file 181 module.exports = ImageDetails; -
src/wp-includes/js/media/views/frame/manage.js
1 /*globals _, Backbone, wp, jQuery */2 3 1 /** 4 2 * wp.media.view.MediaFrame.Manage 5 3 * … … 237 235 // Verify pushState support and activate 238 236 if ( window.history && window.history.pushState ) { 239 237 Backbone.history.start( { 240 root: _wpMediaGridSettings.adminUrl,238 root: window._wpMediaGridSettings.adminUrl, 241 239 pushState: true 242 240 } ); 243 241 } 244 242 } 245 243 }); 246 244 247 module.exports = Manage; 248 No newline at end of file 245 module.exports = Manage; -
src/wp-includes/js/media/views/frame/media-details.js
1 /*globals wp */2 3 1 /** 4 2 * wp.media.view.MediaFrame.MediaDetails 5 3 * … … 129 127 } 130 128 }); 131 129 132 module.exports = MediaDetails; 133 No newline at end of file 130 module.exports = MediaDetails; -
src/wp-includes/js/media/views/frame/post.js
1 /*globals _, wp */2 3 1 /** 4 2 * wp.media.view.MediaFrame.Post 5 3 * … … 748 746 } 749 747 }); 750 748 751 module.exports = Post; 752 No newline at end of file 749 module.exports = Post; -
src/wp-includes/js/media/views/frame/select.js
1 /*globals _, wp */2 3 1 /** 4 2 * wp.media.view.MediaFrame.Select 5 3 * … … 171 169 } 172 170 }); 173 171 174 module.exports = Select; 175 No newline at end of file 172 module.exports = Select; -
src/wp-includes/js/media/views/frame/video-details.js
1 /*globals _, wp */2 3 1 /** 4 2 * wp.media.view.MediaFrame.VideoDetails 5 3 * … … 134 132 } 135 133 }); 136 134 137 module.exports = VideoDetails; 138 No newline at end of file 135 module.exports = VideoDetails; -
src/wp-includes/js/media/views/frame.js
1 /*globals _, Backbone */2 3 1 /** 4 2 * wp.media.view.Frame 5 3 * … … 169 167 // Make the `Frame` a `StateMachine`. 170 168 _.extend( Frame.prototype, StateMachine.prototype ); 171 169 172 module.exports = Frame; 173 No newline at end of file 170 module.exports = Frame; -
src/wp-includes/js/media/views/iframe.js
22 22 } 23 23 }); 24 24 25 module.exports = Iframe; 26 No newline at end of file 25 module.exports = Iframe; -
src/wp-includes/js/media/views/image-details.js
1 /*globals _, wp, jQuery */2 3 1 /** 4 2 * wp.media.view.ImageDetails 5 3 * … … 73 71 postRender: function() { 74 72 setTimeout( _.bind( this.resetFocus, this ), 10 ); 75 73 this.toggleLinkSettings(); 76 if ( getUserSetting( 'advImgDetails' ) === 'show' ) {74 if ( window.getUserSetting( 'advImgDetails' ) === 'show' ) { 77 75 this.toggleAdvanced( true ); 78 76 } 79 77 this.trigger( 'post-render' ); … … 146 144 mode = 'show'; 147 145 } 148 146 149 setUserSetting( 'advImgDetails', mode );147 window.setUserSetting( 'advImgDetails', mode ); 150 148 }, 151 149 152 150 editAttachment: function( event ) { … … 165 163 } 166 164 }); 167 165 168 module.exports = AttachmentDisplay; 169 No newline at end of file 166 module.exports = AttachmentDisplay; -
src/wp-includes/js/media/views/label.js
22 22 } 23 23 }); 24 24 25 module.exports = Label; 26 No newline at end of file 25 module.exports = Label; -
src/wp-includes/js/media/views/media-details.js
1 /*globals _, wp, jQuery */2 3 1 /** 4 2 * wp.media.view.MediaDetails 5 3 * … … 83 81 */ 84 82 setPlayer : function() { 85 83 if ( ! this.players.length && this.media ) { 86 this.players.push( new MediaElementPlayer( this.media, this.settings ) );84 this.players.push( new window.MediaElementPlayer( this.media, this.settings ) ); 87 85 } 88 86 }, 89 87 … … 111 109 */ 112 110 render: function() { 113 111 AttachmentDisplay.prototype.render.apply( this, arguments ); 114 112 115 113 setTimeout( _.bind( function() { 116 114 this.resetFocus(); 117 115 }, this ), 10 ); … … 149 147 } 150 148 }); 151 149 152 module.exports = MediaDetails; 153 No newline at end of file 150 module.exports = MediaDetails; -
src/wp-includes/js/media/views/media-frame.js
1 /*globals _, wp, jQuery */2 3 1 /** 4 2 * wp.media.view.MediaFrame 5 3 * … … 251 249 }; 252 250 }); 253 251 254 module.exports = MediaFrame; 255 No newline at end of file 252 module.exports = MediaFrame; -
src/wp-includes/js/media/views/menu-item.js
1 /*globals wp, jQuery */2 3 1 /** 4 2 * wp.media.view.MenuItem 5 3 * … … 70 68 } 71 69 }); 72 70 73 module.exports = MenuItem; 74 No newline at end of file 71 module.exports = MenuItem; -
src/wp-includes/js/media/views/menu.js
112 112 } 113 113 }); 114 114 115 module.exports = Menu; 116 No newline at end of file 115 module.exports = Menu; -
src/wp-includes/js/media/views/modal.js
1 /*globals _, wp, jQuery */2 3 1 /** 4 2 * wp.media.view.Modal 5 3 * … … 212 210 } 213 211 }); 214 212 215 module.exports = Modal; 216 No newline at end of file 213 module.exports = Modal; -
src/wp-includes/js/media/views/priority-list.js
1 /*globals _, Backbone */2 3 1 /** 4 2 * wp.media.view.PriorityList 5 3 * … … 97 95 } 98 96 }); 99 97 100 module.exports = PriorityList; 101 No newline at end of file 98 module.exports = PriorityList; -
src/wp-includes/js/media/views/router-item.js
22 22 } 23 23 }); 24 24 25 module.exports = RouterItem; 26 No newline at end of file 25 module.exports = RouterItem; -
src/wp-includes/js/media/views/router.js
33 33 } 34 34 }); 35 35 36 module.exports = Router; 37 No newline at end of file 36 module.exports = Router; -
src/wp-includes/js/media/views/search.js
1 /*globals wp */2 3 1 /** 4 2 * wp.media.view.Search 5 3 * … … 46 44 } 47 45 }); 48 46 49 module.exports = Search; 50 No newline at end of file 47 module.exports = Search; -
src/wp-includes/js/media/views/selection.js
1 /*globals _, Backbone, wp */2 3 1 /** 4 2 * wp.media.view.Selection 5 3 * … … 82 80 } 83 81 }); 84 82 85 module.exports = Selection; 86 No newline at end of file 83 module.exports = Selection; -
src/wp-includes/js/media/views/settings/attachment-display.js
1 /*globals _, wp */2 3 1 /** 4 2 * wp.media.view.Settings.AttachmentDisplay 5 3 * … … 91 89 } 92 90 }); 93 91 94 module.exports = AttachmentDisplay; 95 No newline at end of file 92 module.exports = AttachmentDisplay; -
src/wp-includes/js/media/views/settings/gallery.js
1 /*globals wp */2 3 1 /** 4 2 * wp.media.view.Settings.Gallery 5 3 * … … 17 15 template: wp.template('gallery-settings') 18 16 }); 19 17 20 module.exports = Gallery; 21 No newline at end of file 18 module.exports = Gallery; -
src/wp-includes/js/media/views/settings/playlist.js
1 /*globals wp */2 3 1 /** 4 2 * wp.media.view.Settings.Playlist 5 3 * … … 17 15 template: wp.template('playlist-settings') 18 16 }); 19 17 20 module.exports = Playlist; 21 No newline at end of file 18 module.exports = Playlist; -
src/wp-includes/js/media/views/settings.js
1 /*globals _, Backbone, jQuery */2 3 1 /** 4 2 * wp.media.view.Settings 5 3 * … … 107 105 // If the setting has a corresponding user setting, 108 106 // update that as well. 109 107 if ( userSetting = $setting.data('userSetting') ) { 110 setUserSetting( userSetting, value );108 window.setUserSetting( userSetting, value ); 111 109 } 112 110 }, 113 111 … … 118 116 } 119 117 }); 120 118 121 module.exports = Settings; 122 No newline at end of file 119 module.exports = Settings; -
src/wp-includes/js/media/views/sidebar.js
14 14 className: 'media-sidebar' 15 15 }); 16 16 17 module.exports = Sidebar; 18 No newline at end of file 17 module.exports = Sidebar; -
src/wp-includes/js/media/views/spinner.js
1 /*globals _, wp */2 3 1 /** 4 2 * wp.media.view.Spinner 5 3 * … … 35 33 } 36 34 }); 37 35 38 module.exports = Spinner; 39 No newline at end of file 36 module.exports = Spinner; -
src/wp-includes/js/media/views/toolbar/embed.js
1 /*globals _, wp */2 3 1 /** 4 2 * wp.media.view.Toolbar.Embed 5 3 * … … 34 32 } 35 33 }); 36 34 37 module.exports = Embed; 38 No newline at end of file 35 module.exports = Embed; -
src/wp-includes/js/media/views/toolbar/select.js
1 /*globals _, wp */2 3 1 /** 4 2 * wp.media.view.Toolbar.Select 5 3 * … … 67 65 } 68 66 }); 69 67 70 module.exports = Select; 71 No newline at end of file 68 module.exports = Select; -
src/wp-includes/js/media/views/toolbar.js
1 /*globals Backbone, _ */2 3 1 /** 4 2 * wp.media.view.Toolbar 5 3 * … … 159 157 } 160 158 }); 161 159 162 module.exports = Toolbar; 163 No newline at end of file 160 module.exports = Toolbar; -
src/wp-includes/js/media/views/uploader/editor.js
1 /*globals _, wp, jQuery */2 3 1 /** 4 2 * Creates a dropzone on WP editor instances (elements with .wp-editor-wrap 5 3 * or #wp-fullscreen-body) and relays drag'n'dropped files to a media workflow. … … 216 214 } 217 215 }); 218 216 219 module.exports = EditorUploader; 220 No newline at end of file 217 module.exports = EditorUploader; -
src/wp-includes/js/media/views/uploader/inline.js
1 /*globals _, wp */2 3 1 /** 4 2 * wp.media.view.UploaderInline 5 3 * … … 129 127 130 128 }); 131 129 132 module.exports = UploaderInline; 133 No newline at end of file 130 module.exports = UploaderInline; -
src/wp-includes/js/media/views/uploader/status-error.js
1 /*globals wp */2 3 1 /** 4 2 * wp.media.view.UploaderStatusError 5 3 * … … 16 14 template: wp.template('uploader-status-error') 17 15 }); 18 16 19 module.exports = UploaderStatusError; 20 No newline at end of file 17 module.exports = UploaderStatusError; -
src/wp-includes/js/media/views/uploader/status.js
1 /*globals _, wp */2 3 1 /** 4 2 * wp.media.view.UploaderStatus 5 3 * … … 136 134 } 137 135 }); 138 136 139 module.exports = UploaderStatus; 140 No newline at end of file 137 module.exports = UploaderStatus; -
src/wp-includes/js/media/views/uploader/window.js
1 /*globals _, wp, jQuery */2 3 1 /** 4 2 * wp.media.view.UploaderWindow 5 3 * … … 109 107 } 110 108 }); 111 109 112 module.exports = UploaderWindow; 113 No newline at end of file 110 module.exports = UploaderWindow; -
src/wp-includes/js/media/views/video-details.js
1 /*globals wp */2 3 1 /** 4 2 * wp.media.view.VideoDetails 5 3 * … … 40 38 } 41 39 }); 42 40 43 module.exports = VideoDetails; 44 No newline at end of file 41 module.exports = VideoDetails; -
src/wp-includes/js/media/views/view.js
1 /*globals wp */2 3 1 /** 4 2 * wp.media.View 5 3 * … … 63 61 } 64 62 }); 65 63 66 module.exports = View; 67 No newline at end of file 64 module.exports = View; -
src/wp-includes/js/media/views.js
1 1 (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ 2 /*globals _, wp */3 4 2 /** 5 3 * wp.media.controller.CollectionAdd 6 4 * … … 100 98 }); 101 99 102 100 module.exports = CollectionAdd; 103 },{"./library.js":10}],2:[function(require,module,exports){104 /*globals wp, jQuery, Backbone */105 101 102 },{"./library.js":10}],2:[function(require,module,exports){ 106 103 /** 107 104 * wp.media.controller.CollectionEdit 108 105 * … … 263 260 }); 264 261 265 262 module.exports = CollectionEdit; 266 },{"../views/attachment/edit-library.js":25,"../views/view.js":71,"./library.js":10}],3:[function(require,module,exports){267 /*globals _, wp, Backbone */268 263 264 },{"../views/attachment/edit-library.js":25,"../views/view.js":71,"./library.js":10}],3:[function(require,module,exports){ 269 265 /** 270 266 * wp.media.controller.Cropper 271 267 * … … 341 337 342 338 this.$el.text(l10n.cropping); 343 339 this.$el.attr('disabled', true); 344 340 345 341 controller.state().doCrop( selection ).done( function( croppedImage ) { 346 342 controller.trigger('cropped', croppedImage ); 347 343 controller.close(); … … 383 379 }); 384 380 385 381 module.exports = Cropper; 386 },{"../views/cropper.js":34,"../views/toolbar.js":63,"./state.js":15}],4:[function(require,module,exports){387 /*globals _, wp */388 382 383 },{"../views/cropper.js":34,"../views/toolbar.js":63,"./state.js":15}],4:[function(require,module,exports){ 389 384 /** 390 385 * wp.media.controller.EditImage 391 386 * … … 462 457 }); 463 458 464 459 module.exports = EditImage; 465 },{"../views/toolbar.js":63,"./state.js":15}],5:[function(require,module,exports){466 /*globals _, wp, jQuery, Backbone */467 460 461 },{"../views/toolbar.js":63,"./state.js":15}],5:[function(require,module,exports){ 468 462 /** 469 463 * wp.media.controller.Embed 470 464 * … … 600 594 }); 601 595 602 596 module.exports = Embed; 603 },{"./state.js":15}],6:[function(require,module,exports){604 /*globals _, wp */605 597 598 },{"./state.js":15}],6:[function(require,module,exports){ 606 599 /** 607 600 * wp.media.controller.FeaturedImage 608 601 * … … 723 716 }); 724 717 725 718 module.exports = FeaturedImage; 726 },{"./library.js":10}],7:[function(require,module,exports){727 /*globals _, wp */728 719 720 },{"./library.js":10}],7:[function(require,module,exports){ 729 721 /** 730 722 * A state for selecting more images to add to a gallery. 731 723 * … … 777 769 */ 778 770 initialize: function() { 779 771 // If a library wasn't supplied, create a library of images. 780 if ( ! this.get('library') ) 772 if ( ! this.get('library') ) { 781 773 this.set( 'library', wp.media.query({ type: 'image' }) ); 774 } 782 775 783 776 Library.prototype.initialize.apply( this, arguments ); 784 777 }, … … 790 783 var library = this.get('library'), 791 784 edit = this.frame.state('gallery-edit').get('library'); 792 785 793 if ( this.editLibrary && this.editLibrary !== edit ) 786 if ( this.editLibrary && this.editLibrary !== edit ) { 794 787 library.unobserve( this.editLibrary ); 788 } 795 789 796 790 // Accepts attachments that exist in the original library and 797 791 // that do not exist in gallery's library. … … 811 805 }); 812 806 813 807 module.exports = GalleryAdd; 814 },{"./library.js":10}],8:[function(require,module,exports){815 /*globals wp, Backbone */816 808 809 },{"./library.js":10}],8:[function(require,module,exports){ 817 810 /** 818 811 * wp.media.controller.GalleryEdit 819 812 * … … 875 868 */ 876 869 initialize: function() { 877 870 // If we haven't been provided a `library`, create a `Selection`. 878 if ( ! this.get('library') ) 871 if ( ! this.get('library') ) { 879 872 this.set( 'library', new wp.media.model.Selection() ); 873 } 880 874 881 875 // The single `Attachment` view to be used in the `Attachments` view. 882 if ( ! this.get('AttachmentView') ) 876 if ( ! this.get('AttachmentView') ) { 883 877 this.set( 'AttachmentView', EditLibraryView ); 878 } 879 884 880 Library.prototype.initialize.apply( this, arguments ); 885 881 }, 886 882 … … 951 947 }); 952 948 953 949 module.exports = GalleryEdit; 954 },{"../views/attachment/edit-library.js":25,"../views/settings/gallery.js":59,"./library.js":10}],9:[function(require,module,exports){955 /*globals _, wp */956 950 951 },{"../views/attachment/edit-library.js":25,"../views/settings/gallery.js":59,"./library.js":10}],9:[function(require,module,exports){ 957 952 /** 958 953 * wp.media.controller.ImageDetails 959 954 * … … 1014 1009 }); 1015 1010 1016 1011 module.exports = ImageDetails; 1017 },{"./library.js":10,"./state.js":15}],10:[function(require,module,exports){1018 /*globals _, wp, Backbone, getUserSetting, setUserSetting */1019 1012 1013 },{"./library.js":10,"./state.js":15}],10:[function(require,module,exports){ 1020 1014 /** 1021 1015 * wp.media.controller.Library 1022 1016 * … … 1054 1048 var selectionSync = require( '../utils/selection-sync.js' ), 1055 1049 State = require( './state.js' ), 1056 1050 l10n = wp.media.view.l10n, 1051 getUserSetting = window.getUserSetting, 1052 setUserSetting = window.setUserSetting, 1057 1053 Library; 1058 1054 1059 1055 Library = State.extend({ … … 1088 1084 this.set( 'library', wp.media.query() ); 1089 1085 } 1090 1086 1091 if ( ! ( selection instanceof Selection) ) {1087 if ( ! ( selection instanceof wp.media.model.Selection ) ) { 1092 1088 props = selection; 1093 1089 1094 1090 if ( ! props ) { … … 1287 1283 _.extend( Library.prototype, selectionSync ); 1288 1284 1289 1285 module.exports = Library; 1290 },{"../utils/selection-sync.js":16,"./state.js":15}],11:[function(require,module,exports){1291 /*globals _, wp */1292 1286 1287 },{"../utils/selection-sync.js":16,"./state.js":15}],11:[function(require,module,exports){ 1293 1288 /** 1294 1289 * wp.media.controller.MediaLibrary 1295 1290 * … … 1338 1333 }); 1339 1334 1340 1335 module.exports = MediaLibrary; 1341 },{"./library.js":10}],12:[function(require,module,exports){1342 /*globals _, Backbone */1343 1336 1337 },{"./library.js":10}],12:[function(require,module,exports){ 1344 1338 /** 1345 1339 * wp.media.controller.Region 1346 1340 * … … 1518 1512 }); 1519 1513 1520 1514 module.exports = Region; 1521 },{}],13:[function(require,module,exports){1522 /*globals _, wp */1523 1515 1516 },{}],13:[function(require,module,exports){ 1524 1517 /** 1525 1518 * wp.media.controller.ReplaceImage 1526 1519 * … … 1627 1620 }); 1628 1621 1629 1622 module.exports = ReplaceImage; 1630 },{"./library.js":10}],14:[function(require,module,exports){1631 /*globals _, Backbone */1632 1623 1624 },{"./library.js":10}],14:[function(require,module,exports){ 1633 1625 /** 1634 1626 * wp.media.controller.StateMachine 1635 1627 * … … 1752 1744 }); 1753 1745 1754 1746 module.exports = StateMachine; 1755 },{}],15:[function(require,module,exports){1756 /*globals _, Backbone */1757 1747 1748 },{}],15:[function(require,module,exports){ 1758 1749 /** 1759 1750 * wp.media.controller.State 1760 1751 * … … 1994 1985 }); 1995 1986 1996 1987 module.exports = State; 1997 },{}],16:[function(require,module,exports){1998 /*globals _ */1999 1988 1989 },{}],16:[function(require,module,exports){ 2000 1990 /** 2001 1991 * wp.media.selectionSync 2002 1992 * … … 2061 2051 }; 2062 2052 2063 2053 module.exports = selectionSync; 2064 },{}],17:[function(require,module,exports){2065 /* global _wpMediaViewsL10n, confirm, getUserSetting, setUserSetting */2066 ( function( $, _ ) {2067 var l10n,2068 media = wp.media;2069 2070 media.isTouchDevice = ( 'ontouchend' in document );2071 2072 // Link any localized strings.2073 l10n = media.view.l10n = typeof _wpMediaViewsL10n === 'undefined' ? {} : _wpMediaViewsL10n;2074 2075 // Link any settings.2076 media.view.settings = l10n.settings || {};2077 delete l10n.settings;2078 2079 // Copy the `post` setting over to the model settings.2080 media.model.settings.post = media.view.settings.post;2081 2082 // Check if the browser supports CSS 3.0 transitions2083 $.support.transition = (function(){2084 var style = document.documentElement.style,2085 transitions = {2086 WebkitTransition: 'webkitTransitionEnd',2087 MozTransition: 'transitionend',2088 OTransition: 'oTransitionEnd otransitionend',2089 transition: 'transitionend'2090 }, transition;2091 2054 2092 transition = _.find( _.keys( transitions ), function( transition ) { 2093 return ! _.isUndefined( style[ transition ] ); 2094 }); 2055 },{}],17:[function(require,module,exports){ 2056 var media = wp.media, 2057 $ = jQuery, 2058 l10n; 2095 2059 2096 return transition && { 2097 end: transitions[ transition ] 2098 }; 2099 }()); 2060 media.isTouchDevice = ( 'ontouchend' in document ); 2100 2061 2101 /** 2102 * A shared event bus used to provide events into 2103 * the media workflows that 3rd-party devs can use to hook 2104 * in. 2105 */ 2106 media.events = _.extend( {}, Backbone.Events ); 2062 // Link any localized strings. 2063 l10n = media.view.l10n = window._wpMediaViewsL10n || {}; 2107 2064 2108 /** 2109 * Makes it easier to bind events using transitions. 2110 * 2111 * @param {string} selector 2112 * @param {Number} sensitivity 2113 * @returns {Promise} 2114 */ 2115 media.transition = function( selector, sensitivity ) { 2116 var deferred = $.Deferred(); 2065 // Link any settings. 2066 media.view.settings = l10n.settings || {}; 2067 delete l10n.settings; 2068 2069 // Copy the `post` setting over to the model settings. 2070 media.model.settings.post = media.view.settings.post; 2071 2072 // Check if the browser supports CSS 3.0 transitions 2073 $.support.transition = (function(){ 2074 var style = document.documentElement.style, 2075 transitions = { 2076 WebkitTransition: 'webkitTransitionEnd', 2077 MozTransition: 'transitionend', 2078 OTransition: 'oTransitionEnd otransitionend', 2079 transition: 'transitionend' 2080 }, transition; 2081 2082 transition = _.find( _.keys( transitions ), function( transition ) { 2083 return ! _.isUndefined( style[ transition ] ); 2084 }); 2117 2085 2118 sensitivity = sensitivity || 2000; 2086 return transition && { 2087 end: transitions[ transition ] 2088 }; 2089 }()); 2119 2090 2120 if ( $.support.transition ) { 2121 if ( ! (selector instanceof $) ) { 2122 selector = $( selector ); 2123 } 2091 /** 2092 * A shared event bus used to provide events into 2093 * the media workflows that 3rd-party devs can use to hook 2094 * in. 2095 */ 2096 media.events = _.extend( {}, Backbone.Events ); 2124 2097 2125 // Resolve the deferred when the first element finishes animating. 2126 selector.first().one( $.support.transition.end, deferred.resolve ); 2098 /** 2099 * Makes it easier to bind events using transitions. 2100 * 2101 * @param {string} selector 2102 * @param {Number} sensitivity 2103 * @returns {Promise} 2104 */ 2105 media.transition = function( selector, sensitivity ) { 2106 var deferred = $.Deferred(); 2127 2107 2128 // Just in case the event doesn't trigger, fire a callback. 2129 _.delay( deferred.resolve, sensitivity ); 2108 sensitivity = sensitivity || 2000; 2130 2109 2131 // Otherwise, execute on the spot.2132 } else{2133 deferred.resolve();2110 if ( $.support.transition ) { 2111 if ( ! (selector instanceof $) ) { 2112 selector = $( selector ); 2134 2113 } 2135 2114 2136 return deferred.promise();2137 };2115 // Resolve the deferred when the first element finishes animating. 2116 selector.first().one( $.support.transition.end, deferred.resolve ); 2138 2117 2139 media.controller.Region = require( './controllers/region.js' ); 2140 media.controller.StateMachine = require( './controllers/state-machine.js' ); 2141 media.controller.State = require( './controllers/state.js' ); 2142 2143 media.selectionSync = require( './utils/selection-sync.js' ); 2144 media.controller.Library = require( './controllers/library.js' ); 2145 media.controller.ImageDetails = require( './controllers/image-details.js' ); 2146 media.controller.GalleryEdit = require( './controllers/gallery-edit.js' ); 2147 media.controller.GalleryAdd = require( './controllers/gallery-add.js' ); 2148 media.controller.CollectionEdit = require( './controllers/collection-edit.js' ); 2149 media.controller.CollectionAdd = require( './controllers/collection-add.js' ); 2150 media.controller.FeaturedImage = require( './controllers/featured-image.js' ); 2151 media.controller.ReplaceImage = require( './controllers/replace-image.js' ); 2152 media.controller.EditImage = require( './controllers/edit-image.js' ); 2153 media.controller.MediaLibrary = require( './controllers/media-library.js' ); 2154 media.controller.Embed = require( './controllers/embed.js' ); 2155 media.controller.Cropper = require( './controllers/cropper.js' ); 2156 2157 media.View = require( './views/view.js' ); 2158 media.view.Frame = require( './views/view.js' ); 2159 media.view.MediaFrame = require( './views/media-frame.js' ); 2160 media.view.MediaFrame.Select = require( './views/frame/select.js' ); 2161 media.view.MediaFrame.Post = require( './views/frame/post.js' ); 2162 media.view.MediaFrame.ImageDetails = require( './views/frame/image-details.js' ); 2163 media.view.Modal = require( './views/modal.js' ); 2164 media.view.FocusManager = require( './views/focus-manager.js' ); 2165 media.view.UploaderWindow = require( './views/uploader/window.js' ); 2166 media.view.EditorUploader = require( './views/uploader/editor.js' ); 2167 media.view.UploaderInline = require( './views/uploader/inline.js' ); 2168 media.view.UploaderStatus = require( './views/uploader/status.js' ); 2169 media.view.UploaderStatusError = require( './views/uploader/status-error.js' ); 2170 media.view.Toolbar = require( './views/toolbar.js' ); 2171 media.view.Toolbar.Select = require( './views/toolbar/select.js' ); 2172 media.view.Toolbar.Embed = require( './views/toolbar/embed.js' ); 2173 media.view.Button = require( './views/button.js' ); 2174 media.view.ButtonGroup = require( './views/button-group.js' ); 2175 media.view.PriorityList = require( './views/priority-list.js' ); 2176 media.view.MenuItem = require( './views/menu-item.js' ); 2177 media.view.Menu = require( './views/menu.js' ); 2178 media.view.RouterItem = require( './views/router-item.js' ); 2179 media.view.Router = require( './views/router.js' ); 2180 media.view.Sidebar = require( './views/sidebar.js' ); 2181 media.view.Attachment = require( './views/attachment.js' ); 2182 media.view.Attachment.Library = require( './views/attachment/library.js' ); 2183 media.view.Attachment.EditLibrary = require( './views/attachment/edit-library.js' ); 2184 media.view.Attachments = require( './views/attachments.js' ); 2185 media.view.Search = require( './views/search.js' ); 2186 media.view.AttachmentFilters = require( './views/attachment-filters.js' ); 2187 media.view.DateFilter = require( './views/attachment-filters/date.js' ); 2188 media.view.AttachmentFilters.Uploaded = require( './views/attachment-filters/uploaded.js' ); 2189 media.view.AttachmentFilters.All = require( './views/attachment-filters/all.js' ); 2190 media.view.AttachmentsBrowser = require( './views/attachments/browser.js' ); 2191 media.view.Selection = require( './views/selection.js' ); 2192 media.view.Attachment.Selection = require( './views/attachment/selection.js' ); 2193 media.view.Attachments.Selection = require( './views/attachments/selection.js' ); 2194 media.view.Attachment.EditSelection = require( './views/attachment/edit-selection.js' ); 2195 media.view.Settings = require( './views/settings.js' ); 2196 media.view.Settings.AttachmentDisplay = require( './views/settings/attachment-display.js' ); 2197 media.view.Settings.Gallery = require( './views/settings/gallery.js' ); 2198 media.view.Settings.Playlist = require( './views/settings/playlist.js' ); 2199 media.view.Attachment.Details = require( './views/attachment/details.js' ); 2200 media.view.AttachmentCompat = require( './views/attachment-compat.js' ); 2201 media.view.Iframe = require( './views/iframe.js' ); 2202 media.view.Embed = require( './views/embed.js' ); 2203 media.view.Label = require( './views/label.js' ); 2204 media.view.EmbedUrl = require( './views/embed/url.js' ); 2205 media.view.EmbedLink = require( './views/embed/link.js' ); 2206 media.view.EmbedImage = require( './views/embed/image.js' ); 2207 media.view.ImageDetails = require( './views/image-details.js' ); 2208 media.view.Cropper = require( './views/cropper.js' ); 2209 media.view.EditImage = require( './views/edit-image.js' ); 2210 media.view.Spinner = require( './views/spinner.js' ); 2118 // Just in case the event doesn't trigger, fire a callback. 2119 _.delay( deferred.resolve, sensitivity ); 2211 2120 2212 }(jQuery, _)); 2213 },{"./controllers/collection-add.js":1,"./controllers/collection-edit.js":2,"./controllers/cropper.js":3,"./controllers/edit-image.js":4,"./controllers/embed.js":5,"./controllers/featured-image.js":6,"./controllers/gallery-add.js":7,"./controllers/gallery-edit.js":8,"./controllers/image-details.js":9,"./controllers/library.js":10,"./controllers/media-library.js":11,"./controllers/region.js":12,"./controllers/replace-image.js":13,"./controllers/state-machine.js":14,"./controllers/state.js":15,"./utils/selection-sync.js":16,"./views/attachment-compat.js":18,"./views/attachment-filters.js":19,"./views/attachment-filters/all.js":20,"./views/attachment-filters/date.js":21,"./views/attachment-filters/uploaded.js":22,"./views/attachment.js":23,"./views/attachment/details.js":24,"./views/attachment/edit-library.js":25,"./views/attachment/edit-selection.js":26,"./views/attachment/library.js":27,"./views/attachment/selection.js":28,"./views/attachments.js":29,"./views/attachments/browser.js":30,"./views/attachments/selection.js":31,"./views/button-group.js":32,"./views/button.js":33,"./views/cropper.js":34,"./views/edit-image.js":35,"./views/embed.js":36,"./views/embed/image.js":37,"./views/embed/link.js":38,"./views/embed/url.js":39,"./views/focus-manager.js":40,"./views/frame/image-details.js":42,"./views/frame/post.js":43,"./views/frame/select.js":44,"./views/iframe.js":45,"./views/image-details.js":46,"./views/label.js":47,"./views/media-frame.js":48,"./views/menu-item.js":49,"./views/menu.js":50,"./views/modal.js":51,"./views/priority-list.js":52,"./views/router-item.js":53,"./views/router.js":54,"./views/search.js":55,"./views/selection.js":56,"./views/settings.js":57,"./views/settings/attachment-display.js":58,"./views/settings/gallery.js":59,"./views/settings/playlist.js":60,"./views/sidebar.js":61,"./views/spinner.js":62,"./views/toolbar.js":63,"./views/toolbar/embed.js":64,"./views/toolbar/select.js":65,"./views/uploader/editor.js":66,"./views/uploader/inline.js":67,"./views/uploader/status-error.js":68,"./views/uploader/status.js":69,"./views/uploader/window.js":70,"./views/view.js":71}],18:[function(require,module,exports){ 2214 /*globals _ */ 2121 // Otherwise, execute on the spot. 2122 } else { 2123 deferred.resolve(); 2124 } 2125 2126 return deferred.promise(); 2127 }; 2215 2128 2129 media.controller.Region = require( './controllers/region.js' ); 2130 media.controller.StateMachine = require( './controllers/state-machine.js' ); 2131 media.controller.State = require( './controllers/state.js' ); 2132 2133 media.selectionSync = require( './utils/selection-sync.js' ); 2134 media.controller.Library = require( './controllers/library.js' ); 2135 media.controller.ImageDetails = require( './controllers/image-details.js' ); 2136 media.controller.GalleryEdit = require( './controllers/gallery-edit.js' ); 2137 media.controller.GalleryAdd = require( './controllers/gallery-add.js' ); 2138 media.controller.CollectionEdit = require( './controllers/collection-edit.js' ); 2139 media.controller.CollectionAdd = require( './controllers/collection-add.js' ); 2140 media.controller.FeaturedImage = require( './controllers/featured-image.js' ); 2141 media.controller.ReplaceImage = require( './controllers/replace-image.js' ); 2142 media.controller.EditImage = require( './controllers/edit-image.js' ); 2143 media.controller.MediaLibrary = require( './controllers/media-library.js' ); 2144 media.controller.Embed = require( './controllers/embed.js' ); 2145 media.controller.Cropper = require( './controllers/cropper.js' ); 2146 2147 media.View = require( './views/view.js' ); 2148 media.view.Frame = require( './views/view.js' ); 2149 media.view.MediaFrame = require( './views/media-frame.js' ); 2150 media.view.MediaFrame.Select = require( './views/frame/select.js' ); 2151 media.view.MediaFrame.Post = require( './views/frame/post.js' ); 2152 media.view.MediaFrame.ImageDetails = require( './views/frame/image-details.js' ); 2153 media.view.Modal = require( './views/modal.js' ); 2154 media.view.FocusManager = require( './views/focus-manager.js' ); 2155 media.view.UploaderWindow = require( './views/uploader/window.js' ); 2156 media.view.EditorUploader = require( './views/uploader/editor.js' ); 2157 media.view.UploaderInline = require( './views/uploader/inline.js' ); 2158 media.view.UploaderStatus = require( './views/uploader/status.js' ); 2159 media.view.UploaderStatusError = require( './views/uploader/status-error.js' ); 2160 media.view.Toolbar = require( './views/toolbar.js' ); 2161 media.view.Toolbar.Select = require( './views/toolbar/select.js' ); 2162 media.view.Toolbar.Embed = require( './views/toolbar/embed.js' ); 2163 media.view.Button = require( './views/button.js' ); 2164 media.view.ButtonGroup = require( './views/button-group.js' ); 2165 media.view.PriorityList = require( './views/priority-list.js' ); 2166 media.view.MenuItem = require( './views/menu-item.js' ); 2167 media.view.Menu = require( './views/menu.js' ); 2168 media.view.RouterItem = require( './views/router-item.js' ); 2169 media.view.Router = require( './views/router.js' ); 2170 media.view.Sidebar = require( './views/sidebar.js' ); 2171 media.view.Attachment = require( './views/attachment.js' ); 2172 media.view.Attachment.Library = require( './views/attachment/library.js' ); 2173 media.view.Attachment.EditLibrary = require( './views/attachment/edit-library.js' ); 2174 media.view.Attachments = require( './views/attachments.js' ); 2175 media.view.Search = require( './views/search.js' ); 2176 media.view.AttachmentFilters = require( './views/attachment-filters.js' ); 2177 media.view.DateFilter = require( './views/attachment-filters/date.js' ); 2178 media.view.AttachmentFilters.Uploaded = require( './views/attachment-filters/uploaded.js' ); 2179 media.view.AttachmentFilters.All = require( './views/attachment-filters/all.js' ); 2180 media.view.AttachmentsBrowser = require( './views/attachments/browser.js' ); 2181 media.view.Selection = require( './views/selection.js' ); 2182 media.view.Attachment.Selection = require( './views/attachment/selection.js' ); 2183 media.view.Attachments.Selection = require( './views/attachments/selection.js' ); 2184 media.view.Attachment.EditSelection = require( './views/attachment/edit-selection.js' ); 2185 media.view.Settings = require( './views/settings.js' ); 2186 media.view.Settings.AttachmentDisplay = require( './views/settings/attachment-display.js' ); 2187 media.view.Settings.Gallery = require( './views/settings/gallery.js' ); 2188 media.view.Settings.Playlist = require( './views/settings/playlist.js' ); 2189 media.view.Attachment.Details = require( './views/attachment/details.js' ); 2190 media.view.AttachmentCompat = require( './views/attachment-compat.js' ); 2191 media.view.Iframe = require( './views/iframe.js' ); 2192 media.view.Embed = require( './views/embed.js' ); 2193 media.view.Label = require( './views/label.js' ); 2194 media.view.EmbedUrl = require( './views/embed/url.js' ); 2195 media.view.EmbedLink = require( './views/embed/link.js' ); 2196 media.view.EmbedImage = require( './views/embed/image.js' ); 2197 media.view.ImageDetails = require( './views/image-details.js' ); 2198 media.view.Cropper = require( './views/cropper.js' ); 2199 media.view.EditImage = require( './views/edit-image.js' ); 2200 media.view.Spinner = require( './views/spinner.js' ); 2201 2202 },{"./controllers/collection-add.js":1,"./controllers/collection-edit.js":2,"./controllers/cropper.js":3,"./controllers/edit-image.js":4,"./controllers/embed.js":5,"./controllers/featured-image.js":6,"./controllers/gallery-add.js":7,"./controllers/gallery-edit.js":8,"./controllers/image-details.js":9,"./controllers/library.js":10,"./controllers/media-library.js":11,"./controllers/region.js":12,"./controllers/replace-image.js":13,"./controllers/state-machine.js":14,"./controllers/state.js":15,"./utils/selection-sync.js":16,"./views/attachment-compat.js":18,"./views/attachment-filters.js":19,"./views/attachment-filters/all.js":20,"./views/attachment-filters/date.js":21,"./views/attachment-filters/uploaded.js":22,"./views/attachment.js":23,"./views/attachment/details.js":24,"./views/attachment/edit-library.js":25,"./views/attachment/edit-selection.js":26,"./views/attachment/library.js":27,"./views/attachment/selection.js":28,"./views/attachments.js":29,"./views/attachments/browser.js":30,"./views/attachments/selection.js":31,"./views/button-group.js":32,"./views/button.js":33,"./views/cropper.js":34,"./views/edit-image.js":35,"./views/embed.js":36,"./views/embed/image.js":37,"./views/embed/link.js":38,"./views/embed/url.js":39,"./views/focus-manager.js":40,"./views/frame/image-details.js":42,"./views/frame/post.js":43,"./views/frame/select.js":44,"./views/iframe.js":45,"./views/image-details.js":46,"./views/label.js":47,"./views/media-frame.js":48,"./views/menu-item.js":49,"./views/menu.js":50,"./views/modal.js":51,"./views/priority-list.js":52,"./views/router-item.js":53,"./views/router.js":54,"./views/search.js":55,"./views/selection.js":56,"./views/settings.js":57,"./views/settings/attachment-display.js":58,"./views/settings/gallery.js":59,"./views/settings/playlist.js":60,"./views/sidebar.js":61,"./views/spinner.js":62,"./views/toolbar.js":63,"./views/toolbar/embed.js":64,"./views/toolbar/select.js":65,"./views/uploader/editor.js":66,"./views/uploader/inline.js":67,"./views/uploader/status-error.js":68,"./views/uploader/status.js":69,"./views/uploader/window.js":70,"./views/view.js":71}],18:[function(require,module,exports){ 2216 2203 /** 2217 2204 * wp.media.view.AttachmentCompat 2218 2205 * … … 2296 2283 }); 2297 2284 2298 2285 module.exports = AttachmentCompat; 2299 },{"./view.js":71}],19:[function(require,module,exports){2300 /*globals _, jQuery */2301 2286 2287 },{"./view.js":71}],19:[function(require,module,exports){ 2302 2288 /** 2303 2289 * wp.media.view.AttachmentFilters 2304 2290 * … … 2375 2361 }); 2376 2362 2377 2363 module.exports = AttachmentFilters; 2378 },{"./view.js":71}],20:[function(require,module,exports){2379 /*globals _, wp */2380 2364 2365 },{"./view.js":71}],20:[function(require,module,exports){ 2381 2366 /** 2382 2367 * wp.media.view.AttachmentFilters.All 2383 2368 * … … 2467 2452 }); 2468 2453 2469 2454 module.exports = All; 2470 },{"../attachment-filters.js":19}],21:[function(require,module,exports){2471 /*globals _, wp */2472 2455 2456 },{"../attachment-filters.js":19}],21:[function(require,module,exports){ 2473 2457 /** 2474 2458 * A filter dropdown for month/dates. 2475 2459 * … … 2510 2494 }); 2511 2495 2512 2496 module.exports = DateFilter; 2513 },{"../attachment-filters.js":19}],22:[function(require,module,exports){2514 /*globals wp */2515 2497 2498 },{"../attachment-filters.js":19}],22:[function(require,module,exports){ 2516 2499 /** 2517 2500 * wp.media.view.AttachmentFilters.Uploaded 2518 2501 * … … 2571 2554 }); 2572 2555 2573 2556 module.exports = Uploaded; 2574 },{"../attachment-filters.js":19}],23:[function(require,module,exports){2575 /*globals _, wp, jQuery */2576 2557 2558 },{"../attachment-filters.js":19}],23:[function(require,module,exports){ 2577 2559 /** 2578 2560 * wp.media.view.Attachment 2579 2561 * … … 3126 3108 }); 3127 3109 3128 3110 module.exports = Attachment; 3129 },{"./view.js":71}],24:[function(require,module,exports){3130 /*globals _, wp */3131 3111 3112 },{"./view.js":71}],24:[function(require,module,exports){ 3132 3113 /** 3133 3114 * wp.media.view.Attachment.Details 3134 3115 * … … 3188 3169 deleteAttachment: function( event ) { 3189 3170 event.preventDefault(); 3190 3171 3191 if ( confirm( l10n.warnDelete ) ) {3172 if ( window.confirm( l10n.warnDelete ) ) { 3192 3173 this.model.destroy(); 3193 3174 // Keep focus inside media modal 3194 3175 // after image is deleted … … 3267 3248 }); 3268 3249 3269 3250 module.exports = Details; 3251 3270 3252 },{"../attachment.js":23}],25:[function(require,module,exports){ 3271 3253 /** 3272 3254 * wp.media.view.Attachment.EditLibrary … … 3287 3269 }); 3288 3270 3289 3271 module.exports = EditLibrary; 3272 3290 3273 },{"../attachment.js":23}],26:[function(require,module,exports){ 3291 3274 /** 3292 3275 * wp.media.view.Attachments.EditSelection … … 3308 3291 }); 3309 3292 3310 3293 module.exports = EditSelection; 3294 3311 3295 },{"./selection.js":28}],27:[function(require,module,exports){ 3312 3296 /** 3313 3297 * wp.media.view.Attachment.Library … … 3328 3312 }); 3329 3313 3330 3314 module.exports = Library; 3315 3331 3316 },{"../attachment.js":23}],28:[function(require,module,exports){ 3332 3317 /** 3333 3318 * wp.media.view.Attachment.Selection … … 3352 3337 }); 3353 3338 3354 3339 module.exports = Selection; 3355 },{"../attachment.js":23}],29:[function(require,module,exports){3356 /*globals _, wp, jQuery */3357 3340 3341 },{"../attachment.js":23}],29:[function(require,module,exports){ 3358 3342 /** 3359 3343 * wp.media.view.Attachments 3360 3344 * … … 3627 3611 3628 3612 // The scroll event occurs on the document, but the element 3629 3613 // that should be checked is the document body. 3630 if ( el == document ) {3614 if ( el === document ) { 3631 3615 el = document.body; 3632 3616 scrollTop = $(document).scrollTop(); 3633 3617 } … … 3653 3637 }); 3654 3638 3655 3639 module.exports = Attachments; 3656 },{"./attachment.js":23,"./view.js":71}],30:[function(require,module,exports){3657 /*globals _, wp, jQuery */3658 3640 3641 },{"./attachment.js":23,"./view.js":71}],30:[function(require,module,exports){ 3659 3642 /** 3660 3643 * wp.media.view.AttachmentsBrowser 3661 3644 * … … 3846 3829 return; 3847 3830 } 3848 3831 3849 if ( ! mediaTrash && ! confirm( l10n.warnBulkDelete ) ) {3832 if ( ! mediaTrash && ! window.confirm( l10n.warnBulkDelete ) ) { 3850 3833 return; 3851 3834 } 3852 3835 3853 3836 if ( mediaTrash && 3854 3837 'trash' !== selection.at( 0 ).get( 'status' ) && 3855 ! confirm( l10n.warnBulkTrash ) ) {3838 ! window.confirm( l10n.warnBulkTrash ) ) { 3856 3839 3857 3840 return; 3858 3841 } … … 3900 3883 click: function() { 3901 3884 var removed = [], selection = this.controller.state().get( 'selection' ); 3902 3885 3903 if ( ! selection.length || ! confirm( l10n.warnBulkDelete ) ) {3886 if ( ! selection.length || ! window.confirm( l10n.warnBulkDelete ) ) { 3904 3887 return; 3905 3888 } 3906 3889 … … 4113 4096 }); 4114 4097 4115 4098 module.exports = AttachmentsBrowser; 4116 },{"../attachment-compat.js":18,"../attachment-filters/all.js":20,"../attachment-filters/date.js":21,"../attachment-filters/uploaded.js":22,"../attachment/details.js":24,"../attachment/library.js":27,"../attachments.js":29,"../label.js":47,"../search.js":55,"../settings/attachment-display.js":58,"../sidebar.js":61,"../spinner.js":62,"../toolbar.js":63,"../uploader/inline.js":67,"../uploader/status.js":69,"../view.js":71}],31:[function(require,module,exports){4117 /*globals _ */4118 4099 4100 },{"../attachment-compat.js":18,"../attachment-filters/all.js":20,"../attachment-filters/date.js":21,"../attachment-filters/uploaded.js":22,"../attachment/details.js":24,"../attachment/library.js":27,"../attachments.js":29,"../label.js":47,"../search.js":55,"../settings/attachment-display.js":58,"../sidebar.js":61,"../spinner.js":62,"../toolbar.js":63,"../uploader/inline.js":67,"../uploader/status.js":69,"../view.js":71}],31:[function(require,module,exports){ 4119 4101 /** 4120 4102 * wp.media.view.Attachments.Selection 4121 4103 * … … 4145 4127 }); 4146 4128 4147 4129 module.exports = Selection; 4148 },{"../attachment/selection.js":28,"../attachments.js":29}],32:[function(require,module,exports){4149 /*globals _, Backbone, jQuery */4150 4130 4131 },{"../attachment/selection.js":28,"../attachments.js":29}],32:[function(require,module,exports){ 4151 4132 /** 4152 4133 * wp.media.view.ButtonGroup 4153 4134 * … … 4194 4175 }); 4195 4176 4196 4177 module.exports = ButtonGroup; 4197 },{"./button.js":33,"./view.js":71}],33:[function(require,module,exports){4198 /*globals _, Backbone */4199 4178 4179 },{"./button.js":33,"./view.js":71}],33:[function(require,module,exports){ 4200 4180 /** 4201 4181 * wp.media.view.Button 4202 4182 * … … 4284 4264 }); 4285 4265 4286 4266 module.exports = Button; 4287 },{"./view.js":71}],34:[function(require,module,exports){4288 /*globals _, wp, jQuery */4289 4267 4268 },{"./view.js":71}],34:[function(require,module,exports){ 4290 4269 /** 4291 4270 * wp.media.view.Cropper 4292 4271 * … … 4347 4326 4348 4327 this.views.add( '.upload-errors', new UploaderStatusError({ 4349 4328 filename: UploaderStatus.prototype.filename(filename), 4350 message: _wpMediaViewsL10n.cropError4329 message: window._wpMediaViewsL10n.cropError 4351 4330 }), { at: 0 }); 4352 4331 } 4353 4332 }); 4354 4333 4355 4334 module.exports = Cropper; 4356 },{"./uploader/status-error.js":68,"./uploader/status.js":69,"./view.js":71}],35:[function(require,module,exports){4357 /*globals _, wp */4358 4335 4336 },{"./uploader/status-error.js":68,"./uploader/status.js":69,"./view.js":71}],35:[function(require,module,exports){ 4359 4337 var View = require( './view.js' ), 4360 4338 EditImage; 4361 4339 … … 4407 4385 }); 4408 4386 4409 4387 module.exports = EditImage; 4388 4410 4389 },{"./view.js":71}],36:[function(require,module,exports){ 4411 4390 /** 4412 4391 * wp.media.view.Embed … … 4476 4455 }); 4477 4456 4478 4457 module.exports = Embed; 4479 },{"./embed/image.js":37,"./embed/link.js":38,"./embed/url.js":39,"./view.js":71}],37:[function(require,module,exports){4480 /*globals wp */4481 4458 4459 },{"./embed/image.js":37,"./embed/link.js":38,"./embed/url.js":39,"./view.js":71}],37:[function(require,module,exports){ 4482 4460 /** 4483 4461 * wp.media.view.EmbedImage 4484 4462 * … … 4510 4488 }); 4511 4489 4512 4490 module.exports = EmbedImage; 4513 },{"../settings/attachment-display.js":58}],38:[function(require,module,exports){4514 /*globals _, wp, jQuery */4515 4491 4492 },{"../settings/attachment-display.js":58}],38:[function(require,module,exports){ 4516 4493 /** 4517 4494 * wp.media.view.EmbedLink 4518 4495 * … … 4578 4555 }); 4579 4556 4580 4557 module.exports = EmbedLink; 4581 },{"../settings.js":57}],39:[function(require,module,exports){4582 /*globals _, wp, jQuery */4583 4558 4559 },{"../settings.js":57}],39:[function(require,module,exports){ 4584 4560 /** 4585 4561 * wp.media.view.EmbedUrl 4586 4562 * … … 4658 4634 }); 4659 4635 4660 4636 module.exports = EmbedUrl; 4637 4661 4638 },{"../view.js":71}],40:[function(require,module,exports){ 4662 4639 /** 4663 4640 * wp.media.view.FocusManager … … 4706 4683 }); 4707 4684 4708 4685 module.exports = FocusManager; 4709 },{"./view.js":71}],41:[function(require,module,exports){4710 /*globals _, Backbone */4711 4686 4687 },{"./view.js":71}],41:[function(require,module,exports){ 4712 4688 /** 4713 4689 * wp.media.view.Frame 4714 4690 * … … 4879 4855 _.extend( Frame.prototype, StateMachine.prototype ); 4880 4856 4881 4857 module.exports = Frame; 4882 },{"../controllers/region.js":12,"../controllers/state-machine.js":14,"../controllers/state.js":15,"./view.js":71}],42:[function(require,module,exports){4883 /*globals wp */4884 4858 4859 },{"../controllers/region.js":12,"../controllers/state-machine.js":14,"../controllers/state.js":15,"./view.js":71}],42:[function(require,module,exports){ 4885 4860 /** 4886 4861 * wp.media.view.MediaFrame.ImageDetails 4887 4862 * … … 5063 5038 }); 5064 5039 5065 5040 module.exports = ImageDetails; 5066 },{"../../controllers/edit-image.js":4,"../../controllers/image-details.js":9,"../../controllers/replace-image.js":13,"../edit-image.js":35,"../image-details.js":46,"../toolbar.js":63,"./select.js":44}],43:[function(require,module,exports){5067 /*globals _, wp */5068 5041 5042 },{"../../controllers/edit-image.js":4,"../../controllers/image-details.js":9,"../../controllers/replace-image.js":13,"../edit-image.js":35,"../image-details.js":46,"../toolbar.js":63,"./select.js":44}],43:[function(require,module,exports){ 5069 5043 /** 5070 5044 * wp.media.view.MediaFrame.Post 5071 5045 * … … 5815 5789 }); 5816 5790 5817 5791 module.exports = Post; 5818 },{"../../controllers/collection-add.js":1,"../../controllers/collection-edit.js":2,"../../controllers/edit-image.js":4,"../../controllers/embed.js":5,"../../controllers/featured-image.js":6,"../../controllers/gallery-add.js":7,"../../controllers/gallery-edit.js":8,"../../controllers/library.js":10,"../attachment/edit-selection.js":26,"../attachments/browser.js":30,"../edit-image.js":35,"../embed.js":36,"../selection.js":56,"../settings/playlist.js":60,"../toolbar.js":63,"../toolbar/embed.js":64,"../view.js":71,"./select.js":44}],44:[function(require,module,exports){5819 /*globals _, wp */5820 5792 5793 },{"../../controllers/collection-add.js":1,"../../controllers/collection-edit.js":2,"../../controllers/edit-image.js":4,"../../controllers/embed.js":5,"../../controllers/featured-image.js":6,"../../controllers/gallery-add.js":7,"../../controllers/gallery-edit.js":8,"../../controllers/library.js":10,"../attachment/edit-selection.js":26,"../attachments/browser.js":30,"../edit-image.js":35,"../embed.js":36,"../selection.js":56,"../settings/playlist.js":60,"../toolbar.js":63,"../toolbar/embed.js":64,"../view.js":71,"./select.js":44}],44:[function(require,module,exports){ 5821 5794 /** 5822 5795 * wp.media.view.MediaFrame.Select 5823 5796 * … … 5990 5963 }); 5991 5964 5992 5965 module.exports = Select; 5966 5993 5967 },{"../../controllers/library.js":10,"../attachments/browser.js":30,"../media-frame.js":48,"../toolbar/select.js":65,"../uploader/inline.js":67}],45:[function(require,module,exports){ 5994 5968 /** 5995 5969 * wp.media.view.Iframe … … 6016 5990 }); 6017 5991 6018 5992 module.exports = Iframe; 6019 },{"./view.js":71}],46:[function(require,module,exports){6020 /*globals _, wp, jQuery */6021 5993 5994 },{"./view.js":71}],46:[function(require,module,exports){ 6022 5995 /** 6023 5996 * wp.media.view.ImageDetails 6024 5997 * … … 6092 6065 postRender: function() { 6093 6066 setTimeout( _.bind( this.resetFocus, this ), 10 ); 6094 6067 this.toggleLinkSettings(); 6095 if ( getUserSetting( 'advImgDetails' ) === 'show' ) {6068 if ( window.getUserSetting( 'advImgDetails' ) === 'show' ) { 6096 6069 this.toggleAdvanced( true ); 6097 6070 } 6098 6071 this.trigger( 'post-render' ); … … 6165 6138 mode = 'show'; 6166 6139 } 6167 6140 6168 setUserSetting( 'advImgDetails', mode );6141 window.setUserSetting( 'advImgDetails', mode ); 6169 6142 }, 6170 6143 6171 6144 editAttachment: function( event ) { … … 6185 6158 }); 6186 6159 6187 6160 module.exports = AttachmentDisplay; 6161 6188 6162 },{"./settings/attachment-display.js":58}],47:[function(require,module,exports){ 6189 6163 /** 6190 6164 * @class … … 6211 6185 }); 6212 6186 6213 6187 module.exports = Label; 6214 },{"./view.js":71}],48:[function(require,module,exports){6215 /*globals _, wp, jQuery */6216 6188 6189 },{"./view.js":71}],48:[function(require,module,exports){ 6217 6190 /** 6218 6191 * wp.media.view.MediaFrame 6219 6192 * … … 6466 6439 }); 6467 6440 6468 6441 module.exports = MediaFrame; 6469 },{"./frame.js":41,"./iframe.js":45,"./menu.js":50,"./modal.js":51,"./router.js":54,"./toolbar.js":63,"./uploader/window.js":70,"./view.js":71}],49:[function(require,module,exports){6470 /*globals wp, jQuery */6471 6442 6443 },{"./frame.js":41,"./iframe.js":45,"./menu.js":50,"./modal.js":51,"./router.js":54,"./toolbar.js":63,"./uploader/window.js":70,"./view.js":71}],49:[function(require,module,exports){ 6472 6444 /** 6473 6445 * wp.media.view.MenuItem 6474 6446 * … … 6540 6512 }); 6541 6513 6542 6514 module.exports = MenuItem; 6515 6543 6516 },{"./view.js":71}],50:[function(require,module,exports){ 6544 6517 /** 6545 6518 * wp.media.view.Menu … … 6656 6629 }); 6657 6630 6658 6631 module.exports = Menu; 6659 },{"./menu-item.js":49,"./priority-list.js":52}],51:[function(require,module,exports){6660 /*globals _, wp, jQuery */6661 6632 6633 },{"./menu-item.js":49,"./priority-list.js":52}],51:[function(require,module,exports){ 6662 6634 /** 6663 6635 * wp.media.view.Modal 6664 6636 * … … 6872 6844 }); 6873 6845 6874 6846 module.exports = Modal; 6875 },{"./focus-manager.js":40,"./view.js":71}],52:[function(require,module,exports){6876 /*globals _, Backbone */6877 6847 6848 },{"./focus-manager.js":40,"./view.js":71}],52:[function(require,module,exports){ 6878 6849 /** 6879 6850 * wp.media.view.PriorityList 6880 6851 * … … 6973 6944 }); 6974 6945 6975 6946 module.exports = PriorityList; 6947 6976 6948 },{"./view.js":71}],53:[function(require,module,exports){ 6977 6949 /** 6978 6950 * wp.media.view.RouterItem … … 6999 6971 }); 7000 6972 7001 6973 module.exports = RouterItem; 6974 7002 6975 },{"./menu-item.js":49}],54:[function(require,module,exports){ 7003 6976 /** 7004 6977 * wp.media.view.Router … … 7036 7009 }); 7037 7010 7038 7011 module.exports = Router; 7039 },{"./menu.js":50,"./router-item.js":53}],55:[function(require,module,exports){7040 /*globals wp */7041 7012 7013 },{"./menu.js":50,"./router-item.js":53}],55:[function(require,module,exports){ 7042 7014 /** 7043 7015 * wp.media.view.Search 7044 7016 * … … 7086 7058 }); 7087 7059 7088 7060 module.exports = Search; 7089 },{"./view.js":71}],56:[function(require,module,exports){7090 /*globals _, Backbone, wp */7091 7061 7062 },{"./view.js":71}],56:[function(require,module,exports){ 7092 7063 /** 7093 7064 * wp.media.view.Selection 7094 7065 * … … 7172 7143 }); 7173 7144 7174 7145 module.exports = Selection; 7175 },{"./attachments/selection.js":31,"./view.js":71}],57:[function(require,module,exports){7176 /*globals _, Backbone, jQuery */7177 7146 7147 },{"./attachments/selection.js":31,"./view.js":71}],57:[function(require,module,exports){ 7178 7148 /** 7179 7149 * wp.media.view.Settings 7180 7150 * … … 7282 7252 // If the setting has a corresponding user setting, 7283 7253 // update that as well. 7284 7254 if ( userSetting = $setting.data('userSetting') ) { 7285 setUserSetting( userSetting, value );7255 window.setUserSetting( userSetting, value ); 7286 7256 } 7287 7257 }, 7288 7258 … … 7294 7264 }); 7295 7265 7296 7266 module.exports = Settings; 7297 },{"./view.js":71}],58:[function(require,module,exports){7298 /*globals _, wp */7299 7267 7268 },{"./view.js":71}],58:[function(require,module,exports){ 7300 7269 /** 7301 7270 * wp.media.view.Settings.AttachmentDisplay 7302 7271 * … … 7389 7358 }); 7390 7359 7391 7360 module.exports = AttachmentDisplay; 7392 },{"../settings.js":57}],59:[function(require,module,exports){7393 /*globals wp */7394 7361 7362 },{"../settings.js":57}],59:[function(require,module,exports){ 7395 7363 /** 7396 7364 * wp.media.view.Settings.Gallery 7397 7365 * … … 7410 7378 }); 7411 7379 7412 7380 module.exports = Gallery; 7413 },{"../settings.js":57}],60:[function(require,module,exports){7414 /*globals wp */7415 7381 7382 },{"../settings.js":57}],60:[function(require,module,exports){ 7416 7383 /** 7417 7384 * wp.media.view.Settings.Playlist 7418 7385 * … … 7431 7398 }); 7432 7399 7433 7400 module.exports = Playlist; 7401 7434 7402 },{"../settings.js":57}],61:[function(require,module,exports){ 7435 7403 /** 7436 7404 * wp.media.view.Sidebar … … 7449 7417 }); 7450 7418 7451 7419 module.exports = Sidebar; 7452 },{"./priority-list.js":52}],62:[function(require,module,exports){7453 /*globals _, wp */7454 7420 7421 },{"./priority-list.js":52}],62:[function(require,module,exports){ 7455 7422 /** 7456 7423 * wp.media.view.Spinner 7457 7424 * … … 7488 7455 }); 7489 7456 7490 7457 module.exports = Spinner; 7491 },{"./view.js":71}],63:[function(require,module,exports){7492 /*globals Backbone, _ */7493 7458 7459 },{"./view.js":71}],63:[function(require,module,exports){ 7494 7460 /** 7495 7461 * wp.media.view.Toolbar 7496 7462 * … … 7651 7617 }); 7652 7618 7653 7619 module.exports = Toolbar; 7654 },{"./button.js":33,"./priority-list.js":52,"./view.js":71}],64:[function(require,module,exports){7655 /*globals _, wp */7656 7620 7621 },{"./button.js":33,"./priority-list.js":52,"./view.js":71}],64:[function(require,module,exports){ 7657 7622 /** 7658 7623 * wp.media.view.Toolbar.Embed 7659 7624 * … … 7689 7654 }); 7690 7655 7691 7656 module.exports = Embed; 7692 },{"./select.js":65}],65:[function(require,module,exports){7693 /*globals _, wp */7694 7657 7658 },{"./select.js":65}],65:[function(require,module,exports){ 7695 7659 /** 7696 7660 * wp.media.view.Toolbar.Select 7697 7661 * … … 7760 7724 }); 7761 7725 7762 7726 module.exports = Select; 7763 },{"../toolbar.js":63}],66:[function(require,module,exports){7764 /*globals _, wp, jQuery */7765 7727 7728 },{"../toolbar.js":63}],66:[function(require,module,exports){ 7766 7729 /** 7767 7730 * Creates a dropzone on WP editor instances (elements with .wp-editor-wrap 7768 7731 * or #wp-fullscreen-body) and relays drag'n'dropped files to a media workflow. … … 7980 7943 }); 7981 7944 7982 7945 module.exports = EditorUploader; 7983 },{"../view.js":71}],67:[function(require,module,exports){7984 /*globals _, wp */7985 7946 7947 },{"../view.js":71}],67:[function(require,module,exports){ 7986 7948 /** 7987 7949 * wp.media.view.UploaderInline 7988 7950 * … … 8113 8075 }); 8114 8076 8115 8077 module.exports = UploaderInline; 8116 },{"../view.js":71,"./status.js":69}],68:[function(require,module,exports){8117 /*globals wp */8118 8078 8079 },{"../view.js":71,"./status.js":69}],68:[function(require,module,exports){ 8119 8080 /** 8120 8081 * wp.media.view.UploaderStatusError 8121 8082 * … … 8133 8094 }); 8134 8095 8135 8096 module.exports = UploaderStatusError; 8136 },{"../view.js":71}],69:[function(require,module,exports){8137 /*globals _, wp */8138 8097 8098 },{"../view.js":71}],69:[function(require,module,exports){ 8139 8099 /** 8140 8100 * wp.media.view.UploaderStatus 8141 8101 * … … 8273 8233 }); 8274 8234 8275 8235 module.exports = UploaderStatus; 8276 },{"../view.js":71,"./status-error.js":68}],70:[function(require,module,exports){8277 /*globals _, wp, jQuery */8278 8236 8237 },{"../view.js":71,"./status-error.js":68}],70:[function(require,module,exports){ 8279 8238 /** 8280 8239 * wp.media.view.UploaderWindow 8281 8240 * … … 8386 8345 }); 8387 8346 8388 8347 module.exports = UploaderWindow; 8389 },{"../view.js":71}],71:[function(require,module,exports){8390 /*globals wp */8391 8348 8349 },{"../view.js":71}],71:[function(require,module,exports){ 8392 8350 /** 8393 8351 * wp.media.View 8394 8352 * … … 8453 8411 }); 8454 8412 8455 8413 module.exports = View; 8414 8456 8415 },{}]},{},[17]); -
src/wp-includes/js/media/views.manifest.js
1 /* global _wpMediaViewsL10n, confirm, getUserSetting, setUserSetting */ 2 ( function( $, _ ) { 3 var l10n, 4 media = wp.media; 5 6 media.isTouchDevice = ( 'ontouchend' in document ); 7 8 // Link any localized strings. 9 l10n = media.view.l10n = typeof _wpMediaViewsL10n === 'undefined' ? {} : _wpMediaViewsL10n; 10 11 // Link any settings. 12 media.view.settings = l10n.settings || {}; 13 delete l10n.settings; 14 15 // Copy the `post` setting over to the model settings. 16 media.model.settings.post = media.view.settings.post; 17 18 // Check if the browser supports CSS 3.0 transitions 19 $.support.transition = (function(){ 20 var style = document.documentElement.style, 21 transitions = { 22 WebkitTransition: 'webkitTransitionEnd', 23 MozTransition: 'transitionend', 24 OTransition: 'oTransitionEnd otransitionend', 25 transition: 'transitionend' 26 }, transition; 27 28 transition = _.find( _.keys( transitions ), function( transition ) { 29 return ! _.isUndefined( style[ transition ] ); 30 }); 31 32 return transition && { 33 end: transitions[ transition ] 34 }; 35 }()); 36 37 /** 38 * A shared event bus used to provide events into 39 * the media workflows that 3rd-party devs can use to hook 40 * in. 41 */ 42 media.events = _.extend( {}, Backbone.Events ); 43 44 /** 45 * Makes it easier to bind events using transitions. 46 * 47 * @param {string} selector 48 * @param {Number} sensitivity 49 * @returns {Promise} 50 */ 51 media.transition = function( selector, sensitivity ) { 52 var deferred = $.Deferred(); 53 54 sensitivity = sensitivity || 2000; 55 56 if ( $.support.transition ) { 57 if ( ! (selector instanceof $) ) { 58 selector = $( selector ); 59 } 60 61 // Resolve the deferred when the first element finishes animating. 62 selector.first().one( $.support.transition.end, deferred.resolve ); 63 64 // Just in case the event doesn't trigger, fire a callback. 65 _.delay( deferred.resolve, sensitivity ); 66 67 // Otherwise, execute on the spot. 68 } else { 69 deferred.resolve(); 70 } 1 var media = wp.media, 2 $ = jQuery, 3 l10n; 4 5 media.isTouchDevice = ( 'ontouchend' in document ); 6 7 // Link any localized strings. 8 l10n = media.view.l10n = window._wpMediaViewsL10n || {}; 9 10 // Link any settings. 11 media.view.settings = l10n.settings || {}; 12 delete l10n.settings; 13 14 // Copy the `post` setting over to the model settings. 15 media.model.settings.post = media.view.settings.post; 16 17 // Check if the browser supports CSS 3.0 transitions 18 $.support.transition = (function(){ 19 var style = document.documentElement.style, 20 transitions = { 21 WebkitTransition: 'webkitTransitionEnd', 22 MozTransition: 'transitionend', 23 OTransition: 'oTransitionEnd otransitionend', 24 transition: 'transitionend' 25 }, transition; 26 27 transition = _.find( _.keys( transitions ), function( transition ) { 28 return ! _.isUndefined( style[ transition ] ); 29 }); 71 30 72 return deferred.promise(); 31 return transition && { 32 end: transitions[ transition ] 73 33 }; 34 }()); 35 36 /** 37 * A shared event bus used to provide events into 38 * the media workflows that 3rd-party devs can use to hook 39 * in. 40 */ 41 media.events = _.extend( {}, Backbone.Events ); 42 43 /** 44 * Makes it easier to bind events using transitions. 45 * 46 * @param {string} selector 47 * @param {Number} sensitivity 48 * @returns {Promise} 49 */ 50 media.transition = function( selector, sensitivity ) { 51 var deferred = $.Deferred(); 52 53 sensitivity = sensitivity || 2000; 54 55 if ( $.support.transition ) { 56 if ( ! (selector instanceof $) ) { 57 selector = $( selector ); 58 } 59 60 // Resolve the deferred when the first element finishes animating. 61 selector.first().one( $.support.transition.end, deferred.resolve ); 74 62 75 media.controller.Region = require( './controllers/region.js' ); 76 media.controller.StateMachine = require( './controllers/state-machine.js' ); 77 media.controller.State = require( './controllers/state.js' ); 78 79 media.selectionSync = require( './utils/selection-sync.js' ); 80 media.controller.Library = require( './controllers/library.js' ); 81 media.controller.ImageDetails = require( './controllers/image-details.js' ); 82 media.controller.GalleryEdit = require( './controllers/gallery-edit.js' ); 83 media.controller.GalleryAdd = require( './controllers/gallery-add.js' ); 84 media.controller.CollectionEdit = require( './controllers/collection-edit.js' ); 85 media.controller.CollectionAdd = require( './controllers/collection-add.js' ); 86 media.controller.FeaturedImage = require( './controllers/featured-image.js' ); 87 media.controller.ReplaceImage = require( './controllers/replace-image.js' ); 88 media.controller.EditImage = require( './controllers/edit-image.js' ); 89 media.controller.MediaLibrary = require( './controllers/media-library.js' ); 90 media.controller.Embed = require( './controllers/embed.js' ); 91 media.controller.Cropper = require( './controllers/cropper.js' ); 92 93 media.View = require( './views/view.js' ); 94 media.view.Frame = require( './views/view.js' ); 95 media.view.MediaFrame = require( './views/media-frame.js' ); 96 media.view.MediaFrame.Select = require( './views/frame/select.js' ); 97 media.view.MediaFrame.Post = require( './views/frame/post.js' ); 98 media.view.MediaFrame.ImageDetails = require( './views/frame/image-details.js' ); 99 media.view.Modal = require( './views/modal.js' ); 100 media.view.FocusManager = require( './views/focus-manager.js' ); 101 media.view.UploaderWindow = require( './views/uploader/window.js' ); 102 media.view.EditorUploader = require( './views/uploader/editor.js' ); 103 media.view.UploaderInline = require( './views/uploader/inline.js' ); 104 media.view.UploaderStatus = require( './views/uploader/status.js' ); 105 media.view.UploaderStatusError = require( './views/uploader/status-error.js' ); 106 media.view.Toolbar = require( './views/toolbar.js' ); 107 media.view.Toolbar.Select = require( './views/toolbar/select.js' ); 108 media.view.Toolbar.Embed = require( './views/toolbar/embed.js' ); 109 media.view.Button = require( './views/button.js' ); 110 media.view.ButtonGroup = require( './views/button-group.js' ); 111 media.view.PriorityList = require( './views/priority-list.js' ); 112 media.view.MenuItem = require( './views/menu-item.js' ); 113 media.view.Menu = require( './views/menu.js' ); 114 media.view.RouterItem = require( './views/router-item.js' ); 115 media.view.Router = require( './views/router.js' ); 116 media.view.Sidebar = require( './views/sidebar.js' ); 117 media.view.Attachment = require( './views/attachment.js' ); 118 media.view.Attachment.Library = require( './views/attachment/library.js' ); 119 media.view.Attachment.EditLibrary = require( './views/attachment/edit-library.js' ); 120 media.view.Attachments = require( './views/attachments.js' ); 121 media.view.Search = require( './views/search.js' ); 122 media.view.AttachmentFilters = require( './views/attachment-filters.js' ); 123 media.view.DateFilter = require( './views/attachment-filters/date.js' ); 124 media.view.AttachmentFilters.Uploaded = require( './views/attachment-filters/uploaded.js' ); 125 media.view.AttachmentFilters.All = require( './views/attachment-filters/all.js' ); 126 media.view.AttachmentsBrowser = require( './views/attachments/browser.js' ); 127 media.view.Selection = require( './views/selection.js' ); 128 media.view.Attachment.Selection = require( './views/attachment/selection.js' ); 129 media.view.Attachments.Selection = require( './views/attachments/selection.js' ); 130 media.view.Attachment.EditSelection = require( './views/attachment/edit-selection.js' ); 131 media.view.Settings = require( './views/settings.js' ); 132 media.view.Settings.AttachmentDisplay = require( './views/settings/attachment-display.js' ); 133 media.view.Settings.Gallery = require( './views/settings/gallery.js' ); 134 media.view.Settings.Playlist = require( './views/settings/playlist.js' ); 135 media.view.Attachment.Details = require( './views/attachment/details.js' ); 136 media.view.AttachmentCompat = require( './views/attachment-compat.js' ); 137 media.view.Iframe = require( './views/iframe.js' ); 138 media.view.Embed = require( './views/embed.js' ); 139 media.view.Label = require( './views/label.js' ); 140 media.view.EmbedUrl = require( './views/embed/url.js' ); 141 media.view.EmbedLink = require( './views/embed/link.js' ); 142 media.view.EmbedImage = require( './views/embed/image.js' ); 143 media.view.ImageDetails = require( './views/image-details.js' ); 144 media.view.Cropper = require( './views/cropper.js' ); 145 media.view.EditImage = require( './views/edit-image.js' ); 146 media.view.Spinner = require( './views/spinner.js' ); 63 // Just in case the event doesn't trigger, fire a callback. 64 _.delay( deferred.resolve, sensitivity ); 147 65 148 }(jQuery, _)); 149 No newline at end of file 66 // Otherwise, execute on the spot. 67 } else { 68 deferred.resolve(); 69 } 70 71 return deferred.promise(); 72 }; 73 74 media.controller.Region = require( './controllers/region.js' ); 75 media.controller.StateMachine = require( './controllers/state-machine.js' ); 76 media.controller.State = require( './controllers/state.js' ); 77 78 media.selectionSync = require( './utils/selection-sync.js' ); 79 media.controller.Library = require( './controllers/library.js' ); 80 media.controller.ImageDetails = require( './controllers/image-details.js' ); 81 media.controller.GalleryEdit = require( './controllers/gallery-edit.js' ); 82 media.controller.GalleryAdd = require( './controllers/gallery-add.js' ); 83 media.controller.CollectionEdit = require( './controllers/collection-edit.js' ); 84 media.controller.CollectionAdd = require( './controllers/collection-add.js' ); 85 media.controller.FeaturedImage = require( './controllers/featured-image.js' ); 86 media.controller.ReplaceImage = require( './controllers/replace-image.js' ); 87 media.controller.EditImage = require( './controllers/edit-image.js' ); 88 media.controller.MediaLibrary = require( './controllers/media-library.js' ); 89 media.controller.Embed = require( './controllers/embed.js' ); 90 media.controller.Cropper = require( './controllers/cropper.js' ); 91 92 media.View = require( './views/view.js' ); 93 media.view.Frame = require( './views/view.js' ); 94 media.view.MediaFrame = require( './views/media-frame.js' ); 95 media.view.MediaFrame.Select = require( './views/frame/select.js' ); 96 media.view.MediaFrame.Post = require( './views/frame/post.js' ); 97 media.view.MediaFrame.ImageDetails = require( './views/frame/image-details.js' ); 98 media.view.Modal = require( './views/modal.js' ); 99 media.view.FocusManager = require( './views/focus-manager.js' ); 100 media.view.UploaderWindow = require( './views/uploader/window.js' ); 101 media.view.EditorUploader = require( './views/uploader/editor.js' ); 102 media.view.UploaderInline = require( './views/uploader/inline.js' ); 103 media.view.UploaderStatus = require( './views/uploader/status.js' ); 104 media.view.UploaderStatusError = require( './views/uploader/status-error.js' ); 105 media.view.Toolbar = require( './views/toolbar.js' ); 106 media.view.Toolbar.Select = require( './views/toolbar/select.js' ); 107 media.view.Toolbar.Embed = require( './views/toolbar/embed.js' ); 108 media.view.Button = require( './views/button.js' ); 109 media.view.ButtonGroup = require( './views/button-group.js' ); 110 media.view.PriorityList = require( './views/priority-list.js' ); 111 media.view.MenuItem = require( './views/menu-item.js' ); 112 media.view.Menu = require( './views/menu.js' ); 113 media.view.RouterItem = require( './views/router-item.js' ); 114 media.view.Router = require( './views/router.js' ); 115 media.view.Sidebar = require( './views/sidebar.js' ); 116 media.view.Attachment = require( './views/attachment.js' ); 117 media.view.Attachment.Library = require( './views/attachment/library.js' ); 118 media.view.Attachment.EditLibrary = require( './views/attachment/edit-library.js' ); 119 media.view.Attachments = require( './views/attachments.js' ); 120 media.view.Search = require( './views/search.js' ); 121 media.view.AttachmentFilters = require( './views/attachment-filters.js' ); 122 media.view.DateFilter = require( './views/attachment-filters/date.js' ); 123 media.view.AttachmentFilters.Uploaded = require( './views/attachment-filters/uploaded.js' ); 124 media.view.AttachmentFilters.All = require( './views/attachment-filters/all.js' ); 125 media.view.AttachmentsBrowser = require( './views/attachments/browser.js' ); 126 media.view.Selection = require( './views/selection.js' ); 127 media.view.Attachment.Selection = require( './views/attachment/selection.js' ); 128 media.view.Attachments.Selection = require( './views/attachments/selection.js' ); 129 media.view.Attachment.EditSelection = require( './views/attachment/edit-selection.js' ); 130 media.view.Settings = require( './views/settings.js' ); 131 media.view.Settings.AttachmentDisplay = require( './views/settings/attachment-display.js' ); 132 media.view.Settings.Gallery = require( './views/settings/gallery.js' ); 133 media.view.Settings.Playlist = require( './views/settings/playlist.js' ); 134 media.view.Attachment.Details = require( './views/attachment/details.js' ); 135 media.view.AttachmentCompat = require( './views/attachment-compat.js' ); 136 media.view.Iframe = require( './views/iframe.js' ); 137 media.view.Embed = require( './views/embed.js' ); 138 media.view.Label = require( './views/label.js' ); 139 media.view.EmbedUrl = require( './views/embed/url.js' ); 140 media.view.EmbedLink = require( './views/embed/link.js' ); 141 media.view.EmbedImage = require( './views/embed/image.js' ); 142 media.view.ImageDetails = require( './views/image-details.js' ); 143 media.view.Cropper = require( './views/cropper.js' ); 144 media.view.EditImage = require( './views/edit-image.js' ); 145 media.view.Spinner = require( './views/spinner.js' );