comparison plugins/redmine_checkout/assets/javascripts/checkout.js @ 1337:077b8890835a cannam

Merge from live branch
author Chris Cannam
date Thu, 20 Jun 2013 13:14:02 +0100
parents b4b72f1eb644
children
comparison
equal deleted inserted replaced
1304:6137548ba453 1337:077b8890835a
1 document.observe("dom:loaded", function() {
2 /* update the checkout URL if clicked on a protocol */
3 $('checkout_protocols').select('a').each(function(e) {
4 e.observe('click', function(event) {
5 $('checkout_url').value = checkout_commands.get(this.id);
6 $('checkout_protocols').select('a').each(function(e) {
7 e.removeClassName("selected");
8 });
9 this.addClassName("selected")
10
11 var value = checkout_access.get(this.id);
12 $('checkout_access').innerHTML = value;
13
14 event.stop();
15 });
16 });
17 /* select the text field contents if activated */
18 Event.observe('checkout_url', 'click', function(event) {
19 this.activate();
20 });
21
22 if (typeof('ZeroClipboard') != 'undefined') {
23 $('clipboard_container').show();
24 clipboard = new ZeroClipboard.Client();
25 clipboard.setHandCursor( true );
26 clipboard.glue('clipboard_button', 'clipboard_container');
27
28 clipboard.addEventListener('mouseOver', function (client) {
29 clipboard.setText( $('checkout_url').value );
30 });
31 }
32 });
33