Changeset 20417
- Timestamp:
- 04/10/2012 01:19:30 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-header.php
r19871 r20417 12 12 13 13 // In case admin-header.php is included in a function. 14 global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow, $wp_version, $is_iphone,14 global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow, $wp_version, 15 15 $current_site, $update_title, $total_update_count, $parent_file; 16 16 … … 88 88 $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); 89 89 90 if ( $is_iphone ) { ?> 91 <style type="text/css">.row-actions{visibility:visible;}</style> 92 <?php } ?> 90 if ( wp_is_mobile() ) 91 $admin_body_class .= ' mobile'; 92 93 ?> 93 94 </head> 94 95 <body class="wp-admin no-js <?php echo apply_filters( 'admin_body_class', '' ) . " $admin_body_class"; ?>"> -
trunk/wp-admin/css/wp-admin.dev.css
r20414 r20417 5324 5324 } 5325 5325 5326 .mobile .row-actions { 5327 visibility: visible; 5328 } 5329 5326 5330 tr:hover .row-actions, 5327 5331 div.comment-item:hover .row-actions { -
trunk/wp-admin/includes/media.php
r20382 r20417 63 63 */ 64 64 function the_media_upload_tabs() { 65 global $redir_tab , $is_iphone;65 global $redir_tab; 66 66 $tabs = media_upload_tabs(); 67 67 68 if ( $is_iphone) {68 if ( wp_is_mobile() ) { 69 69 unset($tabs['type']); 70 70 $default = 'type_url'; … … 529 529 */ 530 530 function wp_media_upload_handler() { 531 global $is_iphone;532 533 531 $errors = array(); 534 532 $id = 0; … … 601 599 } 602 600 603 if ( $is_iphone)601 if ( wp_is_mobile() ) 604 602 return wp_iframe( 'media_upload_type_url_form', 'image', $errors, $id ); 605 603 else … … 1307 1305 */ 1308 1306 function media_upload_form( $errors = null ) { 1309 global $type, $tab, $pagenow, $is_IE, $is_opera , $is_iphone;1310 1311 if ( $is_iphone)1307 global $type, $tab, $pagenow, $is_IE, $is_opera; 1308 1309 if ( wp_is_mobile() ) 1312 1310 return; 1313 1311 … … 1441 1439 */ 1442 1440 function media_upload_type_form($type = 'file', $errors = null, $id = null) { 1443 global $is_iphone; 1444 1445 if ( $is_iphone ) 1441 if ( wp_is_mobile() ) 1446 1442 return; 1447 1443 -
trunk/wp-admin/includes/misc.php
r20023 r20417 584 584 585 585 function _ipad_meta() { 586 if ( strpos($_SERVER['HTTP_USER_AGENT'], 'iPad') !== false ) { ?> 587 <meta name="viewport" id="ipad-viewportmeta" content="width=device-width, initial-scale=1"> 588 <?php 586 if ( wp_is_mobile() ) { 587 ?> 588 <meta name="viewport" id="viewport-meta" content="width=device-width, initial-scale=1"> 589 <?php 589 590 } 590 591 } -
trunk/wp-admin/js/postbox.dev.js
r20293 r20417 1 var postboxes , is_iPad = navigator.userAgent.match(/iPad/);1 var postboxes; 2 2 3 3 (function($) { -
trunk/wp-admin/media-new.php
r19712 r20417 7 7 */ 8 8 9 global $is_iphone; 10 11 if ( $is_iphone ) // cannot upload files from iPhone/iPad 9 if ( wp_is_mobile() ) // cannot upload files from mobile devices 12 10 return; 13 11 -
trunk/wp-admin/menu.php
r19712 r20417 57 57 $submenu['upload.php'][5] = array( __('Library'), 'upload_files', 'upload.php'); 58 58 /* translators: add new file */ 59 if ( ! $is_iphone)59 if ( ! wp_is_mobile() ) 60 60 $submenu['upload.php'][10] = array( _x('Add New', 'file'), 'upload_files', 'media-new.php'); 61 61 -
trunk/wp-includes/class-wp-admin-bar.php
r19712 r20417 322 322 323 323 final protected function _render( $root ) { 324 global $is_IE , $is_iphone;324 global $is_IE; 325 325 326 326 // Add browser classes. … … 334 334 elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE 9' ) ) 335 335 $class .= ' ie9'; 336 } elseif ( $is_iphone) {336 } elseif ( wp_is_mobile() ) { 337 337 $class .= ' mobile'; 338 338 } -
trunk/wp-includes/general-template.php
r20326 r20417 1747 1747 */ 1748 1748 function user_can_richedit() { 1749 global $wp_rich_edit, $is_gecko, $is_opera, $is_safari, $is_chrome, $is_ iphone, $is_IE;1749 global $wp_rich_edit, $is_gecko, $is_opera, $is_safari, $is_chrome, $is_IE; 1750 1750 1751 1751 if ( !isset($wp_rich_edit) ) { … … 1754 1754 if ( get_user_option( 'rich_editing' ) == 'true' || ! is_user_logged_in() ) { // default to 'true' for logged out users 1755 1755 if ( $is_safari ) { 1756 if ( $is_iphone|| false !== strpos( $_SERVER['HTTP_USER_AGENT'], '; Silk/' ) )1756 if ( wp_is_mobile() || false !== strpos( $_SERVER['HTTP_USER_AGENT'], '; Silk/' ) ) 1757 1757 $wp_rich_edit = ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval( $match[1] ) >= 534 ); 1758 1758 else -
trunk/wp-includes/vars.php
r19712 r20417 98 98 */ 99 99 $is_iis7 = $is_IIS && (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/7.') !== false); 100 101 /** 102 * Test if the current browser runs on a mobile device (smart phone, tablet, etc.) 103 * 104 * @return bool true|false 105 */ 106 function wp_is_mobile() { 107 static $is_mobile; 108 109 if ( isset($is_mobile) ) 110 return $is_mobile; 111 112 if ( empty($_SERVER['HTTP_USER_AGENT']) ) { 113 $is_mobile = false; 114 } elseif ( strpos($_SERVER['HTTP_USER_AGENT'], 'Mobile') !== false // many mobile devices (all iPhone, iPad, etc.) 115 || strpos($_SERVER['HTTP_USER_AGENT'], 'Android') !== false 116 || strpos($_SERVER['HTTP_USER_AGENT'], 'BlackBerry') !== false 117 || strpos($_SERVER['HTTP_USER_AGENT'], 'Opera Mini') !== false ) { 118 $is_mobile = true; 119 } else { 120 $is_mobile = false; 121 } 122 123 return $is_mobile; 124 } -
trunk/wp-login.php
r19925 r20417 40 40 */ 41 41 function login_header($title = 'Log In', $message = '', $wp_error = '') { 42 global $error, $i s_iphone, $interim_login, $current_site;42 global $error, $interim_login, $current_site; 43 43 44 44 // Don't index any of these forms … … 55 55 add_action( 'login_head', 'wp_shake_js', 12 ); 56 56 57 ?> 58 <!DOCTYPE html> 59 <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> 60 <head> 57 ?><!DOCTYPE html> 58 <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> 59 <head> 61 60 <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> 62 61 <title><?php bloginfo('name'); ?> › <?php echo $title; ?></title> 63 <?php 62 <?php 63 64 64 wp_admin_css( 'wp-admin', true ); 65 65 wp_admin_css( 'colors-fresh', true ); 66 66 67 if ( $is_iphone ) { ?> 68 <meta name="viewport" content="width=320; initial-scale=0.9; maximum-scale=1.0; user-scalable=0;" /> 69 <style type="text/css" media="screen"> 70 .login form, .login .message, #login_error { margin-left: 0px; } 71 .login #nav, .login #backtoblog { margin-left: 8px; } 72 .login h1 a { width: auto; } 73 #login { padding: 20px 0; } 74 </style> 75 <?php 67 if ( wp_is_mobile() ) { 68 ?> 69 <meta name="viewport" content="width=320; initial-scale=0.9; maximum-scale=1.0; user-scalable=0;" /> 70 <style type="text/css" media="screen"> 71 .login form, .login .message, #login_error { margin-left: 0px; } 72 .login #nav, .login #backtoblog { margin-left: 8px; } 73 .login h1 a { width: auto; } 74 #login { padding: 20px 0; } 75 </style> 76 <?php 76 77 } 77 78 … … 89 90 $login_header_url = apply_filters( 'login_headerurl', $login_header_url ); 90 91 $login_header_title = apply_filters( 'login_headertitle', $login_header_title ); 91 ?> 92 </head> 93 <body class="login"> 92 93 ?> 94 </head> 95 <body class="login"> 94 96 <div id="login"> 95 97 <h1><a href="<?php echo esc_url( $login_header_url ); ?>" title="<?php echo esc_attr( $login_header_title ); ?>"><?php bloginfo( 'name' ); ?></a></h1> 96 <?php 98 <?php 99 97 100 unset( $login_header_url, $login_header_title ); 98 101 99 102 $message = apply_filters('login_message', $message); 100 if ( !empty( $message ) ) echo $message . "\n"; 103 if ( !empty( $message ) ) 104 echo $message . "\n"; 101 105 102 106 // In case a plugin uses $error rather than the $wp_errors object … … 135 139 </div> 136 140 137 <?php if ( !empty($input_id) ) : ?>138 <script type="text/javascript">139 try{document.getElementById('<?php echo $input_id; ?>').focus();}catch(e){}140 if(typeof wpOnload=='function')wpOnload();141 </script>142 <?php endif; ?>143 144 <?php do_action('login_footer'); ?>145 <div class="clear"></div>146 </body>147 </html>148 <?php141 <?php if ( !empty($input_id) ) : ?> 142 <script type="text/javascript"> 143 try{document.getElementById('<?php echo $input_id; ?>').focus();}catch(e){} 144 if(typeof wpOnload=='function')wpOnload(); 145 </script> 146 <?php endif; ?> 147 148 <?php do_action('login_footer'); ?> 149 <div class="clear"></div> 150 </body> 151 </html> 152 <?php 149 153 } 150 154 151 155 function wp_shake_js() { 152 global $is_iphone; 153 if ( $is_iphone ) 156 if ( wp_is_mobile() ) 154 157 return; 155 158 ?>
Note: See TracChangeset
for help on using the changeset viewer.