goldendict-ng/resources/gd_custom.js
xiaoyifang c01257d592
Update gd_custom.js
bword:xxxx link handle
2022-01-04 07:47:48 +08:00

28 lines
681 B
JavaScript

//document ready ,
$(function() {
$("a").click(function(event) {
var link = $(this).attr("href");
if(link.indexOf(":")>=0){
return;
}
var newLink;
if (link.startsWith("#")) {
newLink = window.location.href + link;
} else {
var href = window.location.href;
var index = href.indexOf("?");
newLink = href.substring(0, index) + "?word=" + link;
}
$(this).attr("href", newLink);
});
}
);
function playSound(sound) {
var a = new Audio(sound);
a.play();
}