2013-06-04 03:29:54 +02:00
|
|
|
$(document).ready(function() {
|
|
|
|
// do stuff when DOM is ready
|
|
|
|
$.get('forum.html', function(data) {
|
|
|
|
$('div#forum_link').html(data);
|
|
|
|
});
|
|
|
|
|
|
|
|
$.get('forban_link.html', function(data) {
|
|
|
|
$('div#forban_link').html(data);
|
|
|
|
});
|
|
|
|
|
2013-05-23 08:52:26 +02:00
|
|
|
$.get('station_cnt.txt', function(data) {
|
2013-06-04 03:29:54 +02:00
|
|
|
$('div#station').html(data);
|
|
|
|
});
|
|
|
|
|
|
|
|
$('div#shoutbox').ajaxError(function() {
|
|
|
|
$(this).text( "Triggered ajaxError handler on shoutbox" );
|
|
|
|
});
|
|
|
|
|
|
|
|
$("#sb_form").submit(function(event) {
|
|
|
|
/* stop form from submitting normally */
|
|
|
|
event.preventDefault();
|
|
|
|
post_shoutbox();
|
|
|
|
});
|
|
|
|
|
|
|
|
display_shoutbox();
|
2013-05-23 08:52:26 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
function refresh_shoutbox () {
|
2013-06-04 03:29:54 +02:00
|
|
|
$.get('chat_content.html', function(data) {
|
|
|
|
$('div#shoutbox').html(data);
|
|
|
|
});
|
2013-05-23 08:52:26 +02:00
|
|
|
}
|
2013-06-04 03:29:54 +02:00
|
|
|
|
2013-05-23 08:52:26 +02:00
|
|
|
function refresh_time_sb () {
|
2013-06-04 03:29:54 +02:00
|
|
|
// Refresh rate in milli seconds
|
|
|
|
mytime=setTimeout('display_shoutbox()', 10000);
|
2013-05-23 08:52:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function post_shoutbox () {
|
|
|
|
$.post("/cgi-bin/psowrte.py" , $("#sb_form").serialize())
|
|
|
|
.success(function() {
|
|
|
|
refresh_shoutbox();
|
|
|
|
});
|
2013-06-05 02:18:42 +02:00
|
|
|
$('#shoutbox_message').val('');
|
2013-05-23 08:52:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function display_shoutbox() {
|
|
|
|
refresh_shoutbox();
|
|
|
|
refresh_time_sb();
|
|
|
|
}
|
|
|
|
|
|
|
|
function fnGetDomain(url) {
|
|
|
|
return url.match(/:\/\/(.[^/]+)/)[1];
|
|
|
|
}
|