| 1 |
// $Id: relatedlinks.js,v 1.4.2.5 2008/02/18 18:35:50 karthik Exp $ |
// $Id: relatedlinks.js,v 1.4.2.6 2008/02/18 20:59:05 karthik Exp $ |
| 2 |
|
|
| 3 |
// Todo: Convert to prototype (or behaviour, I suppose) and promote reuse. |
// Todo: Convert to prototype (or behaviour, I suppose) and promote reuse. |
| 4 |
$(document).ready(function() { |
$(document).ready(function() { |
| 20 |
// -1 signifies that no link is being edited at the moment. |
// -1 signifies that no link is being edited at the moment. |
| 21 |
current = -1; |
current = -1; |
| 22 |
|
|
| 23 |
|
var autocomplete_path = 'relatedlinks/autocomplete'; |
| 24 |
|
autocomplete_path = Drupal.settings.relatedlinks.base_path + (Drupal.settings.relatedlinks.clean_urls ? autocomplete_path : '?q=' + autocomplete_path); |
| 25 |
|
|
| 26 |
// Insert URL and title textfields. |
// Insert URL and title textfields. |
| 27 |
var fields = $('<div class="relatedlinks clear-block">' + |
var fields = $('<div class="relatedlinks clear-block">' + |
| 28 |
'<div id="relatedlinks-preview"></div>' + |
'<div id="relatedlinks-preview"></div>' + |
| 30 |
'<div class="form-item">' + |
'<div class="form-item">' + |
| 31 |
'<label for="field-relatedlinks-title">Title:</label>' + |
'<label for="field-relatedlinks-title">Title:</label>' + |
| 32 |
'<input id="field-relatedlinks-title" class="form-text form-autocomplete" type="text" value="" size="60" name="relatedlinks-title" maxlength="128" />' + |
'<input id="field-relatedlinks-title" class="form-text form-autocomplete" type="text" value="" size="60" name="relatedlinks-title" maxlength="128" />' + |
| 33 |
'<input class="autocomplete" type="hidden" id="field-relatedlinks-title-autocomplete" value="/sites/cvs/drupal/core/cli/d5/relatedlinks/autocomplete" disabled="disabled" />' + |
'<input class="autocomplete" type="hidden" id="field-relatedlinks-title-autocomplete" value="' + autocomplete_path + '" disabled="disabled" />' + |
| 34 |
'</div>' + |
'</div>' + |
| 35 |
'</div>' + |
'</div>' + |
| 36 |
'<div class="relatedlinks-url">' + |
'<div class="relatedlinks-url">' + |