/[drupal]/contributions/modules/ubercart/uc_product/uc_product.js
ViewVC logotype

Contents of /contributions/modules/ubercart/uc_product/uc_product.js

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


Revision 1.6 - (show annotations) (download) (as text)
Thu Jul 10 12:41:03 2008 UTC (16 months, 2 weeks ago) by islandusurper
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-6--2
Changes since 1.5: +36 -21 lines
File MIME type: text/javascript
Begin the Ubercart 6.x-2.x branch.
1 // $Id$
2
3 // Functions used on the product view page.
4
5 function switch_vocabulary(vid) {
6 var settings = {
7 'div': "#products-selector",
8 'class': "product-ubrowser",
9 'vid': vid,
10 'filter': $('#edit-product-filter').val(),
11 'search': "true",
12 'nids': "true",
13 'nodesg': "product",
14 'nodepl': "products",
15 'multi': "true",
16 'select': "buffer_products()"
17 };
18
19 display_ubrowser(Drupal.settings.basePath, settings);
20 }
21
22 function buffer_products(file_path) {
23 $('#edit-unid option:selected').each(
24 function(i) {
25 if (this.value == 0) {
26 return;
27 }
28
29 var productsURL = $('#edit-products').val();
30
31 if (productsURL.search(new RegExp("\/" + this.value + "(\/|$)")) == -1) {
32 if (productsURL == '') {
33 $('#buffer-images').empty();
34 }
35
36 $('#edit-products').val(productsURL + '/' + this.value);
37 $.post(Drupal.settings.basePath + 'products/field_image_cache/' + this.value, {},
38 function(contents) {
39 if (contents != 'false') {
40 $('#buffer-images').append('<img src="' + file_path + '/imagecache/uc_thumbnail/' + contents +'" />');
41 }
42 else {
43 $('#buffer-images').append('<img src="" alt="' + $('#edit-unid option:selected').get(i).text + '" />');
44 }
45 }
46 );
47 }
48 }
49 );
50 }

  ViewVC Help
Powered by ViewVC 1.1.2