diff --git src/wp-includes/css/media-views.css src/wp-includes/css/media-views.css
index cccf307..f52aee9 100644
|
|
|
1669 | 1669 | margin: 10px 0; |
1670 | 1670 | } |
1671 | 1671 | |
| 1672 | .image-details .hidden { |
| 1673 | display: none; |
| 1674 | } |
| 1675 | |
1672 | 1676 | .media-embed .setting input[type="text"], |
1673 | 1677 | .media-embed .setting textarea { |
1674 | 1678 | display: block; |
… |
… |
|
1709 | 1713 | margin-top: 10px; |
1710 | 1714 | } |
1711 | 1715 | |
1712 | | .advanced .hidden { |
1713 | | display: none; |
1714 | | } |
1715 | | |
1716 | 1716 | /* Drag & drop on the editor upload */ |
1717 | 1717 | #wp-fullscreen-body .uploader-editor, |
1718 | 1718 | .wp-editor-wrap .uploader-editor { |
diff --git src/wp-includes/js/media-views.js src/wp-includes/js/media-views.js
index 80db8d2..f2e033f 100644
|
|
|
6064 | 6064 | initialize: function() { |
6065 | 6065 | // used in AttachmentDisplay.prototype.updateLinkTo |
6066 | 6066 | this.options.attachment = this.model.attachment; |
6067 | | if ( this.model.attachment ) { |
6068 | | this.listenTo( this.model, 'change:url', this.updateUrl ); |
6069 | | this.listenTo( this.model, 'change:link', this.toggleLinkSettings ); |
6070 | | } |
| 6067 | this.listenTo( this.model, 'change:url', this.updateUrl ); |
| 6068 | this.listenTo( this.model, 'change:link', this.toggleLinkSettings ); |
6071 | 6069 | media.view.Settings.AttachmentDisplay.prototype.initialize.apply( this, arguments ); |
6072 | 6070 | }, |
6073 | 6071 | |
… |
… |
|
6113 | 6111 | }, |
6114 | 6112 | |
6115 | 6113 | updateUrl: function() { |
6116 | | this.$( '.image img' ).attr( 'src', this.model.get('url' ) ); |
6117 | | this.$( '.url' ).val( this.model.get('url' ) ); |
| 6114 | this.$( '.image img' ).attr( 'src', this.model.get( 'url' ) ); |
| 6115 | this.$( '.url' ).val( this.model.get( 'url' ) ); |
6118 | 6116 | }, |
6119 | 6117 | |
6120 | 6118 | toggleLinkSettings: function() { |
diff --git src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js
index 9f76d4c..c00583f 100644
|
|
tinymce.PluginManager.add( 'wpeditimage', function( editor ) { |
114 | 114 | } |
115 | 115 | |
116 | 116 | function extractImageData( imageNode ) { |
117 | | var classes, metadata, captionBlock, caption, link, |
| 117 | var classes, extraClasses, metadata, captionBlock, caption, link, |
118 | 118 | dom = editor.dom; |
119 | 119 | |
120 | 120 | // default attributes |
… |
… |
tinymce.PluginManager.add( 'wpeditimage', function( editor ) { |
127 | 127 | caption: '', |
128 | 128 | alt: '', |
129 | 129 | align: 'none', |
| 130 | extraClasses: '', |
130 | 131 | link: false, |
131 | 132 | linkUrl: '', |
132 | 133 | linkClassName: '', |
133 | 134 | linkTargetBlank: false, |
134 | 135 | linkRel: '', |
135 | | title: '', |
136 | | className: '' |
| 136 | title: '' |
137 | 137 | }; |
138 | 138 | |
139 | 139 | metadata.url = dom.getAttrib( imageNode, 'src' ); |
… |
… |
tinymce.PluginManager.add( 'wpeditimage', function( editor ) { |
141 | 141 | metadata.title = dom.getAttrib( imageNode, 'title' ); |
142 | 142 | metadata.width = parseInt( dom.getAttrib( imageNode, 'width' ), 10 ); |
143 | 143 | metadata.height = parseInt( dom.getAttrib( imageNode, 'height' ), 10 ); |
144 | | metadata.className = imageNode.className; |
145 | 144 | |
146 | | classes = metadata.className.split( ' ' ); |
| 145 | classes = tinymce.explode( imageNode.className, ' ' ); |
| 146 | extraClasses = []; |
| 147 | |
147 | 148 | tinymce.each( classes, function( name ) { |
148 | 149 | |
149 | 150 | if ( /^wp-image/.test( name ) ) { |
150 | 151 | metadata.attachment_id = parseInt( name.replace( 'wp-image-', '' ), 10 ); |
151 | | } |
152 | | |
153 | | if ( /^align/.test( name ) ) { |
| 152 | } else if ( /^align/.test( name ) ) { |
154 | 153 | metadata.align = name.replace( 'align', '' ); |
155 | | } |
156 | | |
157 | | if ( /^size/.test( name ) ) { |
| 154 | } else if ( /^size/.test( name ) ) { |
158 | 155 | metadata.size = name.replace( 'size-', '' ); |
| 156 | } else { |
| 157 | extraClasses.push( name ); |
159 | 158 | } |
| 159 | |
160 | 160 | } ); |
161 | 161 | |
| 162 | metadata.extraClasses = extraClasses.join( ' ' ); |
| 163 | |
162 | 164 | // Extract caption |
163 | 165 | captionBlock = dom.getParents( imageNode, '.wp-caption' ); |
164 | 166 | |
… |
… |
tinymce.PluginManager.add( 'wpeditimage', function( editor ) { |
251 | 253 | } |
252 | 254 | |
253 | 255 | function createImageAndLink( imageData, mode ) { |
254 | | var classes = [], |
| 256 | var classes = tinymce.explode( imageData.extraClasses, ' ' ), |
255 | 257 | attrs, linkAttrs; |
256 | 258 | |
257 | 259 | mode = mode ? mode : 'node'; |
diff --git src/wp-includes/media-template.php src/wp-includes/media-template.php
index 76e595c..4908f43 100644
|
|
function wp_print_media_templates() { |
663 | 663 | <span><?php _e('Title Attribute'); ?></span> |
664 | 664 | <input type="text" data-setting="title" value="{{ data.model.title }}" /> |
665 | 665 | </label> |
| 666 | <label class="setting extra-classes"> |
| 667 | <span><?php _e('CSS Class'); ?></span> |
| 668 | <input type="text" data-setting="extraClasses" value="{{ data.model.extraClasses }}" /> |
| 669 | </label> |
666 | 670 | </div> |
667 | 671 | </div> |
668 | 672 | |