Make WordPress Core

Changeset 36532

Timestamp:
02/16/2016 01:56:13 AM (8 years ago)
Author:
westonruter
Message:

Customize: Add a user-friendly way to preview site responsiveness for desktop, tablet, and mobile.

Introduces WP_Customize_Manager::get_previewable_devices() with a customize_previewable_devices filter to change the default device and which devices are available for previewing. This is a feature that was first pioneered on WordPress.com.

Props celloexpressions, folletto, valendesigns, westonruter, welcher, adamsilverstein, michaelarestad, Fab1en.
Fixes #31195.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/colors/_admin.scss

    r35265 r36532  
    488488}
    489489
     490
     491
     492
     493
    490494/* Responsive Component */
    491495
  • trunk/src/wp-admin/css/customize-controls.css

    r36291 r36532  
    611611    width: 100%;
    612612    height: 100%;
     613
    613614}
    614615
     
    13121313}
    13131314
     1315
     1316
     1317
     1318
     1319
     1320
     1321
     1322
     1323
     1324
     1325
     1326
     1327
     1328
     1329
     1330
     1331
     1332
     1333
     1334
     1335
     1336
     1337
     1338
     1339
     1340
     1341
     1342
     1343
     1344
     1345
     1346
     1347
     1348
     1349
     1350
     1351
     1352
     1353
     1354
     1355
     1356
     1357
     1358
     1359
     1360
     1361
     1362
     1363
     1364
     1365
     1366
     1367
     1368
     1369
     1370
     1371
     1372
     1373
     1374
     1375
     1376
     1377
     1378
     1379
     1380
     1381
     1382
     1383
     1384
     1385
     1386
     1387
     1388
     1389
     1390
     1391
     1392
     1393
     1394
     1395
     1396
     1397
     1398
     1399
     1400
     1401
     1402
     1403
     1404
     1405
     1406
     1407
     1408
     1409
     1410
     1411
     1412
     1413
     1414
     1415
     1416
     1417
     1418
     1419
     1420
     1421
     1422
     1423
     1424
     1425
     1426
     1427
     1428
     1429
     1430
     1431
     1432
     1433
     1434
     1435
    13141436.widget-reorder-nav span,
    13151437.menu-item-reorder-nav button {
  • trunk/src/wp-admin/customize.php

    r36422 r36532  
    149149
    150150        <div id="customize-footer-actions" class="wp-full-overlay-footer">
     151
     152
     153
     154
     155
     156
     157
     158
     159
     160
     161
     162
     163
     164
     165
     166
     167
     168
     169
     170
    151171            <button type="button" class="collapse-sidebar button-secondary" aria-expanded="true" aria-label="<?php esc_attr_e( 'Collapse Sidebar' ); ?>">
    152172                <span class="collapse-sidebar-arrow"></span>
  • trunk/src/wp-admin/js/customize-controls.js

    r36414 r36532  
    32303230            title = $( '#customize-info .panel-title.site-title' ),
    32313231            closeBtn = $( '.customize-controls-close' ),
    3232             saveBtn = $( '#save' );
     3232            saveBtn = $( '#save' ),
     3233            footerActions = $( '#customize-footer-actions' );
    32333234
    32343235        // Prevent the form from saving when enter is pressed on an input or select element.
     
    36053606            event.preventDefault();
    36063607        });
     3608
     3609
     3610
     3611
     3612
     3613
     3614
     3615
     3616
     3617
     3618
     3619
     3620
     3621
     3622
     3623
     3624
     3625
     3626
     3627
     3628
     3629
     3630
     3631
     3632
     3633
     3634
     3635
     3636
     3637
     3638
     3639
     3640
     3641
     3642
     3643
     3644
     3645
     3646
     3647
    36073648
    36083649        // Bind site title display to the corresponding field.
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r36414 r36532  
    17111711            'autofocus' => array(),
    17121712            'documentTitleTmpl' => $this->get_document_title_template(),
     1713
    17131714        );
    17141715
     
    17851786        </script>
    17861787        <?php
     1788
     1789
     1790
     1791
     1792
     1793
     1794
     1795
     1796
     1797
     1798
     1799
     1800
     1801
     1802
     1803
     1804
     1805
     1806
     1807
     1808
     1809
     1810
     1811
     1812
     1813
     1814
     1815
     1816
     1817
     1818
     1819
     1820
     1821
     1822
     1823
    17871824    }
    17881825
  • trunk/tests/phpunit/tests/customize/manager.php

    r36414 r36532  
    426426        $this->assertNotEmpty( $data );
    427427
    428         $this->assertEqualSets( array( 'theme', 'url', 'browser', 'panels', 'sections', 'nonce', 'autofocus', 'documentTitleTmpl' ), array_keys( $data ) );
     428        $this->assertEqualSets( array( 'theme', 'url', 'browser', 'panels', 'sections', 'nonce', 'autofocus', 'documentTitleTmpl' ), array_keys( $data ) );
    429429        $this->assertEquals( $autofocus, $data['autofocus'] );
    430430        $this->assertArrayHasKey( 'save', $data['nonce'] );
     
    717717        $this->assertEquals( $control_id, $result_control->id );
    718718    }
     719
     720
     721
     722
     723
     724
     725
     726
     727
     728
     729
     730
     731
     732
     733
     734
     735
     736
     737
     738
     739
     740
     741
     742
     743
     744
     745
     746
     747
     748
     749
     750
     751
     752
     753
     754
     755
     756
     757
     758
     759
     760
     761
     762
     763
     764
     765
     766
     767
     768
     769
     770
     771
     772
     773
     774
     775
     776
     777
     778
     779
     780
     781
    719782}
    720783
  • trunk/tests/qunit/fixtures/customize-settings.js

    r34563 r36532  
    131131        'parent': 'http://example.org/wp-admin/',
    132132        'preview': 'http://example.org/'
     133
     134
     135
     136
     137
     138
     139
     140
     141
     142
     143
     144
    133145    }
    134146};
  • trunk/tests/qunit/wp-admin/js/customize-controls.js

    r35231 r36532  
    7676
    7777    };
     78
     79
     80
     81
     82
    7883
    7984    module( 'Customizer Setting in Fixture' );
Note: See TracChangeset for help on using the changeset viewer.