Changeset 27051
- Timestamp:
- 01/28/2014 11:20:04 PM (11 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/media-editor.js
r27005 r27051 448 448 * @param {string} content Content that is searched for possible 449 449 * shortcode markup matching the passed tag name, 450 * 451 * @this wp.media.gallery 452 * 450 453 * @returns {wp.media.view.MediaFrame.Select} A media workflow. 451 454 */ -
trunk/src/wp-includes/js/media-models.js
r27050 r27051 343 343 344 344 /** 345 * wp.media.model. Attachment345 * wp.media.model.PostImage 346 346 * 347 347 * @constructor 348 348 * @augments Backbone.Model 349 *350 349 **/ 351 350 PostImage = media.model.PostImage = Backbone.Model.extend({ … … 355 354 356 355 if ( attributes.attachment_id ) { 357 this.attachment = media.model.Attachment.get( attributes.attachment_id );356 this.attachment = Attachment.get( attributes.attachment_id ); 358 357 this.dfd = this.attachment.fetch(); 359 358 this.bindAttachmentListeners(); … … 365 364 366 365 this.setLinkTypeFromUrl(); 367 368 366 }, 369 367 … … 412 410 413 411 this.set( 'link', type ); 414 415 }, 416 412 }, 417 413 418 414 updateLinkUrl: function() { … … 435 431 this.set( 'linkUrl', '' ); 436 432 break; 437 438 } 439 433 } 440 434 }, 441 435 … … 451 445 this.set( 'width', size.width ); 452 446 this.set( 'height', size.height ); 453 454 447 } 455 456 457 448 }); 458 449 -
trunk/src/wp-includes/js/media-views.js
r27050 r27051 727 727 728 728 /** 729 * wp.media.controller.ImageDetails 730 * 731 * @constructor 732 * @augments wp.media.controller.State 733 * @augments Backbone.Model 734 */ 735 media.controller.ImageDetails = media.controller.State.extend({ 736 defaults: _.defaults({ 737 id: 'image-details', 738 toolbar: 'image-details', 739 title: l10n.imageDetailsTitle, 740 content: 'image-details', 741 menu: 'image-details', 742 router: false, 743 attachment: false, 744 priority: 60, 745 editing: false 746 }, media.controller.Library.prototype.defaults ), 747 748 initialize: function( options ) { 749 this.image = options.image; 750 media.controller.State.prototype.initialize.apply( this, arguments ); 751 } 752 }); 753 754 /** 729 755 * wp.media.controller.GalleryEdit 730 756 * … … 911 937 title: l10n.setFeaturedImageTitle, 912 938 priority: 60, 913 914 939 syncSelection: false 915 940 }, media.controller.Library.prototype.defaults ), … … 981 1006 }); 982 1007 983 984 media.controller.ImageDetails = media.controller.State.extend({985 986 defaults: _.defaults({987 id: 'image-details',988 toolbar: 'image-details',989 title: l10n.imageDetailsTitle,990 content: 'image-details',991 menu: 'image-details',992 router: false,993 attachment: false,994 priority: 60,995 editing: false996 }, media.controller.Library.prototype.defaults ),997 998 initialize: function( options ) {999 this.image = options.image;1000 media.controller.State.prototype.initialize.apply( this, arguments );1001 }1002 });1003 1004 1008 /** 1005 1009 * wp.media.controller.ReplaceImage … … 1007 1011 * Replace a selected single image 1008 1012 * 1009 **/ 1013 * @constructor 1014 * @augments wp.media.controller.Library 1015 * @augments wp.media.controller.State 1016 * @augments Backbone.Model 1017 */ 1010 1018 media.controller.ReplaceImage = media.controller.Library.extend({ 1011 1019 defaults: _.defaults({ … … 1023 1031 1024 1032 this.image = options.image; 1025 1026 1033 // If we haven't been provided a `library`, create a `Selection`. 1027 1034 if ( ! this.get('library') ) { … … 1076 1083 1077 1084 selection.reset( attachment ? [ attachment ] : [] ); 1078 1079 } 1080 1081 1085 } 1082 1086 }); 1083 1087 -
trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js
r27050 r27051 144 144 } ); 145 145 146 147 146 // extract caption 148 147 captionBlock = editor.dom.getParents( imageNode, '.wp-caption' ); … … 173 172 174 173 return metadata; 175 176 174 } 177 175 … … 224 222 } 225 223 editor.nodeChanged(); 226 227 224 } 228 225 … … 232 229 233 230 mode = mode ? mode : 'node'; 234 235 231 236 232 if ( ! imageData.caption ) { … … 262 258 return editor.dom.createHTML( 'a', { href: imageData.linkUrl }, editor.dom.createHTML( 'img', props ) ); 263 259 } 264 } else { 265 if ( mode === 'node' ) { 266 return editor.dom.create( 'img', props ); 267 } else if ( mode === 'html' ) { 268 return editor.dom.createHTML( 'img', props ); 269 } 270 260 } else if ( mode === 'node' ) { 261 return editor.dom.create( 'img', props ); 262 } else if ( mode === 'html' ) { 263 return editor.dom.createHTML( 'img', props ); 271 264 } 272 265 } … … 651 644 652 645 frame.open(); 653 654 655 646 } 656 647 } -
trunk/src/wp-includes/media-template.php
r27050 r27051 547 547 </div> 548 548 <div class="setting link-to"> 549 <span><?php _e('Link To'); ?></span> 550 551 <# if ( data.attachment ) { #> 549 <span><?php _e('Link To'); ?></span> 552 550 <div class="button-group button-large" data-setting="link"> 551 <# if ( data.attachment ) { #> 553 552 <button class="button" value="file"> 554 553 <?php esc_attr_e('Media File'); ?> … … 557 556 <?php esc_attr_e('Attachment Page'); ?> 558 557 </button> 558 <# } else { #> 559 <button class="button" value="file"> 560 <?php esc_attr_e('Image URL'); ?> 561 </button> 562 <# } #> 559 563 <button class="button" value="custom"> 560 564 <?php esc_attr_e('Custom URL'); ?> … … 565 569 </div> 566 570 <input type="text" class="link-to-custom" data-setting="linkUrl" /> 567 568 <# } else { #>569 <div class="button-group button-large" data-setting="link">570 <button class="button" value="file">571 <?php esc_attr_e('Image URL'); ?>572 </button>573 <button class="button" value="custom">574 <?php esc_attr_e('Custom URL'); ?>575 </button>576 <button class="button active" value="none">577 <?php esc_attr_e('None'); ?>578 </button>579 </div>580 <input type="text" class="link-to-custom" data-setting="linkUrl" />581 582 <# } #>583 571 </div> 584 572 … … 597 585 598 586 foreach ( $sizes as $value => $name ) : ?> 599 <# 600 var size = data.attachment.sizes['<?php echo esc_js( $value ); ?>']; 587 <# var size = data.attachment.sizes['<?php echo esc_js( $value ); ?>']; 601 588 if ( size ) { #> 602 589 <button class="button" value="<?php echo esc_attr( $value ); ?>"> -
trunk/src/wp-includes/media.php
r27050 r27051 2009 2009 'reverseOrder' => __( 'Reverse order' ), 2010 2010 2011 2012 2011 // Edit Image 2013 2012 'imageDetailsTitle' => __( 'Image Details' ),
Note: See TracChangeset
for help on using the changeset viewer.