/[drupal]/contributions/modules/morelikethis/morelikethis.js
ViewVC logotype

Contents of /contributions/modules/morelikethis/morelikethis.js

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


Revision 1.1 - (show annotations) (download) (as text)
Fri Oct 3 16:36:58 2008 UTC (13 months, 3 weeks ago) by febbraro
Branch: MAIN
CVS Tags: DRUPAL-6--0-9, HEAD
Branch point for: DRUPAL-6--1
File MIME type: text/javascript
initial commit of new module
1 // $Id$
2
3 /**
4 * Add the UI functionality for the term selction.
5 */
6 Drupal.behaviors.moreLikeThis = function(context) {
7 var list = $('#edit-morelikethis-taxonomy-terms', context);
8 list.click(function() {
9 var terms = $('#edit-morelikethis-terms');
10
11 termVal = jQuery.trim(terms.val());
12 if(termVal.length > 0) {
13 termVal += ',';
14 }
15
16 // Wrap in quotes if term has a comma in it
17 keyword = $(this).val();
18 if(keyword.indexOf(',') != -1) {
19 keyword = '"' + keyword + '"'
20 }
21
22 terms.val(termVal + keyword);
23 });
24 };
25

  ViewVC Help
Powered by ViewVC 1.1.2