comparison vendor/plugins/redmine_checkout/assets/javascripts/checkout.js @ 16:020926a36823 yuya

* Add redmine-checkout plugin (as of svn rev 179 of the plugin)
author Chris Cannam
date Wed, 25 Aug 2010 16:39:01 +0100
parents
children
comparison
equal deleted inserted replaced
15:9c6c72729d91 16:020926a36823
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