| 1 |
//
|
| 2 |
// Add multi-select toggling for file type checkboxes
|
| 3 |
//
|
| 4 |
/*
|
| 5 |
DIV.tree-branch
|
| 6 |
DIV.tree-content
|
| 7 |
LABEL.file-item
|
| 8 |
checkbox.tree-leaf
|
| 9 |
LABEL.image-item
|
| 10 |
checkbox.tree-item
|
| 11 |
|
| 12 |
*/
|
| 13 |
|
| 14 |
/**
|
| 15 |
* Add some checkboxes which, if clicked will toggle on or off all matching file type selectors
|
| 16 |
*/
|
| 17 |
|
| 18 |
if (Drupal.jsEnabled) {
|
| 19 |
$(document).ready(function() {
|
| 20 |
// Add new UI boxes
|
| 21 |
var types = {'html-item':'Page', 'image-item':'Image', 'resource-item':'Resource', 'document-item':'Document'};
|
| 22 |
for(type in types){
|
| 23 |
$('#import-html-selectors').append("<label class='"+ type +"'><input type='checkbox' value='"+ type +"' />"+ types[type] +"</label>");
|
| 24 |
}
|
| 25 |
$('#import-html-selectors input').change(
|
| 26 |
function(e){
|
| 27 |
var checked = $(this).attr("checked");
|
| 28 |
$('#import-html-process-form label.'+ $(this).val() + " input" ).attr("checked", checked ? 1 : 0);
|
| 29 |
|
| 30 |
})
|
| 31 |
}) // ready func
|
| 32 |
} // JS OK
|