| 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 |
|