goldendict-ng/resources/gd_custom.js

28 lines
683 B
JavaScript
Raw Normal View History

2021-12-31 14:15:51 +00:00
//document ready ,
$(function() {
$("a").click(function(event) {
var link = $(this).attr("href");
2022-01-02 01:37:43 +00:00
if(link.indexOf("://")>=0){
return;
}
2022-01-01 13:09:55 +00:00
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;
2021-12-31 14:15:51 +00:00
}
2022-01-01 13:09:55 +00:00
$(this).attr("href", newLink);
2021-12-31 14:15:51 +00:00
});
}
2022-01-01 13:09:55 +00:00
);
2022-01-03 04:00:50 +00:00
function playSound(sound) {
var a = new Audio(sound);
a.play();
}