Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function () {
- // Set this for validation
- $("#mainform").validate({
- errorLabelContainer: $("div.error")
- });
- // Sort the mark as solution button
- $(".marksolution").click(function () {
- var postid = $(this).attr('rel');
- var forumpost = "forumpost" + postid;
- $(".marksolution").remove();
- // Yes this is qualified on the server side, so don't even bother!
- $.get("/base/Solution/MarkAsSolution/" + postid + ".aspx",
- function (data) {
- $('.' + forumpost).removeClass().addClass('forumpost solutionTrue ' + forumpost);
- });
- return false;
- });
- // Sort the thumbs up on a post
- $(".thumbuplink").click(function () {
- var postid = $(this).attr('rel');
- var thumbsholder = "karmathumbs" + postid;
- var karmascore = "karma" + postid;
- $("." + thumbsholder).remove();
- // Yes this is qualified on the server side, so don't even bother!
- $.get("/base/Solution/ThumbsUpPost/" + postid + ".aspx",
- function (data) {
- var newkarma = $('value', data).text();
- $('.' + karmascore).text(newkarma);
- });
- return false;
- });
- // Sort the thumbs up on a post
- $(".thumbdownlink").click(function () {
- var postid = $(this).attr('rel');
- var thumbsholder = "karmathumbs" + postid;
- var karmascore = "karma" + postid;
- $("." + thumbsholder).remove();
- // Yes this is qualified on the server side, so don't even bother!
- $.get("/base/Solution/ThumbsDownPost/" + postid + ".aspx",
- function (data) {
- var newkarma = $('value', data).text();
- $('.' + karmascore).text(newkarma);
- });
- return false;
- });
- // Create a new post
- $(".btnsubmitpost").click(function (event) {
- event.preventDefault();
- var topicid = $(this).attr('rel');
- var sbody = tinyMCE.get('txtPost').getContent();
- $('.topicpostlistnewpost').remove();
- $('.postsuccess').show();
- // Yes this is qualified on the server side, so don't even bother!
- $.post("/base/Solution/NewForumPost/" + topicid + ".aspx", { "postcontent": sbody }, redirect);
- });
- // Create a new topic
- $(".btnsubmittopic").click(function (event) {
- event.preventDefault();
- var catid = $(this).attr('rel');
- var sbody = tinyMCE.get('txtPost').getContent();
- var stitle = $('#tbTopicTitle').val();
- var sticky = $('#cbSticky').is(':checked');
- var locked = $('#cbLockTopic').is(':checked');
- $('.createnewtopicform').remove();
- $('.postsuccess').show();
- // Yes this is qualified on the server side, so don't even bother!
- $.post("/base/Solution/NewForumTopic/" + catid + ".aspx",
- { "postcontent": sbody, "posttitle": stitle, "poststicky": sticky, "postlocked": locked }, redirect);
- });
- $("#topiclistheadbuttons").click(function(){
- var target = $(this).children('p').children('a');
- if($(target).hasClass('forumbutton')){
- submittopic();
- }else{
- if($(target).hasClass('notsubscribedtotopic')){
- var topicid = $(target).attr('rel');
- $(target).slideUp('fast');
- $(target).removeClass('notsubscribedtotopic').addClass('subscribedtotopic');
- $(target).slideDown();
- $.get("/base/Solution/SubScribeToTopic/" + topicid + ".aspx",
- function (data) {
- var result = $('value', data).text();
- });
- $(target).html('Unsubscribe From Topic');
- return false;
- }else{
- var topicid = $(target).attr('rel');
- $(target).slideUp('fast');
- $(target).removeClass('subscribedtotopic').addClass('notsubscribedtotopic');
- $(target).slideDown();
- $.get("/base/Solution/UnSubScribeToTopic/" + topicid + ".aspx",
- function (data) {
- var result = $('value', data).text();
- });
- $(target).html('Subscribe To Topic');
- return false;
- }
- }
- });
- // UnSubscribe to topic subscribedtotopic
- $(".quotebutton").click(function() {
- //event.preventDefault();
- var postid = $(this).attr('rel');
- var postcontentid = "#postcontent" + postid;
- var postmemnameid = ".postmember" + postid;
- var postmemname = jQuery.trim($(postmemnameid).text());
- var postcontent = "<pre><em>" + postmemname + "</em><br>" + jQuery.trim($(postcontentid).text()) + "</pre>";
- tinyMCE.execCommand('mceInsertContent', false, postcontent);
- return true;
- });
- });
- function redirect(data) {
- var returnUrl = $("value", data).text();
- window.location.href = returnUrl;
- }
Advertisement
Add Comment
Please, Sign In to add comment