| 1 |
$(document).ready(function() {
|
| 2 |
// If JS is enabled, then override the submit handler so that enter presses
|
| 3 |
// on textfields don't trigger the no-JS fallback.
|
| 4 |
$("form#skeleton-create-instance-form #edit-add-introduction").click(function(){
|
| 5 |
// If any autocomplete fields are open, don't submit so the enter key can
|
| 6 |
// be used to select an option.
|
| 7 |
if ($("#autocomplete").length == 0) {
|
| 8 |
$("form#skeleton-create-instance-form #edit-submit").click();
|
| 9 |
}
|
| 10 |
return false;
|
| 11 |
});
|
| 12 |
});
|
| 13 |
|
| 14 |
/**
|
| 15 |
* Add a checkbox to lists of nodes on the Syncronize page to select or clear
|
| 16 |
* all checkboxes at once.
|
| 17 |
*/
|
| 18 |
Drupal.behaviors.skeletonAutoCheckbox = function(context) {
|
| 19 |
var strings = { 'selectAll': Drupal.t('Select all rows in this table'), 'selectNone': Drupal.t('Deselect all rows in this table') };
|
| 20 |
$('#skeleton-sync-content-form .form-item .form-checkboxes:not(.skeletonAutoCheckbox-processed)').prepend(
|
| 21 |
$('<label></label>').html(Drupal.t('Select all nodes')).prepend($('<input type="checkbox" class="form-checkbox"/>').attr('title', strings.selectAll).click(function() {
|
| 22 |
if (this.checked) {
|
| 23 |
$('#skeleton-sync-content-form .skeletonAutoCheckbox-processed input[type=checkbox]').attr('checked', true);
|
| 24 |
}
|
| 25 |
else {
|
| 26 |
$('#skeleton-sync-content-form .skeletonAutoCheckbox-processed input[type=checkbox]').attr('checked', false);
|
| 27 |
}
|
| 28 |
}))
|
| 29 |
);
|
| 30 |
|
| 31 |
$('#skeleton-sync-content-form .form-item .form-checkboxes').addClass('skeletonAutoCheckbox-processed');
|
| 32 |
|
| 33 |
$('#skeleton-sync-add-template-form .form-item .form-checkboxes:not(.skeletonAutoCheckbox-processed)').prepend(
|
| 34 |
$('<label></label>').html(Drupal.t('Select all nodes')).prepend($('<input type="checkbox" class="form-checkbox"/>').attr('title', strings.selectAll).click(function() {
|
| 35 |
if (this.checked) {
|
| 36 |
$('#skeleton-sync-add-template-form .skeletonAutoCheckbox-processed input[type=checkbox]').attr('checked', true);
|
| 37 |
}
|
| 38 |
else {
|
| 39 |
$('#skeleton-sync-add-template-form .skeletonAutoCheckbox-processed input[type=checkbox]').attr('checked', false);
|
| 40 |
}
|
| 41 |
}))
|
| 42 |
);
|
| 43 |
$('#skeleton-sync-add-template-form .form-item .form-checkboxes').addClass('skeletonAutoCheckbox-processed');
|
| 44 |
|
| 45 |
$('#skeleton-sync-delete-template-form .form-item .form-checkboxes:not(.skeletonAutoCheckbox-processed)').prepend(
|
| 46 |
$('<label></label>').html(Drupal.t('Select all nodes')).prepend($('<input type="checkbox" class="form-checkbox"/>').attr('title', strings.selectAll).click(function() {
|
| 47 |
if (this.checked) {
|
| 48 |
$('#skeleton-sync-delete-template-form .skeletonAutoCheckbox-processed input[type=checkbox]').attr('checked', true);
|
| 49 |
}
|
| 50 |
else {
|
| 51 |
$('#skeleton-sync-delete-template-form .skeletonAutoCheckbox-processed input[type=checkbox]').attr('checked', false);
|
| 52 |
}
|
| 53 |
}))
|
| 54 |
);
|
| 55 |
$('#skeleton-sync-delete-template-form .form-item .form-checkboxes').addClass('skeletonAutoCheckbox-processed');
|
| 56 |
}
|