Skip to content

Commit 6e15e23

Browse files
committed
fix
1 parent b20412b commit 6e15e23

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

Easy offline/Easy offline.user.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// @namespace http://tampermonkey.net/
99
// @require https://cdn.jsdelivr.net/jquery/1.7.2/jquery.min.js
1010
// @require https://cdn.jsdelivr.net/hi-base64/0.2.0/base64.min.js
11-
// @version 1.2.1
11+
// @version 1.2.2
1212
// @author Hoothin
1313
// @mail rixixi@gmail.com
1414
// @include http*://*/*
@@ -189,7 +189,7 @@
189189
let offNode=$("<a></a>");
190190
offNode.addClass('whx-a').css("position","absolute").css("margin-top","0px").css("margin-left","0px").attr("target","_blank");
191191
let siteConfig=sites[x];
192-
offNode.css("background-color","#"+siteConfig.bgColor).attr("title",i18n[siteConfig.name] ).attr("href", siteConfig.url);
192+
offNode.css("background-color","#"+siteConfig.bgColor).attr("title",i18n[siteConfig.name] ).attr("href", siteConfig.url).attr("name", siteConfig.name);
193193
offNode.click(function(e){
194194
if(!siteConfig.directUrl)GM_setValue("eoUrl",getRightUrl(offUrl));
195195
e.stopPropagation();
@@ -290,7 +290,16 @@
290290
node.show();
291291
node.css("margin-top",-j*25+"px");
292292
j++;
293-
if(!!sites[x].directUrl)node.attr('href', sites[x].directUrl(offUrl));
293+
var name=node.attr("name");
294+
for(var s = 0; s < Object.keys(sites).length; s++){
295+
let siteConfig=sites[s];
296+
if(siteConfig.name==name){
297+
if(siteConfig.directUrl){
298+
node.attr('href', siteConfig.directUrl(offUrl));
299+
}
300+
break;
301+
}
302+
}
294303
}
295304
}
296305
e.stopPropagation();

0 commit comments

Comments
 (0)