Ticket #7015: gears-manifest.patch
File gears-manifest.patch, 8.0 KB (added by , 16 years ago) |
---|
-
wp-admin/gears-manifest.php
1 1 <?php 2 2 3 3 define( 'ABSPATH', dirname(dirname(__FILE__)) ); 4 define( 'WPINC', '/wp-includes' ); 4 5 5 6 function __() {} 6 7 function add_filter() {} … … 8 9 function apply_filters() {} 9 10 function get_option() {} 10 11 function is_lighttpd_before_150() {} 12 function add_action() {} 13 function do_action_ref_array() {} 14 function get_bloginfo() {} 11 15 function is_admin() {return true;} 12 16 13 17 require(ABSPATH . '/wp-includes/script-loader.php'); 18 require(ABSPATH . '/wp-includes/version.php'); 14 19 15 20 $wp_scripts = new WP_Scripts(); 21 wp_default_scripts($wp_scripts); 16 22 17 $default_js = $version = ''; 18 foreach ( $wp_scripts->scripts as $script ) { 23 $wp_styles = new WP_Styles(); 24 wp_default_styles($wp_styles); 25 26 $get_lang = file_exists( ABSPATH . '/wp-config.php') ? file( ABSPATH . '/wp-config.php' ) : file( dirname(ABSPATH) . '/wp-config.php' ); 27 28 if ( is_array($get_lang) ) { 29 foreach ( $get_lang as $val ) { 30 if ( strpos( $val, "'WPLANG'" ) !== false ) { 31 eval( $val ); 32 break; 33 } 34 } 35 } 36 37 if ( defined('WPLANG') && '' != WPLANG ) { 38 if ( file_exists(ABSPATH . '/wp-content/languages') && @is_dir(ABSPATH . '/wp-content/languages') ) 39 $langdir = '/wp-content/languages/'; 40 else 41 $langdir = '/wp-includes/languages/'; 42 43 $locale_file = ABSPATH . $langdir . WPLANG . '.php'; 44 if ( is_readable($locale_file) ) 45 include_once($locale_file); 46 } 47 48 $rtl = ( isset($text_direction) && 'rtl' == $text_direction ) ? true : false; 49 50 $defaults = $man_version = ''; 51 foreach ( $wp_scripts->registered as $script ) { 19 52 if ( empty($script->src) || strpos($script->src, 'tiny_mce_config.php') ) continue; 20 $ src = str_replace( '/wp-admin/', '', $script->src );21 $src = str_replace( '/wp-includes/', '../wp-includes/', $src );22 $default _js .= '{ "url" : "' . $src . '?ver=' . $script->ver . '" },' . "\n";23 $ version .= $script->ver;53 $ver = empty($script->ver) ? $wp_version : $script->ver; 54 $src = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $script->src ); 55 $defaults .= '{ "url" : "' . $src . '?ver=' . $ver . '" },' . "\n"; 56 $man_version .= $ver; 24 57 } 25 58 26 $version = md5($version); 59 foreach ( $wp_styles->registered as $style ) { 60 if ( empty($style->src) ) continue; 27 61 62 $ver = empty($style->ver) ? $wp_version : $style->ver; 63 $src = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $style->src ); 64 if ( 'colors' == $style->handle ) $src = 'css/colors-classic.css'; 65 $defaults .= '{ "url" : "' . $src . '?ver=' . $ver . '" },' . "\n"; 66 67 if ( $rtl && isset($style->extra['rtl']) && $style->extra['rtl'] ) { 68 if ( is_bool( $style->extra['rtl'] ) ) 69 $rtl_href = str_replace( '.css', '-rtl.css', $src ); 70 else 71 $rtl_href = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $style->extra['rtl'] ); 72 73 $defaults .= '{ "url" : "' . $rtl_href . '?ver=' . $ver . '" },' . "\n"; 74 } 75 $man_version .= $ver; 76 } 77 78 $man_version = md5($man_version); 79 28 80 header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' ); 29 81 header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' ); 30 82 header( 'Cache-Control: no-cache, must-revalidate, max-age=0' ); 31 83 header( 'Pragma: no-cache' ); 32 header( 'Content-Type: application/x-javascript; charset=UTF-8' ); // application/json text/plain ?84 header( 'Content-Type: application/x-javascript; charset=UTF-8' ); 33 85 ?> 34 86 { 35 87 "betaManifestVersion" : 1, 36 "version" : "<?php echo $ version; ?>_20080520",88 "version" : "<?php echo $man_version; ?>_20080522", 37 89 "entries" : [ 38 <?php echo $default _js; ?>90 <?php echo $defaults; ?> 39 91 40 { "url" : "wp-admin.css?version=2.6-bleeding" },41 { "url" : "rtl.css?version=2.6-bleeding" },42 { "url" : "../wp-includes/js/thickbox/thickbox.css?version=2.6-bleeding" },43 { "url" : "css/colors-classic-rtl.css?version=2.6-bleeding" },44 { "url" : "css/colors-classic.css?version=2.6-bleeding" },45 { "url" : "css/colors-fresh-rtl.css?version=2.6-bleeding" },46 { "url" : "css/colors-fresh.css?version=2.6-bleeding" },47 { "url" : "css/dashboard-rtl.css?version=2.6-bleeding" },48 { "url" : "css/dashboard.css?version=2.6-bleeding" },49 { "url" : "css/global.css?version=2.6-bleeding" },50 { "url" : "css/global-rtl.css?version=2.6-bleeding" },51 { "url" : "css/ie-rtl.css?version=2.6-bleeding" },52 { "url" : "css/ie.css?version=2.6-bleeding" },53 { "url" : "css/install-rtl.css?version=2.6-bleeding" },54 { "url" : "css/install.css?version=2.6-bleeding" },55 { "url" : "css/login-rtl.css?version=2.6-bleeding" },56 { "url" : "css/login.css?version=2.6-bleeding" },57 { "url" : "css/media-rtl.css?version=2.6-bleeding" },58 { "url" : "css/media.css?version=2.6-bleeding" },59 { "url" : "css/press-this.css?version=2.6-bleeding" },60 { "url" : "css/theme-editor-rtl.css?version=2.6-bleeding" },61 { "url" : "css/theme-editor.css?version=2.6-bleeding" },62 { "url" : "css/upload-rtl.css?version=2.6-bleeding" },63 { "url" : "css/widgets-rtl.css?version=2.6-bleeding" },64 { "url" : "css/widgets.css?version=2.6-bleeding" },65 66 92 { "url" : "images/align-center.png" }, 67 93 { "url" : "images/align-left.png" }, 68 94 { "url" : "images/align-none.png" }, 69 95 { "url" : "images/align-right.png" }, 96 { "url" : "images/browse-happy.gif" }, 70 97 { "url" : "images/bubble_bg.gif" }, 71 98 { "url" : "images/comment-grey-bubble.png" }, 72 99 { "url" : "images/comment-pill.gif" }, … … 75 102 { "url" : "images/comment-stalk-rtl.gif" }, 76 103 { "url" : "images/date-button.gif" }, 77 104 { "url" : "images/fade-butt.png" }, 105 { "url" : "images/gear.png" }, 78 106 { "url" : "images/logo-ghost.png" }, 79 107 { "url" : "images/logo-login.gif" }, 108 { "url" : "images/logo.gif" }, 80 109 { "url" : "images/media-button-gallery.gif" }, 81 110 { "url" : "images/media-button-image.gif" }, 82 111 { "url" : "images/media-button-music.gif" }, 83 112 { "url" : "images/media-button-other.gif" }, 84 113 { "url" : "images/media-button-video.gif" }, 85 114 { "url" : "images/media-buttons.gif" }, 115 { "url" : "images/tab.png" }, 86 116 { "url" : "images/tail.gif" }, 87 117 { "url" : "images/toggle-arrow-rtl.gif" }, 88 118 { "url" : "images/toggle-arrow.gif" }, 89 119 { "url" : "images/wordpress-logo.png" }, 90 120 { "url" : "images/xit.gif" }, 121 91 122 { "url" : "../wp-includes/images/crystal/archive.png" }, 92 123 { "url" : "../wp-includes/images/crystal/audio.png" }, 93 124 { "url" : "../wp-includes/images/crystal/code.png" }, -
wp-includes/general-template.php
1158 1158 echo apply_filters( 'wp_admin_css', "<link rel='stylesheet' href='" . clean_url( wp_admin_css_uri( "$file-rtl" ) ) . "' type='text/css' />\n", "$file-rtl" ); 1159 1159 } 1160 1160 1161 /** 1162 * Enqueues the default ThickBox js and css. 1163 * If any of the settings need to be changed, this can be done with another js file 1164 * similar to media-upload.js and theme-preview.js. That file should require array('thickbox') 1165 * to ensure it is loaded after. 1166 */ 1161 1167 function add_thickbox() { 1162 1168 wp_enqueue_script( 'thickbox' ); 1163 add_action( 'admin_print_scripts', 'add_thickbox_css' );1169 wp_enqueue_style( 'thickbox' ); 1164 1170 } 1165 1171 1166 function add_thickbox_css() {1167 wp_admin_css( 'css/thickbox' );1168 }1169 1170 1172 /** 1171 1173 * Outputs the XHTML generator that is generated on the wp_head hook. 1172 1174 */ -
wp-includes/script-loader.php
158 158 'edit' => __('Edit'), 159 159 ) ); 160 160 $scripts->add( 'admin-gallery', '/wp-admin/js/gallery.js', array( 'jquery-ui-sortable' ), '20080520' ); 161 $scripts->add( 'media-upload', '/wp-admin/js/media-upload.js', false, '20080430' );161 $scripts->add( 'media-upload', '/wp-admin/js/media-upload.js', array( 'thickbox' ), '20080430' ); 162 162 $scripts->localize( 'upload', 'uploadL10n', array( 163 163 'browseTitle' => attribute_escape(__('Browse your files')), 164 164 'back' => __('« Back'),