diff --git a/l10n_client.css b/l10n_client.css index 176b9a5..c69a232 100644 --- a/l10n_client.css +++ b/l10n_client.css @@ -41,6 +41,17 @@ display: none; } +#l10n-client-throbber { + background: 0 0 no-repeat url(../../../../misc/throbber.gif); + display: inline-block; + height: 15px; + vertical-align: middle; + width: 15px; +} +#l10n-client-throbber.throbbing { + background-position: 0 -20px; +} + /* Panel toggle button (span) */ #l10n-client .labels .toggle { cursor: pointer; @@ -224,7 +235,7 @@ } #l10n-client-form .form-textarea { - height: 13em; + height: 12em; font-size: 1em; line-height: 1.25em; width: 95%; diff --git a/l10n_client.js b/l10n_client.js index c4a9b56..629899d 100644 --- a/l10n_client.js +++ b/l10n_client.js @@ -162,6 +162,7 @@ Drupal.behaviors.l10nClient.attach = function (context) { // Send AJAX POST data on form submit. $('#l10n-client-form').submit(function() { $('#l10n-client-form .form-submit').attr("disabled", "true"); + $('#l10n-client-throbber').addClass("throbbing"); $.ajax({ type: "POST", url: $('#l10n-client-form').attr('action'), @@ -203,7 +204,7 @@ Drupal.behaviors.l10nClient.attach = function (context) { // Empty input fields. $('#l10n-client-string-editor .source-text').html(data); $('#l10n-client-form .translation-target').val(''); - + $('#l10n-client-throbber').removeClass("throbbing"); }, error: function (xmlhttp) { alert(Drupal.t('An HTTP error @status occured.', { '@status': xmlhttp.status })); diff --git a/l10n_client.module b/l10n_client.module index 457aa83..1a7b8ec 100644 --- a/l10n_client.module +++ b/l10n_client.module @@ -391,10 +391,6 @@ function l10n_client_form($form_id, $strings) { '#rows' => 6, '#attributes' => array('class' => array('translation-target')), ); - $form['save'] = array( - '#value' => t('Save translation'), - '#type' => 'submit', - ); $form['textgroup'] = array( '#type' => 'hidden', '#value' => 'default', @@ -405,6 +401,17 @@ function l10n_client_form($form_id, $strings) { '#value' => 'default', '#attributes' => array('class' => array('source-context')), ); + $form['container'] = array( + '#type' => 'container', + ); + $form['container']['save'] = array( + '#type' => 'submit', + '#value' => t('Save translation'), + ); + $form['container']['throbber'] = array( + '#type' => 'markup', + '#markup' => '', + ); $form['copy'] = array( '#type' => 'button', '#id' => 'l10n-client-edit-copy',