/[drupal]/contributions/modules/paypalnode/fee-filter.js
ViewVC logotype

Contents of /contributions/modules/paypalnode/fee-filter.js

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


Revision 1.1 - (show annotations) (download) (as text)
Mon Aug 20 22:46:10 2007 UTC (2 years, 3 months ago) by budda
Branch: MAIN
CVS Tags: DRUPAL-5--1-1, HEAD
Branch point for: DRUPAL-5
File MIME type: text/javascript
Added ajax powered filtering to Content Fee admin interface for easier management.
1
2 var fee_filter_register = { };
3
4 function fee_filter_update() {
5 var text = new RegExp($('#edit-filter').val(), 'i');
6 $('.paypalnode-fee-terms').each(function() {
7 terms = new String($(this).text()).split(',');
8 show = false;
9 for (t in terms) {
10 temp = (terms.length == 0) || (terms[t].search(text) != -1);
11 show |= temp;
12
13 if (show)
14 break;
15 }
16
17 if (!show) {
18 $(this).parent().hide();
19 } else {
20 $(this).parent().show();
21 }
22 });
23 }
24
25 fee_filter_init = function() {/*
26 alert(fee_filter_register['foo']);
27 $('.paypalnode-fee-terms').each(function() {
28 terms = new String($(this).text()).split(',');
29
30 for (t in terms) {
31 term = terms[t];
32
33 if (typeof(fee_filter_register[term]) != 'Array') {
34 fee_filter_register[term] = new Array();
35 }
36
37 fee_filter_register[term].push(this);
38 }
39 });
40
41
42
43 for (x in fee_filter_register) {
44 alert(x + ': ' + );
45 alert(fee_filter_register[x]);
46 }*/
47
48 window.setInterval(fee_filter_update, 1000);
49
50 }
51
52
53 if (Drupal.jsEnabled) {
54 $(document).ready(fee_filter_init);
55 }

  ViewVC Help
Powered by ViewVC 1.1.2