Skip to content

Instantly share code, notes, and snippets.

@mramsden
Created April 16, 2010 10:58
Show Gist options
  • Save mramsden/368292 to your computer and use it in GitHub Desktop.
Save mramsden/368292 to your computer and use it in GitHub Desktop.
<div id="manageable_id_102" class="ep_manageable">
<div class="ep_manageable_data">
<input type="checkbox" name="bulkaction_eprintids" value="102" id="select-102" class="ep_resource_manager_select_check">
<a href="http://resourcemanager.quango-vm.local/102/"><span class="ep_manageable_data_title">My New EdShare Resource</span></a>
<span class="ep_manageable_data_viewperms">Just me</span>
</div>
<div class="ep_manageable_controls">
<ul>
<li><a href="http://resourcemanager.quango-vm.local/102/">View</a></li>
<li><a href="http://resourcemanager.quango-vm.local/cgi/users/home?screen=EPrint::Edit&amp;eprintid=102">Edit</a></li>
<li><a href="http://resourcemanager.quango-vm.local/cgi/users/home?screen=EPrint::Remove&amp;eprintid=102">Remove</a></li>
</ul>
</div>
<div style="clear:both;"></div>
</div>
document.observe( 'dom:loaded', function() {
document.observe('click', updateResourceSelection);
});
window.updateResourceSelection = function(event) {
if (!Prototype.Browser.IE && !event.isLeftClick()) return;
var element = event.element();
if (ignoreElement(element)) {
return;
} else if (!Object.isUndefined(element = event.findElement('.ep_manageable'))) {
checkbox = $$('#'+element.readAttribute('id')+' .ep_resource_manager_select_check')[0];
if (inBulkSelection(element)) {
element.removeClassName('ep_manageable_selected');
if (Object.isUndefined(event.findElement('.ep_resource_manager_select_check')))
checkbox.writeAttribute('checked', false);
} else {
element.addClassName('ep_manageable_selected');
if (Object.isUndefined(event.findElement('.ep_resource_manager_select_check')))
checkbox.writeAttribute('checked', true);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment