// Change an element text an revert in a smooth pulse. el is an element id like '#copybox h2' function html_pulse( el, newtext ){ var oldtext = $(el).html(); // Fast pulse to "Copied" and revert $(el).fadeTo( "normal", 0.01, function(){ $(el) .html( newtext ) .css('opacity', 1) .fadeTo( "slow", 1, // this fades from 1 to 1: just a 'sleep(1)' actually function(){ $(el).fadeTo("normal", 0.01, function(){$(el).html( oldtext ).css('opacity', 1)}); } ); } ); } // Update feedback message function feedback(msg, type) { $.notifyBar({ html: ''+msg+'', delay: 2000, animationSpeed: "normal", cls: type }); return true; } // Unused for now function logout() { $.ajax({ type: "POST", url: "index_ajax.php", data: {mode:'logout'}, success: function() { window.parent.location.href = window.parent.location.href; } }); } // Begin the spinning animation & disable a button function add_loading(el) { $(el).attr("disabled", "disabled").addClass('disabled').addClass('loading'); } // End spinning animation function end_loading(el) { $(el).removeClass('loading'); } // Un-disable an element function end_disable(el) { $(el).removeAttr("disabled").removeClass('disabled'); }