Файл: jscript/page.js
Строк: 165
<?php
$(document).ready(function(){
$(window).scroll(function(){
if($(window).scrollTop()>1000)
$('.scroll_fix_bg').show();
else
$('.scroll_fix_bg').hide();
});
$('.scroll_fix_bg').click(function(){$(window).scrollTop(0);});
});
function clc(txt){
var el=document.getElementById("textarea");
el.focus();
var start=el.selectionStart;
var end=el.selectionEnd;
el.value=el.value.substring(0,el.selectionStart)+
txt+
el.value.substring(el.selectionStart,el.selectionEnd)+
""+
el.value.substring(el.selectionEnd);
el.selectionStart=start+txt.length;
el.selectionEnd=el.selectionStart;
}
window.onload = function(){
window.setTimeout(
function(){
window.addEventListener(
"popstate",
function(e){
e.preventDefault();
Page.Prev(e.state.link);
},
false);
},
1);
}
var Page = {
Loading: function(f){
if(f == 'start'){
$('html').css('overflow-y','auto');
$('#loading').show();
$('#window').html('').hide();
}
if(f == 'stop'){
$('#loading').hide();
}
},
Go: function(h){
history.pushState({link:h}, null, h);
Page.Loading('start');
$('.content').load(h, {ajax: 'yes'}, function(data){
$('html, body').scrollTop(0);
Page.Loading('stop');
});
},
Prev: function(h){
Page.Loading('start');
$('.content').load(h, {ajax: 'yes'}, function(data){
Page.Loading('stop');
});
}
}
var Window = {
Open: function(h){
$('html').css('overflow-y','hidden');
$('#window').html('<div class="window_content"></div>');
$('#window .window_content').load(h, {ajax: 'yes', window: 'yes'}, function(data){
$('#window').fadeIn(100);
});
},
Close: function(){
$('#window').fadeOut(100);
$('html').css('overflow-y','auto');
}
}
var Like = {
Go: function(h,id){
$('#like_'+id).load(h, {ajax: 'yes'}, function(data){
});
}
}
var Smiles = {
Open: function(){
$('#block_smiles').load('/smiles.php', {ajax: 'yes'}, function(data){
$('#block_smiles').slideDown(200);
$('#button_smiles_open').hide();
$('#button_smiles_close').show();
});
},
Close: function(){
$('#block_smiles').slideUp(200);
$('#button_smiles_open').show();
$('#button_smiles_close').hide();
}
}
var headradio = {
Open: function(){
$('#block_headradio').load('/radio.php', {ajax: 'yes'}, function(data){
$('#block_headradio').slideDown(200);
$('#button_headradio_open').hide();
$('#button_headradio_close').show();
});
},
Close_radio: function(){
$('#block_headradio').slideUp(200);
$('#button_headradio_open').show();
$('#button_headradio_close').hide();
}
}
var Title = {
Open: function(h){
$('#title_menu').slideDown(200);
}
}
var Notifications = {
Close: function(id){
$('#block_notification_close_'+id).remove();
}
}
var Dialog = {
Refresh: function(id){
$('#refresh_dialog').load('/mail/?id='+id+' '+'#refresh_dialog span', {ajax: 'yes'}, function(data){
});
}
}
var BlockMenu = {
Open: function(id){
$('div#block_menu_'+id).slideDown(200);
$('a#block_menu_'+id).attr('onClick', 'BlockMenu.Close('+id+'); return false');
$('img#block_menu_'+id).attr('src', '/design/img/menu_hide.png');
},
Close: function(id){
$('div#block_menu_'+id).slideUp(200);
$('a#block_menu_'+id).attr('onClick', 'BlockMenu.Open('+id+'); return false');
$('img#block_menu_'+id).attr('src', '/design/img/menu_show.png');
}
}
?>