Making WordPress.org

Changeset 335


Ignore:
Timestamp:
01/30/2014 08:01:01 PM (12 years ago)
Author:
nacin
Message:

Trac: First pass at pulling in ticket reports into a popup.

Location:
sites/trunk/wordpress.org/public_html/style/trac
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/style/trac/wp-trac.css

    r319 r335  
    12831283}
    12841284
     1285/* =Reports page */
     1286#report-popup {
     1287    display: none;
     1288}
     1289body.ticket-reports-open #content {
     1290    display: none;
     1291}
     1292body.ticket-reports-open #report-popup {
     1293    display: block;
     1294    position: absolute;
     1295    top: 184px;
     1296    background: white;
     1297    width: 100%;
     1298}
     1299#report-popup .ticket-reports {
     1300    max-width: 940px;
     1301    margin: 30px auto;
     1302    position: relative;
     1303}
     1304.ticket-reports .report-group h3 {
     1305    font-weight: bold;
     1306}
     1307#main .ticket-reports h4 {
     1308    font-size: 1.2em;
     1309}
     1310#main .ticket-reports h4 a {
     1311    font-weight: normal;
     1312}
     1313.ticket-reports .report {
     1314    float: left;
     1315    display: inline-block;
     1316    width: 220px;
     1317    margin-right: 15px;
     1318}
     1319.ticket-reports .wide .report,
     1320.ticket-reports .report.wide {
     1321    width: 335px;
     1322}
     1323.ticket-reports .narrow .report,
     1324.ticket-reports .report.narrow {
     1325    width: 130px;
     1326    margin-right: 10px;
     1327}
     1328.ticket-reports .report h4 {
     1329    margin-bottom: 8px;
     1330}
     1331.ticket-reports .report p {
     1332    margin-top: 0;
     1333}
     1334.ticket-reports .report p a {
     1335    border: 0;
     1336}
     1337.ticket-reports .report-group {
     1338    clear: both;
     1339    overflow: auto;
     1340    margin-bottom: 30px;
     1341}
     1342.ticket-reports .reports h3 {
     1343    margin: 0 0 10px;
     1344}
     1345#report-popup h4, #report-popup a {
     1346    border: 0;
     1347    background: none;
     1348}
     1349#report-popup .ticket-reports .close {
     1350    position: absolute;
     1351    right: 0;
     1352    top: 0;
     1353}
     1354#report-popup .ticket-reports h3 {
     1355    font-size: 21px;
     1356}
     1357#report-popup .ticket-reports .report {
     1358    margin-right: 40px !important;
     1359}
     1360#report-popup .ticket-reports a {
     1361    color: #21759b;
     1362}
     1363#report-popup .ticket-reports a:hover {
     1364    color: #d54e21;
     1365}
     1366#report-popup .ticket-reports h2 {
     1367    margin-bottom: 30px;
     1368}
     1369
    12851370/* =Responsive / Mobile
    12861371----------------------------------------------- */
  • sites/trunk/wordpress.org/public_html/style/trac/wp-trac.js

    r320 r335  
    4848                wpTrac.workflow.init();
    4949                if ( $(document.body).hasClass( 'core' ) ) {
     50                    wpTrac.reports();
    5051                    wpTrac.focuses.init();
    5152                }
     
    295296                });
    296297            }
     298        },
     299
     300        reports: function() {
     301            var popup = $( '#report-popup' ), failed = false;
     302            $( '.ticket-reports' ).on( 'change', '.tickets-by-topic', function() {
     303                var topic = $(this).val();
     304                if ( ! topic ) {
     305                    return;
     306                }
     307                window.location.href = $(this).data( 'location' ) + topic;
     308                return false;
     309            });
     310            popup.appendTo( '#main' );
     311            $( '.open-ticket-report' ).click( function( event ) {
     312                if ( popup.children().length === 0 ) {
     313                    var jqxhr = $.ajax({
     314                        url: 'https://make.wordpress.org/core/reports/?from-trac',
     315                        xhrFields: { withCredentials: true }
     316                    }).done( function( data ) {
     317                        $( data ).find( '.ticket-reports' ).appendTo( popup );
     318                        $(document.body).addClass( 'ticket-reports-open' );
     319                    }).fail( function() {
     320                        failed = true;
     321                    });
     322                } else {
     323                    $(document.body).toggleClass( 'ticket-reports-open' );
     324                    event.preventDefault();
     325                }
     326                if ( ! failed ) {
     327                    event.preventDefault();
     328                }
     329            });
     330            $( '#report-popup' ).on( 'click', '.close', function() {
     331                $(document.body).removeClass( 'ticket-reports-open' );
     332                return false;
     333            });
    297334        },
    298335
Note: See TracChangeset for help on using the changeset viewer.