/[drupal]/contributions/modules/paypalnode/calculateprice.js
ViewVC logotype

Contents of /contributions/modules/paypalnode/calculateprice.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Thu Aug 2 11:13:13 2007 UTC (2 years, 3 months ago) by budda
Branch: MAIN
CVS Tags: DRUPAL-5--1-0, HEAD
Branch point for: DRUPAL-5
File MIME type: text/javascript
Initial commit of paypalnode module.
1 paypalnode_pricecalc = function () {
2 var uri = $('#edit-price-autocomplete').val();
3 var t = Array();
4
5 $('.paypernode').each(function(i,v) {
6 if(isNaN(v.value)) {
7 v.value = '"'+v.value+'"';
8 }
9 t[i] = v.value;
10 });
11
12 t.reverse();
13
14 var terms = t.join(",");
15
16 $.get(uri,
17 { terms: t.join(",") },
18 function(data){
19 $('#edit-price').attr('value', data);
20 }
21 );
22 }
23
24 paypalnode_pricecalcAttach = function () {
25 $('.paypernode').change( function() {
26 paypalnode_pricecalc();
27 } );
28
29 // Initialise the price field with default term price
30 paypalnode_pricecalc();
31 };
32
33 if (Drupal.jsEnabled) {
34 $(document).ready(paypalnode_pricecalcAttach);
35 }

  ViewVC Help
Powered by ViewVC 1.1.2