Change the link style
[GM_direct_download_links.git] / direct_download_links.js
index f221e68..c7a45a2 100644 (file)
@@ -72,10 +72,10 @@ for (i = 0; i < supported_sites.length; i++) {
  * Add a Direct Download link on the page for the specified file
  *
  * @param pageURL: the URL of the page we are modifying
- * @param fileElem: the emelemt containig the file URL
+ * @param fileElem: the element containing the file URL
  * @param fileRegexp: the regular expression for finding the file, the first
- *                    subpattern is taken as the file URL
- * @param linkDest: the element where to place the DIrect Download link
+ *                    sub-pattern is taken as the file URL
+ * @param linkDest: the element where to place the Direct Download link
  *
  * @return: null on error, true on success
  */
@@ -106,7 +106,11 @@ function direct_download_link_add(pageURL, fileElem, fileRegexp, linkDest) {
   var download_link = document.createElement('a');
   download_link.textContent = 'Direct Download';
   download_link.setAttribute('href', fileURL);
-  download_link.setAttribute('style', 'display: block; font-size: large; margin-left: 30px; margin-bottom: 1em;');
+  var style = 'background-color: white; color: blue;';
+  style += ' border: 2px solid red;'
+  style += ' float: left; font-size: large;';
+  style += ' padding: .5em; margin-left: 30px; margin-bottom: 1em;'
+  download_link.setAttribute('style', style);
 
   links.insertBefore(download_link, links.firstChild);