Rename the 'links' variable in _add_link() to 'destination'
authorAntonio Ospite <ospite@studenti.unina.it>
Sat, 10 Dec 2011 00:21:56 +0000 (01:21 +0100)
committerAntonio Ospite <ospite@studenti.unina.it>
Sat, 10 Dec 2011 01:19:29 +0000 (02:19 +0100)
This is a better name to show that we are dealing with the destination
element where the Direct Download Link is going.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
direct_download_links.user.js

index eb4175a..d430887 100644 (file)
@@ -179,8 +179,8 @@ function _add_link(e) {
   var site = e.site;
   var URL = e.URL;;
 
   var site = e.site;
   var URL = e.URL;;
 
-  var links = document.getElementById(site.linkDest);
-  if (!links) {
+  var destination = document.getElementById(site.linkDest);
+  if (!destination) {
     DDL_log('DirectDl (' + site.pageURL + '): Cannot add the direct download link.');
     return;
   }
     DDL_log('DirectDl (' + site.pageURL + '): Cannot add the direct download link.');
     return;
   }
@@ -194,7 +194,7 @@ function _add_link(e) {
   style += ' padding: .5em; margin: 1em;'
   download_link.setAttribute('style', style);
 
   style += ' padding: .5em; margin: 1em;'
   download_link.setAttribute('style', style);
 
-  links.insertBefore(download_link, links.firstChild);
+  destination.insertBefore(download_link, destination.firstChild);
 }
 
 function DDL_log(message) {
 }
 
 function DDL_log(message) {