WordPress.org

Make WordPress Core

Ticket #7262: 7262.diff

File 7262.diff, 10.3 KB (added by Otto42, 10 years ago)

Patch to add an HTML5 cache manifest to the wp-admin

  • wp-admin/admin-header.php

     
    2424
    2525?>
    2626<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    27 <html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
     27<html manifest="<?php echo admin_url('cache-manifest.php'); ?>" xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
    2828<head>
    2929<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
    3030<title><?php bloginfo('name') ?> &rsaquo; <?php echo wp_specialchars( strip_tags( $title ) ); ?> &#8212; WordPress</title>
  • wp-admin/cache-manifest.php

     
     1<?php
     2
     3define( 'ABSPATH', dirname(dirname(__FILE__)) );
     4define( 'WPINC', '/wp-includes' );
     5
     6function __() {}
     7function add_filter() {}
     8function attribute_escape() {}
     9function apply_filters() {}
     10function get_option() {}
     11function is_lighttpd_before_150() {}
     12function add_action() {}
     13function do_action_ref_array() {}
     14function get_bloginfo() {}
     15function is_admin() {return true;}
     16function site_url() {}
     17function admin_url() {}
     18function wp_guess_url() {}
     19
     20require(ABSPATH . '/wp-includes/script-loader.php');
     21require(ABSPATH . '/wp-includes/version.php');
     22
     23$wp_scripts = new WP_Scripts();
     24wp_default_scripts($wp_scripts);
     25
     26$wp_styles = new WP_Styles();
     27wp_default_styles($wp_styles);
     28
     29$defaults = $man_version = '';
     30foreach ( $wp_scripts->registered as $script ) {
     31        if ( empty($script->src) || strpos($script->src, 'tiny_mce_config.php') ) continue;
     32        $ver = empty($script->ver) ? $wp_version : $script->ver;
     33        $src = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $script->src );
     34        $defaults .= $src . '?ver=' . $ver . "\n";
     35        $man_version .= $ver;
     36}
     37
     38foreach ( $wp_styles->registered as $style ) {
     39        if ( empty($style->src) ) continue;
     40
     41        $ver = empty($style->ver) ? $wp_version : $style->ver;
     42        $src = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $style->src );
     43        if ( 'colors' == $style->handle ) $src = 'css/colors-classic.css';
     44        $defaults .= $src . '?ver=' . $ver . "\n";
     45
     46        if ( isset($style->extra['rtl']) && $style->extra['rtl'] ) {
     47                if ( is_bool( $style->extra['rtl'] ) )
     48                        $rtl_href = str_replace( '.css', '-rtl.css', $src );
     49                else
     50                        $rtl_href = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $style->extra['rtl'] );
     51
     52                $defaults .= $rtl_href . '?ver=' . $ver . "\n";
     53        }
     54        $man_version .= $ver;
     55}
     56
     57$man_version = md5($man_version);
     58
     59header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
     60header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
     61header( 'Cache-Control: no-cache, must-revalidate, max-age=0' );
     62header( 'Pragma: no-cache' );
     63header( 'Content-Type: text/cache-manifest; charset=UTF-8' );
     64?>
     65CACHE MANIFEST
     66#
     67# Version: <?php echo $man_version; ?>_20080710
     68#
     69<?php echo $defaults; ?>
     70images/align-center.png
     71images/align-left.png
     72images/align-none.png
     73images/align-right.png
     74images/browse-happy.gif
     75images/bubble_bg.gif
     76images/comment-grey-bubble.png
     77images/comment-pill.gif
     78images/comment-stalk-classic.gif
     79images/comment-stalk-fresh.gif
     80images/comment-stalk-rtl.gif
     81images/date-button.gif
     82images/fade-butt.png
     83images/gear.png
     84images/logo-ghost.png
     85images/logo-login.gif
     86images/logo.gif
     87images/media-button-gallery.gif
     88images/media-button-image.gif
     89images/media-button-music.gif
     90images/media-button-other.gif
     91images/media-button-video.gif
     92images/media-buttons.gif
     93images/tab.png
     94images/tail.gif
     95images/toggle-arrow-rtl.gif
     96images/toggle-arrow.gif
     97images/wordpress-logo.png
     98images/xit.gif
     99images/loading-publish.gif
     100images/loading.gif
     101images/required.gif
     102images/no.png
     103images/yes.png
     104
     105../wp-includes/images/crystal/archive.png
     106../wp-includes/images/crystal/audio.png
     107../wp-includes/images/crystal/code.png
     108../wp-includes/images/crystal/default.png
     109../wp-includes/images/crystal/document.png
     110../wp-includes/images/crystal/interactive.png
     111../wp-includes/images/crystal/text.png
     112../wp-includes/images/crystal/video.png
     113../wp-includes/images/crystal/spreadsheet.png
     114../wp-includes/images/rss.png
     115../wp-includes/js/thickbox/loadingAnimation.gif
     116../wp-includes/js/thickbox/tb-close.png
     117../wp-includes/js/swfupload/swfupload_f9.swf
     118
     119../wp-includes/js/tinymce/tiny_mce_popup.js?ver=311
     120../wp-includes/js/tinymce/utils/mctabs.js?ver=311
     121../wp-includes/js/tinymce/utils/validate.js?ver=311
     122../wp-includes/js/tinymce/utils/form_utils.js?ver=311
     123../wp-includes/js/tinymce/utils/editable_selects.js?ver=311
     124../wp-includes/js/tinymce/plugins/paste/js/pasteword.js?ver=311
     125../wp-includes/js/tinymce/plugins/paste/js/pastetext.js?ver=311
     126../wp-includes/js/tinymce/plugins/media/js/media.js?ver=311
     127../wp-includes/js/tinymce/themes/advanced/js/color_picker.js?ver=311
     128../wp-includes/js/tinymce/themes/advanced/js/charmap.js?ver=311
     129../wp-includes/js/tinymce/themes/advanced/js/image.js?ver=311
     130../wp-includes/js/tinymce/themes/advanced/js/link.js?ver=311
     131../wp-includes/js/tinymce/themes/advanced/js/source_editor.js?ver=311
     132../wp-includes/js/tinymce/themes/advanced/js/anchor.js?ver=311
     133../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=311c
     134../wp-includes/js/tinymce/tiny_mce.js?ver=311
     135../wp-includes/js/tinymce/themes/advanced/editor_template.js?ver=311
     136../wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js?ver=311
     137
     138../wp-includes/js/tinymce/themes/advanced/source_editor.htm?ver=311
     139../wp-includes/js/tinymce/themes/advanced/anchor.htm?ver=311
     140../wp-includes/js/tinymce/themes/advanced/image.htm?ver=311
     141../wp-includes/js/tinymce/themes/advanced/link.htm?ver=311
     142../wp-includes/js/tinymce/themes/advanced/color_picker.htm?ver=311
     143../wp-includes/js/tinymce/themes/advanced/charmap.htm?ver=311
     144../wp-includes/js/tinymce/plugins/media/media.htm?ver=311
     145../wp-includes/js/tinymce/plugins/paste/pasteword.htm?ver=311
     146../wp-includes/js/tinymce/plugins/paste/blank.htm?ver=311
     147../wp-includes/js/tinymce/plugins/paste/pastetext.htm?ver=311
     148../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=311
     149../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=311
     150../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311c
     151../wp-includes/js/tinymce/wp-mce-help.php?ver=311
     152
     153../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css?ver=311
     154../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css?ver=311
     155../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css?ver=311
     156../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css?ver=311
     157../wp-includes/js/tinymce/plugins/spellchecker/css/content.css?ver=311
     158../wp-includes/js/tinymce/plugins/wordpress/css/content.css?ver=311
     159../wp-includes/js/tinymce/plugins/media/css/content.css?ver=311
     160../wp-includes/js/tinymce/plugins/media/css/media.css?ver=311
     161../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=311
     162../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=311
     163../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311c
     164../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css?ver=311
     165../wp-includes/js/tinymce/wordpress.css?ver=311
     166
     167../wp-includes/js/tinymce/themes/advanced/img/icons.gif
     168../wp-includes/js/tinymce/themes/advanced/img/colorpicker.jpg
     169../wp-includes/js/tinymce/themes/advanced/img/fm.gif
     170../wp-includes/js/tinymce/themes/advanced/img/gotmoxie.png
     171../wp-includes/js/tinymce/themes/advanced/img/sflogo.png
     172../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/butt2.png
     173../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/fade-butt.png
     174../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/tabs.gif
     175../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/down_arrow.gif
     176../wp-includes/js/tinymce/themes/advanced/skins/default/img/progress.gif
     177../wp-includes/js/tinymce/themes/advanced/skins/default/img/menu_check.gif
     178../wp-includes/js/tinymce/themes/advanced/skins/default/img/menu_arrow.gif
     179../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/drag.gif
     180../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif
     181../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif
     182../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif
     183../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif
     184../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/button.gif
     185../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif
     186../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif
     187../wp-includes/js/tinymce/plugins/media/img/flash.gif
     188../wp-includes/js/tinymce/plugins/media/img/flv_player.swf
     189../wp-includes/js/tinymce/plugins/media/img/quicktime.gif
     190../wp-includes/js/tinymce/plugins/media/img/realmedia.gif
     191../wp-includes/js/tinymce/plugins/media/img/shockwave.gif
     192../wp-includes/js/tinymce/plugins/media/img/windowsmedia.gif
     193../wp-includes/js/tinymce/plugins/media/img/trans.gif
     194../wp-includes/js/tinymce/plugins/wordpress/img/more.gif
     195../wp-includes/js/tinymce/plugins/wordpress/img/more_bug.gif
     196../wp-includes/js/tinymce/plugins/wordpress/img/page.gif
     197../wp-includes/js/tinymce/plugins/wordpress/img/page_bug.gif
     198../wp-includes/js/tinymce/plugins/wordpress/img/toolbars.gif
     199../wp-includes/js/tinymce/plugins/wpeditimage/img/image.png
     200../wp-includes/js/tinymce/plugins/wpeditimage/img/delete.png
     201../wp-includes/js/tinymce/plugins/wordpress/img/help.gif
     202../wp-includes/js/tinymce/plugins/wordpress/img/image.gif
     203../wp-includes/js/tinymce/plugins/wordpress/img/media.gif
     204../wp-includes/js/tinymce/plugins/wordpress/img/video.gif
     205../wp-includes/js/tinymce/plugins/wordpress/img/audio.gif
     206