rewrite addFavorite in ws_main.js