Chris@0: Event.observe(window,'load',function() { Chris@0: /* Chris@0: If we're viewing a tag or branch, don't display it in the Chris@0: revision box Chris@0: */ Chris@0: var branch_selected = $('branch') && $('rev').getValue() == $('branch').getValue(); Chris@0: var tag_selected = $('tag') && $('rev').getValue() == $('tag').getValue(); Chris@0: if (branch_selected || tag_selected) { Chris@0: $('rev').setValue(''); Chris@0: } Chris@0: Chris@0: /* Chris@0: Copy the branch/tag value into the revision box, then disable Chris@0: the dropdowns before submitting the form Chris@0: */ Chris@0: $$('#branch,#tag').each(function(e) { Chris@0: e.observe('change',function(e) { Chris@0: $('rev').setValue(e.element().getValue()); Chris@0: $$('#branch,#tag').invoke('disable'); Chris@0: e.element().parentNode.submit(); Chris@0: $$('#branch,#tag').invoke('enable'); Chris@0: }); Chris@0: }); Chris@0: Chris@0: /* Chris@0: Disable the branch/tag dropdowns before submitting the revision form Chris@0: */ Chris@0: $('rev').observe('keydown', function(e) { Chris@0: if (e.keyCode == 13) { Chris@0: $$('#branch,#tag').invoke('disable'); Chris@0: e.element().parentNode.submit(); Chris@0: $$('#branch,#tag').invoke('enable'); Chris@0: } Chris@0: }); Chris@0: })