App.Views.ContextMenuView=Backbone.View.extend({id:"child_content",el:"#child_content",className:"contextMenu",template:_.template(context_menu_template),initialize:function(){this.render()},events:function(){var e={};return e[vup+" .but"]="but_vup",e},but_vup:function(e){var t=this.model.get("xml"),n=this.model.get("source");switch(t.tagName){case"item":if($(e.currentTarget).hasClass("but_externalAppLink")){var r=t,i="externAppDeepLink",s=$(r).find("ContentItem").attr("sourceAccount"),o=$(r).clone(),u=funcObj.UIMain.getXMLfromString("<subtype>"+i+"</subtype>");$(o).append(u),srcObj[n].getCustomContentForSourceItem(s,o)}else $(e.currentTarget).hasClass("but_remove")&&srcObj[n].promptRemoveStation(null,null,t);break;case"nowPlaying":var a=$(t),f=a.children("ContentItem")[0].attributes.source.value.toLowerCase();$(this).hasClass("but_off")||($(e.currentTarget).hasClass("but_bookSong")?(funcObj.message.createQuickMessage("##TRANS_InternalMessages_QuickMessages_PandoraBookmarkSong##"),funcObj.devCon.sendMsg(funcObj.UIMain.getUID(),"bookmark","bookmark",{MARK:"song",ITEM:getPlayItem()},null,!1)):$(e.currentTarget).hasClass("but_bookArtist")?(funcObj.message.createQuickMessage("##TRANS_InternalMessages_QuickMessages_PandoraBookmarkArtist##"),funcObj.devCon.sendMsg(funcObj.UIMain.getUID(),"bookmark","bookmark",{MARK:"artist",ITEM:getPlayItem()},null,!1)):$(e.currentTarget).hasClass("but_visitArtistPage")||$(e.currentTarget).hasClass("but_viewArtistPage")?srcObj[f].getFeature("hasLocalTopMenu")?srcObj[f].goToBrowsePageFromNowPlaying(a,"artist"):srcObj[f].goToArtistAlbumOrPodcastPageFromNowPlaying(a,"artistAlbums"):$(e.currentTarget).hasClass("but_viewAlbumPage")?srcObj[f].goToArtistAlbumOrPodcastPageFromNowPlaying(a,"albumTracks"):$(e.currentTarget).hasClass("but_viewPodcastPage")?srcObj[f].goToArtistAlbumOrPodcastPageFromNowPlaying(a,"podcastEpisodes"):$(e.currentTarget).hasClass("but_addToFavorites")?($(e.currentTarget).hasClass("but_hasToggle")&&$(e.currentTarget).addClass("but_off"),$(a).find("isFavorite").length>0?(funcObj.message.createQuickMessage("##TRANS_InternalMessages_QuickMessages_"+f.toUpperCase()+"RemoveFromFavorites##"),setTimeout(function(){funcObj.devCon.sendMsg(funcObj.UIMain.getUID(),"key","keyPress",{ACTION:"REMOVE_FAVORITE"})},1)):(funcObj.message.createQuickMessage("##TRANS_InternalMessages_QuickMessages_"+f.toUpperCase()+"AddToFavorites##"),setTimeout(function(){funcObj.devCon.sendMsg(funcObj.UIMain.getUID(),"key","keyPress",{ACTION:"ADD_FAVORITE"})},1))):$(e.currentTarget).hasClass("but_externalAppLink")&&srcObj[f].performExternalAppLinking(a),this.closeBottomDrawer())}},render:function(){var e=this.model.get("source"),t=this.model.get("xml"),n=srcObj[e].getContextMenu(t);this.$el.append(this.template({header:funcObj.langCon.getString("AccessibilityMessages_MoreInfo"),sourceSpecificContent:n,closeAccessibility:funcObj.contentCon.getContent("ACCESSIBILITYATTR",{repl:{LABEL:funcObj.langCon.getString("AccessibilityMessages_Close")}})}));switch(t.tagName){case"item":break;case"nowPlaying":funcObj.play.setExtra(srcObj[e].getFeature("moreExtra")),$("#more_extra").children().length>0&&$("#more_extra").removeClass("disp_off").addClass("disp_on"),$("#more_buts").children().length>0?($("#more_buts").removeClass("disp_off").addClass("disp_on"),$("#more_extra").css("border-width","")):$("#more_extra").css("border-width",0)}},closeBottomDrawer:function(e){var t="#"+this.model.get("parentDrawer");$(t).close()}});