function mngl_request_friend( mingle_url, user_id, friend_id, friend_requested_text ) { mngl_replace_id_with_loading_indicator('friend_request_button-' + friend_id); jQuery.ajax( { type: "POST", url: mingle_url, data: "controller=friends&action=friend_request&user_id=" + user_id + "&friend_id=" + friend_id, success: function(html) { jQuery("#friend_request_button-" + friend_id ).replaceWith( friend_requested_text ); } }); } function mngl_escape(message) { // escape problematic characters -- don't escape utf8 chars return message.replace(/&/g,'%26').replace(/=/g,'%3D').replace(/ /g, '%20').replace(/\?/g, '%3F'); } function mngl_post_to_board( mingle_url, owner_id, author_id, message, controller ) { var mnglparams = jQuery('#mngl-board-post-button').attr('mnglparams'); mngl_replace_id_with_loading_indicator('mngl-board-post-button'); if(mnglparams==undefined) { mnglparams = ''; } jQuery.ajax( { type: "POST", url: mingle_url, data: "controller=" + controller + "&action=post&owner_id=" + owner_id + "&author_id=" + author_id + "&message=" + mngl_escape(message) + mnglparams, success: function(html) { jQuery('.mngl-board').replaceWith('
'+html+'
'); mngl_load_growables(); } }); } function mngl_clear_status(user_id) { mngl_replace_id_with_loading_indicator('mngl-clear-status-button'); jQuery.ajax( { type: "POST", url: 'MNGL_SCRIPT_URL', data: "controller=boards&action=clear_status&u=" + user_id, success: function(html) { jQuery('.mngl-profile-status').slideUp(); } }); } function mngl_show_older_posts( pagenum, loc, screenname ) { mngl_replace_id_with_loading_indicator('mngl-older-posts'); jQuery.ajax( { type: "POST", url: 'MNGL_SCRIPT_URL', data: "controller=boards&action=older_posts&mdp=" + pagenum + "&loc=" + loc + "&u=" + screenname, success: function(html) { jQuery('#mngl-older-posts').replaceWith(html); mngl_load_growables(); } }); } function mngl_comment_on_post( mingle_url, author_id, board_post_id, message, controller ) { mngl_replace_id_with_loading_indicator('mngl-comment-button-' + board_post_id); jQuery.ajax( { type: "POST", url: mingle_url, data: "controller=" + controller + "&action=comment&author_id=" + author_id + "&board_post_id=" + board_post_id + "&message=" + mngl_escape(message), success: function(html) { jQuery('#mngl-comment-form-wrap-'+board_post_id).replaceWith(html); mngl_load_growables(); jQuery("#mngl-board-comment-list-" + board_post_id).show(); jQuery("#mngl-fake-board-comment-" + board_post_id).show(); } }); } function mngl_delete_board_post( mingle_url, board_post_id, controller ) { if(confirm("