WordPress.org

Make WordPress Core

Ticket #20805: 20805-7.patch

File 20805-7.patch, 13.9 KB (added by koopersmith, 9 years ago)
  • wp-includes/js/plupload/wp-plupload.dev.js

     
    44(function( exports, $ ) {
    55        var Uploader;
    66
     7        if ( typeof _wpPluploadSettings === 'undefined' )
     8                return;
     9
    710        /*
    811         * An object that helps create a WordPress uploader using plupload.
    912         *
     
    2730                        },
    2831                        key;
    2932
     33                this.supports = {
     34                        upload: Uploader.browser.supported
     35                };
     36
     37                this.supported = this.supports.upload;
     38
     39                if ( ! this.supported )
     40                        return;
     41
    3042                // Use deep extend to ensure that multipart_params and other objects are cloned.
    31                 this.plupload = $.extend( true, { multipart_params: {} }, wpPluploadDefaults );
     43                this.plupload = $.extend( true, { multipart_params: {} }, Uploader.defaults );
    3244                this.container = document.body; // Set default container.
    3345
    3446                // Extend the instance with options
     
    6880                this.param( this.params || {} );
    6981                delete this.params;
    7082
    71                 this.uploader.bind( 'Init', this.init );
    72 
    7383                this.uploader.init();
    7484
     85                this.supports.dragdrop = this.uploader.features.dragdrop && ! Uploader.browser.mobile;
     86
    7587                // Generate drag/drop helper classes.
    7688                (function( dropzone, supported ) {
    7789                        var sensitivity = 50,
     
    99111                                active = false;
    100112                                dropzone.removeClass('drag-over');
    101113                        });
    102                 }( this.dropzone, this.uploader.features.dragdrop ));
     114                }( this.dropzone, this.supports.dragdrop ));
    103115
    104116                this.browser.on( 'mouseenter', this.refresh );
    105117
     
    147159                        up.refresh();
    148160                        up.start();
    149161                });
     162
     163                this.init();
    150164        };
    151165
     166        // Adds the 'defaults' and 'browser' properties.
     167        $.extend( Uploader, _wpPluploadSettings );
     168
    152169        Uploader.uuid = 0;
    153170
    154171        Uploader.errorMap = {
     
    200217        });
    201218
    202219        exports.Uploader = Uploader;
    203 })( wp, jQuery );
    204  No newline at end of file
     220})( wp, jQuery );
  • wp-includes/js/customize-loader.dev.js

     
    7070                        if ( this.active )
    7171                                return;
    7272
     73                        // Load the full page on mobile devices.
     74                        if ( Loader.settings.browser.mobile )
     75                                return window.location = src;
     76
    7377                        this.active = true;
    7478                        this.body.addClass('customize-loading');
    7579
  • wp-includes/class-wp-customize-control.php

     
    331331                        $src = call_user_func( $this->get_url, $src );
    332332
    333333                ?>
    334                 <label class="customize-image-picker">
     334                <div class="customize-image-picker">
    335335                        <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
    336336
    337337                        <div class="customize-control-content">
     
    366366                        <div class="actions">
    367367                                <a href="#" class="remove"><?php _e( 'Remove Image' ); ?></a>
    368368                        </div>
    369                 </label>
     369                </div>
    370370                <?php
    371371        }
    372372
     
    382382        }
    383383
    384384        public function tab_upload_new() {
    385                 ?>
    386                 <div class="upload-dropzone">
    387                         <?php _e('Drop a file here or <a href="#" class="upload">select a file</a>.'); ?>
    388                 </div>
    389                 <div class="upload-fallback">
    390                         <span class="button-secondary"><?php _e('Select File'); ?></span>
    391                 </div>
    392                 <?php
     385                if ( ! _device_can_upload() ) {
     386                        ?>
     387                        <p><?php _e('The web browser on your device cannot be used to upload files. You may be able to use the <a href="http://wordpress.org/extend/mobile/">native app for your device</a> instead.'); ?></p>
     388                        <?php
     389                } else {
     390                        ?>
     391                        <div class="upload-dropzone">
     392                                <?php _e('Drop a file here or <a href="#" class="upload">select a file</a>.'); ?>
     393                        </div>
     394                        <div class="upload-fallback">
     395                                <span class="button-secondary"><?php _e('Select File'); ?></span>
     396                        </div>
     397                        <?php
     398                }
    393399        }
    394400
    395401        public function tab_uploaded() {
  • wp-includes/theme.php

     
    16051605        $home_origin  = parse_url( home_url() );
    16061606        $cross_domain = ( strtolower( $admin_origin[ 'host' ] ) != strtolower( $home_origin[ 'host' ] ) );
    16071607
     1608        $browser = array(
     1609                'mobile' => wp_is_mobile(),
     1610                'ios'    => wp_is_mobile() && preg_match( '/iPad|iPod|iPhone/', $_SERVER['HTTP_USER_AGENT'] ),
     1611        );
     1612
    16081613        $settings = array(
    16091614                'url'           => esc_url( admin_url( 'customize.php' ) ),
    16101615                'isCrossDomain' => $cross_domain,
     1616                'browser'       => $browser,
    16111617        );
    16121618
    16131619        $script = 'var _wpCustomizeLoaderSettings = ' . json_encode( $settings ) . ';';
  • wp-includes/media.php

     
    14671467
    14681468        $max_upload_size = wp_max_upload_size();
    14691469
    1470         $settings = array(
     1470        $defaults = array(
    14711471                'runtimes'            => 'html5,silverlight,flash,html4',
    14721472                'file_data_name'      => 'async-upload', // key passed to $_FILE.
    14731473                'multiple_queues'     => true,
     
    14801480                'urlstream_upload'    => true,
    14811481        );
    14821482
    1483         $settings = apply_filters( 'plupload_default_settings', $settings );
     1483        $defaults = apply_filters( 'plupload_default_settings', $defaults );
    14841484
    14851485        $params = array(
    14861486                'action' => 'upload-attachment',
     
    14881488
    14891489        $params = apply_filters( 'plupload_default_params', $params );
    14901490        $params['_wpnonce'] = wp_create_nonce( 'media-form' );
    1491         $settings['multipart_params'] = $params;
     1491        $defaults['multipart_params'] = $params;
    14921492
    1493         $script = 'var wpPluploadDefaults = ' . json_encode( $settings ) . ';';
     1493        $settings = array(
     1494                'defaults' => $defaults,
     1495                'browser'  => array(
     1496                        'mobile'    => wp_is_mobile(),
     1497                        'supported' => _device_can_upload(),
     1498                ),
     1499        );
    14941500
     1501        $script = 'var _wpPluploadSettings = ' . json_encode( $settings ) . ';';
     1502
    14951503        $data = $wp_scripts->get_data( 'wp-plupload', 'data' );
    14961504        if ( $data )
    14971505                $script = "$data\n$script";
  • wp-admin/includes/class-wp-theme-install-list-table.php

     
    250250         */
    251251        function theme_installer() {
    252252                ?>
    253                 <div id="theme-installer" class="wp-full-overlay">
     253                <div id="theme-installer" class="wp-full-overlay expanded">
    254254                        <div class="wp-full-overlay-sidebar">
    255255                                <div class="wp-full-overlay-header">
    256256                                        <a href="#" class="close-full-overlay"><?php _e( '&larr; Close' ); ?></a>
  • wp-admin/customize.php

     
    3939wp_user_settings();
    4040_wp_admin_html_begin();
    4141
     42$body_class = '';
     43
     44if ( wp_is_mobile() ) :
     45        $body_class .= ' mobile';
     46
     47        ?><meta name="viewport" id="viewport-meta" content="width=device-width, initial-scale=0.8, minimum-scale=0.5, maximum-scale=1.2"><?php
     48endif;
     49
     50$is_ios = wp_is_mobile() && preg_match( '/iPad|iPod|iPhone/', $_SERVER['HTTP_USER_AGENT'] );
     51
     52if ( $is_ios )
     53        $body_class .= ' ios';
     54
    4255$admin_title = sprintf( __( '%1$s &#8212; WordPress' ), strip_tags( sprintf( __( 'Customize %s' ), $wp_customize->theme()->display('Name') ) ) );
    4356?><title><?php echo $admin_title; ?></title><?php
    4457
     
    4659do_action( 'customize_controls_print_scripts' );
    4760?>
    4861</head>
    49 <body class="wp-full-overlay">
     62<body class="<?php echo esc_attr( $body_class ); ?>">
     63<div class="wp-full-overlay expanded">
    5064        <form id="customize-controls" class="wrap wp-full-overlay-sidebar">
    5165                <?php wp_nonce_field( 'customize_controls' ); ?>
    5266                <div id="customize-header-actions" class="wp-full-overlay-header">
     
    145159                        'isCrossDomain' => $cross_domain,
    146160                        'fallback'      => $fallback_url,
    147161                ),
     162                'browser'  => array(
     163                        'mobile' => wp_is_mobile(),
     164                        'ios'    => $is_ios,
     165                ),
    148166                'settings' => array(),
    149167                'controls' => array(),
    150168        );
     
    165183        <script type="text/javascript">
    166184                var _wpCustomizeSettings = <?php echo json_encode( $settings ); ?>;
    167185        </script>
     186</div>
    168187</body>
    169188</html>
  • wp-admin/js/theme.dev.js

     
    4141        });
    4242
    4343        preview.on( 'click', '.collapse-sidebar', function( event ) {
    44                 preview.toggleClass('collapsed');
     44                preview.toggleClass( 'collapsed' ).toggleClass( 'expanded' );
    4545                event.preventDefault();
    4646        });
    4747
  • wp-admin/js/customize-controls.dev.js

     
    148148                                success:   this.success
    149149                        }, this.uploader || {} );
    150150
     151                        if ( this.uploader.supported ) {
     152                                if ( control.params.context )
     153                                        control.uploader.param( 'post_data[context]', this.params.context );
     154
     155                                control.uploader.param( 'post_data[theme]', api.settings.theme.stylesheet );
     156                        }
     157
    151158                        this.uploader = new wp.Uploader( this.uploader );
    152159
    153160                        this.remover = this.container.find('.remove');
     
    159166                        this.removerVisibility = $.proxy( this.removerVisibility, this );
    160167                        this.setting.bind( this.removerVisibility );
    161168                        this.removerVisibility( this.setting.get() );
    162 
    163                         if ( this.params.context )
    164                                 control.uploader.param( 'post_data[context]', this.params.context );
    165 
    166                         control.uploader.param( 'post_data[theme]', api.settings.theme.stylesheet );
    167169                },
    168170                success: function( attachment ) {
    169171                        this.setting.set( attachment.url );
     
    182184                                init: function( up ) {
    183185                                        var fallback, button;
    184186
    185                                         if ( up.features.dragdrop )
     187                                        if ( this.supports.dragdrop )
    186188                                                return;
    187189
    188190                                        // Maintain references while wrapping the fallback button.
     
    566568                        return window.location = api.settings.url.fallback;
    567569
    568570                var body = $( document.body ),
     571                        overlay = body.children('.wp-full-overlay'),
    569572                        query, previewer, parent;
    570573
    571574                // Prevent the form from saving when enter is pressed.
     
    702705                });
    703706
    704707                $('.collapse-sidebar').click( function( event ) {
    705                         body.toggleClass( 'collapsed' );
     708                        overlay.toggleClass( 'collapsed' ).toggleClass( 'expanded' );
    706709                        event.preventDefault();
    707710                });
    708711
  • wp-admin/css/wp-admin.dev.css

     
    52555255        overflow: visible;
    52565256        top: 0;
    52575257        bottom: 0;
    5258         left: 300px;
     5258        left: 0;
    52595259        right: 0;
    52605260        height: 100%;
    52615261        min-width: 0;
    52625262}
    52635263
    5264 .wp-full-overlay.collapsed {
    5265         left: 0 !important;
    5266 }
    5267 
    52685264.wp-full-overlay-sidebar {
    52695265        -webkit-box-sizing: border-box;
    52705266        -moz-box-sizing:    border-box;
    52715267        box-sizing:         border-box;
    52725268
    5273         position: absolute;
     5269        position: fixed;
    52745270        width: 300px;
    52755271        height: 100%;
    52765272        top: 0;
    52775273        bottom: 0;
    5278         right: 100%;
     5274        left: 0;
    52795275        padding: 0;
    52805276        margin: 0;
    52815277        z-index: 10;
     
    52885284        overflow: visible;
    52895285}
    52905286
     5287.wp-full-overlay.collapsed,
     5288.wp-full-overlay.expanded .wp-full-overlay-sidebar {
     5289        margin-left: 0 !important;
     5290}
     5291
     5292.wp-full-overlay.expanded {
     5293        margin-left: 300px;
     5294}
     5295
     5296.wp-full-overlay.collapsed .wp-full-overlay-sidebar {
     5297        margin-left: -300px;
     5298}
     5299
    52915300.wp-full-overlay-sidebar:after {
    52925301        content: '';
    52935302        display: block;
     
    54045413.wp-full-overlay-sidebar,
    54055414.wp-full-overlay .collapse-sidebar,
    54065415.wp-full-overlay-main {
    5407         -webkit-transition-property: left, right, top, bottom, width;
    5408         -moz-transition-property:    left, right, top, bottom, width;
    5409         -ms-transition-property:     left, right, top, bottom, width;
    5410         -o-transition-property:      left, right, top, bottom, width;
    5411         transition-property:         left, right, top, bottom, width;
     5416        -webkit-transition-property: left, right, top, bottom, width, margin;
     5417        -moz-transition-property:    left, right, top, bottom, width, margin;
     5418        -ms-transition-property:     left, right, top, bottom, width, margin;
     5419        -o-transition-property:      left, right, top, bottom, width, margin;
     5420        transition-property:         left, right, top, bottom, width, margin;
    54125421
    54135422        -webkit-transition-duration: 0.2s;
    54145423        -moz-transition-duration:    0.2s;
  • wp-admin/css/customize-controls.dev.css

     
    402402        text-align: right;
    403403}
    404404
    405 .customize-section .customize-control-image .actions a {
    406         display: block;
    407 }
    408 
    409405.customize-section .customize-control-image .library ul {
    410406        border-bottom: 1px solid #dfdfdf;
    411407        float: left;
     
    456452
    457453.customize-section .customize-control-image .library .thumbnail img {
    458454        display: block;
    459         max-width: 220px;
     455        max-width: 90%;
    460456        max-height: 80px;
    461457
    462458        margin: 5px auto;
     
    479475        text-align: center;
    480476        color: #777;
    481477        position: relative;
     478        cursor: default;
    482479}
    483480
    484481.customize-section .customize-control-upload .upload-dropzone.supports-drag-drop,
     
    491488        transition:         border-color 0.1s;
    492489}
    493490
     491.customize-section .customize-control-upload .library ul li,
     492.customize-section .customize-control-image .library ul li {
     493        cursor: pointer;
     494}
     495
    494496.customize-section .customize-control-upload .upload-dropzone.supports-drag-drop.drag-over,
    495497.customize-section .customize-control-image .upload-dropzone.supports-drag-drop.drag-over {
    496498        border-color: #83b4d8;
    497 }
    498  No newline at end of file
     499}
     500
     501/**
     502 * iOS can't scroll iframes,
     503 * instead it expands the iframe size to match the size of the content
     504 */
     505.ios .wp-full-overlay {
     506        position: relative;
     507}
     508
     509.ios #customize-preview {
     510        position: relative;
     511}
     512
     513.ios #customize-controls .wp-full-overlay-sidebar-content {
     514        -webkit-overflow-scrolling: touch;
     515}
     516