tot - Check-in [41]
Not logged in
[Browse]  [Home]  [Login]  [Reports]  [Search]  [Timeline
  [Patchset
Check-in Number: 41
Date: 2008-Aug-28 19:35:18 (local)
2008-Aug-28 17:35:18 (UTC)
User:rse
Branch:
Comment: allow one to prefix the path with an absolute URL
Tickets:
Inspections:
Files:
jquery/jquery.extlink.js      39 -> 41
Modified: jquery/jquery.extlink.js
===================================================================
--- jquery/jquery.extlink.js	2008-08-28 17:32:59 UTC (rev 40)
+++ jquery/jquery.extlink.js	2008-08-28 17:35:18 UTC (rev 41)
@@ -9,9 +9,11 @@
 
 (function($) {
     $.fn.extend({
-        extlink: function (color) {
+        extlink: function (color, prefix) {
             if (typeof color === "undefined")
                 color = "grey";
+            if (typeof prefix === "undefined")
+                prefix = "";
             var site = String(document.location)
                 .replace(/^(https?:\/\/[^:\/]+).*$/, "$1")
                 .replace(/^((site)?(file:\/\/.+\/))[^\/]+$/, "$3")
@@ -26,7 +28,7 @@
                 );
             }).each(function () {
                 $(this)
-                    .css("backgroundImage",    "url('jquery.extlink.d/extlink-" + color + ".gif')")
+                    .css("backgroundImage",    "url('"+prefix+"jquery.extlink.d/extlink-" + color + ".gif')")
                     .css("backgroundRepeat",   "no-repeat")
                     .css("backgroundPosition", "right center")
                     .css("padding-right",      "11px");