Making WordPress.org

Changeset 2082


Ignore:
Timestamp:
11/14/2015 08:00:10 AM (9 years ago)
Author:
dd32
Message:

Translate: JS Warnings: Add support for the 3rd translateion UI HTML format.
The GlotPress output has nothing that links the text field to the actual original display, so we're using DOM transversal, which can be.. interesting :)

See #1390

Location:
sites/trunk/translate.wordpress.org/includes/gp-plugins/wporg-js-warnings
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/translate.wordpress.org/includes/gp-plugins/wporg-js-warnings/wporg-js-warnings.js

    r2066 r2082  
    1212        var entries = jQuery("textarea[name='"+name+"']", editor).map(function( prop, el ) {
    1313            var $el = jQuery(el);
     14
    1415            return {
    1516                index: prop,
    1617                name: name,
    1718                translation: $el.val(),
    18                 original: $el.parent('div.textareas').prev('p.original').text() || $el.parent('div.textareas').prev('p').find('span.original').text() // Singular original, or plurals...
     19                original: // Singular original, or plural original, or.. the single-original plural view..
     20                    $el.parent('div.textareas').prev('p.original').text() ||
     21                    $el.parent('div.textareas').prev('p').find('span.original').text() ||
     22                    jQuery( $el.parents('div.strings').find('span.original').get(prop) ).text()
    1923            }
    2024        }).get();
  • sites/trunk/translate.wordpress.org/includes/gp-plugins/wporg-js-warnings/wporg-js-warnings.php

    r2067 r2082  
    3232
    3333        wp_deregister_script( 'editor' );
    34         wp_register_script( 'editor', gp_url_public_root() . 'gp-plugins/wporg-js-warnings/wporg-js-warnings.js', array( 'editor-core', 'jquery' ), '2015-11-10' );
     34        wp_register_script( 'editor', gp_url_public_root() . 'gp-plugins/wporg-js-warnings/wporg-js-warnings.js', array( 'editor-core', 'jquery' ), '2015-11-14' );
    3535
    3636    }
Note: See TracChangeset for help on using the changeset viewer.