funchat/modules/chat/chat.js

55 lines
1.5 KiB
JavaScript
Raw Normal View History

2025-06-02 10:01:12 +02:00
document.domain = "ponytopia.net";
function notice() {
document.getElementById('notice').play();
}
function play(source) {
if(window.parent.bgmusic!=false){
updateSource(source);
document.getElementById('audioPlayer').play();
}
}
function changenotice(file) {
var zeit = new Date();
var ms = zeit.getMilliseconds();
var audio = $('#notice').empty();
var newSrc = $("<source>").attr("src", "//chat.ponytopia.net/modules/chat/sound/"+file+"_notice.ogg?id="+ms).appendTo(audio);
var newSrc2 = $("<source>").attr("src", "//chat.ponytopia.net/modules/chat/sound/"+file+"_notice.mp3?id="+ms).appendTo(audio);
audio[0].pause();
audio[0].load();
}
function reload_locations() {
window.parent.refresh();
}
function pause() {
document.getElementById('audioPlayer').pause();
}
var as=true;
var asoff=false;
function doscroll() {
if (as != false && asoff==false) {
window.scrollTo(1, 500000);
}
window.setTimeout("doscroll()", 200);
}
function scroll_toggle() {
if(as==false){
as=true;
window.scroll(1, 500000);
}else{
as=false;
}
}
doscroll();
function updateSource(file) {
var zeit = new Date();
var ms = zeit.getMilliseconds();
var audio = $('#audioPlayer');
$('#oggSource').attr('src',"//chat.ponytopia.net/modules/chat/sound/"+file+".ogg?id="+ms).detach().appendTo($('#audioPlayer'));
$('#mp3Source').attr('src',"//chat.ponytopia.net/modules/chat/sound/"+file+".mp3?id="+ms).detach().appendTo($('#audioPlayer'));
audio[0].pause();
audio[0].load();
}