diff --git wp-admin/css/colors-classic.css wp-admin/css/colors-classic.css
index 74a1060..c8963fc 100644
|
|
textarea.disabled { |
164 | 164 | color: #fff; |
165 | 165 | } |
166 | 166 | |
| 167 | .post-format-options, |
167 | 168 | .widget .widget-top, |
168 | 169 | .postbox h3, |
169 | 170 | .stuffbox h3, |
… |
… |
table.widefat span.spam a, |
688 | 689 | background-image: linear-gradient(to top, #eff8ff, #f7fcfe); |
689 | 690 | } |
690 | 691 | |
| 692 | .post-format-options, |
691 | 693 | .postbox h3 { |
692 | 694 | color: #174f69; |
693 | 695 | } |
diff --git wp-admin/css/colors-fresh.css wp-admin/css/colors-fresh.css
index 5aa5fa8..1941f51 100644
|
|
textarea.disabled { |
164 | 164 | color: #fff; |
165 | 165 | } |
166 | 166 | |
| 167 | .post-format-options, |
167 | 168 | .widget .widget-top, |
168 | 169 | .postbox h3, |
169 | 170 | .stuffbox h3, |
… |
… |
table.widefat span.spam a, |
690 | 691 | background-image: linear-gradient(to top, #f5f5f5, #f9f9f9); |
691 | 692 | } |
692 | 693 | |
| 694 | .post-format-options, |
693 | 695 | .postbox h3 { |
694 | 696 | color: #464646; |
695 | 697 | } |
diff --git wp-admin/css/wp-admin.css wp-admin/css/wp-admin.css
index 1b07b3e..883e7d0 100644
|
|
body .ui-tooltip { |
4000 | 4000 | } |
4001 | 4001 | |
4002 | 4002 | .wp-format-status #titlewrap, |
| 4003 | .wp-format-image .wp-media-buttons .insert-media, |
| 4004 | .wp-format-audio .wp-media-buttons .insert-media, |
| 4005 | .wp-format-video .wp-media-buttons .insert-media, |
4003 | 4006 | .wp-format-aside .wp-media-buttons .insert-media, |
4004 | 4007 | .wp-format-status .wp-media-buttons .insert-media { |
4005 | 4008 | display: none; |
… |
… |
body .ui-tooltip { |
4101 | 4104 | } |
4102 | 4105 | |
4103 | 4106 | .post-format-options { |
4104 | | height: 50px; |
| 4107 | border-width: 1px; |
| 4108 | border-style: solid; |
| 4109 | -webkit-border-radius: 3px; |
| 4110 | border-radius: 3px; |
| 4111 | border-color: #CCC; |
4105 | 4112 | margin: 13px 0 10px; |
4106 | | padding: 0; |
| 4113 | padding: 5px; |
4107 | 4114 | } |
4108 | 4115 | |
4109 | 4116 | .post-format-options a { |
4110 | 4117 | display: inline-block; |
4111 | | height: 34px; |
4112 | | margin-right: 33px; |
| 4118 | min-width: 62px; |
| 4119 | padding:5px; |
| 4120 | border:1px solid transparent; |
| 4121 | margin-right: 10px; |
4113 | 4122 | position: relative; |
4114 | 4123 | text-decoration: none; |
4115 | 4124 | text-align: center; |
| 4125 | transition: opacity 0.1s linear; |
| 4126 | opacity: 0.6; |
| 4127 | } |
| 4128 | |
| 4129 | .post-format-options:hover a { |
| 4130 | opacity: 1.0; |
| 4131 | } |
| 4132 | .post-format-options a:hover, |
| 4133 | .post-format-options a.active { |
| 4134 | opacity: 1.0; |
| 4135 | background-color: #fff; |
| 4136 | border-color: #ccc; |
4116 | 4137 | } |
4117 | 4138 | |
4118 | 4139 | .post-format-options a div { |
… |
… |
body .ui-tooltip { |
4127 | 4148 | margin-top: 4px; |
4128 | 4149 | } |
4129 | 4150 | |
4130 | | .post-format-change, .post-format-set .post-format-options { |
| 4151 | .post-format-set .post-format-options { |
4131 | 4152 | display: none; |
4132 | 4153 | } |
4133 | 4154 | |
… |
… |
body .ui-tooltip { |
4150 | 4171 | width: 16px; |
4151 | 4172 | } |
4152 | 4173 | |
4153 | | .post-format-change span.icon.standard { |
| 4174 | .post-format-change span.icon.wp-format-standard { |
4154 | 4175 | background: url(../images/post-formats.png) no-repeat -8px -8px; |
4155 | 4176 | } |
4156 | 4177 | |
4157 | | .post-format-change span.icon.image { |
| 4178 | .post-format-change span.icon.wp-format-image { |
4158 | 4179 | background: url(../images/post-formats.png) no-repeat -40px -8px; |
4159 | 4180 | } |
4160 | 4181 | |
4161 | | .post-format-change span.icon.gallery { |
| 4182 | .post-format-change span.icon.wp-format-gallery { |
4162 | 4183 | background: url(../images/post-formats.png) no-repeat -72px -8px; |
4163 | 4184 | } |
4164 | 4185 | |
4165 | | .post-format-change span.icon.audio { |
| 4186 | .post-format-change span.icon.wp-format-audio { |
4166 | 4187 | background: url(../images/post-formats.png) no-repeat -104px -8px; |
4167 | 4188 | } |
4168 | 4189 | |
4169 | | .post-format-change span.icon.video { |
| 4190 | .post-format-change span.icon.wp-format-video { |
4170 | 4191 | background: url(../images/post-formats.png) no-repeat -136px -8px; |
4171 | 4192 | } |
4172 | 4193 | |
4173 | | .post-format-change span.icon.chat { |
| 4194 | .post-format-change span.icon.wp-format-chat { |
4174 | 4195 | background: url(../images/post-formats.png) no-repeat -168px -8px; |
4175 | 4196 | } |
4176 | 4197 | |
4177 | | .post-format-change span.icon.status { |
| 4198 | .post-format-change span.icon.wp-format-status { |
4178 | 4199 | background: url(../images/post-formats.png) no-repeat -200px -8px; |
4179 | 4200 | } |
4180 | 4201 | |
4181 | | .post-format-change span.icon.aside { |
| 4202 | .post-format-change span.icon.wp-format-aside { |
4182 | 4203 | background: url(../images/post-formats.png) no-repeat -232px -8px; |
4183 | 4204 | } |
4184 | 4205 | |
4185 | | .post-format-change span.icon.quote { |
| 4206 | .post-format-change span.icon.wp-format-quote { |
4186 | 4207 | background: url(../images/post-formats.png) no-repeat -264px -8px; |
4187 | 4208 | } |
4188 | 4209 | |
4189 | | .post-format-change span.icon.link { |
| 4210 | .post-format-change span.icon.wp-format-link { |
4190 | 4211 | background: url(../images/post-formats.png) no-repeat -296px -8px; |
4191 | 4212 | } |
4192 | 4213 | |
diff --git wp-admin/edit-form-advanced.php wp-admin/edit-form-advanced.php
index d92e8c4..454e1da 100644
|
|
if ( post_type_supports( $post_type, 'post-formats' ) && apply_filters( 'enable_ |
135 | 135 | wp_enqueue_script( 'wp-mediaelement' ); |
136 | 136 | wp_enqueue_style( 'wp-mediaelement' ); |
137 | 137 | $post_format = get_post_format(); |
138 | | $post_format_set_class = 'post-format-set'; |
139 | 138 | |
140 | 139 | if ( ! $post_format ) { |
141 | 140 | $post_format = 'standard'; |
142 | 141 | |
143 | 142 | if ( ! empty( $_REQUEST['format'] ) && in_array( $_REQUEST['format'], get_post_format_slugs() ) ) |
144 | 143 | $post_format = $_REQUEST['format']; |
145 | | elseif ( 'auto-draft' == $post->post_status ) |
146 | | $post_format_set_class = ''; |
147 | 144 | } |
148 | 145 | |
149 | 146 | $user_wants = get_user_option( 'post_formats_' . $post_type ); |
… |
… |
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); |
424 | 421 | <div id="poststuff"> |
425 | 422 | <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>"> |
426 | 423 | <div id="post-body-content"<?php echo $format_class; ?>> |
| 424 | <div class="wp-post-format-ui<?php if ( ! $show_post_format_ui ) echo ' no-ui' ?>"> |
| 425 | <div class="post-format-change"><span class="icon <?php echo esc_attr( 'wp-format-' . $post_format ); ?>"></span> <span class="post-format-description"><?php echo $all_post_formats[$post_format]['description']; ?></span></div> |
| 426 | </div> |
427 | 427 | <?php if ( post_type_supports($post_type, 'title') ) { ?> |
428 | 428 | <div id="titlediv"> |
429 | 429 | <div id="titlewrap"> |
diff --git wp-admin/includes/post-formats.php wp-admin/includes/post-formats.php
index 9571e55..e06d09c 100644
|
|
wp_nonce_field( 'show-post-format-ui_' . $post_type, 'show_post_format_ui_nonce' |
10 | 10 | |
11 | 11 | ?> |
12 | 12 | <div class="wp-post-format-ui<?php if ( ! $show_post_format_ui ) echo ' no-ui' ?>"> |
13 | | <div class="post-format-change"><span class="icon <?php echo esc_attr( $post_format ); ?>"></span> <span class="post-format-description"><?php echo $all_post_formats[$post_format]['description']; ?></span> <a href="#"><?php _e('Change format'); ?></a></div> |
14 | 13 | <div class="post-formats-fields"> |
15 | 14 | |
16 | 15 | <input type="hidden" name="post_format" id="post_format" value="<?php echo esc_attr( $post_format ); ?>" /> |
… |
… |
wp_nonce_field( 'show-post-format-ui_' . $post_type, 'show_post_format_ui_nonce' |
144 | 143 | </div> |
145 | 144 | </div> |
146 | 145 | </div> |
147 | | </div> |
148 | | No newline at end of file |
| 146 | </div> |
diff --git wp-admin/js/post-formats.js wp-admin/js/post-formats.js
index 9344df0..c83bc66 100644
|
|
window.wp = window.wp || {}; |
4 | 4 | var container, $container, mediaFrame, lastMimeType, mediaPreview, lastHeight = 360, content, insertMediaButton, |
5 | 5 | initialFormat = 'standard', |
6 | 6 | shortClass = 'short-format', |
| 7 | noTitleFormats = ['status'], |
| 8 | noMediaFormats = ['status', 'aside', 'image', 'audio', 'video'], |
7 | 9 | shortContentFormats = ['status', 'aside'], |
8 | 10 | noUIFormats = ['standard', 'chat', 'status', 'aside', 'gallery'], |
9 | 11 | $screenIcon = $( '.icon32' ); |
10 | 12 | |
11 | 13 | |
12 | 14 | function switchFormatClass( format ) { |
| 15 | $('#post_format').val(format); |
13 | 16 | container.get(0).className = container.get(0).className.replace( /\s?\bwp-format-[^ ]+/g, '' ); |
14 | 17 | container.addClass('wp-format-' + format); |
15 | 18 | $screenIcon.get(0).className = $screenIcon.get(0).className.replace( /\s?\bwp-format-[^ ]+/g, '' ); |
… |
… |
window.wp = window.wp || {}; |
45 | 48 | } |
46 | 49 | |
47 | 50 | function switchFormat($this) { |
48 | | var editor, body, |
| 51 | var editor, body, formatTo, formatFrom, |
49 | 52 | parent = $this.parent(), |
50 | 53 | format = $this.data('wp-format'), |
51 | 54 | description = $('.post-format-description'), |
52 | 55 | postTitle = $('#title'); |
53 | 56 | |
| 57 | if ( format === postFormats.currentPostFormat ) |
| 58 | return; |
| 59 | |
54 | 60 | if ( typeof container === 'undefined' ) |
55 | 61 | container = $('#post-body-content'); |
56 | 62 | |
57 | | parent.slideUp().find('a.active').removeClass('active'); |
| 63 | parent.find('a.active').removeClass('active'); |
58 | 64 | $this.addClass('active'); |
59 | | $('#post_format').val(format); |
60 | | $('.post-format-change').show().find('span.icon').removeClass(postFormats.currentPostFormat).addClass(format); |
61 | 65 | |
62 | | if ( -1 < $.inArray( format, noUIFormats ) ) { |
| 66 | // Animate the media button going away or coming back |
| 67 | formatTo = -1 < $.inArray( format, noMediaFormats ); |
| 68 | formatFrom = -1 < $.inArray( postFormats.currentPostFormat, noMediaFormats ); |
| 69 | if ( formatFrom ? !formatTo : formatTo ) // XOR |
| 70 | insertMediaButton.fadeToggle( 200 ).css( 'display', 'inline-block' ); |
| 71 | |
| 72 | // Animate the title going away or coming back |
| 73 | formatTo = -1 < $.inArray( format, noTitleFormats ); |
| 74 | formatFrom = -1 < $.inArray( postFormats.currentPostFormat, noTitleFormats ); |
| 75 | if ( formatFrom ? !formatTo : formatTo ) // XOR |
| 76 | $('#titlewrap').fadeToggle( 200 ); |
| 77 | |
| 78 | if ( -1 < $.inArray( format, noUIFormats ) && -1 < $.inArray( postFormats.currentPostFormat, noUIFormats ) ) { |
63 | 79 | switchFormatClass( format ); // No slide |
64 | | $container.hide(); |
| 80 | $container.slideUp(); |
65 | 81 | } else { |
66 | | $container.slideUp( 200, function(){ |
| 82 | $container.slideUp( 400, function(){ |
67 | 83 | switchFormatClass( format ); |
68 | | $container.slideDown( 400 ); |
| 84 | if ( -1 == $.inArray( format, noUIFormats ) ) |
| 85 | $container.slideDown( 400 ); |
69 | 86 | }); |
70 | 87 | } |
71 | 88 | |
… |
… |
window.wp = window.wp || {}; |
78 | 95 | |
79 | 96 | // Update description line |
80 | 97 | description.html($this.data('description')); |
| 98 | var tinyIcon = $('.post-format-change').show().find('span.icon'); |
| 99 | tinyIcon.attr('class', tinyIcon.attr('class').replace(/\s?\bwp-format-[^ ]+/g, '' )).addClass( 'wp-format-' + format); |
81 | 100 | |
82 | 101 | if (description.not(':visible')) |
83 | 102 | description.slideDown('fast'); |
… |
… |
window.wp = window.wp || {}; |
119 | 138 | }); |
120 | 139 | }); |
121 | 140 | |
122 | | $('.post-format-change a').click(function() { |
123 | | $('.post-formats-fields, .post-format-change').slideUp(); |
124 | | $('.post-format-options').slideDown(); |
125 | | return false; |
126 | | }); |
127 | | |
128 | 141 | // Post formats selection |
129 | 142 | $('.post-format-options').on( 'click', 'a', function (e) { |
130 | 143 | e.preventDefault(); |