if(!window.Kolich){ Kolich = {}; } Kolich.Selector = {}; // getSelected() was borrowed from CodeToad at // http://www.codetoad.com/javascript_get_selected_text.asp Kolich.Selector.getSelected = function(){ var t = ''; if(window.getSelection){ t = window.getSelection(); }else if(document.getSelection){ t = document.getSelection(); }else if(document.selection){ t = document.selection.createRange().text; } return t; } Kolich.Selector.mouseup = function(){ var st = Kolich.Selector.getSelected(); if(st!=''){ document.quoter.quote.value = st; } } $(document).ready(function(){ $(document).bind("mouseup", Kolich.Selector.mouseup); GetNewPosts(); $(".jumpToMobile").html($(".jumpTo").html()); }); function EditPost(id){ $.ajax({ type: "GET", url: "/common/functions.php?type=editpost&id="+id, success: function(html){ $("#"+id+"-content").html(html); } }); } function ReloadPost(id){ $("#"+id+"-content").empty().load('/common/functions.php?type=reloadpost&id='+id).fadeIn(); } function EditThread(id){ $("#"+id+"-content").load('/common/functions.php?type=editthread&id='+id); } function ReloadThread(id){ $("#"+id+"-content").load('/common/functions.php?type=reloadthread&id='+id).fadeIn(); } setInterval("GetNewPosts()",120000); var pl = 1; function GetNewPosts(){ if ($("#reply").is(":focus")){ $("#auto_update_placeholder").html('Auto Updates are disabled while you type your reply. Check for new posts'); } else { $("#auto_update_loader").fadeIn(); $("#auto_update_placeholder").html(''); var currentId = $('.ReplyId:last').attr('id'); var postCount = $('.postCount:last').attr('id'); $.ajax({ type: "POST", url: "/common/content/GetReplies.php", data: "threadid=16&order=&replies="+currentId+" &postCount="+postCount, success: function(html){ $("#NewPosts").append(html); $(".thread_posting").fadeIn('slow'); $("#auto_update_loader").fadeOut(); var hash = location.hash.replace('#',''); //alert(hash); if(hash != '' && pl==1){ $("#"+hash).slideto({highlight: false}); } pl = 0; } }); } ShallISave(); } function markEventAttendance(attendance){ $.ajax({ type: "GET", url: "/common/functions.php?type=markEventAttendance&event=16&attendance="+attendance, success: function(html){ $("#attendance_register").html(html); } }); } function votePoll(pollId, answerId){ $.ajax({ type: "GET", url: "/common/functions.php?type=votePoll&pollId="+pollId+"&answerId="+answerId, success: function(html){ pollResults(pollId); } }); } function pollResults(pollId){ $.ajax({ type: "GET", url: "/common/functions.php?type=pollResults&pollId="+pollId, success: function(html){ $(".poll_query").hide(); $(".poll_results").html(html); } }); } function createThreadReply(thePostId,theThreadId,theForumId,originId, replyTo){ $(".reply_box_outer").html(''); $.ajax({ type: "GET", url: "/common/functions.php?type=createReply&reference_reply_to="+replyTo+"&postId="+thePostId+"&threadId="+theThreadId+"&forumId="+theForumId+"&originPostId="+originId, success: function(html){ $("."+replyTo+"_reply_box").html(html); } }); } function refreshThreadedPosts(refreshElement){ // $("#"+refreshElement).html(''); var currentId = $('.ReplyId:last').attr('id'); var postCount = $('.postCount:last').attr('id'); $.ajax({ type: "POST", url: "/common/content/GetReplies.php", data: "threadid=16&order=&refreshElement="+refreshElement+"&replies="+currentId+"&postCount="+postCount, success: function(html){ $("."+refreshElement).html(html); $(".thread_posting").fadeIn(); } }); } -->