| 1 |
// $Id$
|
| 2 |
|
| 3 |
/**
|
| 4 |
* Set text of Save button dependent on the selected send option.
|
| 5 |
*/
|
| 6 |
Drupal.behaviors.simplenewsCommandSend = function (context) {
|
| 7 |
var simplenewsSendButton = function () {
|
| 8 |
switch ($(".simplenews-command-send :radio:checked").val()) {
|
| 9 |
case '0':
|
| 10 |
$('#edit-submit').attr({value: Drupal.t('Save')});
|
| 11 |
break;
|
| 12 |
case '1':
|
| 13 |
$('#edit-submit').attr({value: Drupal.t('Save and send')});
|
| 14 |
break;
|
| 15 |
case '2':
|
| 16 |
$('#edit-submit').attr({value: Drupal.t('Save and send test')});
|
| 17 |
break;
|
| 18 |
}
|
| 19 |
}
|
| 20 |
|
| 21 |
// Update send button at page load and when a send option is selected.
|
| 22 |
$(function() { simplenewsSendButton(); });
|
| 23 |
$(".simplenews-command-send").click( function() { simplenewsSendButton(); });
|
| 24 |
|
| 25 |
|
| 26 |
}
|