Update button icon and text.

1. Use jQuery.ajax to send post request and update button icon and text after
   publish state changed successfully.
2. Add useful javascript logger console.
   See: http://www.songho.ca/misc/logger/logger.html