/[drupal]/contributions/modules/eventfinder_filter/common.js
ViewVC logotype

Contents of /contributions/modules/eventfinder_filter/common.js

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


Revision 1.1 - (show annotations) (download) (as text)
Wed Mar 1 10:11:17 2006 UTC (3 years, 8 months ago) by grugnog
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/javascript
Moving active_profiles, arooga, eventfinder_filter and userpoints_levels from sandbox to modules
1 /**
2 * Creates a URL from various form elements
3 */
4 function createurl() {
5 var node = document.getElementById('edit-event_filter_link');
6 var filterurl = document.getElementById('edit-eventfilter_filterurl');
7
8 // Recursively add all the terms
9 var terms = document.getElementById('edit-event_filter_terms');
10 var txtterms = '';
11 var i;
12 for (i=0; i<terms.options.length; i++) {
13 if (terms.options[i].selected) {
14 if (txtterms != '') { txtterms = txtterms + '+'; }
15 txtterms = txtterms + terms.options[i].value;
16 }
17 }
18
19 // Fetch the dates and replace spaces with underscores
20 var txtstart = '';
21 var start = document.getElementById('edit-event_filter_start');
22 if (start.value != '') { txtstart = 'start=' + start.value + '&'; }
23 txtstart = txtstart.replace(' ','_');
24
25 var txtfinish = '';
26 var finish = document.getElementById('edit-event_filter_finish');
27 if (finish.value != '') { txtfinish = 'finish=' + finish.value + '&'; }
28 txtfinish = txtfinish.replace(' ','_');
29
30 // Add a desc sort attribute if selected (asc is default, so we can leave it blank)
31 var txtsort = '';
32 if (document.getElementById('edit-eventfilter_desc').checked==true) {
33 txtsort = 'sort=desc';
34 }
35
36 // Output the answer
37 node.value = filterurl.value + txtterms + '?' + txtstart + txtfinish + txtsort;
38 }
39
40 /**
41 * Loads the URL in a new window
42 */
43 function testurl() {
44 createurl();
45 var node = document.getElementById('edit-event_filter_link');
46 openwin = this.open(node.value);
47 }

  ViewVC Help
Powered by ViewVC 1.1.2