public
Last active

  • Download Gist
gistfile1.html
HTML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<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>
gistfile2.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
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);
}
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.