public static function revision_admin_footer()
{
$post = get_post();
if ('custom_css' !== $post->post_type) {
return;
}
$stylesheet = $post->post_title;
?>
<script type="text/html" id="tmpl-other-themes-switcher">
<?php
self::revisions_switcher_box($stylesheet);
?>
</script>
<style>
.other-themes-wrap {
float: right;
background-color: #fff;
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.1);
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
padding: 5px 10px;
margin-bottom: 10px;
}
.other-themes-wrap label {
display: block;
margin-bottom: 10px;
}
.other-themes-wrap select {
float: left;
width: 77%;
}
.other-themes-wrap button {
float: right;
width: 20%;
}
.revisions {
clear: both;
}
/* Hide the back-to-post link */
.long-header + a {
display: none;
}
</style>
<script>
(function($){
var switcher = $('#tmpl-other-themes-switcher').html(),
qty = $( switcher ).find('select option').length,
$switcher;
if ( qty >= 3 ) {
$('h1.long-header').before( switcher );
$switcher = $('.other-themes-wrap');
$switcher.find('button').on('click', function(e){
e.preventDefault();
if ( $switcher.find('select').val() ) {
window.location.href = $switcher.find('select').val();
}
})
}
})(jQuery);
</script>
<?php
}