<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[8766] sites/trunk/wordpress.org/public_html/wp-content/plugins: Translate: Split source details into separate `<details>` elements and add persistent storage for open/close state.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/8766">8766</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/8766","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>ocean90</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2019-05-09 21:59:52 +0000 (Thu, 09 May 2019)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Translate: Split source details into separate `<details>` elements and add persistent storage for open/close state.
See <a href="http://meta.trac.wordpress.org/ticket/4431">#4431</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggpcustomizationstemplateshelperfunctionsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/helper-functions.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggpcustomizationstemplatesjseditorjs">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/js/editor.js</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggpcustomizationstemplatesstylecss">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/style.css</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggpcustomizationstemplatestranslationroweditorphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/translation-row-editor.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationsuggestionsjstranslationsuggestionsjs">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-suggestions/js/translation-suggestions.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggpcustomizationstemplateshelperfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/helper-functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/helper-functions.php 2019-05-09 20:25:34 UTC (rev 8765)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/helper-functions.php 2019-05-09 21:59:52 UTC (rev 8766)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -288,3 +288,28 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $count;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+/**
+ * Lists file references for a translation.
+ *
+ * @param \GP_Project $project Current project.
+ * @param object $entry Current translation entry.
+ */
+function wporg_references( $project, $entry ) {
+ ?>
+ <ul>
+ <?php
+ foreach ( $entry->references as $reference ) :
+ list( $file, $line ) = array_pad( explode( ':', $reference ), 2, 0 );
+ if ( $source_url = $project->source_url( $file, $line ) ) :
+ ?>
+ <li><a target="_blank" href="<?php echo $source_url; ?>"><?php echo $file.':'.$line ?></a></li>
+ <?php
+ else :
+ echo "<li>$file:$line</li>";
+ endif;
+ endforeach;
+ ?>
+ </ul>
+ <?php
+}
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggpcustomizationstemplatesjseditorjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/js/editor.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/js/editor.js 2019-05-09 20:25:34 UTC (rev 8765)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/js/editor.js 2019-05-09 21:59:52 UTC (rev 8766)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2,6 +2,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> var $html = $( 'html' );
</span><span class="cx" style="display: block; padding: 0 10px"> var $document = $( document );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function checkStorage() {
+ var test = 'test',
+ result = false;
+
+ try {
+ window.localStorage.setItem( 'test', test );
+ result = window.localStorage.getItem( 'test' ) === test;
+ window.localStorage.removeItem( 'test' );
+ } catch(e) {}
+
+ hasStorage = result;
+ return result;
+ }
+
+ var hasStorage = checkStorage();
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Handle tab view for plural forms.
</span><span class="cx" style="display: block; padding: 0 10px"> function switchPluralTabs() {
</span><span class="cx" style="display: block; padding: 0 10px"> var $tab = $( this );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -124,6 +140,99 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $gp.editor.keydown = ( function( original ) {
+ return function( event ) {
+ // Shift-Enter = Save.
+ if ( 13 === event.keyCode && event.shiftKey ) {
+ var $textarea = $( event.target );
+
+ if ( ! $textarea.val().trim() ) {
+ $gp.notices.error( 'Translation is empty.' );
+ return false;
+ }
+
+ // Check plural forms.
+ var $textareas = $gp.editor.current.find( '.textareas:not(.active) textarea' );
+ var isValid = true;
+ $textareas.each( function() {
+ if ( ! this.value.trim() ) {
+ isValid = false;
+ }
+ } );
+
+ if ( ! isValid ) {
+ $gp.notices.error( 'Translation is empty.' );
+ return false;
+ }
+
+ $gp.editor.save( $gp.editor.current.find( 'button.translation-actions__save' ) );
+
+ // Ctrl-Enter or Ctrl-Shift-B = Copy original.
+ } else if (
+ ( 13 === event.keyCode && event.ctrlKey ) ||
+ ( 66 === event.keyCode && event.shiftKey && event.ctrlKey ) )
+ {
+ var $button = $gp.editor.current.find( 'button.translation-actions__copy' );
+
+ $button.trigger( 'click' );
+ } else {
+ return original.apply( $gp.editor, arguments );
+ }
+
+ return false;
+ }
+ })( $gp.editor.keydown );
+
+ // Store the open/close state of <details> element in locale storage and apply state when editor is shown.
+ var DETAILS_STORE_KEY = 'translate-details-state';
+ function updateDetailsState( type, state ) {
+ if ( ! hasStorage ) {
+ return;
+ }
+
+ var store = window.localStorage.getItem( DETAILS_STORE_KEY );
+ var states = store ? JSON.parse( store ) : {};
+
+ states[ type ] = state;
+
+ window.localStorage.setItem( DETAILS_STORE_KEY, JSON.stringify( states ) );
+ }
+
+ function toggleDetails( event ) {
+ var $el = $( event.target ).closest( 'details' );
+ var isClosed = $el.attr( 'open' ) === 'open'; // Gets closed when open attribute was previously set.
+ var className = $el.attr( 'class' ).replace( /^(\S*).*/, '$1' );
+
+ updateDetailsState( className, isClosed ? 'close' : 'open' );
+ }
+
+ function applyDetailsState() {
+ if ( ! hasStorage || ! $gp.editor.current.length ) {
+ return;
+ }
+
+ var store = window.localStorage.getItem( DETAILS_STORE_KEY );
+ var states = store ? JSON.parse( store ) : {};
+
+ for ( var type in states ) {
+ var state = states[ type ];
+
+ if ( 'open' === state ) {
+ $gp.editor.current.find( '.' + type ).attr( 'open', 'open' );
+ } else {
+ $gp.editor.current.find( '.' + type ).removeAttr( 'open' );
+ }
+ }
+ }
+
+ $gp.editor.show = ( function( original ) {
+ return function() {
+ original.apply( $gp.editor, arguments );
+
+ applyDetailsState();
+ }
+ })( $gp.editor.show );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $gp.editor.install_hooks = ( function( original ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return function() {
</span><span class="cx" style="display: block; padding: 0 10px"> original.apply( $gp.editor, arguments );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -139,6 +248,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .on( 'click', 'button.translation-actions__ltr', switchTextDirection )
</span><span class="cx" style="display: block; padding: 0 10px"> .on( 'click', 'button.translation-actions__rtl', switchTextDirection )
</span><span class="cx" style="display: block; padding: 0 10px"> .on( 'focus', 'textarea', textareaAutosize )
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ .on( 'click', 'summary', toggleDetails )
</ins><span class="cx" style="display: block; padding: 0 10px"> .on( 'click', 'button.button-menu__toggle', toggleLinkMenu );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> })( $gp.editor.install_hooks );
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggpcustomizationstemplatesstylecss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/style.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/style.css 2019-05-09 20:25:34 UTC (rev 8765)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/style.css 2019-05-09 21:59:52 UTC (rev 8766)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2,6 +2,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> height: 100%;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+body,
+html,
+.gp-content,
+.gp-content textarea,
+.gp-content input {
+ color: #191e23;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> .site-header {
</span><span class="cx" style="display: block; padding: 0 10px"> font-family: "Open Sans", sans-serif;
</span><span class="cx" style="display: block; padding: 0 10px"> line-height: 1.5;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -312,7 +320,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> table.translations td.translation li {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-bottom: 1px dotted #eee;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-bottom: 1px dotted #e2e4e7;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> table.translations thead th,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -345,8 +353,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> table.locale-sub-projects th,
</span><span class="cx" style="display: block; padding: 0 10px"> table.locale-sub-projects td {
</span><span class="cx" style="display: block; padding: 0 10px"> border: 0;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-bottom: 1px solid #eee;
- border-right: 1px solid #eee;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-bottom: 1px solid #e2e4e7;
+ border-right: 1px solid #e2e4e7;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> table.translations td:first-child,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -359,7 +367,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> table.glossary td:first-child,
</span><span class="cx" style="display: block; padding: 0 10px"> table.locale-sub-projects th:first-child,
</span><span class="cx" style="display: block; padding: 0 10px"> table.locale-sub-projects td:first-child {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-left: 1px solid #eee;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-left: 1px solid #e2e4e7;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> table.translations tr:nth-child(4n+3),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -446,7 +454,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .editor .meta {
</span><span class="cx" style="display: block; padding: 0 10px"> background: #fff;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border: 1px solid #eee;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border: 1px solid #e2e4e7;
</ins><span class="cx" style="display: block; padding: 0 10px"> font-size: 13px;
</span><span class="cx" style="display: block; padding: 0 10px"> margin: 0;
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 5px 10px;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -457,7 +465,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .editor .meta h3 {
</span><span class="cx" style="display: block; padding: 0 10px"> text-align: center;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-bottom: 1px solid #eee;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-bottom: 1px solid #e2e4e7;
</ins><span class="cx" style="display: block; padding: 0 10px"> margin-bottom: 15px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -858,7 +866,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> margin-top: 20px;
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 10px 20px;
</span><span class="cx" style="display: block; padding: 0 10px"> color: #006799;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-left: 1px solid #eee;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-left: 1px solid #e2e4e7;
</ins><span class="cx" style="display: block; padding: 0 10px"> text-align: center;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1027,7 +1035,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .projects .project-status > div:not(:first-child) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-left: 1px solid #eee;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-left: 1px solid #e2e4e7;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> @media (max-width: 500px) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1160,7 +1168,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> font-weight: 600;
</span><span class="cx" style="display: block; padding: 0 10px"> color: #509040;
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 10px 0 10px 15px;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-left: 1px solid #eee;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-left: 1px solid #e2e4e7;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .project-box .project-box-footer {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1231,7 +1239,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> width: 20px;
</span><span class="cx" style="display: block; padding: 0 10px"> height: 20px;
</span><span class="cx" style="display: block; padding: 0 10px"> font: 20px/1 "dashicons";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-left: 1px solid #eee;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-left: 1px solid #e2e4e7;
</ins><span class="cx" style="display: block; padding: 0 10px"> padding: 5px 0 5px 12px;
</span><span class="cx" style="display: block; padding: 0 10px"> box-shadow: inset 1px 0 0 #fff;
</span><span class="cx" style="display: block; padding: 0 10px"> -webkit-font-smoothing: antialiased;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1496,7 +1504,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .sort-bar {
</span><span class="cx" style="display: block; padding: 0 10px"> float: right;
</span><span class="cx" style="display: block; padding: 0 10px"> margin: -30px 0 5px 5px;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- background-color: #eee;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ background-color: #e2e4e7;
</ins><span class="cx" style="display: block; padding: 0 10px"> padding: 5px;
</span><span class="cx" style="display: block; padding: 0 10px"> border: 1px solid #dfdfdf;
</span><span class="cx" style="display: block; padding: 0 10px"> border-top: none;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1805,7 +1813,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .locale-project-contributors-table th {
</span><span class="cx" style="display: block; padding: 0 10px"> font-weight: bold;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-bottom: 1px solid #eee;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-bottom: 1px solid #e2e4e7;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .locale-project-contributors-table th.contributor-stats {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1858,7 +1866,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .locale-project-contributors-table tbody td {
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 10px 0;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-bottom: 1px solid #eee;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-bottom: 1px solid #e2e4e7;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .locale-project-contributors-table tbody tr:last-child td {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2001,7 +2009,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .consistency-table tr {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-bottom: 1px solid #eee;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-bottom: 1px solid #e2e4e7;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .consistency-table tr.new-translation {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2152,7 +2160,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> width: 100%;
</span><span class="cx" style="display: block; padding: 0 10px"> border: 0;
</span><span class="cx" style="display: block; padding: 0 10px"> background: #fff;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- color: #333;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ color: #191e23;
</ins><span class="cx" style="display: block; padding: 0 10px"> outline: none;
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 15px 0;
</span><span class="cx" style="display: block; padding: 0 10px"> font-size: 16px;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2198,7 +2206,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .editor-panel__left {
</span><span class="cx" style="display: block; padding: 0 10px"> flex: 1;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-bottom: 3px solid #eee;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-bottom: 3px solid #e2e4e7;
</ins><span class="cx" style="display: block; padding: 0 10px"> min-width: 1%;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2205,7 +2213,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> @media screen and (min-width: 700px) {
</span><span class="cx" style="display: block; padding: 0 10px"> .editor-panel__left {
</span><span class="cx" style="display: block; padding: 0 10px"> border-bottom: 0;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-right: 3px solid #eee;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-right: 3px solid #e2e4e7;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2218,8 +2226,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> display: flex;
</span><span class="cx" style="display: block; padding: 0 10px"> align-items: center;
</span><span class="cx" style="display: block; padding: 0 10px"> justify-content: flex-end;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-bottom: 1px solid #eee;
- background-color: #fbfbfb;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-bottom: 1px solid #e2e4e7;
+ background-color: #f3f4f5;
</ins><span class="cx" style="display: block; padding: 0 10px"> height: 40px;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2254,7 +2262,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> font-weight: 400;
</span><span class="cx" style="display: block; padding: 0 10px"> letter-spacing: 1px;
</span><span class="cx" style="display: block; padding: 0 10px"> text-transform: uppercase;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- color: #666;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ color: #191e23;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .panel-header__bubble {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2303,7 +2311,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .panel-header-actions button:hover {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- background: #eee;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ background: #e2e4e7;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> table.translations tbody > tr:first-child + tr .panel-header-actions__previous,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2346,7 +2354,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .panel-content summary:focus {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- color: #0073aa;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ color: #191e23;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .panel-content details[open] summary {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2370,19 +2378,19 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .source-details {
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 0 10px;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- color: #666;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ font-size: 13px;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.source-details dl + dl {
- margin-top: 10px;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.source-details summary {
+ color: #666;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.source-details dt {
- font-size: 12px;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.source-details details[open] summary {
+ margin: 0;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-.source-details dd {
- color: #333;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.source-details details + details{
+ margin-top: 5px;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .translation-wrapper {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2390,7 +2398,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> margin: 15px 0;
</span><span class="cx" style="display: block; padding: 0 10px"> border-top: 1px solid;
</span><span class="cx" style="display: block; padding: 0 10px"> border-bottom: 1px solid;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-color: #eee;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-color: #e2e4e7;
</ins><span class="cx" style="display: block; padding: 0 10px"> background: #fff;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2411,7 +2419,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> .translation-form-wrapper {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- border-bottom: 1px solid #eee;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ border-bottom: 1px solid #e2e4e7;
</ins><span class="cx" style="display: block; padding: 0 10px"> margin-left: -10px;
</span><span class="cx" style="display: block; padding: 0 10px"> margin-right: -10px;
</span><span class="cx" style="display: block; padding: 0 10px"> padding: 0 10px;
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggpcustomizationstemplatestranslationroweditorphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/translation-row-editor.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/translation-row-editor.php 2019-05-09 20:25:34 UTC (rev 8765)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/translation-row-editor.php 2019-05-09 21:59:52 UTC (rev 8766)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -110,25 +110,28 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php endif; ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <details class="source-details">
- <summary>Context</summary>
-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="source-details">
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php if ( $t->context ): ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <dl class="source-details__context">
- <dt><?php _e( 'Context:', 'glotpress' ); ?></dt>
- <dd><span class="context bubble"><?php echo esc_translation( $t->context ); ?></span></dd>
- </dl>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <details open class="source-details__context">
+ <summary>Context</summary>
+ <span class="context bubble"><?php echo esc_translation( $t->context ); ?></span>
+ </details>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php endif; ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php if ( $t->extracted_comments ) :
</span><span class="cx" style="display: block; padding: 0 10px"> $comments = trim( preg_replace( '/^translators:/ ', '', $t->extracted_comments ) );
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <dl class="source-details__comments">
- <dt><?php _e( 'Comment:', 'glotpress' ); ?></dt>
- <dd><?php echo make_clickable( esc_translation( $comments ) ); ?></dd>
- </dl>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <details open class="source-details__comment">
+ <summary><?php _e( 'Comment', 'glotpress' ); ?></summary>
+ <p><?php echo make_clickable( esc_translation( $comments ) ); ?></p>
+ </details>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php endif; ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php references( $project, $t ); ?>
- </details>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php if ( $t->references ) : ?>
+ <details class="source-details__references">
+ <summary>References</summary>
+ <?php wporg_references( $project, $t ); ?>
+ </details>
+ <?php endif; ?>
+ </div>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="translation-wrapper">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php if ( $t->plural && $locale->nplurals > 1 ) : ?>
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporggptranslationsuggestionsjstranslationsuggestionsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-suggestions/js/translation-suggestions.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-suggestions/js/translation-suggestions.js 2019-05-09 20:25:34 UTC (rev 8765)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-suggestions/js/translation-suggestions.js 2019-05-09 21:59:52 UTC (rev 8766)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,7 +1,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ( function( $ ){
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function fetchTranslationMemorySuggestions( $container, originalId, nonce ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function fetchSuggestions( $container, apiUrl, originalId, nonce ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> var xhr = $.ajax( {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- url: window.WPORG_TRANSLATION_MEMORY_API_URL,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ url: apiUrl,
</ins><span class="cx" style="display: block; padding: 0 10px"> data: {
</span><span class="cx" style="display: block; padding: 0 10px"> 'original': originalId,
</span><span class="cx" style="display: block; padding: 0 10px"> 'nonce': nonce
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -32,7 +32,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function maybeFetchTranslationMemorySuggestions() {
</span><span class="cx" style="display: block; padding: 0 10px"> var $container = $gp.editor.current.find( '.suggestions__translation-memory' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! $container.length ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( !$container.length ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -45,40 +45,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> var originalId = $gp.editor.current.original_id;
</span><span class="cx" style="display: block; padding: 0 10px"> var nonce = $container.data( 'nonce' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- fetchTranslationMemorySuggestions( $container, originalId , nonce );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ fetchSuggestions( $container, window.WPORG_TRANSLATION_MEMORY_API_URL, originalId, nonce );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function fetchOtherLanguageSuggestions( $container, originalId, nonce ) {
- var xhr = $.ajax( {
- url: window.WPORG_OTHER_LANGUAGES_API_URL,
- data: {
- 'original': originalId,
- 'nonce': nonce
- },
- dataType: 'json'
- } );
-
- xhr.done( function( response ) {
- $container.find( '.suggestions__loading-indicator' ).remove();
- if ( response.success ) {
- $container.append( response.data );
- } else {
- $container.append( $( '<span/>', { 'text': 'Error while loading suggestions.' } ) );
- }
- $container.addClass( 'initialized' );
- } );
-
- xhr.fail( function() {
- $container.find( '.suggestions__loading-indicator' ).remove();
- $container.append( $( '<span/>', { 'text': 'Error while loading suggestions.' } ) );
- $container.addClass( 'initialized' );
- } );
-
- xhr.always( function() {
- $container.removeClass( 'fetching' );
- } );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> function maybeFetchOtherLanguageSuggestions() {
</span><span class="cx" style="display: block; padding: 0 10px"> var $container = $gp.editor.current.find( '.suggestions__other-languages' );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $container.length ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -94,7 +63,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> var originalId = $gp.editor.current.original_id;
</span><span class="cx" style="display: block; padding: 0 10px"> var nonce = $container.data( 'nonce' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- fetchOtherLanguageSuggestions( $container, originalId , nonce );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ fetchSuggestions( $container, window.WPORG_OTHER_LANGUAGES_API_URL, originalId , nonce );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function copySuggestion( event ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -125,6 +94,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> original.apply( $gp.editor, arguments );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> maybeFetchTranslationMemorySuggestions();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ maybeFetchOtherLanguageSuggestions();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> })( $gp.editor.show );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -133,8 +103,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> original();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $( $gp.editor.table )
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- .on( 'click', '.translation-suggestion', copySuggestion )
- .on( 'click', '.suggestions__other-languages summary', maybeFetchOtherLanguageSuggestions );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ .on( 'click', '.translation-suggestion', copySuggestion );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> })( $gp.editor.install_hooks );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre>
</div>
</div>
</body>
</html>