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

Diff of /contributions/modules/relatedlinks/relatedlinks.js

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

revision 1.4.2.7, Thu May 8 17:25:33 2008 UTC revision 1.4.2.8, Thu May 8 18:03:13 2008 UTC
# Line 1  Line 1 
1  // $Id: relatedlinks.js,v 1.4.2.6 2008/02/18 20:59:05 karthik Exp $  // $Id: relatedlinks.js,v 1.4.2.7 2008/05/08 17:25:33 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() {
# Line 17  $(document).ready(function() { Line 17  $(document).ready(function() {
17      }      }
18    }    }
19    
   // -1 signifies that no link is being edited at the moment.  
   current = -1;  
   
20    var autocomplete_path = 'relatedlinks/autocomplete';    var autocomplete_path = 'relatedlinks/autocomplete';
21    autocomplete_path = Drupal.settings.relatedlinks.base_path + (Drupal.settings.relatedlinks.clean_urls ? autocomplete_path : '?q=' + autocomplete_path);    autocomplete_path = Drupal.settings.relatedlinks.base_path + (Drupal.settings.relatedlinks.clean_urls ? autocomplete_path : '?q=' + autocomplete_path);
22    
# Line 42  $(document).ready(function() { Line 39  $(document).ready(function() {
39      .appendTo(top);      .appendTo(top);
40    
41    var preview = $('#relatedlinks-preview', fields);    var preview = $('#relatedlinks-preview', fields);
   
42    links_preview();    links_preview();
43    
44      // -1 signifies that no link is being edited at the moment.
45      var current = -1;
46    
47    var l = $('<a id="relatedlinks-add" href="#">Add / Update</a>')    var l = $('<a id="relatedlinks-add" href="#">Add / Update</a>')
48      .appendTo(fields)      .appendTo(fields)
49      .click(function() {      .click(function() {
# Line 138  $(document).ready(function() { Line 138  $(document).ready(function() {
138    
139      // Handle up clicks. Move clicked link up one row.      // Handle up clicks. Move clicked link up one row.
140      $('.relatedlinks-up', table).each(function(k) {      $('.relatedlinks-up', table).each(function(k) {
141        $(this).click(function() {        $('a', this).click(function() {
142          links_swap(k, k + 1);          links_swap(k, k - 1);
143          links_preview();          links_preview();
144          return false;          return false;
145        });        });
# Line 147  $(document).ready(function() { Line 147  $(document).ready(function() {
147    
148      // Handle down clicks. Move clicked link down one row.      // Handle down clicks. Move clicked link down one row.
149      $('.relatedlinks-down', table).each(function(k) {      $('.relatedlinks-down', table).each(function(k) {
150        $(this).click(function() {        $('a', this).click(function() {
151          links_swap(k, k + 1);          links_swap(k, k + 1);
152          links_preview();          links_preview();
153          return false;          return false;

Legend:
Removed from v.1.4.2.7  
changed lines
  Added in v.1.4.2.8

  ViewVC Help
Powered by ViewVC 1.1.2