Changeset 63516
- Timestamp:
- 09/07/2026 02:26:49 PM (83 minutes ago)
- Location:
- trunk/src/js/media
- Files:
-
- 31 edited
-
controllers/collection-add.js (modified) (2 diffs)
-
controllers/collection-edit.js (modified) (3 diffs)
-
controllers/featured-image.js (modified) (4 diffs)
-
controllers/image-details.js (modified) (2 diffs)
-
controllers/library.js (modified) (11 diffs)
-
controllers/media-library.js (modified) (2 diffs)
-
controllers/replace-image.js (modified) (4 diffs)
-
controllers/state-machine.js (modified) (3 diffs)
-
controllers/state.js (modified) (11 diffs)
-
models/attachment.js (modified) (1 diff)
-
models/attachments.js (modified) (23 diffs)
-
models/query.js (modified) (2 diffs)
-
utils/selection-sync.js (modified) (1 diff)
-
views/attachment-compat.js (modified) (5 diffs)
-
views/attachment-filters.js (modified) (3 diffs)
-
views/attachment.js (modified) (4 diffs)
-
views/attachments/browser.js (modified) (12 diffs)
-
views/button.js (modified) (2 diffs)
-
views/embed.js (modified) (4 diffs)
-
views/frame/manage.js (modified) (10 diffs)
-
views/frame/post.js (modified) (27 diffs)
-
views/iframe.js (modified) (1 diff)
-
views/media-details.js (modified) (12 diffs)
-
views/media-frame.js (modified) (17 diffs)
-
views/menu-item.js (modified) (2 diffs)
-
views/menu.js (modified) (9 diffs)
-
views/search.js (modified) (2 diffs)
-
views/settings.js (modified) (6 diffs)
-
views/settings/attachment-display.js (modified) (4 diffs)
-
views/toolbar.js (modified) (6 diffs)
-
views/view.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/media/controllers/collection-add.js
r63408 r63516 52 52 53 53 /** 54 * Initializes the CollectionAdd controller. 55 * 54 56 * @since 3.9.0 55 57 */ … … 73 75 74 76 /** 77 * Activates the CollectionAdd controller. 78 * 75 79 * @since 3.9.0 76 80 */ -
trunk/src/js/media/controllers/collection-edit.js
r63408 r63516 58 58 59 59 /** 60 * Initializes the CollectionEdit controller. 61 * 60 62 * @since 3.9.0 61 63 */ … … 82 84 83 85 /** 86 * Activates the CollectionEdit controller. 87 * 84 88 * @since 3.9.0 85 89 */ … … 99 103 100 104 /** 105 * Deactivates the CollectionEdit controller. 106 * 101 107 * @since 3.9.0 102 108 */ -
trunk/src/js/media/controllers/featured-image.js
r63408 r63516 49 49 50 50 /** 51 * Initializes the FeaturedImage controller. 52 * 51 53 * @since 3.5.0 52 54 */ … … 85 87 86 88 /** 89 * Activates the FeaturedImage controller. 90 * 87 91 * @since 3.5.0 88 92 */ … … 94 98 95 99 /** 100 * Deactivates the FeaturedImage controller. 101 * 96 102 * @since 3.5.0 97 103 */ … … 103 109 104 110 /** 111 * Updates the selection to match the current featured image. 112 * 105 113 * @since 3.5.0 106 114 */ -
trunk/src/js/media/controllers/image-details.js
r63408 r63516 43 43 44 44 /** 45 * Initializes the ImageDetails controller. 46 * 45 47 * @since 3.9.0 46 48 * … … 53 55 54 56 /** 57 * Activates the ImageDetails controller. 58 * 55 59 * @since 3.9.0 56 60 */ -
trunk/src/js/media/controllers/library.js
r63408 r63516 59 59 60 60 /** 61 * Initializes the Library controller. 62 * 61 63 * If a library isn't provided, query all media items. 62 64 * If a selection instance isn't provided, create one. … … 90 92 91 93 /** 94 * Activates the Library controller. 95 * 92 96 * @since 3.5.0 93 97 */ … … 106 110 107 111 /** 112 * Deactivates the Library controller. 113 * 108 114 * @since 3.5.0 109 115 */ … … 121 127 122 128 /** 123 * Reset the library to its initial state.129 * Resets the library to its initial state. 124 130 * 125 131 * @since 3.5.0 … … 132 138 133 139 /** 134 * Reset the attachment display settings defaults to the site options.140 * Resets the attachment display settings defaults to the site options. 135 141 * 136 142 * If site options don't define them, fall back to a persistent user setting. … … 149 155 150 156 /** 151 * Create a model to represent display settings (alignment, etc.) for an attachment.157 * Creates a model to represent display settings (alignment, etc.) for an attachment. 152 158 * 153 159 * @since 3.5.0 … … 166 172 167 173 /** 168 * Given an attachment, create attachment display settings properties.174 * Given an attachment, creates attachment display settings properties. 169 175 * 170 176 * @since 3.6.0 … … 187 193 188 194 /** 189 * Whether an attachment isimage.195 * Determines whether an attachment is an image. 190 196 * 191 197 * @since 4.4.1 … … 204 210 205 211 /** 206 * Whether an attachment can be embedded (audio or video).212 * Determines whether an attachment can be embedded (audio or video). 207 213 * 208 214 * @since 3.6.0 … … 225 231 226 232 /** 233 * Resets the content mode to the default. 234 * 227 235 * If the state is active, no items are selected, and the current 228 236 * content mode is not an option in the state's router (provided … … 271 279 272 280 /** 273 * Persist the mode of the content region as a user setting.281 * Persists the mode of the content region as a user setting. 274 282 * 275 283 * @since 3.5.0 -
trunk/src/js/media/controllers/media-library.js
r63408 r63516 23 23 24 24 /** 25 * Initializes the MediaLibrary controller. 26 * 25 27 * @since 3.9.0 26 28 * … … 36 38 37 39 /** 40 * Activates the MediaLibrary controller. 41 * 38 42 * @since 3.9.0 39 43 */ -
trunk/src/js/media/controllers/replace-image.js
r63408 r63516 49 49 50 50 /** 51 * Initializes the ReplaceImage controller. 52 * 51 53 * @since 3.9.0 52 54 * … … 88 90 89 91 /** 92 * Activates the ReplaceImage controller. 93 * 90 94 * @since 3.9.0 91 95 */ … … 97 101 98 102 /** 103 * Deactivates the ReplaceImage controller. 104 * 99 105 * @since 5.9.0 100 106 */ … … 106 112 107 113 /** 114 * Updates the selection to match the current image. 115 * 108 116 * @since 3.9.0 109 117 */ -
trunk/src/js/media/controllers/state-machine.js
r63408 r63516 107 107 _.each([ 'on', 'off', 'trigger' ], function( method ) { 108 108 /** 109 * Binds an event listener to events in the StateMachine's states collection. 110 * 109 111 * @function on 110 112 * @memberOf wp.media.controller.StateMachine … … 113 115 */ 114 116 /** 117 * Unbinds an event listener from the StateMachine's states collection. 118 * 115 119 * @function off 116 120 * @memberOf wp.media.controller.StateMachine … … 119 123 */ 120 124 /** 125 * Triggers an event on the StateMachine's states collection. 126 * 121 127 * @function trigger 122 128 * @memberOf wp.media.controller.StateMachine -
trunk/src/js/media/controllers/state.js
r63408 r63516 72 72 73 73 /** 74 * Ready event callback. 75 * 74 76 * @since 3.5.0 75 77 * @access private … … 80 82 81 83 /** 84 * Pre-activate event callback. 85 * 82 86 * @since 3.5.0 83 87 * @access private … … 88 92 89 93 /** 94 * Post-activate event callback. 95 * 90 96 * @since 3.5.0 91 97 * @access private … … 107 113 108 114 /** 115 * Deactivate event callback. 116 * 109 117 * @since 3.5.0 110 118 * @access private … … 122 130 123 131 /** 132 * Renders the frame's title using the titleMode property. 133 * 134 * 124 135 * @since 3.5.0 125 136 * @access private … … 130 141 131 142 /** 143 * Renders the title in the media frame. 144 * 132 145 * @param {media.view.Title} view The title view. 133 146 * @since 3.5.0 … … 139 152 140 153 /** 154 * Renders and manages the router region. 155 * 141 156 * @since 3.5.0 142 157 * @access private … … 161 176 162 177 /** 178 * Renders and manages the menu region. 179 * 163 180 * @since 3.5.0 164 181 * @access private … … 190 207 191 208 /** 209 * Updates the menu. 210 * 192 211 * @since 3.5.0 193 212 * @access private … … 207 226 208 227 /** 209 * Create a view in the media menu for the state.228 * Creates a view in the media menu for the state. 210 229 * 211 230 * @since 3.5.0 … … 235 254 }); 236 255 256 /** 257 * Creates render methods for frame regions. 258 */ 237 259 _.each(['toolbar','content'], function( region ) { 238 260 /** 261 * Renders the region in the media frame. 262 * 239 263 * @access private 240 264 */ -
trunk/src/js/media/models/attachment.js
r63408 r63516 114 114 }, 115 115 /** 116 * Save attachment details using the `save-attachment-compat` action. 117 * 116 118 * @param {Object} data The properties to be saved. 117 119 * @param {Object} options Sync options. e.g. patch, wait, success, error. -
trunk/src/js/media/models/attachments.js
r63408 r63516 29 29 model: wp.media.model.Attachment, 30 30 /** 31 * Initializes the Attachments collection. 32 * 31 33 * @param {Array} [models=[]] Array of models used to populate the collection. 32 34 * @param {Object} [options={}] … … 66 68 }, 67 69 /** 68 * Sort the collection when the order attribute changes.70 * Sorts the collection when the order attribute changes. 69 71 * 70 72 * @access private … … 76 78 }, 77 79 /** 78 * Set the default comparator only when the `orderby` property is set.80 * Sets the default comparator only when the `orderby` property is set. 79 81 * 80 82 * @access private … … 96 98 }, 97 99 /** 98 * If the `query` property is set to true, query the server using 99 * the `props` values, and sync the results to this collection. 100 * Queries the server using the `props` values and syncs the results to this collection if the `query` property is set to true. 100 101 * 101 102 * @access private … … 113 114 }, 114 115 /** 116 * Updates the collection when a property that has a filter is changed. 117 * 115 118 * @access private 116 119 * … … 174 177 }, 175 178 /** 176 * Add or removean attachment to the collection depending on its validity.179 * Adds or removes an attachment to the collection depending on its validity. 177 180 * 178 181 * @param {wp.media.model.Attachment} attachment … … 194 197 195 198 /** 196 * Add or removeall attachments from another collection depending on each one's validity.199 * Adds or removes all attachments from another collection depending on each one's validity. 197 200 * 198 201 * @param {wp.media.model.Attachments} attachments … … 216 219 }, 217 220 /** 218 * Start observing another attachments collection change events 219 * and replicate them on this collection. 221 * Starts observing another attachments collection change events and replicates them on this collection. 220 222 * 221 223 * @param {wp.media.model.Attachments} attachments The attachments collection to observe. … … 232 234 }, 233 235 /** 234 * Stop replicating collection change events from another attachments collection.236 * Stops replicating collection change events from another attachments collection. 235 237 * 236 238 * @param {wp.media.model.Attachments} attachments The attachments collection to stop observing. … … 252 254 }, 253 255 /** 254 * Update total attachment count when items are added to a collection.256 * Updates total attachment count when items are added to a collection. 255 257 * 256 258 * @access private … … 264 266 }, 265 267 /** 266 * Update total attachment count when items are added to a collection.268 * Updates total attachment count when items are added to a collection. 267 269 * 268 270 * @access private … … 276 278 }, 277 279 /** 280 * Validates an attachment against the collection's rules. 281 * 278 282 * @access private 279 283 * … … 294 298 }, 295 299 /** 300 * Validates all attachments in a collection against the collection's rules. 301 * 296 302 * @access private 297 303 * … … 304 310 }, 305 311 /** 306 * Start mirroring another attachments collection, clearing out any models already 307 * in the collection. 312 * Starts mirroring another attachments collection, clearing out any models already in the collection. 308 313 * 309 314 * @param {wp.media.model.Attachments} attachments The attachments collection to mirror. … … 334 339 }, 335 340 /** 336 * Stop mirroring another attachments collection.341 * Stops mirroring another attachments collection. 337 342 */ 338 343 unmirror: function() { … … 345 350 }, 346 351 /** 347 * Retrieve more attachments from the server for the collection.352 * Retrieves more attachments from the server for the collection. 348 353 * 349 354 * Only works if the collection is mirroring a Query Attachments collection, … … 380 385 }, 381 386 /** 382 * Whether there are more attachments that haven't been sync'd from the server 383 * that match the collection's query. 387 * Checks whether there are more attachments that haven't been sync'd from the server that match the collection's query. 384 388 * 385 389 * Only works if the collection is mirroring a Query Attachments collection, … … 450 454 451 455 /** 452 * If the collection is a query, create and mirror an Attachments Query collection.456 * Creates and mirrors an Attachments Query collection if the collection is a query. 453 457 * 454 458 * @access private … … 462 466 }, 463 467 /** 464 * If this collection is sorted by `menuOrder`, recalculates and saves 465 * the menu order to the database. 468 * If this collection is sorted by `menuOrder`, recalculates and saves the menu order to the database. 466 469 * 467 470 * @return {undefined|Promise} Returns a promise if the menu order is saved, otherwise undefined. … … 534 537 filters: { 535 538 /** 539 * Filters attachments based on a search query. 540 * 536 541 * @static 537 542 * Note that this client-side searching is *not* equivalent … … 555 560 }, 556 561 /** 562 * Filters attachments based on their type. 563 * 557 564 * @static 558 565 * @param {wp.media.model.Attachment} attachment … … 582 589 }, 583 590 /** 591 * Filters attachments based on their uploadedTo property. 592 * 584 593 * @static 585 594 * @param {wp.media.model.Attachment} attachment … … 598 607 }, 599 608 /** 609 * Filters attachments based on their status property. 610 * 600 611 * @static 601 612 * @param {wp.media.model.Attachment} attachment -
trunk/src/js/media/models/query.js
r63408 r63516 23 23 Query = Attachments.extend(/** @lends wp.media.model.Query.prototype */{ 24 24 /** 25 * Initializes the Query collection. 26 * 25 27 * @param {Array} [models=[]] Array of initial models to populate the collection. 26 28 * @param {Object} [options={}] … … 237 239 238 240 /** 241 * Creates and returns an Attachments Query collection given the properties. 242 * 239 243 * @param {Object} [props] 240 244 * @param {Object} [options] -
trunk/src/js/media/utils/selection-sync.js
r47122 r63516 13 13 var selectionSync = { 14 14 /** 15 * Syncs the selection in this state with the master selection. 16 * 15 17 * @since 3.5.0 16 18 */ -
trunk/src/js/media/views/attachment-compat.js
r63409 r63516 31 31 32 32 /** 33 * Disposes of the view and its children. 34 * 33 35 * @return {wp.media.view.AttachmentCompat} Returns itself to allow chaining. 34 36 */ … … 43 45 }, 44 46 /** 47 * Renders the view. 48 * 45 49 * @return {void|wp.media.view.AttachmentCompat} Returns itself to allow chaining. 46 50 */ … … 57 61 }, 58 62 /** 63 * Prevents the default action of the event. 64 * 59 65 * @param {Object} event 60 66 */ … … 63 69 }, 64 70 /** 71 * Saves the attachment compat data. 72 * 65 73 * @param {Object} event 66 74 */ … … 80 88 }, 81 89 90 /** 91 * Triggers the `attachment:compat:ready` event on the controller after saving the compat data. 92 */ 82 93 postSave: function() { 83 94 this.controller.trigger( 'attachment:compat:ready', ['ready'] ); -
trunk/src/js/media/views/attachment-filters.js
r43309 r63516 40 40 41 41 /** 42 * Creates the filters for the view. 43 * 42 44 * @abstract 43 45 */ … … 47 49 48 50 /** 49 * When the selected filter changes, update the Attachment Query properties to match.51 * Updates the Attachment Query properties to match when the selected filter changes. 50 52 */ 51 53 change: function() { … … 56 58 }, 57 59 60 /** 61 * Selects the filter based on the Attachment Query properties. 62 */ 58 63 select: function() { 59 64 var model = this.model, -
trunk/src/js/media/views/attachment.js
r63409 r63516 571 571 }, function( method, setting ) { 572 572 /** 573 * Updates the DOM when the model's caption changes. 574 * 573 575 * @function _syncCaption 574 576 * @memberOf wp.media.view.Attachment … … 580 582 */ 581 583 /** 584 * Updates the DOM when the model's title changes. 585 * 582 586 * @function _syncTitle 583 587 * @memberOf wp.media.view.Attachment … … 589 593 */ 590 594 /** 595 * Updates the DOM when the model's artist changes. 596 * 591 597 * @function _syncArtist 592 598 * @memberOf wp.media.view.Attachment … … 598 604 */ 599 605 /** 606 * Updates the DOM when the model's album changes. 607 * 600 608 * @function _syncAlbum 601 609 * @memberOf wp.media.view.Attachment -
trunk/src/js/media/views/attachments/browser.js
r63409 r63516 34 34 className: 'attachments-browser', 35 35 36 /** 37 * Initializes the AttachmentsBrowser view. 38 */ 36 39 initialize: function() { 37 40 _.defaults( this.options, { … … 148 151 }, 200 ), 149 152 153 /** 154 * Edits the selection in the modal. This is used when the user clicks the "Edit" button in the modal. 155 * 156 * @param {wp.media.view.Modal} modal The modal view. 157 */ 150 158 editSelection: function( modal ) { 151 159 // When editing a selection, move focus to the "Go to library" button. … … 154 162 155 163 /** 164 * Disposes of the view and its children. 165 * 156 166 * @return {wp.media.view.AttachmentsBrowser} Returns itself to allow chaining. 157 167 */ … … 162 172 }, 163 173 174 /** 175 * Creates the toolbar view. 176 */ 164 177 createToolbar: function() { 165 178 var LibraryViewSwitcher, Filters, toolbarOptions, … … 411 424 }, 412 425 426 /** 427 * Updates the content of the attachments browser. 428 */ 413 429 updateContent: function() { 414 430 var view = this, … … 442 458 }, 443 459 460 /** 461 * Creates the uploader view. 462 */ 444 463 createUploader: function() { 445 464 this.uploader = new wp.media.view.UploaderInline({ … … 454 473 }, 455 474 475 /** 476 * Toggles the uploader view. 477 */ 456 478 toggleUploader: function() { 457 479 if ( this.uploader.$el.hasClass( 'hidden' ) ) { … … 479 501 }, 480 502 503 /** 504 * Creates the attachments view. 505 */ 481 506 createAttachments: function() { 482 507 this.attachments = new wp.media.view.Attachments({ … … 662 687 }, 663 688 689 /** 690 * Creates the attachments heading view. 691 */ 664 692 createAttachmentsHeading: function() { 665 693 this.attachmentsHeading = new wp.media.view.Heading( { … … 671 699 }, 672 700 701 /** 702 * Creates the sidebar view. 703 */ 673 704 createSidebar: function() { 674 705 var options = this.options, … … 695 726 }, 696 727 728 /** 729 * Creates the single attachment view. 730 */ 697 731 createSingle: function() { 698 732 var sidebar = this.sidebar, … … 727 761 }, 728 762 763 /** 764 * Disposes of the single attachment view. 765 */ 729 766 disposeSingle: function() { 730 767 var sidebar = this.sidebar; -
trunk/src/js/media/views/button.js
r62963 r63516 48 48 }, 49 49 /** 50 * Renders the button. 51 * 50 52 * @return {wp.media.view.Button} Returns itself to allow chaining. 51 53 */ … … 71 73 }, 72 74 /** 75 * Handles the click event. 76 * 73 77 * @param {Object} event 74 78 */ -
trunk/src/js/media/views/embed.js
r43309 r63516 9 9 * @augments Backbone.View 10 10 */ 11 var Embed = wp.media.View.extend(/** @lends wp.media.view.Embe r.prototype */{11 var Embed = wp.media.View.extend(/** @lends wp.media.view.Embed.prototype */{ 12 12 className: 'media-embed', 13 13 14 /** 15 * Initializes the embed view. 16 */ 14 17 initialize: function() { 15 18 /** … … 28 31 29 32 /** 33 * Sets the settings for the embed view. 34 * 30 35 * @param {Object} view 31 36 */ … … 38 43 }, 39 44 45 /** 46 * Refreshes the embed view based on the type of embed. 47 */ 40 48 refresh: function() { 41 49 var type = this.model.get('type'), … … 57 65 }, 58 66 67 /** 68 * Toggles the loading state of the embed view. 69 */ 59 70 loading: function() { 60 71 this.$el.toggleClass( 'embed-loading', this.model.get('loading') ); -
trunk/src/js/media/views/frame/manage.js
r63409 r63516 24 24 Manage = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.Manage.prototype */{ 25 25 /** 26 * Initializes the manage frame. 27 * 26 28 * @constructs 27 29 */ … … 88 90 }, 89 91 92 /** 93 * Binds the search input to the grid router. 94 */ 90 95 bindSearchHandler: function() { 91 96 var search = this.$( '#media-search-input' ), … … 124 129 125 130 /** 126 * Create the default states for the frame.131 * Creates the default states for the frame. 127 132 */ 128 133 createStates: function() { … … 149 154 150 155 /** 151 * Bind region mode activation events to proper handlers.156 * Binds region mode activation events to proper handlers. 152 157 */ 153 158 bindRegionModeHandlers: function() { … … 161 166 }, 162 167 168 /** 169 * Handles keydown events for the frame. 170 * 171 * @param {JQuery.Event} e The keydown event. 172 */ 163 173 handleKeydown: function( e ) { 164 174 if ( 27 === e.which ) { … … 168 178 }, 169 179 180 /** 181 * Binds the keydown event for the frame. 182 */ 170 183 bindKeydown: function() { 171 184 this.$body.on( 'keydown.select', _.bind( this.handleKeydown, this ) ); 172 185 }, 173 186 187 /** 188 * Unbinds the keydown event for the frame. 189 */ 174 190 unbindKeydown: function() { 175 191 this.$body.off( 'keydown.select' ); 176 192 }, 177 193 194 /** 195 * Fixes the position of the attachments browser when scrolling the page. 196 */ 178 197 fixPosition: function() { 179 198 var $browser, $toolbar; … … 210 229 211 230 /** 212 * Open the Edit Attachment modal.231 * Opens the Edit Attachment modal. 213 232 * 214 233 * @param {wp.media.model.Attachment} model The attachment model to edit. … … 229 248 230 249 /** 231 * Create an attachments browser view within the content region.250 * Creates an attachments browser view within the content region. 232 251 * 233 252 * @param {Object} contentRegion Basic object with a `view` property, which … … 265 284 }, 266 285 286 /** 287 * Handles the visibility of the sidebar 288 */ 267 289 sidebarVisibility: function() { 268 290 this.browserView.$( '.media-sidebar' ).toggle( !! this.errors.length ); 269 291 }, 270 292 293 /** 294 * Binds the deferred object of the browser view to the startHistory method. 295 */ 271 296 bindDeferred: function() { 272 297 if ( ! this.browserView.dfd ) { … … 276 301 }, 277 302 303 /** 304 * Starts the history for the frame, if supported. 305 */ 278 306 startHistory: function() { 279 307 // Verify pushState support and activate. -
trunk/src/js/media/views/frame/post.js
r60031 r63516 235 235 }, 236 236 237 /** 238 * Activates the frame. 239 */ 237 240 activate: function() { 238 241 // Hide menu items for states tied to particular media types if there are no items. … … 244 247 }, 245 248 249 /** 250 * Handles the counts of media types. 251 * 252 * @param {wp.media.model.Attachments} model The attachment model that changed. 253 * @param {string} attr The attribute that changed on the model. 254 */ 246 255 mediaTypeCounts: function( model, attr ) { 247 256 if ( typeof this.counts[ attr ] !== 'undefined' && this.counts[ attr ].count < 1 ) { … … 253 262 // Menus. 254 263 /** 264 * Handles the main menu for the frame. 265 * 255 266 * @param {wp.Backbone.View} view 256 267 */ … … 267 278 }, 268 279 280 /** 281 * Handles the visibility of menu items for the frame. 282 * 283 * @param {string} state The state to show or hide. 284 * @param {string} visibility The visibility of the menu item, either 'show' or 'hide'. 285 */ 269 286 menuItemVisibility: function( state, visibility ) { 270 287 var menu = this.menu.get(); … … 276 293 }, 277 294 /** 295 * Handles the gallery menu for the frame. 296 * 278 297 * @param {wp.Backbone.View} view 279 298 */ … … 305 324 }, 306 325 326 /** 327 * Handles the playlist menu for the frame. 328 * 329 * @param {wp.Backbone.View} view The menu view. 330 */ 307 331 playlistMenu: function( view ) { 308 332 var lastState = this.lastState(), … … 332 356 }, 333 357 358 /** 359 * Handles the video playlist menu for the frame. 360 * 361 * @param {wp.Backbone.View} view The menu view. 362 */ 334 363 videoPlaylistMenu: function( view ) { 335 364 var lastState = this.lastState(), … … 360 389 361 390 // Content. 391 /** 392 * Handles the embed content for the frame. 393 */ 362 394 embedContent: function() { 363 395 var view = new wp.media.view.Embed({ … … 369 401 }, 370 402 403 /** 404 * Handles the edit selection content for the frame. 405 */ 371 406 editSelectionContent: function() { 372 407 var state = this.state(), … … 405 440 }, 406 441 442 /** 443 * Handles the edit image content for the frame. 444 */ 407 445 editImageContent: function() { 408 446 var image = this.state().get('image'), … … 419 457 420 458 /** 421 * @param {wp.Backbone.View} view 459 * Handles the selection status toolbar for the frame 460 * 461 * @param {wp.Backbone.View} view The toolbar view. 422 462 */ 423 463 selectionStatusToolbar: function( view ) { … … 438 478 439 479 /** 440 * @param {wp.Backbone.View} view 480 * Handles the main insert toolbar for the frame. 481 * 482 * @param {wp.Backbone.View} view The toolbar view. 441 483 */ 442 484 mainInsertToolbar: function( view ) { … … 467 509 468 510 /** 469 * @param {wp.Backbone.View} view 511 * Handles the main gallery toolbar for the frame. 512 * 513 * @param {wp.Backbone.View} view The toolbar view. 470 514 */ 471 515 mainGalleryToolbar: function( view ) { … … 499 543 }, 500 544 545 /** 546 * Handles the main playlist toolbar for the frame. 547 * 548 * @param {wp.Backbone.View} view The toolbar view. 549 */ 501 550 mainPlaylistToolbar: function( view ) { 502 551 var controller = this; … … 529 578 }, 530 579 580 /** 581 * Handles the main video playlist toolbar for the frame. 582 * 583 * @param {wp.Backbone.View} view The toolbar view. 584 */ 531 585 mainVideoPlaylistToolbar: function( view ) { 532 586 var controller = this; … … 559 613 }, 560 614 615 /** 616 * Handles the featured image toolbar for the frame. 617 * 618 * @param {wp.media.view.Toolbar} toolbar The toolbar view. 619 */ 561 620 featuredImageToolbar: function( toolbar ) { 562 621 this.createSelectToolbar( toolbar, { … … 566 625 }, 567 626 627 /** 628 * Handles the main embed toolbar for the frame. 629 * 630 * @param {wp.media.view.Toolbar} toolbar The toolbar view. 631 */ 568 632 mainEmbedToolbar: function( toolbar ) { 569 633 toolbar.view = new wp.media.view.Toolbar.Embed({ … … 572 636 }, 573 637 638 /** 639 * Handles the edit image toolbar for the frame. 640 */ 574 641 galleryEditToolbar: function() { 575 642 var editing = this.state().get('editing'); … … 584 651 585 652 /** 653 * Handles the click event for the insert button. 654 * 586 655 * @fires wp.media.controller.State#update 587 656 */ … … 602 671 }, 603 672 673 /** 674 * Handles the add to gallery toolbar for the frame. 675 */ 604 676 galleryAddToolbar: function() { 605 677 this.toolbar.set( new wp.media.view.Toolbar({ … … 613 685 614 686 /** 687 * Handles the click event for the insert button. 688 * 615 689 * @fires wp.media.controller.State#reset 616 690 */ … … 631 705 }, 632 706 707 /** 708 * Handles the edit playlist toolbar for the frame. 709 */ 633 710 playlistEditToolbar: function() { 634 711 var editing = this.state().get('editing'); … … 643 720 644 721 /** 722 * Handles the click event for the insert button. 723 * 645 724 * @fires wp.media.controller.State#update 646 725 */ … … 661 740 }, 662 741 742 /** 743 * Handles the add to playlist toolbar for the frame. 744 */ 663 745 playlistAddToolbar: function() { 664 746 this.toolbar.set( new wp.media.view.Toolbar({ … … 672 754 673 755 /** 756 * Handles the click event for the insert button. 757 * 674 758 * @fires wp.media.controller.State#reset 675 759 */ … … 690 774 }, 691 775 776 /** 777 * Handles the edit video playlist toolbar for the frame. 778 */ 692 779 videoPlaylistEditToolbar: function() { 693 780 var editing = this.state().get('editing'); … … 720 807 }, 721 808 809 /** 810 * Handles the add to video playlist toolbar for the frame. 811 */ 722 812 videoPlaylistAddToolbar: function() { 723 813 this.toolbar.set( new wp.media.view.Toolbar({ -
trunk/src/js/media/views/iframe.js
r46800 r63516 12 12 className: 'media-iframe', 13 13 /** 14 * Renders the iframe view. 15 * 14 16 * @return {wp.media.view.Iframe} Returns itself to allow chaining. 15 17 */ -
trunk/src/js/media/views/media-details.js
r63409 r63516 17 17 */ 18 18 MediaDetails = AttachmentDisplay.extend(/** @lends wp.media.view.MediaDetails.prototype */{ 19 /** 20 * Initializes the media details view. 21 */ 19 22 initialize: function() { 20 23 _.bindAll(this, 'success'); … … 29 32 }, 30 33 34 /** 35 * Handle events for the media details view. 36 * 37 * @return {Object} The events object. 38 */ 31 39 events: function(){ 32 40 return _.extend( { … … 38 46 }, 39 47 48 /** 49 * Prepares the data for the media details view. 50 * 51 * @return {Object} The prepared data. 52 */ 40 53 prepare: function() { 41 54 return _.defaults({ … … 45 58 46 59 /** 47 * Remove a setting's UI when the model unsets it60 * Removes a setting's UI when the model unsets it 48 61 * 49 62 * @fires wp.media.view.MediaDetails#media:setting:remove … … 64 77 65 78 /** 79 * Sets the tracks for the media details view. 66 80 * 67 81 * @fires wp.media.view.MediaDetails#media:setting:remove … … 78 92 }, 79 93 94 /** 95 * Adds a source to the media details view. 96 * 97 * @param {JQuery.Event} e The event object. 98 */ 80 99 addSource : function( e ) { 81 100 this.controller.lastMime = $( e.currentTarget ).data( 'mime' ); … … 83 102 }, 84 103 104 /** 105 * Loads the media player for the media details view. 106 */ 85 107 loadPlayer: function () { 86 108 this.players.push( new MediaElementPlayer( this.media, this.settings ) ); … … 88 110 }, 89 111 112 /** 113 * Sets the media player for the media details view. 114 */ 90 115 setPlayer : function() { 91 116 var src; … … 105 130 106 131 /** 132 * Sets the media for the media details view. 133 * 107 134 * @abstract 108 135 */ … … 111 138 }, 112 139 140 /** 141 * Handles the success event for the media details view. 142 * 143 * @param {MediaElementPlayer} mejs The media element player instance. 144 */ 113 145 success : function(mejs) { 114 146 var autoplay = mejs.attributes.autoplay && 'false' !== mejs.attributes.autoplay; … … 124 156 125 157 /** 126 * @return {media.view.MediaDetails} Returns itself to allow chaining. 158 * Renders the media details view. 159 * 160 * @return {wp.media.view.MediaDetails} Returns itself to allow chaining. 127 161 */ 128 162 render: function() { … … 140 174 }, 141 175 176 /** 177 * Scrolls the media details view to the top. 178 */ 142 179 scrollToTop: function() { 143 180 this.$( '.embed-media-settings' ).scrollTop( 0 ); -
trunk/src/js/media/views/media-frame.js
r61626 r63516 28 28 29 29 /** 30 * Initializes the media frame. 31 * 30 32 * @constructs 31 33 */ … … 142 144 143 145 /** 146 * Renders the media frame. 147 * 144 148 * @return {wp.media.view.MediaFrame} Returns itself to allow chaining. 145 149 */ … … 155 159 }, 156 160 /** 161 * Creates the title view. 162 * 157 163 * @param {Object} title 158 164 * @this wp.media.controller.Region … … 165 171 }, 166 172 /** 173 * Creates the menu view. 174 * 167 175 * @param {Object} menu 168 176 * @this wp.media.controller.Region … … 181 189 }, 182 190 191 /** 192 * Toggles the menu visibility. 193 * 194 * @param {JQuery.Event} event The click event. 195 */ 183 196 toggleMenu: function( event ) { 184 197 var menu = this.$el.find( '.media-menu' ); … … 189 202 190 203 /** 204 * Creates the toolbar view. 205 * 191 206 * @param {Object} toolbar 192 207 * @this wp.media.controller.Region … … 198 213 }, 199 214 /** 215 * Creates the router view. 216 * 200 217 * @param {Object} router 201 218 * @this wp.media.controller.Region … … 214 231 }, 215 232 /** 233 * Creates the iframe states. 234 * 216 235 * @param {Object} options 217 236 */ … … 251 270 252 271 /** 272 * Creates the iframe content view. 273 * 253 274 * @param {Object} content 254 275 * @this wp.media.controller.Region … … 261 282 }, 262 283 284 /** 285 * Cleans up the iframe content view. 286 */ 263 287 iframeContentCleanup: function() { 264 288 this.$el.removeClass('hide-toolbar'); 265 289 }, 266 290 291 /** 292 * Creates the iframe menu. 293 * 294 * @param {wp.media.view.Menu} view The menu view. 295 */ 267 296 iframeMenu: function( view ) { 268 297 var views = {}; … … 282 311 }, 283 312 313 /** 314 * Hijacks the Thickbox close function to close the media modal. 315 */ 284 316 hijackThickbox: function() { 285 317 var frame = this; … … 298 330 }, 299 331 332 /** 333 * Restores the Thickbox close function. 334 */ 300 335 restoreThickbox: function() { 301 336 if ( ! this._tb_remove ) { … … 311 346 _.each(['open','close','attach','detach','escape'], function( method ) { 312 347 /** 348 * Opens the media frame modal. 349 * 313 350 * @function open 314 351 * @memberOf wp.media.view.MediaFrame … … 318 355 */ 319 356 /** 357 * Closes the media frame modal. 358 * 320 359 * @function close 321 360 * @memberOf wp.media.view.MediaFrame … … 325 364 */ 326 365 /** 366 * Attaches the media frame to the DOM. 367 * 327 368 * @function attach 328 369 * @memberOf wp.media.view.MediaFrame … … 332 373 */ 333 374 /** 375 * Detaches the media frame from the DOM. 376 * 334 377 * @function detach 335 378 * @memberOf wp.media.view.MediaFrame … … 339 382 */ 340 383 /** 384 * Triggers the escape action on the media frame modal. 385 * 341 386 * @function escape 342 387 * @memberOf wp.media.view.MediaFrame -
trunk/src/js/media/views/menu-item.js
r47122 r63516 37 37 }, 38 38 39 /** 40 * Handles the click event. 41 */ 39 42 click: function() { 40 43 var state = this.options.state; … … 48 51 49 52 /** 53 * Renders the menu item. 54 * 50 55 * @return {wp.media.view.MenuItem} returns itself to allow chaining. 51 56 */ -
trunk/src/js/media/views/menu.js
r63409 r63516 26 26 }, 27 27 28 /** 29 * Initializes the menu view. 30 */ 28 31 initialize: function() { 29 32 this._views = {}; … … 47 50 48 51 /** 52 * Creates a view for the given options and id. 53 * 49 54 * @param {Object} options 50 55 * @param {string} id … … 57 62 }, 58 63 64 /** 65 * Updates the menu when the state changes. 66 */ 59 67 ready: function() { 60 68 /** … … 68 76 }, 69 77 78 /** 79 * Sets the menu items. 80 */ 70 81 set: function() { 71 82 /** … … 76 87 }, 77 88 89 /** 90 * Unsets the menu items. 91 */ 78 92 unset: function() { 79 93 /** … … 84 98 }, 85 99 100 /** 101 * Updates the menu visibility. 102 */ 86 103 visibility: function() { 87 104 var region = this.region, … … 98 115 }, 99 116 /** 100 * @param {string} id 117 * Selects the menu item with the given id. 118 * 119 * @param {string} id The menu item id. 101 120 */ 102 121 select: function( id ) { … … 114 133 }, 115 134 135 /** 136 * Deselects the menu items. 137 */ 116 138 deselect: function() { 117 139 this.$el.children().removeClass('active'); 118 140 }, 119 141 142 /** 143 * Hides the menu item with the given id. 144 * 145 * @param {string} id The menu item id. 146 */ 120 147 hide: function( id ) { 121 148 var view = this.get( id ); … … 128 155 }, 129 156 157 /** 158 * Shows the menu item with the given id. 159 * 160 * @param {string} id The menu item id. 161 */ 130 162 show: function( id ) { 131 163 var view = this.get( id ); -
trunk/src/js/media/views/search.js
r46800 r63516 25 25 26 26 /** 27 * Renders the search input. 28 * 27 29 * @return {wp.media.view.Search} Returns itself to allow chaining. 28 30 */ … … 32 34 }, 33 35 36 /** 37 * Searches the media library. 38 * 39 * @param {JQuery.Event} event The input event. 40 */ 34 41 search: _.debounce( function( event ) { 35 42 var searchTerm = event.target.value.trim(); -
trunk/src/js/media/views/settings.js
r47029 r63516 21 21 }, 22 22 23 /** 24 * Initializes the settings view. 25 */ 23 26 initialize: function() { 24 27 this.model = this.model || new Backbone.Model(); … … 26 29 }, 27 30 31 /** 32 * Prepares the data for rendering. 33 * 34 * @return {Object} The data to be used in the template. 35 */ 28 36 prepare: function() { 29 37 return _.defaults({ … … 32 40 }, 33 41 /** 42 * Renders the settings view. 43 * 34 44 * @return {wp.media.view.Settings} Returns itself to allow chaining. 35 45 */ … … 41 51 }, 42 52 /** 53 * Updates the selected value for a setting. 54 * 43 55 * @param {string} key 44 56 */ … … 88 100 }, 89 101 /** 102 * Updates the model when a setting is changed. 103 * 90 104 * @param {Object} event 91 105 */ … … 117 131 }, 118 132 133 /** 134 * Updates the view when the model changes. 135 * 136 * @param {Backbone.Model} model The model that changed. 137 */ 119 138 updateChanges: function( model ) { 120 139 if ( model.hasChanged() ) { -
trunk/src/js/media/views/settings/attachment-display.js
r47266 r63516 17 17 template: wp.template('attachment-display-settings'), 18 18 19 /** 20 * Initializes the attachment display settings view. 21 */ 19 22 initialize: function() { 20 23 var attachment = this.options.attachment; … … 32 35 }, 33 36 37 /** 38 * Disposes of the attachment display settings view. 39 */ 34 40 dispose: function() { 35 41 var attachment = this.options.attachment; … … 43 49 }, 44 50 /** 51 * Renders the attachment display settings view. 52 * 45 53 * @return {wp.media.view.AttachmentDisplay} Returns itself to allow chaining. 46 54 */ … … 61 69 }, 62 70 71 /** 72 * Updates the linkTo setting. 73 */ 63 74 updateLinkTo: function() { 64 75 var linkTo = this.model.get('link'), -
trunk/src/js/media/views/toolbar.js
r63409 r63516 19 19 className: 'media-toolbar', 20 20 21 /** 22 * Initializes the toolbar view. 23 */ 21 24 initialize: function() { 22 25 var state = this.controller.state(), … … 53 56 }, 54 57 /** 58 * Disposes of the toolbar view. 59 * 55 60 * @return {wp.media.view.Toolbar} Returns itself to allow chaining 56 61 */ … … 69 74 }, 70 75 76 /** 77 * Prepares the data for rendering. 78 */ 71 79 ready: function() { 72 80 this.refresh(); … … 74 82 75 83 /** 84 * Sets a view by its ID. 85 * 76 86 * @param {string} id 77 87 * @param {Backbone.View|Object} view … … 119 129 }, 120 130 /** 131 * Unsets a view by its ID. 132 * 121 133 * @param {string} id 122 134 * @param {Object} options … … 135 147 }, 136 148 149 /** 150 * Refreshes the toolbar view. 151 */ 137 152 refresh: function() { 138 153 var state = this.controller.state(), -
trunk/src/js/media/views/view.js
r47122 r63516 18 18 */ 19 19 var View = wp.Backbone.View.extend(/** @lends wp.media.View.prototype */{ 20 /** 21 * Constructor for the media view. 22 * 23 * @param {Object} [options] Options for the view. 24 */ 20 25 constructor: function( options ) { 21 26 if ( options && options.controller ) { … … 25 30 }, 26 31 /** 32 * Disposes of the media view. 33 * 27 34 * @todo The internal comment mentions this might have been a stop-gap 28 35 * before Backbone 0.9.8 came out. Figure out if Backbone core takes … … 55 62 }, 56 63 /** 64 * Removes the media view. 65 * 57 66 * @return {wp.media.View} Returns itself to allow chaining. 58 67 */
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)