Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions admin/themes/default/css/sass/components/_inputs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ input[type=text].small {
}

label {
select,
input[type=checkbox],
input[type=radio],
input[type=text] {
Expand Down
1 change: 1 addition & 0 deletions admin/themes/default/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,7 @@ input[type=text].small {
border: 1px solid #D6D5C2;
}

label select,
label input[type=checkbox],
label input[type=radio],
label input[type=text] {
Expand Down
10 changes: 7 additions & 3 deletions admin/themes/default/item-types/add-existing-element.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<li class="element">
<div class="sortable-item drawer">
<span id="move-<?php echo $element_id_name; ?>" class="move icon" title="<?php echo __('Move'); ?>" aria-labelledby="move-<?php echo $element_id_name; ?> <?php echo $element_id_name; ?>"></span>
<label class="drawer-name">
<?php
echo __('Element Name');
echo $this->formSelect(
$element_id_name, $element_id_value,
[
'class' => 'existing-element-drop-down drawer-name',

'aria-labelledby' => 'unnamed-element-label'
],
get_table_options(
'Element', null,
Expand All @@ -16,14 +19,15 @@
)
);
?>
</label>
<?php
echo $this->formHidden(
$element_order_name, $element_order_value,
['class' => 'element-order']
);
?>
<button type="button" id="return-element-link-<?php echo $element_id_temp; ?>" class="undo-delete" data-action-selector="deleted" title="<?php echo __('Undo'); ?>" aria-label="<?php echo __('Undo'); ?> <?php echo __('Remove'); ?>" aria-labelledby="return-element-link-<?php echo $element_id_temp; ?> elements-to-add-<?php echo $element_id_temp; ?>-id"><span class="icon" aria-hidden="true"></span></button>
<button type="button" id="remove-element-link-<?php echo $element_id_temp; ?>" class="delete-drawer" data-action-selector="deleted" title="<?php echo __('Remove'); ?>" aria-label="<?php echo __('Remove'); ?>" aria-labelledby="remove-element-link-<?php echo $element_id_temp; ?> elements-to-add-<?php echo $element_id_temp; ?>-id"><span class="icon" aria-hidden="true"></span></button>
<button type="button" id="return-element-link-<?php echo $element_id_temp; ?>" class="undo-delete" data-action-selector="deleted" title="<?php echo __('Undo'); ?>" aria-label="<?php echo __('Undo'); ?> <?php echo __('Remove'); ?>" aria-labelledby="return-element-link-<?php echo $element_id_temp; ?> unnamed-element-label"><span class="icon" aria-hidden="true"></span></button>
<button type="button" id="remove-element-link-<?php echo $element_id_temp; ?>" class="delete-drawer" data-action-selector="deleted" title="<?php echo __('Remove'); ?>" aria-label="<?php echo __('Remove'); ?>" aria-labelledby="remove-element-link-<?php echo $element_id_temp; ?> unnamed-element-label"><span class="icon" aria-hidden="true"></span></button>
</div>
<div class="drawer-contents opened"></div>
</li>
13 changes: 9 additions & 4 deletions admin/themes/default/item-types/add-new-element.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
<li class="element new">
<div class="sortable-item drawer">
<span id="move-<?php echo $element_id_temp; ?>" class="move icon" title="<?php echo __('Move'); ?>" aria-labelledby="move-<?php echo $element_id_temp; ?> <?php echo $element_id_temp; ?>"></span>
<label class="drawer-name">
<?php
echo __('Element Name');
echo $this->formText(
$element_name_name, $element_name_value,
[
'placeholder' => __('Element Name'),
'class' => 'drawer-name'
]
);
?>
<button type="button" id="return-element-link-<?php echo $element_id_temp; ?>" class="undo-delete" data-action-selector="deleted" title="<?php echo __('Undo'); ?>" aria-label="<?php echo __('Undo'); ?> <?php echo __('Remove'); ?>" aria-labelledby="return-element-link-<?php echo $element_id_temp; ?> new-elements-<?php echo $element_id_temp; ?>-name"><span class="icon" aria-hidden="true"></span></button>
<button type="button" id="remove-element-link-<?php echo $element_id_temp; ?>" class="delete-drawer" data-action-selector="deleted" title="<?php echo __('Remove'); ?>" aria-label="<?php echo __('Remove'); ?>" aria-labelledby="remove-element-link-<?php echo $element_id_temp; ?> new-elements-<?php echo $element_id_temp; ?>-name"><span class="icon" aria-hidden="true"></span></button>
</label>
<button type="button" id="return-element-link-<?php echo $element_id_temp; ?>" class="undo-delete" data-action-selector="deleted" title="<?php echo __('Undo'); ?>" aria-label="<?php echo __('Undo'); ?> <?php echo __('Remove'); ?>" aria-labelledby="return-element-link-<?php echo $element_id_temp; ?> unnamed-element-label"><span class="icon" aria-hidden="true"></span></button>
<button type="button" id="remove-element-link-<?php echo $element_id_temp; ?>" class="delete-drawer" data-action-selector="deleted" title="<?php echo __('Remove'); ?>" aria-label="<?php echo __('Remove'); ?>" aria-labelledby="remove-element-link-<?php echo $element_id_temp; ?> unnamed-element-label"><span class="icon" aria-hidden="true"></span></button>
<?php
echo $this->formHidden(
$element_order_name, $element_order_value,
Expand All @@ -19,15 +22,17 @@
?>
</div>
<div class="drawer-contents opened">
<label>
<?php
echo __('Element Description');
echo $this->formTextarea(
$element_description_name, $element_description_value,
[
'placeholder' => __('Element Description'),
'rows' => '3',
'cols'=>'30'
]
);
?>
</label>
</div>
</li>
1 change: 1 addition & 0 deletions admin/themes/default/item-types/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
</div>
</li>
</ul>
<span class="sr-only" id="unnamed-element-label"><?php echo __('Unnamed Element'); ?></span>
<?php echo $this->form->getElement(Omeka_Form_ItemTypes::REMOVE_HIDDEN_ELEMENT_ID); ?>
</div>
</fieldset>
Expand Down
20 changes: 20 additions & 0 deletions admin/themes/default/javascripts/item-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,26 @@ Omeka.ItemTypes = {};
}
}

$('#item-type-elements').on('change', '.drawer-name input, .drawer-name select', function() {
var currentInput = $(this);
var currentInputId = currentInput.attr('id');
var drawer = currentInput.parents('.drawer').first();
var drawerToggles = drawer.find('.delete-drawer, .undo-delete');
if (currentInput.val() !== '') {
drawerToggles.each(function() {
var toggleButton = $(this);
var buttonAriaLabelledBy = [toggleButton.attr('id'), currentInputId].join(' ');
toggleButton.attr('aria-labelledby', buttonAriaLabelledBy);
});
} else {
drawerToggles.each(function() {
var toggleButton = $(this);
var buttonAriaLabelledBy = [toggleButton.attr('id'), 'unnamed-element-label'].join(' ');
toggleButton.attr('aria-labelledby', buttonAriaLabelledBy);
});
}
});

$('#add-element').click( function () {
$('#add-element-success').hide();
var elementCount = $('#item-type-elements li').length;
Expand Down
Loading