Make WordPress Core

Ticket #31798: 31798.patch

File 31798.patch, 1.5 KB (added by iseulde, 10 years ago)
  • Gruntfile.js

     
    196196                                                name: 'swap-dashicons-left-right-arrows',
    197197                                                expr: /content/im,
    198198                                                action: function( prop, value ) {
    199                                                         if ( value === '"\\f141"' ) { // dashicons-arrow-left
    200                                                                 value = '"\\f139"';
    201                                                         } else if ( value === '"\\f340"' ) { // dashicons-arrow-left-alt
    202                                                                 value = '"\\f344"';
    203                                                         } else if ( value === '"\\f341"' ) { // dashicons-arrow-left-alt2
    204                                                                 value = '"\\f345"';
    205                                                         } else if ( value === '"\\f139"' ) { // dashicons-arrow-right
    206                                                                 value = '"\\f141"';
    207                                                         } else if ( value === '"\\f344"' ) { // dashicons-arrow-right-alt
    208                                                                 value = '"\\f340"';
    209                                                         } else if ( value === '"\\f345"' ) { // dashicons-arrow-right-alt2
    210                                                                 value = '"\\f341"';
    211                                                         }
    212                                                         return { prop: prop, value: value };
     199                                                        var map = {
     200                                                                // dashicons-arrow-(left|right)
     201                                                                '"\\f141"': '"\\f139"',
     202                                                                // dashicons-arrow-(left|right)-alt
     203                                                                '"\\f340"': '"\\f344"',
     204                                                                // dashicons-arrow-(left|right)-alt2
     205                                                                '"\\f341"': '"\\f345"',
     206                                                                // dashicons-(undo|redo)
     207                                                                '"\\f171"': '"\\f172"'
     208                                                        };
     209
     210                                                        Object.keys( map ).forEach( function( key ) {
     211                                                                map[ map[ key ] ] = key;
     212                                                        } );
     213
     214                                                        value = value.replace( /'/g, '"' );
     215
     216                                                        return {
     217                                                                prop: prop,
     218                                                                value: map[ value ] || value
     219                                                        };
    213220                                                }
    214221                                        }
    215222                                ],